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;
}
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. |