Share script
#1

HI,
Wath is the 2 fonction and timer for auto respawn on 1 minute please help me.
PS: sorry for my englich.
Reply
#2

UP help me
Reply
#3

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
Reply
#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
#5

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)