24.09.2014, 14:07
I have this command, that will respawn all the cars from a certain faction. The problem is, that it respawns the car, even if a player is driving it. What should i do, to respawn only the unused faction cars?
Код:
if(strcmp(cmd, "/fvr", true)) //Brooklyn Family { if(PlayerInfo[playerid][pLeader] == 6) { SetVehicleToRespawn(brooklyncar[0]); SetVehicleToRespawn(brooklyncar[1]); SetVehicleToRespawn(brooklyncar[2]); SetVehicleToRespawn(brooklyncar[3]); SetVehicleToRespawn(brooklyncar[4]); SetVehicleToRespawn(brooklyncar[5]); SetVehicleToRespawn(brooklyncar[6]); SetVehicleToRespawn(brooklyncar[7]); SetVehicleToRespawn(brooklyncar[8]); SetVehicleToRespawn(brooklyncar[9]); for(new i = 0; i < MAX_PLAYERS; i ++) { if(PlayerInfo[i][pMember] == 6 ||PlayerInfo[i][pLeader] == 6) { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), " All faction cars have been respawned by Leader %s.", sendername); SendClientMessage(i,COLOR_LIGHTBLUE,string); } } } else { SendClientMessage(playerid,COLOR_GREY," You are not the leader of an illegal faction !"); } }