Error In Script [+REP]
#1

Here My Script
pawn Код:
new masked[MAX_PLAYERS];
pawn Код:
CMD:mask(playerid, params[])
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pAdmin] < 2 || (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    SendClientMessage(playerid, COLOR_GREY, "    You are not authorized to use that command!");
    }
    if(masked[playerid] == 0)
    {
    masked[playerid] = 1;
    SendClientMessage(playerid, -1,"You are now masked.");
    }
    else
    {
    masked[playerid] = 0;
    SendClientMessage(playerid, -1,"You are no longer masked.");
    }
    return 1;
    }
Errors
pawn Код:
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(30733) : error 029: invalid expression, assumed zero
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(30736) : error 010: invalid function or declaration
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(30741) : error 010: invalid function or declaration
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(30746) : error 010: invalid function or declaration
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(85807) : warning 203: symbol is never used: "masked"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

You are missing the starting bracket of the CMD:mask(playerid, params[]) scope.
pawn Код:
CMD:mask(playerid, params[])
{
    // ...
    return true;
}
Also, if you want to stop the user from actually going further on with the command if they aren't authorized, you need to stop the code processing by adding a return.
Reply
#3

Quote:
Originally Posted by AndreT
Посмотреть сообщение
You are missing the starting bracket of the CMD:mask(playerid, params[]) scope.
pawn Код:
CMD:mask(playerid, params[])
{
    // ...
    return true;
}
Also, if you want to stop the user from actually going further on with the command if they aren't authorized, you need to stop the code processing by adding a return.
pawn Код:
CMD:mask(playerid, params[])
    {
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pAdmin] < 2 || (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    SendClientMessage(playerid, COLOR_GREY, "    You are not authorized to use that command!");
    }
    if(masked[playerid] == 0)
    {
    masked[playerid] = 1;
    SendClientMessage(playerid, -1,"You are now masked.");
    }
    else
    {
    masked[playerid] = 0;
    SendClientMessage(playerid, -1,"You are no longer masked.");
    }
    return true;
    }
Error Now:
pawn Код:
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(30743) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Which line is it? Comment it in your script to let me see it...
Reply
#5

Idk It will help you but try this Wait I will put it in... http://pastebin.com/vhzvuHBz
Reply
#6

Код:
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pAdmin] < 2 || (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
There's clearly an opening round bracket leftover in there. I won't tell you what to replace it with and I also ask anyone else not to do that. So perhaps you will actually know what the problem is.
Reply
#7

Replace your line with the following:

pawn Код:
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
Reply
#8

Now Script Looks Like
pawn Код:
CMD:mask(playerid, params[]) {
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pAdmin] < 2 || (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
    }
    if(masked[playerid] == 0) {
        masked[playerid] = 1;
            SendClientMessage(playerid, -1,"You are now masked.");
    }
    else {
        masked[playerid] = 0;
            SendClientMessage(playerid, -1,"You are no longer masked.");
    }
    return true;
}
Errors
pawn Код:
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(30743) : error 029: invalid expression, assumed zero
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(30748) : warning 217: loose indentation
F:\My favorite sa-mp script\gamemodes\EXRP..pwn(30752) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

Oh god, you didn't understand what to change and...oh well, forget it! Your script's structure is all messed up, delete it and put in this:

pawn Код:
CMD:mask(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
    }
   
    if(masked[playerid] == 0)
    {
        masked[playerid] = 1;
        SendClientMessage(playerid, -1,"You are now masked.");
    }
    else
    {
        masked[playerid] = 0;
        SendClientMessage(playerid, -1,"You are no longer masked.");
    }
    return true;
}
Reply
#10

pawn Код:
CMD:mask(playerid, params[]) {
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
    }
    if(masked[playerid] == 0) {
        masked[playerid] = 1;
        SendClientMessage(playerid, -1,"You are now masked.");
    }
    else {
        masked[playerid] = 0;
        SendClientMessage(playerid, -1,"You are no longer masked.");
    }
    return true;
}
maybe try this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)