3DTextLabel set string ?
#1

hi,
i ve been trying this for so long and i just dont get it!

Ive created text labels over the head of every player depending on their team.
Well it works but i want that there is also their rank displayed after the team name.
Ive tried it with UpdatePlayer3DTextLabelText but i just dont know how, i always get a missmatch error or warning!


pawn Код:
ranklabelCTU[playerid] = Create3DTextLabel("{1464F4}CTU",0xF97804FF,30.0,40.0,50.0,40.0,0);
    ranklabelSNAKES[playerid] = Create3DTextLabel("{CC3232}Coral Snake",0xF97804FF,30.0,40.0,50.0,40.0,0);


    {
    switch (gTeam[playerid])
    {
    case 1: //police
    {
    Attach3DTextLabelToPlayer(ranklabelCTU[playerid], playerid, 0.0, 0.0, 0.5);
    }

    case 2: //terrorists
    {
    Attach3DTextLabelToPlayer(ranklabelSNAKES[playerid], playerid, 0.0, 0.0, 0.5);
    }
    }

    }

// i had to do sth. like this but i get a missmatch warning or sth....

//this is how my ranks are saved:
RankName[pRank[playerid]]

UpdatePlayer3DTextLabelText(playerid, ranklabelCTU[playerid], color, "CTU %d",RankName[pRank[playerid]])
hope i get some help

regards...
Reply
#2

You should format it
pawn Код:
new blah[80];
format(blah, sizeof(blah), "CTU %d", RankName[pRank[playerid]]);
UpdatePlayer3DTextLabelText(playerid, ranklabelCTU[playerid], color, blah);
Reply
#3

thank you fredde,

but it gives me a warning:

pawn Код:
warning 213: tag mismatch

    Attach3DTextLabelToPlayer(ranklabelCTU[playerid], playerid, 0.0, 0.0, 0.5);
    new labelstring[50];
    format(labelstring, sizeof(labelstring), "{1464F4}CTU {20B2AA}%d", RankName[pRank[playerid]]);
    UpdatePlayer3DTextLabelText(playerid, ranklabelCTU[playerid], 0xF97804FF, labelstring); //here
Reply
#4

Well.. You create a normal 3DTextLabel but you update a player text label.. So idk how you want it but I think you should change it to:
pawn Код:
Update3DTextLabelText(ranklabelCTU[playerid], 0xF97804FF, labelstring);
Reply
#5

thx.

im gonna try it out tomorrow.
im too lazy right now

regards...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)