Quote:
Originally Posted by ~Mapper™~
pawn Код:
if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] < 3) { SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!"); return 1; } new bool:unwanted[CAR_AMOUNT]; for(new player=0; player<MAX_PLAYERS; player++) { if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; } } for(new vehi = 0; vehi < MAX_VEHICLES; vehi++) { if(!unwanted[vehi]) SetVehicleToRespawn(vehi); if(CarInfo[vehi][tOwned] == 1 && CarInfo[vehi][tLicensePlate] != 0) { new plate[9]; strmid(plate, CarInfo[vehi][tLicensePlate], 0, strlen(CarInfo[vehi][tLicensePlate]), 255); SetVehicleNumberPlate(vehi, plate); } } GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Info: All unused cars respawned by %s.", sendername); SendClientMessageToAll(COLOR_LIGHTRED, string); } return 1; }
|
You're using some variables which isn't even created.
windrush just asked for the respawnallcars cmd.
The below code is what he want.
Quote:
Originally Posted by clarencecuzz
pawn Код:
CMD:respawnallcars(playerid,params[]) { for(new v = 0; v < MAX_VEHICLES; v++) //Start looping through vehicles { SetVehicleToRespawn(v); //Respawn each vehicle found. } return 1; }
|