SA-MP Forums Archive
/mask help please - 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: /mask help please (/showthread.php?tid=551264)



/mask help please - Jing_Chan - 17.12.2014

pawn Код:
if(strcmp(cmd, "/mask", true) == 0)
    {
        if(PlayerInfo[playerid][pMember] != 8 || PlayerInfo[playerid][pMember] != 11)
        {
            SendClientMessage(playerid, COLOR_GREY, "   You are not a member of the Hitman Agency / Bratva !");
            return 1;
        }
        if(PlayerInfo[playerid][pMask] == 0)
        {
            PlayerInfo[playerid][pMask] = 1;
            foreach (Player, i)
            {
                if(IsPlayerConnected(i))
                {
                    ShowPlayerNameTagForPlayer(i, playerid, 0);
                }
            }
            strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME);
            format(string, sizeof(string), "* %s has put a mask on.", sendername);
            ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        else if(PlayerInfo[playerid][pMask] == 1)
        {
            PlayerInfo[playerid][pMask] = 0;
            foreach (Player, i)
            {
                if(IsPlayerConnected(i))
                {
                    ShowPlayerNameTagForPlayer(i, playerid, 1);
                }
            }
            strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME);
            format(string, sizeof(string), "* %s has put their mask away.", sendername);
            ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
    }
When in either faction 8, or faction 11 /mask still doesn't work. What's wrong?


Re: /mask help please - Schneider - 17.12.2014

You are checking if the player not 8 OR not 11, so if for example the player is in faction 8, he is not in faction 11, so he will still get the error-message.

The way to go is to check if the player is not from 8 AND not from 11, so use && instead of ||


Re: /mask help please - Jing_Chan - 17.12.2014

Quote:
Originally Posted by Schneider
Посмотреть сообщение
You are checking if the player not 8 OR not 11, so if for example the player is in faction 8, he is not in faction 11, so he will still get the error-message.

The way to go is to check if the player is not from 8 AND not from 11, so use && instead of ||
I'll give it a go and get back to you, thanks.

edit: worked ty