unban help
#1

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;
        }
Reply
#2

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
Reply
#3

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:
{

Reply
#4

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));
Reply
#5

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



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

My bad, just noticed.
Reply
#6

show pName please...
Reply
#7

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
Reply
#8

pawn Код:
pName[126],
Reply
#9

Yes I know but I don't know what
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)