How to do that - 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: How to do that (
/showthread.php?tid=646106)
How to do that -
DavidGravelli - 10.12.2017
I forget how to make if player get box from someone i mean if someone hit a person his health won't decrease
Re: How to do that -
Eoussama - 10.12.2017
If you mean, enabling god-mode. Give them infinite health,
PHP код:
SetPlayerHeath(playerid, 0x7F800000);
Re: How to do that -
rfr - 10.12.2017
You can set their heath to an infinite float
PHP код:
#define INFINITY (Float:0x7F800000)
CMD:godmode(playerid, params[])
{
SetPlayerHeath(playerid, INFINITY);
return 1;
}
or
PHP код:
new bool:HasPlayerGodMode;
new Float:hp;
new Float:arm;
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(HasPlayerGodMode)
{
GetPlayerHealth(damagedid, hp);
GetPlayerArmour(damagedid, arm);
SetPlayerHealth(damagedid, hp);
SetPlayerArmour(damagedid, arm);
}
}
CMD:godmode(playerid, params[])
{
if(HasPlayerGodMode)
{
HasPlayerGodMode = false
SendClientMessage(playerid,-1,"God made has been disabled");
}
else if (!HasPlayerGodMode)
{
HasPlayerGodMode = true
SendClientMessage(playerid,-1,"God made has been enabled");
}
return 1;
}
Re: How to do that -
DavidGravelli - 10.12.2017
No not godmode something like this
OnPlayerTakeDamage
Re: How to do that -
rfr - 10.12.2017
I do not understand what you exactly want. Can you head over to GoogƖe translate and write what you want in your spoken language then translate it into English then post it here? Thanks.
Re: How to do that -
Xeon™ - 10.12.2017
You mean to desync a bullet? even if player shoot it won't give a damage okay, here you go.
PHP код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(weaponid == 0) return 0;
return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot
Re: How to do that -
Lucases - 10.12.2017
I think he meant fist. He wants that when you punch someone his damage won't change the health or something like that