3dtextlabel on player
#1

hi, i want to make that below players skin head, show his level.. but i dont know how..

my level code:

pawn Код:
pInfo[playerid][Level]
Reply
#2

ok i tryed to create, but the 3dtext dont showing and i get warning: tag misint match...

pawn Код:
new PlayerText3D:playertextid[MAX_PLAYERS];

Onplayerspawn:

new Float:X, Float:Y, Float:Z;
GetPlayerPos( playerid, X, Y, Z );
playertextid[playerid] = CreatePlayer3DTextLabel(playerid,"Level:",0x008080FF,X,Y,Z,40.0);
format(string, sizeof(string), "Lygis: %d", pInfo[playerid][Lygis]);
Attach3DTextLabelToPlayer(playertextid[playerid],playerid,X,Y,Z); // tag mismatch

Playerdisconnect

Delete3DTextLabel(playertextid[playerid]); // tag mismatch

Playerupdate:

UpdatePlayer3DTextLabelText(playerid, playertextid[playerid], 0x008080FF, "Level: %d");
Reply
#3

Change:
pawn Код:
new Float:X, Float:Y, Float:Z;
GetPlayerPos( playerid, X, Y, Z );
playertextid[playerid] = CreatePlayer3DTextLabel(playerid,"Level:",0x008080FF,X,Y,Z,40.0);
format(string, sizeof(string), "Lygis: %d", pInfo[playerid][Lygis]);
Attach3DTextLabelToPlayer(playertextid[playerid],playerid,X,Y,Z); // tag mismatch
To:
pawn Код:
new string [128];
format(string,sizeof(string),"Lygis: %d", pInfo[playerid][Level]);
playertextid[playerid] = Create3DTextLabel(string,0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(playertextid[playerid],playerid,0.0, 0.0, 0.7);
Edit: Not tested.
Reply
#4

Quote:
Originally Posted by Clive
Посмотреть сообщение
Change:
pawn Код:
new Float:X, Float:Y, Float:Z;
GetPlayerPos( playerid, X, Y, Z );
playertextid[playerid] = CreatePlayer3DTextLabel(playerid,"Level:",0x008080FF,X,Y,Z,40.0);
format(string, sizeof(string), "Lygis: %d", pInfo[playerid][Lygis]);
Attach3DTextLabelToPlayer(playertextid[playerid],playerid,X,Y,Z); // tag mismatch
To:
pawn Код:
new string [128];
format(string,sizeof(string),"Lygis: %d", pInfo[playerid][Level]);
playertextid[playerid] = Create3DTextLabel(string,0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // tag mismatch
Attach3DTextLabelToPlayer(playertextid[playerid],playerid,0.0, 0.0, 0.7); // tag mismatch
Edit: Not tested.
Now i get 3 mismatch warnings -.-
Reply
#5

Quote:
Originally Posted by jaksimaksi
Посмотреть сообщение
Now i get 3 mismatch warnings -.-
pawn Код:
Create3DTextLabel(playertextid[playerid],COLOR_BLUE,30.0,40.0,50.0,40.0,0);
Try this.. and this..
pawn Код:
Delete3DTextLabel(playertextid[playerid]);
if errors or warnings show up - tell me..
EDIT: maybe this can help you.. i copied it from my GM.. it's showing score and money.. edit a bit and you should get what you need.. sorry for my bad english.
pawn Код:
new strings[128];
     format(strings, sizeof(strings),"Punkti %d Nauda %d",GetPlayerScore(playerid),GetPlayerMoney(playerid));
     tag[playerid] = Create3DTextLabel(strings,COLOR_BLUE,30.0,40.0,50.0,40.0,0);
     Attach3DTextLabelToPlayer(tag[playerid], playerid, 0.0, 0.0, 0.7);
Reply
#6

Quote:
Originally Posted by jaksimaksi
Посмотреть сообщение
Now i get 3 mismatch warnings -.-
Change:
pawn Код:
new PlayerText3D:playertextid[MAX_PLAYERS];
To:
pawn Код:
new Text3D:playertextid[MAX_PLAYERS];
Reply
#7

same 3 warnings...

EDIT: Ty, now its okey
Reply
#8

But now 2 warnings here:

pawn Код:
public OnPlayerUpdate(playerid)
{
UpdatePlayer3DTextLabelText(playerid, playertextid[playerid], 0x008080FF, "Level: %d", pInfo[playerid][Lygis]);
number of arguments does not match definition
Tag mismatch
Reply
#9

OnPlayerUpdate:
pawn Код:
new string [128];
format(string,sizeof(string),"Lygis: %d", pInfo[playerid][Level]);
playertextid[playerid] = Create3DTextLabel(string,0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Update3DTextLabelText(playertextid[playerid], 0xFFFFFFFF, string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)