can't extend the letters amount in 3dtextlabel?
#1

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

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); 
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)