SA-MP Forums Archive
Create3dTextlabel BUG - 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: Create3dTextlabel BUG (/showthread.php?tid=607194)



Create3dTextlabel BUG - Pearson - 16.05.2016

CODE:
new textachvenebs[123];
new Floaticocxleii,Float:bronii;
GetPlayerHealth(playerid,sicocxleii);
GetPlayerArmour(playerid,bronii);
format(textachvenebs, sizeof(textachvenebs),"%s\n{6666FF}Sicocxle: %d - Broni: %d",name,sicocxleii,bronii);
axalitag[playerid] = Create3DTextLabel(textachvenebs,0xFFFFFFFF,0.0,0.0 ,0.0,8.0,GetPlayerVirtualWorld(playerid),1);
SetPlayerHealth(playerid, 100);
Attach3DTextLabelToPlayer(axalitag[playerid],playerid,0.0,0.0,0.3);
BUG:
It only show health 0 and armour 0 Help me Please its very important for me.


Re: Create3dTextlabel BUG - MBilal - 16.05.2016

Quote:
Originally Posted by Pearson
Посмотреть сообщение
CODE:
new textachvenebs[123];
new Floaticocxleii,Float:bronii;
GetPlayerHealth(playerid,sicocxleii);
GetPlayerArmour(playerid,bronii);
format(textachvenebs, sizeof(textachvenebs),"%s\n{6666FF}Sicocxle: %d - Broni: %d",name,sicocxleii,bronii);
axalitag[playerid] = Create3DTextLabel(textachvenebs,0xFFFFFFFF,0.0,0.0 ,0.0,8.0,GetPlayerVirtualWorld(playerid),1);
SetPlayerHealth(playerid, 100);
Attach3DTextLabelToPlayer(axalitag[playerid],playerid,0.0,0.0,0.3);
BUG:
It only show health 0 and armour 0 Help me Please its very important for me.
This line have Problem:
This isn't correct
format(textachvenebs, sizeof(textachvenebs),"%s\n{6666FF}Sicocxle: %d - Broni: %d",name,sicocxleii,bronii);


This is correct Health is in a Float and you're trying to show his health in integer that is not correct.

For Showing in Float use %0.1f
This is for Integer %d

format(textachvenebs, sizeof(textachvenebs),"%s\n{6666FF}Sicocxle: %0.1f - Broni: %0.1f",name,sicocxleii,bronii);


Use This Fixed Code:

Код:
new textachvenebs[123];
		    new Float:sicocxleii,Float:bronii;
		    GetPlayerHealth(playerid,sicocxleii);
		    GetPlayerArmour(playerid,bronii);
 format(textachvenebs, sizeof(textachvenebs),"%s\n{6666FF}Sicocxle: %0.1f - Broni: %0.1f",name,sicocxleii,bronii);
		    axalitag[playerid] = Create3DTextLabel(textachvenebs,0xFFFFFFFF,0.0,0.0,0.0,8.0,GetPlayerVirtualWorld(playerid),1);
		    SetPlayerHealth(playerid, 100);/// i don't know why u setting health here..
		    Attach3DTextLabelToPlayer(axalitag[playerid],playerid,0.0,0.0,0.3);



Re: Create3dTextlabel BUG - Pearson - 16.05.2016

Тhanks i will try


Re: Create3dTextlabel BUG - Pearson - 16.05.2016

It Doesnt Work((((


Re: Create3dTextlabel BUG - SyS - 16.05.2016

edit your code like this and tell what is showing on the server log
PHP код:
new textachvenebs[123];
new 
Float:sicocxleii,Float:bronii;
GetPlayerHealth(playerid,sicocxleii);
GetPlayerArmour(playerid,bronii);
printf("Sicocxle: %0.1f - Broni: %0.1f",sicocxleii,bronii);//debugging
format(textachvenebssizeof(textachvenebs),"%s\n{6666FF}Sicocxle: %0.1f - Broni: %0.1f",name,sicocxleii,bronii);
printf("text : %s",textachvenebs);//debugging           
axalitag[playerid] = Create3DTextLabel(textachvenebs,0xFFFFFFFF,0.0,0.0,0.0,8.0,GetPlayerVirtualWorld(playerid),1);
SetPlayerHealth(playerid100);
Attach3DTextLabelToPlayer(axalitag[playerid],playerid,0.0,0.0,0.3); 



Re: Create3dTextlabel BUG - MBilal - 16.05.2016

What is the problem you getting Create3dtext not showing or
Health not showing?
Explain it.


Re: Create3dTextlabel BUG - Pearson - 16.05.2016

Example i want to it shows armour 0.0 health 0.0 Not Player Health


Re: Create3dTextlabel BUG - JawsCraft - 17.05.2016

Try this
Haven't try but i think it will help you!
Код:
public OnPlayerUpdate(playerid)
{
    new textachvenebs[123];
    new Floaticocxleii,Float:bronii;
    GetPlayerHealth(playerid,sicocxleii);
    GetPlayerArmour(playerid,bronii);
    format(textachvenebs, sizeof(textachvenebs),"%s\n{6666FF}Sicocxle: %d - Broni: %d",name,sicocxleii,bronii);
    Update3DTextLabelText(axalitag[playerid], 0xFFFFFFFF, textachvenebs);
}



Re: Create3dTextlabel BUG - SyS - 17.05.2016

Quote:
Originally Posted by Pearson
Посмотреть сообщение
Example i want to it shows armour 0.0 health 0.0 Not Player Health
did u even try what i posted?