Unban

Started by Coolkid, Mar 04, 2016, 07:06 PM

Previous topic - Next topic

Coolkid

When I unban a person the command works perfectly and it deletes the players ban info Frm database but prb is when player try to join it kicks saying player is ban but when I restart server the player is unbanned plz help

MacTavish

can you show us you ban command and function

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

Quote from: Kusanagi on Mar 04, 2016, 07:17 PMcan you show us you ban command and function
He's probably storing them in a array and forgetting to remove them from the array when he unbans someone.
oh no

Coolkid

Quote from: KAKAN on Mar 04, 2016, 07:19 PM
Quote from: Kusanagi on Mar 04, 2016, 07:17 PMcan you show us you ban command and function
He's probably storing them in a array and forgetting to remove them from the array when he unbans someone.
I am in school will show you command in. 30 min when I am back at home I also think I need to erase the array because the ban is stored in array I will try removing it and tell you if I need any help thanks buddy

KAKAN

Quote from: Coolkid on Mar 04, 2016, 07:29 PM
Quote from: KAKAN on Mar 04, 2016, 07:19 PM
Quote from: Kusanagi on Mar 04, 2016, 07:17 PMcan you show us you ban command and function
He's probably storing them in a array and forgetting to remove them from the array when he unbans someone.
I am in school will show you command in. 30 min when I am back at home I also think I need to erase the array because the ban is stored in array I will try removing it and tell you if I need any help thanks buddy
Give me your unban command and the arrays name. I can try to fix it
oh no

Coolkid

15 min going back to home will give you command as soon I am back

Coolkid

command

[spoiler]else if ( cmd == "unban" )
{
local q = QuerySQL( database2, "SELECT * FROM Banlist WHERE Nick='" + text + "' COLLATE NOCASE" );
if ( IsNoob( player, cmd ) ) return 0;
else {
if ( !text ) MessagePlayer(RED+"Usage: /" + cmd + " [Full/Nick]", player );
else if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer(RED+"** [KM-Error]: >> "+ORANGE+""+text+" Is Not Exist In Ban-List.", player );
else {
local nickname = GetSQLColumnData( q, 0 );
q = QuerySQL( database2,"DELETE FROM Banlist WHERE Nick='" + text + "' COLLATE NOCASE" );
FreeSQLQuery( q );
BannedNicks.remove( BannedNicks.find( nickname.tolower() ) );
MessagePlayer(YELLOW+"** >> Admin " + player.Name + " Un-Banned " + text + ".",player );
}
}
}
[/spoiler]

KAKAN

Post the arrays, their works and the needed onPlayerJoin code
oh no