SA-MP Forums Archive
Text Draw Health / Armour Problem - 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: Text Draw Health / Armour Problem (/showthread.php?tid=599932)



Text Draw Health / Armour Problem - eikzdej - 01.02.2016

Hi!

When my players starts to play in my server, their HP / Armour Text draws are not updating, if they got hit or killed, the hp bar is changed but the Text is not changed. Thanks!

I use this https://sampforum.blast.hk/showthread.php?tid=241026


Re: Text Draw Health / Armour Problem - TopShooter - 01.02.2016

Well, update it?

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
TextDrawDestroyForPlayer(playeridHealth[i]);
TextDrawDestroyForPlayer(playeridArmour[i]);
return 
1;

PHP код:
public OnPlayerSpawn(playerid)
TextDrawShowForPlayer(playeridHealth[I]);
TextDrawShowForPlayer(playeridArmour[1]);
return 
1;




Re: Text Draw Health / Armour Problem - eikzdej - 01.02.2016

Hi TopShooter,

Still not working, the text draws only update on the accountID 0, other accounts are not affected. That's what i found out.


Re: Text Draw Health / Armour Problem - TopShooter - 01.02.2016

I think I had a problem with my code, small one, problem with OnPlayerSPawn
Copy this one above.

[PHP]
public OnPlayerSpawn(playerid)
TextDrawShowForPlayer(playerid, Health[i]);
TextDrawShowForPlayer(playerid, Armour[i]);
return 1;
}


Re: Text Draw Health / Armour Problem - eikzdej - 01.02.2016

I tried it, but still the same. I'm using SQL Saving method of HP/Armour, but i know this is not affect text draws.


Re: Text Draw Health / Armour Problem - KillerDVX - 01.02.2016

Do you have "SetTimer("vitals",1000,1);" under "OnGameModeInit" ? Since it's in the tutorial, you should use it in order to update your public function each second.


Re: Text Draw Health / Armour Problem - jedzkie13 - 01.02.2016

Nvm.


Re: Text Draw Health / Armour Problem - eikzdej - 01.02.2016

Yes i have settimer for vitals


Re: Text Draw Health / Armour Problem - KillerDVX - 01.02.2016

Show us your "OnPlayerUpdate".


Re: Text Draw Health / Armour Problem - eikzdej - 01.02.2016

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
Show us your "OnPlayerUpdate".
public OnPlayerUpdate(playerid)
{
new FloatArmour;
GetPlayerArmour(playerid, pArmour);

if(pArmour == 0)
{
TextDrawHideForPlayer(playerid, textArmour[playerid]);
}
else
{
TextDrawShowForPlayer(playerid, textArmour[playerid]);
}

return 1;
}