SA-MP Forums Archive
Need a Respawn - 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)
+--- Thread: Need a Respawn (/showthread.php?tid=412151)



Need a Respawn - DerickClark - 01.02.2013

i need a /respawnallcars


Re: Need a Respawn - iGetty - 01.02.2013

This is easy.

pawn Код:
command(rac, playerid, params[])
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        SetVehicleToRespawn(i);
    }
}
Is that all you want?


Re: Need a Respawn - DerickClark - 01.02.2013

Yes.


Re: Need a Respawn - DerickClark - 01.02.2013

But how can i add dis
if a player in a car it don't spawn how to make that?


Re: Need a Respawn - Jewell - 01.02.2013

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
But how can i add dis
if a player in a car it don't spawn how to make that?
This code will check if a player in a car or not.
pawn Код:
public VehicleOccupied(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid)) return 1;
}
return 0;
}
add this code into the iGetty's script.
pawn Код:
if(!VehicleOccupied(i))
{
SetVehicleToRespawn(i);
}