SA-MP Forums Archive
Show HP more than 255 (format) - 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: Show HP more than 255 (format) (/showthread.php?tid=645485)



Show HP more than 255 (format) - Adain - 27.11.2017

Beforehand sorry for my eng.
Hello everybody!

I need your help! So I've created for example new textdraw, and if I set up player health 255 it shows me 255, but when I set up 256 it shows me 1 (2 means - 257, 3 - 258 etc.) How can I get this more hp by using format? Maybe smth. like that

PHP код:
new Floathealthstr256+];
GetPlayerHealth(playeridhealth);
formatstrsizeofstr ), "%.0f"health/10);
TextDrawSetString(bla... bla... bla...); 
help me


Re: Show HP more than 255 (format) - Meller - 27.11.2017

Quote:

Even though the health can be set to near infinite values on the server side, the individual clients will only report values up to 255. Anything higher will wrap around; 256 becomes 0, 257 becomes 1, etc.

https://sampwiki.blast.hk/wiki/GetPlayerHealth


Re: Show HP more than 255 (format) - Lucases - 27.11.2017

It's SA:MP issue


Re: Show HP more than 255 (format) - rfr - 27.11.2017

PHP код:
new Float:health[MAX_PLAYERS];
GetPlayerHealth(playeridhealth[playerid]);
//format
//textdraw 
Quote:
*Even though the health can be set to near infinite values on the server side, the individual clients will only report values up to 255. Anything higher will wrap around; 256 becomes 0, 257 becomes 1, etc.

Refer to the SA-MP Wiki: https://sampwiki.blast.hk/wiki/GetPlayerHealth
There's a large red box, you should read that.


Re: Show HP more than 255 (format) - Adain - 27.11.2017

https://sampwiki.blast.hk/wiki/GetPlayerHealth

lol I know about it, maybe some fix could be?


Re: Show HP more than 255 (format) - rfr - 27.11.2017

Create your own health system?


Re: Show HP more than 255 (format) - Adain - 27.11.2017

No just get player health and put it in textdraw, but i can't (for instance I want 1000 hp, but it cant be shown, because of samp issue with 256 and more)


Re: Show HP more than 255 (format) - Lucases - 27.11.2017

Quote:
Originally Posted by Adain
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/GetPlayerHealth

lol I know about it, maybe some fix could be?
Why would you need to set player health to 255?


Re: Show HP more than 255 (format) - Adain - 27.11.2017

Because gamemode of my server is is not typical rp, rpg. This information enough )


Re: Show HP more than 255 (format) - Lucases - 27.11.2017

Use server sided health then.

pawn Код:
new PlayerHealth[MAX_PLAYERS];

stock SetPlayerHealthAdv(playerid, Float:health)
{
           SetPlayerHealth(playerid, health);
           PlayerHealth[playerid] = health;
}

Under OnPlayerConnect
pawn Код:
PlayerHealth[playerid] = 0;
Under OnPlayerTakeDamage
pawn Код:
PlayerHealth[playerid] -= amount;

Finish it, I know you can script