SA-MP Forums Archive
can't extend the letters amount in 3dtextlabel? - 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: can't extend the letters amount in 3dtextlabel? (/showthread.php?tid=635022)



can't extend the letters amount in 3dtextlabel? - DemME - 31.05.2017

mask system shows the id and stranger name, but can't print health and such it prints in-game like "Stranger XXX Health".
Quote:

stock PlayerNameEx(playerid) {

new name[MAX_PLAYER_NAME];
new Float:health, Float:armour;
GetPlayerHealth(playerid, health);
GetPlayerArmourEx(playerid, armour);
if(GetPVarInt(playerid, "MaskUse") == 1) {
format(name,sizeof(name),"Stranger(%d)\n(Health: %.1f, Armour: %.1f)",GetPVarInt(playerid, "MaskID"));
return name;
}

format(name, sizeof(name), "%s", PlayerInfo[playerid][pName]);
return name;
}



Re: can't extend the letters amount in 3dtextlabel? - ShihabSoft - 31.05.2017

You haven't passed the health and armor to the format function.

Use like

PHP код:

format
(name,sizeof(name),"Stranger(%d)\n(Health: %.1f, Armour: %.1f)",GetPVarInt(playerid"MaskID"),health,armour); 



Re: can't extend the letters amount in 3dtextlabel? - DemME - 31.05.2017

Quote:
Originally Posted by ShihabSoft
Посмотреть сообщение
You haven't passed the health and armor to the format function.

Use like

PHP код:

format
(name,sizeof(name),"Stranger(%d)\n(Health: %.1f, Armour: %.1f)",GetPVarInt(playerid"MaskID"),health,armour); 
Amount of letters sir, I did it in purpose when I didn't put the variables, It gives an half of the characters and I'd like to expand the characters amount in the 3Dtextlabel.
Instead of showing health and armour under stranger's line, it shows only " (He"


Re: can't extend the letters amount in 3dtextlabel? - Sew_Sumi - 31.05.2017

'name', being the string you are using, has caused it to be losing the end.

name has a length of 'MAX_PLAYER_NAME', is too short for all the characters you want in there.


This is what copy-pasting and simply editing code gets you... This is very simple string manipulation, and yet you've got a very simple problem.