Vehicle respawning
#1

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.

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;
}
Help would be appreciated
Reply
#2

search for GetCosestVehicle function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)