21.12.2013, 20:36
Hi there,
I have a problem with my unban, when I try to unban someone who is banned I got this error :
My unban command :
Thanks
I have a problem with my unban, when I try to unban someone who is banned I got this error :
Код:
[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
pawn Код:
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 Код:
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;
}
}