SA-MP Forums Archive
Need Some Help - 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: Need Some Help (/showthread.php?tid=580095)



Need Some Help - Mouiz - 02.07.2015

I have a godmod command:

Код:
CMD:god(playerid,params[])
{
        if (God[playerid] == 1)
        {
			GameTextForPlayer(playerid,"~g~Godmod ~w~Off",4500,3);
            SetPlayerHealth(playerid, 100);
            Delete3DTextLabel(GodON);
            God[playerid] = 0;
            return 1;
        }
        else if(God[playerid] == 0)
        {
            GameTextForPlayer(playerid,"~g~Godmod ~w~On",4500,3);
			GodON = Create3DTextLabel("GODMODE ON", 0xFC3A69AA, 30.0, 40.0, 50.0, 40.0, 0);
			Attach3DTextLabelToPlayer(GodON, playerid, 0, 0, 0.3);
            SetPlayerHealth(playerid, 99999);
			ResetPlayerWeapons(playerid);
			God[playerid] = 1;
            return 1;
        }

	    else if(PlayerInfo[playerid][Jail] == 1)
        {
        SetPlayerHealth(playerid, 0);
        indm[playerid] = 0;
        ResetPlayerWeapons(playerid);
        GameTextForPlayer(playerid,"~g~Player is not in freeroam",4500,3);
	    }
        return 1;
}
and i want to make it enabled on everytime player spawn if its enabled.So i did this:
Код:
public OnPlayerSpawn(playerid)
{
	if(God[playerid] == 1) return SetPlayerHealth(playerid, 99999);
	return 1;
}
but the bug is still there,please help


Re: Need Some Help - youssefehab500 - 02.07.2015

What bug? Could you explain more, what exactly do you want?


Re: Need Some Help - Vince - 02.07.2015

'99999' is the naive approach and is not true infinity. Use:
pawn Код:
Float:0x7F800000