Text Draw Health / Armour Problem
#1

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
Reply
#2

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;

Reply
#3

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.
Reply
#4

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;
}
Reply
#5

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.
Reply
#6

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.
Reply
#7

Nvm.
Reply
#8

Yes i have settimer for vitals
Reply
#9

Show us your "OnPlayerUpdate".
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)