SA-MP Forums Archive
GetPlayerHealth Bug??? - 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: GetPlayerHealth Bug??? (/showthread.php?tid=153000)



GetPlayerHealth Bug??? - RSC_Quicker - 06.06.2010

Hey I got this in a timer:
Код:
   				GetPlayerHealth(i,pHealth[i]); //Example 100
   				       new Float:plushealth = pHealth[i]; // << 100 health
					SetPlayerHealth(i,plushealth-1); // the player health get 99
					GetPlayerHealth(i,aHealth[i]); // this get 99
					if(aHealth[i] == pHealth[i]) // HOW THE FUCK can pHealth be 99
					{
						SendClientMessage(i, Green, "Hacking health!");
						printf("%f,%f",pHealth[i],aHealth[i]);
					}
					SetPlayerHealth(i,pHealth[i]);
Why the fuck I get 99.000000,99.000000 in my server console?



Re: GetPlayerHealth Bug??? - -Rebel Son- - 06.06.2010

Basicly, you did it right, but here.


Код:
   				GetPlayerHealth(i,pHealth[i]); //Example 100
   				       new Float:plushealth = pHealth[i]; // << 100 health
					SetPlayerHealth(i,plushealth-1); // the player health get 99
					GetPlayerHealth(i,aHealth[i]); // this get 99
					if(aHealth[i] == pHealth[i]) // HOW THE FUCK can pHealth be 99
					{
						SendClientMessage(i, Green, "Hacking health!");
						printf("%0.f,%0.f",pHealth[i],aHealth[i]);
					}
					SetPlayerHealth(i,pHealth[i]);



Re: GetPlayerHealth Bug??? - RSC_Quicker - 06.06.2010

well thanks but thats not the point.
The point is that it detects me for hacking.
And I'm not hacking. SO I don't understand how the health still can be the same.



Re: GetPlayerHealth Bug??? - whitedragon - 06.06.2010

you set user health to 99 and you get then the player 99 so that means the user always hack you may have to Get before seting it?


Re: GetPlayerHealth Bug??? - ReVo_ - 06.06.2010

floatround.
For float to int.


Re: GetPlayerHealth Bug??? - RSC_Quicker - 06.06.2010

Quote:
Originally Posted by whitedragon
you set user health to 99 and you get then the player 99 so that means the user always hack you may have to Get before seting it?
You don't understand it I gues.
First I get the player health with pHealth. Then I remove 1 health. Then I get the health with the aHealth. So if the player hacked his had has turned back to 100.
If Ahealth (Should be 99) is the same as pHealth. Then it detects the player as hacks.



Re: GetPlayerHealth Bug??? - whitedragon - 23.06.2010

have you solved that? I will make omething like that to my server but i have no idea where to start


Re: GetPlayerHealth Bug??? - Sergei - 23.06.2010

Modern cheat tolls don't set your health to 100 all the time, they just freeze it, so this method is completly useless.