11.12.2009, 22:24
I've been experimenting with this for a while now, but i can't figure out why this isnt working!
(color codes are temporary)
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new vehicle = GetPlayerVehicleID(playerid); //The vehicle ID the player is in new plrHP = GetPlayerHealth(playerid); //The players health if (strcmp("/godon", cmdtext, true, 10) == 0) //God mode for both vehicle and player, admin cmd || ON { if(IsPlayerInAnyVehicle(playerid)) { SetPlayerHealth(playerid, 100000); SetVehicleHealth(vehicle, 1000000); } else { SetPlayerHealth(playerid, 100000); } SendClientMessage(playerid, 0xFF0000FF, "ACCESS: God mode ON"); return 1; } if (strcmp("/godoff", cmdtext, true, 10) == 0) //God mode for both vehicle and player, admin cmd || OFF { if(IsPlayerInAnyVehicle(playerid)) { SetPlayerHealth(playerid, 100); SetVehicleHealth(vehicle, 1000); } else { SetPlayerHealth(playerid, 100); } SendClientMessage(playerid, 0xFF0000FF, "ACCESS: God mode OFF"); return 1; } return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Unknown command"); }