28.04.2009, 19:39
No, they wont work but this should:
At The Top:
Then This:
That should work.
At The Top:
pawn Код:
forward GodMode(playerid);
new GodModeActive[MAX_PLAYERS];
new GodTimer;
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/GodMode", cmdtext, true, 10) == 0)
{
if(GodModeActive[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "Godmode On");
GodModeActive[playerid] = 1;
SetTimer("GodMode", 100, 1);
}
else if(GodModeActive[playerid] == 1)
{
GodModeActive[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "god off");
KillTimer(GodTimer);
}
return 1;
}
return 0;
}
public GodMode(playerid)
{
SetPlayerHealth(playerid, 1000.0);
ResetPlayerWeapons(playerid);
return 1;
}