SA-MP Forums Archive
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 FloatVita 0// Health Float
    
new FloatArmatura 0// Armour Float
    
GetPlayerHealth(killeridVita); //Here I get killer's health
    
GetPlayerHealth(killeridArmatura); //Here I get killer's armour
     
new randMSG random(sizeof(RandomKill));
     
format(stringasizeof(stringa), "{00FF00}*{FFFFFF}*{FF0000}* {FFFFFF}%s ha %s %s {FF0000}| %s | H/A:%d | FT: %0.2f |"nome2RandomKill[randMSG], nomeGunNames[GetPlayerWeapon(killerid)], floatround(Vita+Armatura)/*floatround (health+armour)*/Distanza);
     
SendClientMessageToAll(-1stringa);} 



Re: HP won't work - xganyx - 12.08.2013

Hey you forgot something is the
PHP код:
new FloatVita 0// Health Float
    
new FloatArmatura 0// Armour Float
    
GetPlayerHealth(killeridVita); //Here I get killer's health
    
GetPlayerArmour(killeridArmatura); //Here I get killer's armour // here should be getplayerarmour
     
new randMSG random(sizeof(RandomKill));
     
format(stringasizeof(stringa), "{00FF00}*{FFFFFF}*{FF0000}* {FFFFFF}%s ha %s %s {FF0000}| %s | H/A:%d | FT: %0.2f |"nome2RandomKill[randMSG], nomeGunNames[GetPlayerWeapon(killerid)], floatround(Vita+Armatura)/*floatround (health+armour)*/Distanza);
     
SendClientMessageToAll(-1stringa);} 



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 FloatVita 0// Health Float
    
new FloatArmatura 0// Armour Float
    
GetPlayerHealth(killeridVita); //Here I get killer's health
    
GetPlayerArmour(killeridArmatura); //Here I get killer's armour // here should be getplayerarmour
     
new randMSG random(sizeof(RandomKill));
     
format(stringasizeof(stringa), "{00FF00}*{FFFFFF}*{FF0000}* {FFFFFF}%s ha %s %s {FF0000}| %s | H/A:%d | FT: %0.2f |"nome2RandomKill[randMSG], nomeGunNames[GetPlayerWeapon(killerid)], floatround(Vita+Armatura)/*floatround (health+armour)*/Distanza);
     
SendClientMessageToAll(-1stringa);} 
OMG. OMG. OMG. Never noticed that!! Thanks so much!. It'll work fine. Never, never noticed it! That's so hilarious. REP +.