10.07.2010, 11:25
pawn Код:
new GodMode[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
GodMode[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/god", false))
{
if(IsPlayerAdmin(playerid))
{
if(GodMode[playerid] == 0)
{
SendClientMessage(playerid, COLOR_MAGENTA, "GOD MODE ON");
SetPlayerArmour(playerid, INFINITY);
SetPlayerHealth(playerid, INFINITY);
GodMode[playerid] = 1;
}
else if(GodMode[playerid] == 1)
{
SendClientMessage(playerid, COLOR_MAGENTA, "GOD MODE OFF");
SetPlayerHealth(playerid, 0);
SetPlayerArmour(playerid, 0);
GodMode[playerid] = 0;
}
}
else SendClientMessage(playerid, COLOR_MAGENTA, "You are not an admin!"0;
}
return 0;
}