20.03.2016, 14:12
Hello there,
I made a command which its aim is to respawn all vehicles within a certain range. The range can be chosen by the administrator in the command itself. The problem is, it respawns every vehicle in the server and not just the ones within the chosen range.
Help would be appreciated.
Thanks
I made a command which its aim is to respawn all vehicles within a certain range. The range can be chosen by the administrator in the command itself. The problem is, it respawns every vehicle in the server and not just the ones within the chosen range.
Код:
CMD:range(playerid, params[]) { if(pInfo[playerid][pAdmin] < 3) return 0; new range, Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if( sscanf(params, "f", range)) return SendUsageError( playerid, "/range [Range Distance]" ); for(new i = 1, j = GetVehiclePoolSize(); i <= j; i ++) { if(!IsPlayerInRangeOfPoint(i, range, x, y, z)) { if(!IsValidVehicle(i)) { continue; } if(spawnedcar[i]) { DestroyVehicle(i); spawnedcar[i] = 0; } else { SetVehicleToRespawn(i); } } } }
Thanks