SA-MP Forums Archive
god mode while /fly - 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 while /fly (/showthread.php?tid=648789)



god mode while /fly - PepsiCola23 - 28.01.2018

Is there any method to make me invincible while flying? ( you die if you touch a building or the ground ) or should i just setplayerhealth 999999 ?


Re: god mode while /fly - Nizarh - 28.01.2018

I saw that on a server, so I think is possible, they had the command /god and the command /fly, so you don't take damage while flying and hitting the buildings.


Re: god mode while /fly - Abagail - 28.01.2018

You can use Float:0x7F800000 to set health to "unlimited", commonly defined as:
Код:
#define FLOAT_INFINITY (Float:0x7F800000)
Note that certain game events (explosion in vehicle, etc) are hard coded and will still cause death.


Re: god mode while /fly - iSteve - 28.01.2018

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) 
{ 
    new Float:hp; 
    if(weaponid == 54) GetPlayerHealth(playerid, hp), hp+=amount, SetPlayerHealth(playerid, hp); 
    return 1; 
}



Re: god mode while /fly - Mugala - 29.01.2018

splat will kill you from long distance anyway.