SA-MP Forums Archive
How to update this one? - 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: How to update this one? (/showthread.php?tid=643731)



How to update this one? - TitoRayne - 26.10.2017

I'm new in scripting so i dont know everything, all i want is to have an update on my Dynamic3dtextlabel, because when we shoot each other it didn't update the health/armor Textdraw, can someone help me please?

here's the code i used.

Код:
 format(string, sizeof(string), "%s\n{089DCE}HP: %.1f - {00FF00}AR: %.1f", GetPlayerRPName(playerid), GetPlayerHealth(playerid), GetPlayerArmour(playerid));
PlayerInfo[playerid][pSpecialTag] = CreateDynamic3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.2, 20.0, .attachedplayer = playerid, .testlos = 1);



Re: How to update this one? - TitoRayne - 26.10.2017

Bump


Re: How to update this one? - FailerZ - 26.10.2017

Use the update function instead of creating it everytime.
Just use the create when the player logins.

PHP код:
UpdateDynamic3DTextLabelText(PlayerInfo[playerid][pSpecialTag], COLOR_WHITEstring



Re: How to update this one? - TitoRayne - 26.10.2017

Can you create me the exact one? or put it in filterscript i dont understand everything lol, im new in scripting sir please?


Re: How to update this one? - TitoRayne - 26.10.2017

By the way, what if they got shooted whyt the text is still 100? can you help me?


Re: How to update this one? - Lucases - 26.10.2017

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
         new string[128];
         format(string, sizeof(string), "%s\n{089DCE}HP: %.1f - {00FF00}AR: %.1f", GetPlayerRPName(playerid), GetPlayerHealth(playerid), GetPlayerArmour(playerid));
         UpdateDynamic3DTextLabelText(PlayerInfo[playerid][pSpecialTag], COLOR_WHITE, string)
         return 1;
}



Re: How to update this one? - TitoRayne - 06.11.2017

I'll try this dw, i +rep for you thanks for helping buddies


Re: How to update this one? - OneDay - 06.11.2017

Where is your code put now?