24.04.2014, 00:11
When i do /REUNCARS it respawns all cars ... but it should only respawn UNOCCUPIED cars
it would be verry nice if someone can help
it would be verry nice if someone can help

PHP код:
//RESPAWN ALL UNOCCUPIED CARS
if(!strcmp("/REUNCARS", cmdtext, true))
{
new AdminChk = AdminStatus(playerid);
if(AdminChk >= 5 && AdminChk <= 7)
{
new PlayerName[P_MAX_NAMELEN], Message[100];
GetPVarString(playerid, "P_JoinName", PlayerName, sizeof(PlayerName));
for(new Veh = 0; Veh <= MAX_VEHICLES; Veh++)
{
for(new Pla = 0; Pla <= S_MAX_PLAYERS; Pla++)
{
if(!IsPlayerInVehicle(Pla, Veh))
{
SetVehicleToRespawn(Veh);
}
}
}
format(Message, sizeof(Message),"ADMIN: %s(%i) Respawned all unoccupied cars", PlayerName, playerid);
SndAdminMgs(Message, 2);
return 1;
}
}