HP won't work - 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: HP won't work (
/showthread.php?tid=457537)
HP won't work -
FiReAlEx - 11.08.2013
Hi guys, i'm having this problem with this Health + Armour script. I tried it all, but it won't work. When it sends the messagge, the value isn't right and I don't know why. Can you help me? Thanks.
The script is italian, so I'll translate sideways
PHP код:
new Float: Vita = 0; // Health Float
new Float: Armatura = 0; // Armour Float
GetPlayerHealth(killerid, Vita); //Here I get killer's health
GetPlayerHealth(killerid, Armatura); //Here I get killer's armour
new randMSG = random(sizeof(RandomKill));
format(stringa, sizeof(stringa), "{00FF00}*{FFFFFF}*{FF0000}* {FFFFFF}%s ha %s %s {FF0000}| %s | H/A:%d | FT: %0.2f |", nome2, RandomKill[randMSG], nome, GunNames[GetPlayerWeapon(killerid)], floatround(Vita+Armatura)/*floatround (health+armour)*/, Distanza);
SendClientMessageToAll(-1, stringa);}
Re: HP won't work -
xganyx - 12.08.2013
Hey you forgot something is the
PHP код:
new Float: Vita = 0; // Health Float
new Float: Armatura = 0; // Armour Float
GetPlayerHealth(killerid, Vita); //Here I get killer's health
GetPlayerArmour(killerid, Armatura); //Here I get killer's armour // here should be getplayerarmour
new randMSG = random(sizeof(RandomKill));
format(stringa, sizeof(stringa), "{00FF00}*{FFFFFF}*{FF0000}* {FFFFFF}%s ha %s %s {FF0000}| %s | H/A:%d | FT: %0.2f |", nome2, RandomKill[randMSG], nome, GunNames[GetPlayerWeapon(killerid)], floatround(Vita+Armatura)/*floatround (health+armour)*/, Distanza);
SendClientMessageToAll(-1, stringa);}
Re: HP won't work -
dEcooR - 12.08.2013
try just
Код:
new Float: Vita = GetPlayerHealth(killerid, Vita); // Health Float
new Float: Armatura = GetPlayerHealth(killerid, Armatura); // Armour Float
Re: HP won't work -
FiReAlEx - 12.08.2013
Quote:
Originally Posted by xganyx
Hey you forgot something is the
PHP код:
new Float: Vita = 0; // Health Float
new Float: Armatura = 0; // Armour Float
GetPlayerHealth(killerid, Vita); //Here I get killer's health
GetPlayerArmour(killerid, Armatura); //Here I get killer's armour // here should be getplayerarmour
new randMSG = random(sizeof(RandomKill));
format(stringa, sizeof(stringa), "{00FF00}*{FFFFFF}*{FF0000}* {FFFFFF}%s ha %s %s {FF0000}| %s | H/A:%d | FT: %0.2f |", nome2, RandomKill[randMSG], nome, GunNames[GetPlayerWeapon(killerid)], floatround(Vita+Armatura)/*floatround (health+armour)*/, Distanza);
SendClientMessageToAll(-1, stringa);}
|
OMG. OMG. OMG. Never noticed that!! Thanks so much!. It'll work fine. Never, never noticed it! That's so hilarious. REP +.