SA-MP Forums Archive
Error In Script [+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: Error In Script [+REP] (/showthread.php?tid=324670)



Error In Script [+REP] - VIPAwesome - 10.03.2012

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.



Re: Error In Script [+REP] - AndreT - 10.03.2012

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.


Re: Error In Script [+REP] - VIPAwesome - 10.03.2012

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.



Re: Error In Script [+REP] - Twisted_Insane - 10.03.2012

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


Re: Error In Script [+REP] - Scrillex - 10.03.2012

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


Re: Error In Script [+REP] - AndreT - 10.03.2012

Код:
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.


Re: Error In Script [+REP] - Twisted_Insane - 10.03.2012

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)



Re: Error In Script [+REP] - VIPAwesome - 10.03.2012

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.



Re: Error In Script [+REP] - Twisted_Insane - 10.03.2012

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



Re: Error In Script [+REP] - Kiets - 10.03.2012

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?