24.05.2016, 10:28
Let's take an example :
There is an admin command making you in GODMODE.
I hope you understand the difference. By the way check THIS.
There is an admin command making you in GODMODE.
PHP код:
CMD:god(playerid,params[])
{
if(PlayerInfo[playerid][pAdminlvl] >= 4 && PlayerGodMode[playerid] == 1) // If the player has AT LEAST a admin lvl > 4 AND he is NOT in godmode
{
PlayerGodMode[playerid] = 2;
SendClientMessage(playerid, -1, "Godmode on");
GOD = SetTimerEx("GodMode", 100, true, "i", playerid);
return 1;
}
else if(PlayerInfo[playerid][pAdminlvl] >= 4 && PlayerGodMode[playerid] == 2) // ELSE IF the player has AT LEAST a admin lvl > 4 AND he IS in godmode.
{
SendClientMessage(playerid, -1, "Godmode off");
KillTimer(GOD);
PlayerGodMode[playerid] = 1;
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
return 1;
}
else return SendClientMessage(playerid, red, "You are not allowed to use this command."); // ELSE : the player isn't admin
}