25.12.2009, 15:32
Hey,
How would I go about making a command to respawn the closest vehicle. So I can make an admin command to re-spawning a vehicle they are standing on or are near. I tryed this and failed, noticing it has to be getting driven.
Help would be appreciated
How would I go about making a command to respawn the closest vehicle. So I can make an admin command to re-spawning a vehicle they are standing on or are near. I tryed this and failed, noticing it has to be getting driven.
pawn Код:
dcmd_respawn(playerid,params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0x33CCFFFF,"[VT ERROR] You're not an admin.");
{
new vehid = GetPlayerSurfingVehicleID(playerid);
SetVehicleToRespawn(vehid);
if(vehid == INVALID_VEHICLE_ID)
{
vehid = GetPlayerVehicleID(playerid);
SetVehicleToRespawn(vehid);
}
}
return 1;
}