Credits:
Zeex: ZCMD
Usmanmemon: GetpVarFloat & SetpVarfloat [helper]
RoyalGamer: scripting the god command
Zeex: ZCMD
Usmanmemon: GetpVarFloat & SetpVarfloat [helper]
RoyalGamer: scripting the god command
PHP Code:
/* CREDITS
*
* RoyalGamer & Usmanmemon
*
*/
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Simple God Command By RoyalGamer");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
CMD:god(playerid, params[])
{
if(GetPVarInt(playerid, "godmod") == 0)
{
new Float:healths, Float:armours;
//Old Health
GetPlayerHealth(playerid,healths);
SetPVarFloat(playerid, "health", healths);
//Old Armour
GetPlayerArmour(playerid,armours);
SetPVarFloat(playerid, "armour", armours);
SetPVarInt(playerid, "godmod", 1);
SetPlayerHealth(playerid, 99999999);
SetPlayerArmour(playerid, 99999999);
}
else
{
//Restore Health
SetPlayerHealth(playerid, GetPVarFloat(playerid, "health"));
//Restore Armour
SetPlayerArmour(playerid, GetPVarFloat(playerid, "armour"));
SetPVarInt(playerid, "godmod", 0);
}
return 1;
}