Share script
#4

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
Reply


Messages In This Thread
Share script - by TGameR - 19.12.2011, 14:10
Re : Share script - by TGameR - 19.12.2011, 18:25
Re: Share script - by Ballu Miaa - 19.12.2011, 18:47
Re: Share script - by grand.Theft.Otto - 19.12.2011, 19:52
Re: Share script - by Ballu Miaa - 20.12.2011, 01:07

Forum Jump:


Users browsing this thread: 1 Guest(s)