SA-MP Forums Archive
Respawn a vehicle when enter checkpoint - 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: Respawn a vehicle when enter checkpoint (/showthread.php?tid=268169)



Respawn a vehicle when enter checkpoint - lewismichaelbbc - 11.07.2011

Hi, what is the pawno code to respawn a vehicle when someone drives into a checkpoint.

SetVehicleToRespawn(--The playerID's vehicle); <<< How can i make that players car respawn?

Thanks


Re: Respawn a vehicle when enter checkpoint - Macintosh - 11.07.2011

pawn Код:
new CheckRespawn;
pawn Код:
public OnGameModeInit()
{
     CheckRespawn = SetPlayerCheckpoint(playerid, X, Y, Z, 3.0);
     return 1;
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(CheckRespawn[playerid] == 1)
    {
         new vehicleid = GetPlayerVehicleID(playerid);
         SetVehicleToRespawn(vehicleid);
         SendClientMessage(playerid, -1, "[!] Your vehicle was respawn!");
         return 1;
    }
    return 1;
}



Re: Respawn a vehicle when enter checkpoint - lewismichaelbbc - 11.07.2011

It worked. Thank you very much!