02.08.2011, 11:04
The code is weird.. ^_^
For such things, a "bool" var is good and has better performance.
EDIT: ahh, too late.. xD
For such things, a "bool" var is good and has better performance.
pawn Код:
//Global Variable (On top of your script)
new bool:gGMEnabled[MAX_PLAYERS];
COMMAND:god(playerid, params[])
{
if(Adminstrator[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You're not an Adminstrator!");
if(!gGMEnabled[playerid])
{
SetPlayerHealth(playerid, INFINITY);
SendClientMessage(playerid, 0x00FF00FF, "Godmode ON");
} else {
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, 0xFF0000FF, "Godmode OFF");
}
return 1;
}
//And add gGMEnabled[playerid] = false; on player connect/disconnect, as you wish.