24.12.2015, 16:28
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
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 i; i < sizeof(GameModeCars); i++) {
if(IsValidVehicle(GameModeCars[i])) {
SetVehicleToRespawn(GameModeCars[i]);
count++;
}
}
printf("Respawned total of %i cars",count);
return true;
}