What about this commands?
#17

Alright, foreach doesn't work anymore. Woa.
The code doesn't perform. He is like ignored.
EDIT:
Alriiiight! I changed the foreach include and the function!
Final version:
PHP код:
CMD:respawncall(playeridparams[])
{
    if(
pAccount[playerid][pAdmin] < ADMIN) return ErrorMsg(playerid_false);
    new 
time;
    if(
sscanf(params"I(20)"time)) return SCM(playeridLBLUE"/respawncall [temps avant respawn]");
    if(
RespawnAllVehicle != -1)
    {
        
ServeurAnnonce(_"Le respawn des vйhicules a йtй annulй par un administrateur.");
        
SendMessageToAdmins(ARED"%s a annulй le respawn des vйhicules"GetName(playerid));
        
KillTimer(RespawnAllVehicle);
        
RespawnAllVehicle = -1;
        return 
1;
    }
    
RespawnAllVehicle SetTimerEx("AllVehicleRespawn"5000false"i"time);
    
AdminMessage(playerid"Vous avez dйmarrй le respawn de tous les vйhicules.");
    
SendMessageToAdmins(ARED"%s a dйmarrй le respawn de tous les vйhicules."GetName(playerid));
    
ServeurAnnonce(_"%i secondes avant le respawn de tous les vйhicules."time);
    return 
1;
}
PUBLIC:
AllVehicleRespawn(interval)
{
    if((
interval -= 5) > 0)
    {
        
ServeurAnnonce(_"%i secondes avant le respawn de tous les vйhicules."interval);
        
RespawnAllVehicle SetTimerEx("AllVehicleRespawn"5000false"i"interval);
        return 
1;
    }
    
KillTimer(RespawnAllVehicle);
    
RespawnAllVehicle = -1;
    
ServeurAnnonce(_"Tous les vйhicules ont йtй respawn par un administrateur.");
    
RespawnVehicles();
    return 
1;
}
RespawnVehicles()
{
    new 
booloccupied_vehicle[MAX_VEHICLES char], vehicleid;
    foreach(new 
Player)
    {
        if ((
vehicleid GetPlayerVehicleID(i)) != 0)
        {
            
occupied_vehicle{vehicleid} = true;
            
occupied_vehicle{GetVehicleTrailer(vehicleid)} = true;
        }
    }
    foreach(new 
Vehicle)
    {
        if (!
occupied_vehicle{v}) SetVehicleToRespawn(v);
    }

Thanks a lot Konstantinos for your help and precious code!
I was wondering if I can use char for every array which can be divided by 4 ? Why nobody use this instead of normal array? This is optimization but it's interesting!
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)