What about this commands?
#3

Quote:
Originally Posted by Shinja
View Post
First optimization is your loop, it's calling GetVehiclePoolSize at every iteration.
And a little (mistake or it's mean't to be like that?), it will respawn also used vehicles which will be annoying to players.
PHP Code:
for(new ij=GetVehiclePoolSize(); <= ji++) 
    { 
        if(
GetVehicleDriver(i) == INVALID_PLAYER_IDSetVehicleToRespawn(i); 
    } 
Ye'p, I forget those 2 things.
This is better?
PHP Code:
PUBLIC:AllVehicleRespawn()
{
    if(
TimeRespawn gettime() > 13)
    {
        
ServeurAnnonce(_"15 secondes avant le respawn de tous les vйhicules.");
        
SetTimer("AllVehicleRespawn"5000false);
        return 
1;
    }
    else if(
TimeRespawn gettime() > 9)
    {
        
ServeurAnnonce(_"10 secondes avant le respawn de tous les vйhicules.");
        
SetTimer("AllVehicleRespawn"5000false);
        return 
1;
    }
    else if(
TimeRespawn gettime() > 4)
    {
        
ServeurAnnonce(_"5 secondes avant le respawn de tous les vйhicules.");
        
SetTimer("AllVehicleRespawn"5000false);
        return 
1;
    }
    
ServeurAnnonce(_"Tous les vйhicules ont йtй respawn par un administrateur.");
    for(new 
iGetVehiclePoolSize(); <= ji++)  
    {  
        if(
GetVehicleDriver(i) == INVALID_PLAYER_IDSetVehicleToRespawn(i);  
    }  
    return 
1;
}
GetVehicleDriver(vehicleid)
{
    foreach(new 
Player)
    {
        if(
GetPlayerVehicleID(i) == vehicleid) return i;
    }
    return 
INVALID_PLAYER_ID;

Reply


Messages In This Thread
What about this commands? - by Dayrion - 17.09.2016, 11:19
Re: What about this commands? - by Shinja - 17.09.2016, 11:25
Re: What about this commands? - by Dayrion - 17.09.2016, 11:32
Re: What about this commands? - by Konstantinos - 17.09.2016, 11:37
Re: What about this commands? - by Dayrion - 17.09.2016, 22:46
Re: What about this commands? - by Konstantinos - 18.09.2016, 10:26
Re: What about this commands? - by Dayrion - 18.09.2016, 12:08
Re: What about this commands? - by Konstantinos - 18.09.2016, 12:19
Re: What about this commands? - by Dayrion - 18.09.2016, 17:28
Re: What about this commands? - by Konstantinos - 18.09.2016, 17:33
Re: What about this commands? - by Dayrion - 18.09.2016, 18:03
Re: What about this commands? - by Konstantinos - 18.09.2016, 18:09
Re: What about this commands? - by Dayrion - 18.09.2016, 20:27
Re: What about this commands? - by Konstantinos - 19.09.2016, 08:15
Re: What about this commands? - by Stinged - 19.09.2016, 13:02
Re: What about this commands? - by Dayrion - 19.09.2016, 14:07
Re: What about this commands? - by Dayrion - 20.09.2016, 18:03
Re: What about this commands? - by Dayrion - 07.12.2016, 11:13
Re: What about this commands? - by SickAttack - 07.12.2016, 15:14
Re: What about this commands? - by Dayrion - 07.12.2016, 15:26
Re: What about this commands? - by Konstantinos - 07.12.2016, 19:06

Forum Jump:


Users browsing this thread: 1 Guest(s)