/mask help (+rep)
#1

hello please help i make my /mask cmd and it got 4 errors why please help me.
pawn Код:
pMask
pawn Код:
CMD:mask(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a member of the Hitman Agency Or CIA!");
                return 1;
            }
            if(PlayerInfo[playerid][pMask] == 0)
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 0);
                    }
                }
                PlayerInfo[playerid][pMask] = 1;
                GetPlayerName(playerid, GetPlayerNameEx(playerid), sizeof(GetPlayerNameEx(playerid));
                format(string, sizeof(string), "* %s has put a mask on.", GetPlayerNameEx(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if(PlayerInfo[playerid][pMask] == 1)
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 1);
                    }
                }
                PlayerInfo[playerid][pMask] = 0;
                GetPlayerName(playerid, GetPlayerNameEx(playerid), sizeof(GetPlayerNameEx(playerid)));
                format(string, sizeof(string), "* %s has put their mask away.", GetPlayerNameEx(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
        }
        return 1;
    }
Erros
pawn Код:
F:\My favorite sa-mp script\gamemodes\EXRP.pwn(32607) : error 072: "sizeof" operator is invalid on "function" symbols
F:\My favorite sa-mp script\gamemodes\EXRP.pwn(32607) : warning 215: expression has no effect
F:\My favorite sa-mp script\gamemodes\EXRP.pwn(32607) : error 001: expected token: ";", but found ")"
F:\My favorite sa-mp script\gamemodes\EXRP.pwn(32607) : error 029: invalid expression, assumed zero
F:\My favorite sa-mp script\gamemodes\EXRP.pwn(32607) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

Try this, you had an unmatched closing paranthesis.
pawn Код:
CMD:mask(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a member of the Hitman Agency Or CIA!");
                return 1;
            }
            if(PlayerInfo[playerid][pMask] == 0)
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 0);
                    }
                }
                PlayerInfo[playerid][pMask] = 1;
                // You forgot a closing paranthesis on the following line.
                GetPlayerName(playerid, GetPlayerNameEx(playerid), sizeof(GetPlayerNameEx(playerid)));
                format(string, sizeof(string), "* %s has put a mask on.", GetPlayerNameEx(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if(PlayerInfo[playerid][pMask] == 1)
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 1);
                    }
                }
                PlayerInfo[playerid][pMask] = 0;
                GetPlayerName(playerid, GetPlayerNameEx(playerid), sizeof(GetPlayerNameEx(playerid)));
                format(string, sizeof(string), "* %s has put their mask away.", GetPlayerNameEx(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
        }
        return 1;
    }
Reply
#3

This script still isnt working, Im getting the same error codes



Код:
CMD:mask(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a member of the Hitman Agency Or CIA!");
                return 1;
            }
            if(PlayerInfo[playerid][pMask] == 0)
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 0);
                    }
                }
                PlayerInfo[playerid][pMask] = 1;
                // You forgot a closing paranthesis on the following line.
                GetPlayerName(playerid, GetPlayerNameEx(playerid), sizeof(GetPlayerNameEx(playerid)));
                format(string, sizeof(string), "* %s has put a mask on.", GetPlayerNameEx(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if(PlayerInfo[playerid][pMask] == 1)
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 1);
                    }
                }
                PlayerInfo[playerid][pMask] = 0;
                GetPlayerName(playerid, GetPlayerNameEx(playerid), sizeof(GetPlayerNameEx(playerid)));
                format(string, sizeof(string), "* %s has put their mask away.", GetPlayerNameEx(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
        }
        return 1;
    }
Reply
#4

Delete the line below.

pawn Код:
GetPlayerName(playerid, GetPlayerNameEx(playerid), sizeof(GetPlayerNameEx(playerid)));
GetPlayerNameEx already executes this function
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)