SA-MP Forums Archive
Vehicle respawning - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Vehicle respawning (/showthread.php?tid=115693)



Vehicle respawning - jamesb93 - 25.12.2009

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


Re: Vehicle respawning - M4S7ERMIND - 25.12.2009

search for GetCosestVehicle function.