Respawning Vehs
#10

Yes it is possible but assign the vehicles to an array or some variable so you can loop thru it.

Ie example. Lets say you are using static vehicle system and that you dont create any new vehicles inside a gamemode

Just an example code

PHP код:
new GameModeCars[10]; //Increase 1 to how many cars you want.
GameModeInit() {
    
GameModeCars[0] = CreateVehicle(.....);
    
GameModeCars[1] = CreateVehicle(.....);
    
GameModeCars[2] = CreateVehicle(.....);
    
GameModeCars[3] = CreateVehicle(.....);
    
GameModeCars[4] = CreateVehicle(.....);
    
GameModeCars[5] = CreateVehicle(.....);
    
GameModeCars[6] = CreateVehicle(.....);
    
GameModeCars[7] = CreateVehicle(.....);
    
GameModeCars[8] = CreateVehicle(.....);
    
GameModeCars[9] = CreateVehicle(.....);
       return 
true;
}
CMD:respawngamemodecars(playerid,params[]) {
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not a rcon admin");
    new 
count;
    for(new 
isizeof(GameModeCars); i++) {
        if(
IsValidVehicle(GameModeCars[i])) {
            
SetVehicleToRespawn(GameModeCars[i]);
            
count++;
        }
    }
    
printf("Respawned total of %i cars",count);
    return 
true;

Reply


Messages In This Thread
Respawning Vehs - by zamaleksc - 24.12.2015, 14:29
Re: Respawning Vehs - by Ritzy2K - 24.12.2015, 14:33
Re: Respawning Vehs - by Amunra - 24.12.2015, 14:50
Re: Respawning Vehs - by zamaleksc - 24.12.2015, 14:52
Re: Respawning Vehs - by Amunra - 24.12.2015, 15:04
Re: Respawning Vehs - by zamaleksc - 24.12.2015, 15:37
Re: Respawning Vehs - by Amunra - 24.12.2015, 15:43
Re: Respawning Vehs - by Ritzy2K - 24.12.2015, 15:45
Re: Respawning Vehs - by Amunra - 24.12.2015, 16:00
Re: Respawning Vehs - by TwinkiDaBoss - 24.12.2015, 16:28

Forum Jump:


Users browsing this thread: 1 Guest(s)