11.01.2010, 11:25
I need to make a respawn command, because people can spawn cars, and after a while the map gets a mess.
if(strcmp(cmd,"/respawncars",true)==0) { if(IsPlayerAdmin(playerid)) for(new v = 1; v <= MAX_VEHICLES; v++) SetVehicleToRespawn(v); return 1; }
forward IsVehicleOccupied(vehicleid); |
public IsVehicleOccupied(vehicleid) { for(new i=0;i<MAX_PLAYERS;i++) { if(IsPlayerInVehicle(i,vehicleid)) return 1; } return 0; } |
if(strcmp(cmd, "/reloadcars", true) == 0) { if (IsPlayerAdmin(playerid)) { for(new i=0;i<MAX_VEHICLES;i++) { if(IsVehicleOccupied(i) == 0) { SetVehicleToRespawn(i); } } SendClientMessageToAll(an_color, "All vehicles reloaded!"); } else { SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command"); } return 1; } |
Originally Posted by Fedee!
I need to make a respawn command, because people can spawn cars, and after a while the map gets a mess.
|