SA-MP Forums Archive
3dRankTextLabelUpdate - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 3dRankTextLabelUpdate (/showthread.php?tid=224403)



3dRankTextLabelUpdate - BlackWolf120 - 11.02.2011

hi,
there are 2 teams and i want to attach 3d text labels with their current ranks to the players.
But i got a missmatch warning!
Whats wrong?

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


    {
    switch (gTeam[playerid])
    {
    case 1: //police
    {
    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
    }

    case 2: //terrorists
    {
    Attach3DTextLabelToPlayer(ranklabelSNAKES[playerid], playerid, 0.0, 0.0, 0.5);
    new labelstring[50];
    format(labelstring, sizeof(labelstring), "{CC3232}Coral Snake {C73F17}%d", RankName[pRank[playerid]]);
    UpdatePlayer3DTextLabelText(playerid, ranklabelSNAKES[playerid], 0xF97804FF, labelstring);//and here
    }
    }

    }
}



Re: 3dRankTextLabelUpdate - BlackWolf120 - 12.02.2011

pls someone help...


Re: 3dRankTextLabelUpdate - xxmitsu - 12.02.2011

are you declaring variables with:
Код:
    new Text3D:ranklabelCTU[MAX_PLAYERS],
    Text3D:ranklabelSNAKES[MAX_PLAYERS];
?


Re: 3dRankTextLabelUpdate - BlackWolf120 - 12.02.2011

thx for ur answer!

Yeah, i do, like in the folowing:
pawn Код:
new Text3D:ranklabelCTU[MAX_PLAYERS];
new Text3D:ranklabelSNAKES[MAX_PLAYERS];
I hope someone can help me...


Re: 3dRankTextLabelUpdate - xxmitsu - 12.02.2011

oh, now I see

You're creating labels with Create3DTextLabel but you're updating them with UpdatePlayer3DTextLabelText

To update labels created with CreatePlayer3DTextLabel use UpdatePlayer3DTextLabelText

and, to update labels created with Create3DTextLabel, use Update3DTextLabelText


Re: 3dRankTextLabelUpdate - rjjj - 12.02.2011

I think that it can solve your problem:

pawn Код:
stock Add3DTextLabelToPlayer(playerid)
{
    ranklabelCTU[playerid] = Create3DTextLabel("{1464F4}CTU",0xF97804FF,30.0,40.0,50.0, 3.0, 0, 0);
    ranklabelSNAKES[playerid] = Create3DTextLabel("{CC3232}Coral Snake",0xF97804FF,30.0,40.0,50.0,3.0, 0, 0);
    switch (gTeam[playerid])
    {
        case 1: //police
        {
            Attach3DTextLabelToPlayer(ranklabelCTU[playerid], playerid, 0.0, 0.0, 0.5);
            new labelstring[50];
            format(labelstring, sizeof(labelstring), "{1464F4}CTU {20B2AA}%d", RankName[pRank[playerid]]);
            Update3DTextLabelText(ranklabelCTU[playerid], 0xF97804FF, labelstring);
        }
        case 2:
        {
            Attach3DTextLabelToPlayer(ranklabelSNAKES[playerid], playerid, 0.0, 0.0, 0.5);
            new labelstring[50];
            format(labelstring, sizeof(labelstring), "{CC3232}Coral Snake {C73F17}%d", RankName[pRank[playerid]]);
            Update3DTextLabelText(ranklabelSNAKES[playerid], 0xF97804FF, labelstring);
        }
    }
    return true;
}

I hope that i have helped


Re: 3dRankTextLabelUpdate - BlackWolf120 - 12.02.2011

thank you both.
Ive never used 3dTextLabels before so i mixed up 3dtextlabel and playertextlabel.
thx.

//edit nvm. solved