Recent posts

#1
General Discussion / Re: vehicle slip problem
Last post by lamkotien - Today at 06:53 AM
Quote from: byendofday on Jan 30, 2026, 02:48 PMi want a script  it can creat a temporary car. when car bomb it will not spawned. And pre player have create car restrict  how can i modify my scrip and suggustion 
Please refer to my code; the logic works as follows:
When summoning a vehicle, if it explodes or falls into the water, the remains of it will be hidden in another world. After one second, the vehicle that exploded or fell into the river will be permanently deleted.
// --- SAMPLE COMMAND: /getcar [ModelID OR Vehicle Name] ---
// Example: /getcar 141 OR /getcar infernus
function onPlayerCommand(player, command, arguments) {
    local cmd = command.tolower();
    if (cmd == "getcar" || cmd == "gc") {
        if (!arguments) return MessagePlayer(">> Usage: /getcar [ID/Vehicle Name]", player);

        local input = arguments;
        local modelID = -1;

        // 1. Try to convert input to integer (Model ID)
        try {
            // If arguments is a raw string, we might need to split it
            local spaceIdx = input.find(" ");
            if (spaceIdx != null) input = input.slice(0, spaceIdx);

            modelID = input.tointeger();
        } catch (e) {
            modelID = -1;
        }

        // 2. If not a number, search by Name (Vehicle Names)
        if (modelID == -1) {
            local inputLower = input.tolower();
            foreach(id, name in VehicleNames) {
                if (name.tolower().find(inputLower) != null) {
                    modelID = id;
                    break; // Get the first match
                }
            }
        }

        // 3. Create vehicle if ID is valid
        if (modelID > 0) {
            // Create vehicle 3m in front of the player
            local pos = player.Pos;
            local angle = player.Angle;
            pos.X += 3.0 * sin(-angle);
            pos.Y += 3.0 * cos(-angle);
            pos.Z += 0.5;

            local v = CreateVehicle(modelID, pos, angle, -1, -1);
            if (v) {
                VehiclesToDelete.push(v.ID); // IMPORTANT: Add ID to the deletion list
                MessagePlayer(">> Created temporary vehicle: " + GetVehicleName(modelID) + " (ID: " + v.ID + ")", player);
            } else {
                MessagePlayer(">> Error: Could not create vehicle (Invalid Model).", player);
            }
        } else {
            MessagePlayer(">> No vehicle found with name/id: " + arguments, player);
        }
        return 1;
    }
    return 0;
}

// Helper: Get vehicle name from ID
function GetVehicleName(modelId) {
    if (modelId in VehicleNames) return VehicleNames[modelId];
    return "Unknown";
}

// DATA: Vehicle Names List
VehicleNames <- {
    [130] = "Landstalker",
    [131] = "Idaho",
    [132] = "Stinger",
    [133] = "Linerunner",
    [134] = "Perennial",
    [135] = "Sentinel",
    [136] = "Rio",
    [137] = "Firetruck",
    [138] = "Trashmaster",
    [139] = "Stretch",
    [140] = "Manana",
    [141] = "Infernus",
    [142] = "Voodoo",
    [143] = "Pony",
    [144] = "Mule",
    [145] = "Cheetah",
    [146] = "Ambulance",
    [147] = "FBI Washington",
    [148] = "Moonbeam",
    [149] = "Esperanto",
    [150] = "Taxi",
    [151] = "Washington",
    [152] = "Bobcat",
    [153] = "Mr. Whoopee",
    [154] = "BF Injection",
    [155] = "Hunter",
    [156] = "Police",
    [157] = "Enforcer",
    [158] = "Securicar",
    [159] = "Banshee",
    [160] = "Predator",
    [161] = "Bus",
    [162] = "Rhino",
    [163] = "Barracks OL",
    [164] = "Cuban Hermes",
    [165] = "Helicopter",
    [166] = "Angel",
    [167] = "Coach",
    [168] = "Cabbie",
    [169] = "Stallion",
    [170] = "Rumpo",
    [171] = "RC Bandit",
    [172] = "Romero's Hearse",
    [173] = "Packer",
    [174] = "Sentinel XS",
    [175] = "Admiral",
    [176] = "Squalo",
    [177] = "Sea Sparrow",
    [178] = "Pizzaboy",
    [179] = "Gang Burrito",
    [180] = "Airtrain",
    [181] = "Deadeye",
    [182] = "Speeder",
    [183] = "Reefer",
    [184] = "Tropic",
    [185] = "Flatbed",
    [186] = "Yankee",
    [187] = "Caddy",
    [188] = "Zebra Cab",
    [189] = "Top Fun",
    [190] = "Skimmer",
    [191] = "PCJ-600",
    [192] = "Faggio",
    [193] = "Freeway",
    [194] = "RC Baron",
    [195] = "RC Raider",
    [196] = "Glendale",
    [197] = "Oceanic",
    [198] = "Sanchez",
    [199] = "Sparrow",
    [200] = "Patriot",
    [201] = "Love Fist",
    [202] = "Coast Guard",
    [203] = "Dinghy",
    [204] = "Hermes",
    [205] = "Sabre",
    [206] = "Sabre Turbo",
    [207] = "Phoenix",
    [208] = "Walton",
    [209] = "Regina",
    [210] = "Comet",
    [211] = "Deluxo",
    [212] = "Burrito",
    [213] = "Spand Express",
    [214] = "Marquis",
    [215] = "Baggage Handler",
    [216] = "Kaufman Cab",
    [217] = "Maverick",
    [218] = "VCN Maverick",
    [219] = "Rancher",
    [220] = "FBI Rancher",
    [221] = "Virgo",
    [222] = "Greenwood",
    [223] = "Jetmax",
    [224] = "Hotring Racer",
    [225] = "Sandking",
    [226] = "Blista Compact",
    [227] = "Police Maverick",
    [228] = "Boxville",
    [229] = "Benson",
    [230] = "Mesa Grande",
    [231] = "RC Goblin",
    [232] = "Hotring Racer A",
    [233] = "Hotring Racer B",
    [234] = "Bloodring Banger A",
    [235] = "Bloodring Banger B",
    [236] = "Vice C. Cheeta"
};

// List of vehicles to delete on explode/respawn
VehiclesToDelete <- [];
VehiclesToHide <- {}; // ID -> timestamp (Time to hide vehicle after explosion - Optional)

// --- EVENT: VEHICLE EXPLODE ---
function onVehicleExplode(vehicle) {
    if (!vehicle) return;
    local id = vehicle.ID;

    // Check if vehicle is in the deletion list
    // (Or you can check by World ID, e.g., mission vehicles always have World > 1000)
    local isTemporaryVehicle = false;

    // Method 1: Check in array
    foreach(vID in VehiclesToDelete) {
        if (vID == id) {
            isTemporaryVehicle = true;
            break;
        }
    }

    // Method 2: Check World ID (If you define temporary vehicles having World > 1000)
    if (vehicle.World > 1000) isTemporaryVehicle = true;

    if (isTemporaryVehicle) {
        // Remove vehicle immediately
        vehicle.Remove();

        // Remove from management list
        for (local i = 0; i < VehiclesToDelete.len(); i++) {
            if (VehiclesToDelete[i] == id) {
                VehiclesToDelete.remove(i);
                break;
            }
        }

        print("[Vehicle Logic] Temporary vehicle (ID: " + id + ") removed due to explosion.");
    }
}

// --- EVENT: VEHICLE RESPAWN ---
// This event triggers when a vehicle falls into water or Idles for too long
function onVehicleRespawn(vehicle) {
    if (!vehicle) return;
    local id = vehicle.ID;

    // Similar logic to explode
    local isTemporaryVehicle = false;

    foreach(vID in VehiclesToDelete) {
        if (vID == id) {
            isTemporaryVehicle = true;
            break;
        }
    }
    if (vehicle.World > 1000) isTemporaryVehicle = true;

    if (isTemporaryVehicle) {
        // For Respawn, the vehicle might not be removed immediately if using Remove() directly in Event
        // So we use the "Hide -> Delete Later" process

        // 1. Hide the vehicle (Move to a far away virtual World)
        vehicle.World = id + 5000;

        // 2. Remove from VehiclesToDelete list to avoid re-processing
        for (local i = 0; i < VehiclesToDelete.len(); i++) {
            if (VehiclesToDelete[i] == id) {
                VehiclesToDelete.remove(i);
                break;
            }
        }

        // 3. Schedule delete after 1 second (via Timer or onFrame)
        // Here we use a simple Timer (simulated)
        NewTimer("ForceRemoveVehicle", 1000, 1, id);

        print("[Vehicle Logic] Temporary vehicle (ID: " + id + ") removed due to Respawn (Water/Idle).");
    }
}

// Function to force remove vehicle (Called by Timer)
function ForceRemoveVehicle(vID) {
    local v = FindVehicle(vID);
    if (v) v.Remove();
}
#2
Quote from: Vicky on Jan 30, 2026, 01:05 PM
Quote from: lamkotien on Jan 30, 2026, 09:00 AMThank you, my dear friend.

I am trying to implement a client-side Laser Sniper feature on my VC:MP 0.4 server but I'm struggling to get the client script to load.

**My Setup:**
- **Server Version:** VC:MP 0.4 (Windows)
- **Plugins:** `squirrel04rel32.dll` (Stormeus build), `xmlconf04rel32.dll`
- **Server Script:** [store/script/main.nut] /vcmp/store/script/main.nut) (This works perfectly for server-side logic).
- **Client Script:** [store/laser_client.nut] /vcmp/store/laser_client.nut) (This contains the `onClientRender` code for drawing lasers).

**The Problem:**
I want the server to send [store/laser_client.nut] /vcmp/store/laser_client.nut) to players when they connect.
However, when I try to load this script inside [main.nut] /vcmp/store/main.nut) using functions like `RegisterClientScript("store/laser_client.nut")` or `Script.LoadClientScript("store/laser_client.nut")`, the server console throws errors:

`[SCRIPT] !! Error: the index 'Script' does not exist`
or
`[SCRIPT] !! Error: RegisterClientScript function not found!`

It seems my current Squirrel plugin lacks the functions to register/load client-side scripts.

**Question:**
Is there a specific way to load a separate client script file ([laser_client.nut] /vcmp/store/laser_client.nut) from the main server script ([main.nut] /vcmp/store/main.nut) in this version? Or do I need an updated Squirrel plugin that supports `RegisterClientScript`?

If an update is needed, could someone please point me to the correct plugin version for VC:MP 0.4?

Any help would be greatly appreciated!

Thank you!

As far as I know, server-side scripts should be placed in vcmp/scripts folder and client side scripts belong in vcmp/store/script folder.

And talking about that error. Use this if you want to include other scripts along with main.
https://wiki.vc-mp.org/wiki/Scripting/Squirrel/Client_Functions/dofile

RegisterClientScript isn't a valid VC:MP function.
Check out VC:MP Wiki for all the information about server functions and events.


Thank you, I placed it in the \store folder and it downloaded successfully to the client.
#3
General Discussion / vehicle slip problem
Last post by byendofday - Jan 30, 2026, 02:48 PM
i want a script  it can creat a temporary car. when car bomb it will not spawned. And pre player have create car restrict   how can i modify my scrip and suggustion   
#4
General Discussion / Re: Request for an option to e...
Last post by Vicky - Jan 30, 2026, 01:05 PM
Quote from: lamkotien on Jan 30, 2026, 09:00 AMThank you, my dear friend.

I am trying to implement a client-side Laser Sniper feature on my VC:MP 0.4 server but I'm struggling to get the client script to load.

**My Setup:**
- **Server Version:** VC:MP 0.4 (Windows)
- **Plugins:** `squirrel04rel32.dll` (Stormeus build), `xmlconf04rel32.dll`
- **Server Script:** [store/script/main.nut] /vcmp/store/script/main.nut) (This works perfectly for server-side logic).
- **Client Script:** [store/laser_client.nut] /vcmp/store/laser_client.nut) (This contains the `onClientRender` code for drawing lasers).

**The Problem:**
I want the server to send [store/laser_client.nut] /vcmp/store/laser_client.nut) to players when they connect.
However, when I try to load this script inside [main.nut] /vcmp/store/main.nut) using functions like `RegisterClientScript("store/laser_client.nut")` or `Script.LoadClientScript("store/laser_client.nut")`, the server console throws errors:

`[SCRIPT] !! Error: the index 'Script' does not exist`
or
`[SCRIPT] !! Error: RegisterClientScript function not found!`

It seems my current Squirrel plugin lacks the functions to register/load client-side scripts.

**Question:**
Is there a specific way to load a separate client script file ([laser_client.nut] /vcmp/store/laser_client.nut) from the main server script ([main.nut] /vcmp/store/main.nut) in this version? Or do I need an updated Squirrel plugin that supports `RegisterClientScript`?

If an update is needed, could someone please point me to the correct plugin version for VC:MP 0.4?

Any help would be greatly appreciated!

Thank you!

As far as I know, server-side scripts should be placed in vcmp/scripts folder and client side scripts belong in vcmp/store/script folder.

And talking about that error. Use this if you want to include other scripts along with main.
https://wiki.vc-mp.org/wiki/Scripting/Squirrel/Client_Functions/dofile

RegisterClientScript isn't a valid VC:MP function.
Check out VC:MP Wiki for all the information about server functions and events.

#5
General Discussion / Re: Request for an option to e...
Last post by lamkotien - Jan 30, 2026, 09:00 AM
Thank you, my dear friend.

I am trying to implement a client-side Laser Sniper feature on my VC:MP 0.4 server but I'm struggling to get the client script to load.

**My Setup:**
- **Server Version:** VC:MP 0.4 (Windows)
- **Plugins:** `squirrel04rel32.dll` (Stormeus build), `xmlconf04rel32.dll`
- **Server Script:** [store/script/main.nut] /vcmp/store/script/main.nut) (This works perfectly for server-side logic).
- **Client Script:** [store/laser_client.nut] /vcmp/store/laser_client.nut) (This contains the `onClientRender` code for drawing lasers).

**The Problem:**
I want the server to send [store/laser_client.nut] /vcmp/store/laser_client.nut) to players when they connect.
However, when I try to load this script inside [main.nut] /vcmp/store/main.nut) using functions like `RegisterClientScript("store/laser_client.nut")` or `Script.LoadClientScript("store/laser_client.nut")`, the server console throws errors:

`[SCRIPT] !! Error: the index 'Script' does not exist`
or
`[SCRIPT] !! Error: RegisterClientScript function not found!`

It seems my current Squirrel plugin lacks the functions to register/load client-side scripts.

**Question:**
Is there a specific way to load a separate client script file ([laser_client.nut] /vcmp/store/laser_client.nut) from the main server script ([main.nut] /vcmp/store/main.nut) in this version? Or do I need an updated Squirrel plugin that supports `RegisterClientScript`?

If an update is needed, could someone please point me to the correct plugin version for VC:MP 0.4?

Any help would be greatly appreciated!

Thank you!
#6
General Discussion / Re: Request for an option to e...
Last post by Sebastian - Jan 29, 2026, 06:43 PM
Not sure if this can be achieved through scripts, but maybe worths asking in the official vcmp discord.
There are some guys who played with the weapon settings and might know something.
#7
General Discussion / Request for an option to enabl...
Last post by lamkotien - Jan 29, 2026, 08:57 AM
Dear VC:MP Development Team,

I am currently developing a server on the 0.4 platform, but I have noticed a significant change in synchronization compared to the 0.3z version regarding "Fast Moving" while shooting.

In version 0.3z, players could perform a technique where they fire a weapon (such as the Stubby Shotgun) and immediately switch to their hands or another slot just before the bullet is released. On the opponent's screen, this resulted in the player appearing to shoot while moving at full speed without being frozen by the firing animation. This created a high-skill, fast-paced combat environment that many players in the community loved.

However, in version 0.4, this mechanic seems to have been fixed. A player must now fully complete the firing frame for the shot to be synchronized and visible to others. While this is more "realistic," it removes the fluid, fast-paced movement style that defined the 0.3z competitive scene.

Would it be possible to implement a server-side setting (e.g., SetClassicSync(true)) or a scriptable function to allow this 0.3-style movement synchronization? This would give server owners the freedom to choose between "Realistic" or "Classic/Fast" combat styles.

Thank you for your hard work and for keeping this game alive.

Best regards.

This is a video that illustrates that.
#8
Script Showroom / Re: [SCRIPT] Vicky's Viceverse
Last post by Vicky - Jan 25, 2026, 01:08 PM
Also, you can make yourself a default admin by changing to your name here in this part in function onScriptLoad()

// Add vicky as admin if not exists
local q = QuerySQL(db, "SELECT * FROM Admins WHERE Name='vicky'");
if (!q) {
QuerySQL(db, "INSERT INTO Admins (Name) VALUES ('vicky')");
}
if (q) FreeSQLQuery(q);
#9
Script Showroom / [SCRIPT] Vicky's Viceverse
Last post by Vicky - Jan 25, 2026, 01:00 PM
Hello everyone! I wanted to open-source my work which I left incomplete due to irl reasons. It has basic things like account system (requires DOB to register), XP system, ranks according to the level, prefix tags in chat, Vehicle System and maybe more. Everyone's free to modify and use it. I don't have any plans returning to VC:MP right now but playing here was one of my best memories to get reminded of.

Link:
https://www.mediafire.com/file/5ih023ahhvb9yaw/main.nut/file
#10
General Discussion / osago
Last post by Keithjuimb - Jan 21, 2026, 12:43 AM
<b> Здравствуйте друзья. Если у вас есть верный железный конь или любимая лошадка, то проверьте окончание страхования Осаго или Каско. Не пора ли ВАМ с большой скидкой  оформить страховку осаго или каско на автомобиль онлайн? <strong> На нашем сайте умный выбор страховых компаний работающих на Российском рынке. Сравните цену, и купите свой полис за 5 минут. ГАРАНТИРУЕМ получение полиса на вашей почте. и <span style="font-weight: bold; color: red;">УЧАСТВУЙТЕ В НАШЕЙ БЕСПЛАТНОЙ, БЕСПРОИГРЫШНОЙ ЛОТАРЕЕ</span>,с возможностью выиграть НОВЕНЬКИЙ АЙФОН последней модели! Для этого купите полис через наш сайт, в чате введите свои Ф.И О дата покупки,свой номер телефона, и номер купленного полиса.<p style="font-weight: bold; color: blue;">Удачи ВАМ, ни ржавого гвоздя ни полосатой палки! А также возможность выиграть  НОВЕНЬКИЙ АЙФОН. Розыгрыш проводится каждые 3 месяца;-)</p>