Problem with change nickname color
#1

Hello everyone,

I have a problem with my nickname color part.
Players are able to change there nickname color. Works fine.

I have a color for admins only, works fine to. But Admins level 3 to level 8 have there own color. And level 9 to 10 must be have another color.

Wel I tried a lot, but admins level 8 can still use the level 9 and 10 admin color.

This is the part:

pawn Код:
CMD:bosscolor(playerid, params[])
{
    if(PlayerAcc[playerid][Log] == 1)
    PlayerAcc[playerid][UseColor] = 1;
    PlayerAcc[playerid][SaveColor] = COLOR_BOSS;
    SetPlayerColor(playerid, PlayerAcc[playerid][SaveColor]);
    if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "** You are not logged in, please login first.");
    if(PlayerAcc[playerid][Admin] == 0) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] == 1) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] == 2) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] == 3) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] == 4) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] == 5) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] == 6) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] == 7) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] == 8) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    if(PlayerAcc[playerid][Admin] >= 9)
    {
        {
            SetPlayerColor(playerid, COLOR_BOSS);
            SendClientMessage(playerid, COLOR_YELLOW, "** You have succesfully changed your nickname color in the Management/Owner color.");
        }
    }
    else return ErrorMessages(playerid, 7);
    return 1;
}
Hope anyone can learn me whats wrong with it.

Thanks.
Reply
#2

You set the colour and then you check the player's level so it will set the player's colour to the value of COLOR_BOSS and then it will return an error.

pawn Код:
// these lines:
PlayerAcc[playerid][SaveColor] = COLOR_BOSS;
SetPlayerColor(playerid, PlayerAcc[playerid][SaveColor]);
Reply
#3

Doens't work man, Idk why..
Reply
#4

Isn't this much better?
pawn Код:
CMD:bosscolor(playerid, params[])
{
    if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "** You are not logged in, please login first.");
    //PlayerAcc[playerid][UseColor] = 1;
    //PlayerAcc[playerid][SaveColor] = COLOR_BOSS;
    //SetPlayerColor(playerid, PlayerAcc[playerid][SaveColor]);
   
    if(PlayerAcc[playerid][Admin] < 9) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
    SetPlayerColor(playerid, COLOR_BOSS);
    SendClientMessage(playerid, COLOR_YELLOW, "** You have succesfully changed your nickname color in the Management/Owner color.");
    PlayerAcc[playerid][UseColor] = 1;
    PlayerAcc[playerid][SaveColor] = COLOR_BOSS;
    return 1;
}
Reply
#5

Try this :

pawn Код:
CMD:bosscolor(playerid, params[])
{
    if(PlayerAcc[playerid][Log] == 1)
    {
        PlayerAcc[playerid][UseColor] = 1;
        PlayerAcc[playerid][SaveColor] = COLOR_BOSS;
        SetPlayerColor(playerid, PlayerAcc[playerid][SaveColor]);

        if(PlayerAcc[playerid][Admin] < 9) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 9+ can use that command!");
        SetPlayerColor(playerid, COLOR_BOSS);
        SendClientMessage(playerid, COLOR_YELLOW, "** You have succesfully changed your nickname color in the Management/Owner color.");

    } else return ErrorMessages(playerid, 7);
    return 1;
}
Works ?
Reply
#6

No, It only says Sorry, only admins level 9+ blabla...
But it still change the admin level 8 color as example..
Reply
#7

Like I said, it sets the colour and then you check if the player's admin level is less than 9. It should be the opposite, so Matess' way will work (he forgot to close the string in SCM though).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)