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



unban help - McFellow - 18.02.2013

Hello,
I got an unban system (Not made by me) but I'm getting these errors
Код:
(3045) : error 012: invalid function call, not a valid address
(3045) : warning 215: expression has no effect
(3045) : error 001: expected token: ";", but found ")"
(3045) : error 029: invalid expression, assumed zero
(3045) : fatal error 107: too many error messages on one line
and this is the system
pawn Код:
public OnQueryFinishEx(thread_id, pl, playerid)
{
    new string[128], plname[MAX_PLAYER_NAME], reason[64], val;
    switch(thread_id)
    {
        case UNBAN_THREAD:
        {
            if(mysql_affected_rows(gHandle))
            {
                GetPVarString(playerid, "UnbanPL", plname, MAX_PLAYER_NAME);
                format(string, sizeof(string), "%s has successfully been unbanned.", plname);
                SendClientMessage(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), "AdminMessage: %s was unbanned by %s.", plname, pName(playerid)); // error line
                SendAdminMessage(COLOR_LIGHTRED, string, 1);
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "Could not unban the player.");
            }
            DeletePVar(playerid, "UnbanPL");
            return 1;
        }



Re: unban help - Blast3r - 18.02.2013

Remove the ":" at the end of:
pawn Код:
case UNBAN_THREAD:
So it should be like this:

pawn Код:
case UNBAN_THREAD
NOTE: only do it if that's the line that's with the error, if it isn't, my bad


Re: unban help - S0n1COwnsYou - 18.02.2013

which is 3045 ??

Quote:

Remove the ":" at the end of:
pawn Code:
case UNBAN_THREAD:

So it should be like this:

pawn Code:
case UNBAN_THREAD

can't be , case is used like that
PHP код:
case Something:
{




Re: unban help - McFellow - 18.02.2013

Quote:
Originally Posted by Blast3r
Посмотреть сообщение
Remove the ":" at the end of:
pawn Код:
case UNBAN_THREAD:
So it should be like this:

pawn Код:
case UNBAN_THREAD
doesn't work
and this is error line 3045:
pawn Код:
format(string, sizeof(string), "AdminMessage: %s was unbanned by %s.", plname, pName(playerid));



Re: unban help - Blast3r - 18.02.2013

Quote:
Originally Posted by S0n1COwnsYou
Посмотреть сообщение
which is 3045 ??



can't be , case is used like that
PHP код:
case Something:
{

My bad, just noticed.


Re: unban help - S0n1COwnsYou - 18.02.2013

show pName please...


Re: unban help - DaRk_RaiN - 18.02.2013

Quote:
Originally Posted by Blast3r
Посмотреть сообщение
Remove the ":" at the end of:
pawn Код:
case UNBAN_THREAD:
So it should be like this:

pawn Код:
case UNBAN_THREAD
https://sampwiki.blast.hk/wiki/Control_Structures#case


Re: unban help - McFellow - 18.02.2013

pawn Код:
pName[126],



Re: unban help - McFellow - 18.02.2013

Yes I know but I don't know what


Re: unban help - McFellow - 18.02.2013

Well I fixed it pName needed to be GetName but now I get this warnings
Код:
(3035) : warning 203: symbol is never used: "val"
(3035 -- 3075) : warning 209: function "OnQueryFinishEx" should return a value
pawn Код:
new string[128], plname[MAX_PLAYER_NAME], reason[64], val; //line 3035
pawn Код:
return 1;
        }
    }
} //Line 3075