CMD:god(playerid) { if(PlayerInfo[playerid][Level]> = 2) { if(PlayerInfo[playerid][God] == 0) { PlayerInfo[playerid][God] = 1; SetPlayerHealth(playerid, 100000.0); GivePlayerWeaponEx(playerid, 16, 50000); GivePlayerWeaponEx(playerid, 26, 50000); GivePlayerWeaponEx(playerid, 35, 50000); SendClientMessage (playerid, green, "GODMODE ON"); CMDMessageToAdmins (playerid, "GOD (on)"); } else { PlayerInfo[playerid][God] = 0; SendClientMessage(playerid, red, "GODMODE OFF"); SetPlayerHealth(playerid, 100.0); CMDMessageToAdmins (playerid, "GOD (off)"); } } else return SendClientMessage (playerid, red, "ERROR: You need to be Admins to use this command"); return 1; }
PlayerInfo[playerid][God] = 0; //set god mode to 0 or the disconnecting player SetPlayerHealth(playerid, 100.0);
Make your life easier by organizing your code
Код:
CMD:god(playerid) { if(PlayerInfo[playerid][Level]> = 2) { if(PlayerInfo[playerid][God] == 0) { PlayerInfo[playerid][God] = 1; SetPlayerHealth(playerid, 100000.0); GivePlayerWeaponEx(playerid, 16, 50000); GivePlayerWeaponEx(playerid, 26, 50000); GivePlayerWeaponEx(playerid, 35, 50000); SendClientMessage (playerid, green, "GODMODE ON"); CMDMessageToAdmins (playerid, "GOD (on)"); } else { PlayerInfo[playerid][God] = 0; SendClientMessage(playerid, red, "GODMODE OFF"); SetPlayerHealth(playerid, 100.0); CMDMessageToAdmins (playerid, "GOD (off)"); } } else return SendClientMessage (playerid, red, "ERROR: You need to be Admins to use this command"); return 1; } Код:
PlayerInfo[playerid][God] = 0; //set god mode to 0 or the disconnecting player SetPlayerHealth(playerid, 100.0); |