/mask help?
#1

Код:
//===============================[Mask System]=================================================

    if(strcmp(cmd, "/mask", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "  You need to login first !");
                return 1;
            }

            if(PlayerInfo[playerid][pMask] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, " You dont have a mask !");
                return 1;
            }

            GetPlayerName(playerid, sendername, sizeof(sendername));
			GiveNameSpace(sendername);
            if(PlayerInfo[playerid][pMaskUse] == 0)
            {
                PlayerInfo[playerid][pMaskUse] = 1;
                format(string, sizeof(string), "* Stranger puts a mask on.");
                for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
                GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
            }
            else
            {
                PlayerInfo[playerid][pMaskUse] = 0;
                for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, true);
                GameTextForPlayer(playerid, "~W~Nametags ~R~on", 5000, 5);
               	if(PlayerInfo[playerid][pSex] == 1) {
                format(string, sizeof(string), "* %s puts his mask away.", sendername);
                } else {
                format(string, sizeof(string), "* %s puts her mask away.", sendername);
                }
            }
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        return 1;
    }
Well, yes basically when the player types /mask, he should dosen't see the other player nametags, but the player without /mask they see the masked guy with the name above his head and it's visible, what i'm trying to do is when the player got /mask his name would be not visible for the other players.
Reply
#2

Your params should be flip-flopped. To hide the masked player's tag:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, 0);
and to show it:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, 1);
Reply
#3

Quote:
Originally Posted by zDevon
Посмотреть сообщение
Your params should be flip-flopped. To hide the masked player's tag:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, 0);
and to show it:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, 1);
Worked, thank you
+rep.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)