Please help me to add command for health&armour to cant die!
#1

Код:
	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!
Reply
#2

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
Reply
#3

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!
Reply
#4

tnx man. sry for spam
Reply
#5

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....
Reply
#6

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.
Reply
#7

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
Reply
#8

add few more 999
Reply
#9

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?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)