SA-MP Forums Archive
is the random player's health is: 153546489? LOL - 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: is the random player's health is: 153546489? LOL (/showthread.php?tid=630081)



is the random player's health is: 153546489? LOL - RyderX - 08.03.2017

Hello there! i have been trying to make textdraw which it got the amount of player's health and got this :



What if that is the random player's health? LMAO

PHP код:
public OnPlayerUpdate(playerid)
{
    new 
string7[20];
    new 
FloatHealth;
    
GetPlayerHealth(playeridHealth);
    
format(string7sizeof(string7), "%d"Health);
    
TextDrawSetString(Textdraw14[playerid], string7);
    
TextDrawShowForPlayer(playeridTextdraw14[playerid]);
    new 
string8[120];
    new 
FloatArmour;
    
GetPlayerArmour(playeridArmour);
    
format(string8sizeof(string8), "%d"Armour);
    
TextDrawSetString(Textdraw15[playerid], string8);
    
TextDrawShowForPlayer(playeridTextdraw15[playerid]);
    return 
1;




Re: is the random player's health is: 153546489? LOL - Djole1337 - 08.03.2017

Quote:
Originally Posted by RyderX
Посмотреть сообщение
Hello there! i have been trying to make textdraw which it got the amount of player's health and got this :



What if that is the random player's health? LMAO

PHP код:
public OnPlayerUpdate(playerid)
{
    new 
string7[20];
    new [
B]Float[/B]: Health;
    
GetPlayerHealth(playeridHealth);
    
format(string7sizeof(string7), "%d"Health);
    
TextDrawSetString(Textdraw14[playerid], string7);
    
TextDrawShowForPlayer(playeridTextdraw14[playerid]);
    new 
string8[120];
    new [
B]Float[/B]: Armour;
    
GetPlayerArmour(playeridArmour);
    
format(string8sizeof(string8), "%d"Armour);
    
TextDrawSetString(Textdraw15[playerid], string8);
    
TextDrawShowForPlayer(playeridTextdraw15[playerid]);
    return 
1;


4char123



Re: is the random player's health is: 153546489? LOL - 4D1L - 08.03.2017

Shouldn't you be using %f instead of %d for floats?


Re: is the random player's health is: 153546489? LOL - RyderX - 08.03.2017

Quote:
Originally Posted by 4D1L
Посмотреть сообщение
Shouldn't you be using %f instead of %d for floats?
Ouch! Fk this typo thanks nigger