28.04.2009, 19:05
i make godmode command like this
at the top
then i have
but i screw up and it is ALWAYS on so can any one please help fix me it thanks.
at the top
pawn Код:
new Godmode[MAX_PLAYERS];
new GodTimer;
forward GodMode(playerid);
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/GodMode", cmdtext, true, 10) == 0)
{
if(Godmode[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "Godmode On");
Godmode[playerid] = 1;
GodTimer = SetTimer("GodMode", 100, 1);
}
else if(Godmode[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "god off");
KillTimer(GodTimer);
}
return 1;
}
return 0;
}
public GodMode(playerid)
{
SetPlayerHealth(playerid, 1000.0);
ResetPlayerWeapons(playerid);
return 1;
}