SA-MP Forums Archive
/mask help (+rep) - 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 (+rep) (/showthread.php?tid=330507)



/mask help (+rep) - Paul_Saint - 01.04.2012

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.



Re: /mask help (+rep) - ReneG - 01.04.2012

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;
    }



Re: /mask help (+rep) - MilesMan - 27.06.2012

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;
    }



Re: /mask help (+rep) - Jason` - 27.06.2012

Delete the line below.

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