SA-MP Forums Archive
Problem with label - 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: Problem with label (/showthread.php?tid=387446)



Problem with label - Face9000 - 24.10.2012

Hello, i created admin names based on level and added a textlabel to show it:

OnPlayerSpawn:

pawn Код:
new ok[128];
    format(ok, sizeof(ok), "%s\n", AdminLevelToName(playerid));
    AdminLabel[playerid] = Create3DTextLabel(ok, 0x008040FF, 30.0, 40.0, 50.0, 40.0, 0, 0);
    Attach3DTextLabelToPlayer(AdminLabel[playerid], playerid, 0.0, 0.0, 0.7);
And the stock:

pawn Код:
stock AdminLevelToName(playerid)
{
    new admin[128];
    switch(PlayerInfo[playerid][pAdmin])
    {
        case 0:
        {
            admin = "Normal Player";
        }
        case 1:
        {
            admin = "Trustee";
        }
        case 2:
        {
            admin = "Moderator";
        }
        case 3:
        {
            admin = "Admin";
        }
        case 4:
        {
            admin = "Head Admin";
        }
        case 5:
        {
            admin = "Owner";
        }
    }
    return admin;
}
But it shows only "Owner",i've the /setlevel command so if i try to set someone to level 2-3 (for example),it doesn't update the text label. Thanks.


Re: Problem with label - ViniBorn - 24.10.2012

Try add Update3DTextLabelText in the command /setlevel


Re: Problem with label - Face9000 - 24.10.2012

Already done:

pawn Код:
Update3DTextLabelText(AdminLabel[playerid], 0x008040FF,AdminLevelToName(playerid));
but nothing.