Rank tag
#1

Hey guys, I have a little problem with my Rank tag system. The problem is that if a player is a VIP and a Moderator it shows both of the labels and I just want one of them to be shown (Moderator). Same is if a player is a VIP, Moderator and an Admin, it shows the three of them, and I only want one to be shown (Administrator)

Here is the code:
pawn Код:
#define RankLabel true

public OnPlayerSpawn(playerid)
{
    #if RankLabel == true
    if(PlayerInfo[playerid][pVIP] >= 1)
    {
        new Text3D:VIPtag;
        VIPtag = Create3DTextLabel("VIP", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(VIPtag, playerid, 0.0, 0.0, 0.7);
    }
    else if(PlayerInfo[playerid][pMod] >= 1)
    {
        new Text3D:Modtag;
        new Text3D:VIPtag;
        Modtag = Create3DTextLabel("Moderator", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(Modtag, playerid, 0.0, 0.0, 0.7);
        Delete3DTextLabel(VIPtag);
    }
    else if(IsPlayerAdmin(playerid))
    {
        new Text3D:Admintag;
        new Text3D:Modtag;
        new Text3D:VIPtag;
        Admintag = Create3DTextLabel("Administrator", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(Admintag, playerid, 0.0, 0.0, 0.7);
        Delete3DTextLabel(Modtag);
        Delete3DTextLabel(VIPtag);
    }
    #endif
Thanks in advance
Reply
#2

Untested, let me know if it works.
pawn Код:
#define RankLabel true

public OnPlayerSpawn(playerid)
{
    #if RankLabel == true
    if(PlayerInfo[playerid][pVIP] >= 1)
    {
        new Text3D:VIPtag;
        VIPtag = Create3DTextLabel("VIP", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(VIPtag, playerid, 0.0, 0.0, 0.7);
    }
    else if(PlayerInfo[playerid][pMod] >= 1 || (PlayerInfo[playerid][pVIP] >= 1 && PlayerInfo[playerid][pMod] >= 1))
    {
        new Text3D:Modtag;
        new Text3D:VIPtag;
        Modtag = Create3DTextLabel("Moderator", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(Modtag, playerid, 0.0, 0.0, 0.7);
        Delete3DTextLabel(VIPtag);
    }
    else if(IsPlayerAdmin(playerid))
    {
        new Text3D:Admintag;
        new Text3D:Modtag;
        new Text3D:VIPtag;
        Admintag = Create3DTextLabel("Administrator", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(Admintag, playerid, 0.0, 0.0, 0.7);
        Delete3DTextLabel(Modtag);
        Delete3DTextLabel(VIPtag);
    }
Reply
#3

Goind to test it when my friend is online, thanks
Reply
#4

Is it compiling fine?
Reply
#5

Yes
Reply
#6

Ok, I tried it, but it does not work :/ It just stays at VIP.
Reply
#7

pawn Код:
#define RankLabel true

public OnPlayerSpawn(playerid)
{
    #if RankLabel == true
    if(PlayerInfo[playerid][pVIP] >= 1 || PlayerInfo[playerid][pMod] < 1 || !IsPlayerAdmin(playerid))
    {
        new Text3D:VIPtag;
        VIPtag = Create3DTextLabel("VIP", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(VIPtag, playerid, 0.0, 0.0, 0.7);
    }
    else if(PlayerInfo[playerid][pMod] >= 1 || !IsPlayerAdmin(playerid))
    {
        new Text3D:Modtag;
        new Text3D:VIPtag;
        Modtag = Create3DTextLabel("Moderator", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(Modtag, playerid, 0.0, 0.0, 0.7);
        Delete3DTextLabel(VIPtag);
    }
    else if(IsPlayerAdmin(playerid))
    {
        new Text3D:Admintag;
        new Text3D:Modtag;
        new Text3D:VIPtag;
        Admintag = Create3DTextLabel("Administrator", COLOR_CYAN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(Admintag, playerid, 0.0, 0.0, 0.7);
        Delete3DTextLabel(Modtag);
        Delete3DTextLabel(VIPtag);
    }
    #endif
I have not tested it but it should work.
Reply
#8

Ok thanks, going to try it when my friend is online again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)