10.07.2015, 15:07
PHP код:
new godmode[MAX_PLAYERS]; // Add this to the top of your script under the includes.
//The god command made using OnPlayerCommandText.Just copy paste this code.
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/god", cmdtext, true, 10) == 0)
{
if(godmode[playerid] == 0)
{
SetPlayerHealth(playerid, 100000);
GameTextForPlayer(playerid,"~w~God Mode ~g~enabled!", 5000, 6);
godmode[playerid] = 1;
}
else if(godmode[playerid] == 1)
{
SetPlayerHealth(playerid, 100);
GameTextForPlayer(playerid,"~w~God Mode ~r~disabled!", 5000, 6);
godmode[playerid] = 1;
}
return 1;
}
return 0;
}