06.07.2013, 20:03
I can't really understand your system, but I have this scripted.
Quote:
CMD:destroycar(playerid, params[]) { if(!CheckAdmin(playerid, ADMIN_LEVEL_1)) return NotAuthMSG(playerid); if(!PlayerInCar(playerid)) return NotInCarMSG(playerid); format(msg, sizeof(msg), "You've destroyed vehicle ID: %d.", GetPlayerVehicleID(playerid)); SCM(playerid, COLOR_GRAD4, msg); DestoryCar(GetPlayerVehicleID(playerid)); return 1; } |
Quote:
if(strcmp(cmd, "/destroycar", true)== 0) { if(PlayerInfo[playerid][pAdmin] >= 4) { if(!vehenabled) return SendClientMessage(playerid, GREY, "/veh was disabled by executive staff."); new currentVehicle = GetPlayerVehicleID(playerid); if(currentVehicle == 0) return SendClientMessage(playerid,GREY, " You must be in a vehicle to destroy it."); new check; for(new i = 0; i < sizeof(CreatedCars); i++) { if(CreatedCars[i] == currentVehicle) { check = 1; CreatedCars[i] = INVALID_VEHICLE_ID; break; } } if(!check) return SendClientMessage(playerid, GREY, " You may only destroy a vehicle that was created with /veh."); gDestroyVehicle[currentVehicle] = 1; RemoveSiren(currentVehicle); SetVehicleToRespawn(currentVehicle); return 1; } else { SendClientMessage(playerid, GREY, " You are not authorized to use that command."); } } |
Quote:
CMD:destroycars(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 4) { SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!"); return 1; } for(new i = 0; i < sizeof(CreatedCars); i++) { if(CreatedCars[i] != INVALID_VEHICLE_ID) { DestroyVehicle(CreatedCars[i]); CreatedCars[i] = INVALID_VEHICLE_ID; } } SendClientMessageEx(playerid, COLOR_GREY, " Created vehicles destroyed!"); return 1; } |