SA-MP Forums Archive
Please help me to add command for health&armour to cant die! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please help me to add command for health&armour to cant die! (/showthread.php?tid=174932)



Please help me to add command for health&armour to cant die! - GBLTeam - 07.09.2010

Код:
	if(strcmp(cmd,"/gmon",true)==0)
	{
        if(PlayerInfo[playerid][pAdmin] >= 2)
        {
			SetPlayerHealth(playerid, 100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000);
			SetPlayerArmour(playerid, 100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, 256, "-| Admin [ID %d ] %s go vkluci GODMODE. |-", playerid,sendername);
         	SendClientMessageToAll(COLOR_RED, string);
		}
		return 1;
	}
so i make this command but i see on other servers when you type like /adminduty it gives you health
when someone try kill you with anyweapon like minigun you not die your health is light ? Please help what i need to add!


Re: Please help me to add command for health&armour to cant die! - Mimic - 07.09.2010

Add this to the top of your script next to your other definitions
Код:
 #define INFINITY (Float:0x7F800000)
and instead of
Код:
 SetPlayerHealth(playerid, 100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000);
 SetPlayerArmour(playerid, 100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000);
use
Код:
SetPlayerHealth(playerid, INFINITY);
SetPlayerArmour(playerid, INFINITY);
That should do the trick! (credits to ****** of course


Re: Please help me to add command for health&armour to cant die! - GBLTeam - 09.09.2010

so man look i add that

Код:
	//---------------------------------------[goodmode]--------------------------
	if(strcmp(cmd,"/gospod",true)==0)
	{
        if(PlayerInfo[playerid][pAdmin] >= 1338)
        {
			SetPlayerHealth(playerid, INFINITY);
			SetPlayerArmour(playerid, INFINITY);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, 256, "-| Admin [ID %d ] %s go vkluci GODMODE. |-", playerid,sendername);
         	SendClientMessageToAll(COLOR_RED, string);
		}
		return 1;
	}
and #define INFINITY (Float:0x7F800000)

but peoples can kill me again i type /gospod i get full health armor but when he shout me my health go away.. and i can die! I want to make a command to cant die i see that in raven rp when you adminonduty others cant kill you!


Re: Please help me to add command for health&armour to cant die! - kiss - 09.09.2010

tnx man. sry for spam


Re: Please help me to add command for health&armour to cant die! - iggy1 - 09.09.2010

You could also try
pawn Код:
SetPlayerHealth(playerid,999999);
That worked for me in an old script i made. But if these that you have tryed are not working this may not....


Re: Please help me to add command for health&armour to cant die! - Mimic - 09.09.2010

When you execute that command is your health blinking? If so you shouldn't be able to get killed if it's not blinking something is wrong.


Re: Please help me to add command for health&armour to cant die! - GBLTeam - 10.09.2010

Quote:
Originally Posted by iggy1
Посмотреть сообщение
You could also try
pawn Код:
SetPlayerHealth(playerid,999999);
That worked for me in an old script i made. But if these that you have tryed are not working this may not....
I try and this

Код:
	if(strcmp(cmd,"/gospod",true)==0)
	{
        if(PlayerInfo[playerid][pAdmin] >= 1338)
        {
            SetPlayerHealth(playerid,999999);
            SetPlayerArmour(playerid,999999);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, 256, "-| Admin [ID %d ] %s go vkluci GODMODE. |-", playerid,sendername);
         	SendClientMessageToAll(COLOR_RED, string);
		}
		return 1;
	}
Still not work.



Quote:
Originally Posted by Mimic
Посмотреть сообщение
When you execute that command is your health blinking? If so you shouldn't be able to get killed if it's not blinking something is wrong.
Yes i know but its not BLINKING :S :S


Re: Please help me to add command for health&armour to cant die! - Voldemort - 10.09.2010

add few more 999


Re: Please help me to add command for health&armour to cant die! - Vince - 10.09.2010

Use the INFINITY define .....
And if your health is not blinking, something is wrong with other parts of your code. Does it sends the message?