CreateVehicle
#1

Yeah I have this CMD, it works fine but when I exit the car it respawns at the place i typed the cmd. Anyway of preventing it of respawning?

pawn Код:
COMMAND:av(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] > 0)
    {
        new Float:x, Float:y, Float:z;
        new v;
        GetPlayerPos(playerid, x, y, z);
        if(IsPlayerInAnyVehicle(playerid))
        {
            new veh;
            veh = GetPlayerVehicleID(playerid);
            DestroyVehicle(veh);
        }
        v = CreateVehicle(411, x, y, z, 0, 0, 0, 1);
        PutPlayerInVehicle(playerid, v, 0);
    }
    else
    {
        ServerMessage(playerid, "Jij kan dit niet doen.");
    }
    return 1;
}
Reply
#2

https://sampwiki.blast.hk/wiki/CreateVehicle

The last parameter is respawn_delay, which is in seconds, and you put 1, so it will respawn right after you leave the vehicle, if you don't want it to respawn, use -1.
Reply
#3

Quote:
Originally Posted by IstuntmanI
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/CreateVehicle

The last parameter is respawn_delay, which is in seconds, and you put 1, so it will respawn right after you leave the vehicle, if you don't want it to respawn, use -1.
Awesome thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)