SA-MP Forums Archive
Unban problem - 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 problem (/showthread.php?tid=482492)



Unban problem - PakPak - 21.12.2013

Hi there,

I have a problem with my unban, when I try to unban someone who is banned I got this error :

Code:
[14:36:34] [debug] Run time error 6: "Invalid instruction"
[14:36:34] [debug]  Unknown opcode 0xb8000000 at address 0x00000069
[14:36:34] [debug] AMX backtrace:
[14:36:34] [debug] #0 00000069 in public cmd_unban () from MyRP.amx
[14:36:34] [debug] #1 native CallLocalFunction () [00471e90] from samp-server.exe
[14:36:34] [debug] #2 0000341c in public OnPlayerCommandText () from MyRP.amx
My unban command :

pawn Code:
CMD:unban(playerid, params[])
{
    new target;
    if(PlayerInfo[playerid][pAdmin] < ADMIN_LVL_SUPER) return ShowInfoForPlayer(playerid, "~r~TOO low", 6000);
    if(sscanf(params, "s[40]", target)) return ShowInfoForPlayer(playerid, "~w~USAGE: ~r~/unban~w~ (name)", 6000);
    if(IsPlayerBanned(target)) {
        new query[200];
        format(query, sizeof(query), "DELETE FROM `myrp_bans` WHERE name = '%s'", returnName(playerid));
        mysql_function_query(g_Handle, query, true, "", "d", playerid);
        new str[256];
        format(str,sizeof(str),"%s unban %s",returnName(playerid), target);
        SendAdminMessage(COLOR_ORANGE,str);
        format(str,sizeof(str),"[UNBAN]%s | %s unban %s",returnTimeDate(), returnName(playerid), target);
        log("bans.ini",str);
    }
    else {
        ShowInfoForPlayer(playerid, "~r~Not banned", 6000);
    }
    return 1;
}


pawn Code:
stock IsPlayerBanned(target)
{
    new query[256];
    format(query, 70, "SELECT * FROM `myrp_bans` WHERE name = '%s'", target);
    mysql_function_query(g_Handle, query, true, "", "d", target);
    new rows, fields;
    cache_get_data(rows, fields, g_Handle);
    if(rows)
    {
        return true;
    }
    else {
        return false;
    }
}
Thanks


Re: Unban problem - PakPak - 21.12.2013

up please