Respawn all unused vehicles
#1

i have a problem

i want, to respawn all unused vehicles in every 2h 30 mins with forward

pls help!


at the beginning
PHP код:
forward RespawnVehs(); 
under ongamemodeinit
PHP код:
SetTimer("RespawnVehs"9000000true); 
at the end
PHP код:
public RespawnVehs()
{
////////HELP
////////HELP
////////HELP
////////HELP//////
////////HELP
////////HELP
return 1;

Reply
#2

It something with SetVehicleToRespawn
Reply
#3

just pls help
Reply
#4

Код:
public RespawnVehs() 
{ 
for(new i=0;i<MAX_VEHICLES;i++)
{                
if(IsVehicleOccupied(i) == 0)                
{                    
SetVehicleToRespawn(i);                
}            
}            
SendClientMessageToAll([YOURCOLOR],"All unused vehicles have been respawned");
return 1;
i hope it works

EDIT: errmm your timer 9000000 or sumthing isnt that 1,30 hours each time? use 150(00000)
Reply
#5

Lol, to test it you need to be on ur server 2,30 hours long, set the timer to every 23 seconds (simple delete some 0s) then check if it works, if it works set the timer to 2,30 hours
Reply
#6

ok thanks
Reply
#7

error 017: undefined symbol "IsVehicleOccupied" bug xD
Reply
#8

hmm, wait


EDIT: add this to the bottom of your script:
Код:
stock IsVehicleOccupied(vehicleid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInVehicle(i,vehicleid))
        return 1;
    }
    return 0;
}
Reply
#9

ok i just wait
Reply
#10

Now im about sure it works, may i test it on your server? dont forget to set the timer 23 secs btw (if you wanna test it with me )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)