Share script - 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: Share script (
/showthread.php?tid=304693)
Share script -
TGameR - 19.12.2011
HI,
Wath is the 2 fonction and timer for auto respawn on 1 minute please help me.
PS: sorry for my englich.
Re : Share script -
TGameR - 19.12.2011
UP help me
Re: Share script -
Ballu Miaa - 19.12.2011
pawn Код:
forward AutoRespawn();
public AutoRespawn()
{
new bool:unwanted[500];
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 450; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
return 1;
}
}
// Add this under OnGameModeInIt()
SetTimer("AutoRespawn",1 * 60 * 1000,0);
NOTE:UNTESTED
Re: Share script -
grand.Theft.Otto - 19.12.2011
Quote:
Originally Posted by Ballu Miaa
pawn Код:
forward AutoRespawn(); public AutoRespawn() { new bool:unwanted[500]; for(new player=0; player<MAX_PLAYERS; player++) { if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; } } for(new car = 1; car <= 450; car++) { if(!unwanted[car]) SetVehicleToRespawn(car); return 1; } } // Add this under OnGameModeInIt() SetTimer("AutoRespawn",1 * 60 * 1000,0);
NOTE:UNTESTED
|
Instead of doing all that hard work, use AddStaticVehicleEx and set the respawn delay time:
Parameters:
pawn Код:
AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, respawn_delay);
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
Re: Share script -
Ballu Miaa - 20.12.2011
Quote:
Originally Posted by grand.Theft.Otto
Instead of doing all that hard work, use AddStaticVehicleEx and set the respawn delay time:
Parameters:
pawn Код:
AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, respawn_delay);
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
|
He wanted it to be that way, So i gave him what he wanted!