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(playerid, killerid, reason)
{
TextDrawDestroyForPlayer(playerid, Health[i]);
TextDrawDestroyForPlayer(playerid, Armour[i]);
return 1;
}
PHP код:
public OnPlayerSpawn(playerid)
TextDrawShowForPlayer(playerid, Health[I]);
TextDrawShowForPlayer(playerid, Armour[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 Float

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