02.09.2012, 15:48
Need me when player write /setfuelall to refuel all cars in server.
This is my command for one refuel car.
Код:
CMD:setfuel(playerid, params[]) { if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_RED, "You are not admin!"); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!"); new amount, msg[128]; if(sscanf(params, "d", amount)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /setfuel [amount]"); if(amount < 0 || amount > 100) return SendClientMessage(playerid, COLOR_RED, "Invalid amount! (0-100)"); Fuel[GetPlayerVehicleID(playerid)] = amount; format(msg, sizeof(msg), "You have set your vehicle fuel to %d", amount); SendClientMessage(playerid, COLOR_WHITE, msg); return 1; }