SA-MP Forums Archive
God Mode on Startup? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: God Mode on Startup? (/showthread.php?tid=444420)



God Mode on Startup? - PerformerFX - 16.06.2013

Can someone tell me howto get the Gode Mode working on player connect? So its on by default?

I'm new at scripting, sorry

if(strcmp("/god", cmdtext, true, 10) == 0)
{
if (God[playerid] == 1)
{
SendClientMessage(playerid, Rot, "God Modus aus. Du bist nun Verwundbar!");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
God[playerid] = 0;
return 1;
}
else if(God[playerid] == 0)
{
SendClientMessage(playerid, Hellblau, "God Modus an. Du bist nun Unverwundbar.");
God[playerid] = 1;
SetPlayerArmour(playerid, 10000);
SetPlayerHealth(playerid, 10000);
return 1;
}


AW: God Mode on Startup? - HurtLocker - 16.06.2013

onplayerspawn

SetPlayerHealth(playerid, 0x7F800000);


Re: God Mode on Startup? - Nick.D - 16.06.2013

public OnPlayerConnect(playerid)
{
God[playerid] = 1;
return 1;
}


Re: God Mode on Startup? - PerformerFX - 16.06.2013

Thanks, Nick. I got it.