Unban problem

Started by Williams, Jan 02, 2016, 07:40 PM

Previous topic - Next topic

Williams

HI guys i need help i have Delban function it's not work so help me.. and tell me what is bug please!.

Command
else if ( cmd == "unban" )
{
   if ( IsNoob( player, cmd ) ) return 0;
   else if ( !text ) MessagePlayer(WHITE+"Syntax - /" + cmd + " <Full Nick>", player );
   else if ( CheckBan( text ) == 0 ) MessagePlayer( YELLOW+"Error - - [ " + text + " ] is not Banned.", player );
   else DelBan( player, text );
}

Function.
function DelBan( admin, banned )
{
    local type = "Nick-Banned";
    local q = QuerySQL( db, "SELECT * FROM Ban WHERE Name='" + banned + "'" );
    local name = GetSQLColumnData( q, 0 );
    if ( GetSQLColumnData( q, 6 ) == type )
   {
    QuerySQL( db, "DELETE FROM Ban WHERE Name='" + banned + "'" );
Message(RED+ "--> Admin [ " + admin + " ] Un-Banned Player:[ "  + banned +  " ]" );
EchoMessage(ICOL_GREEN+ICOL_BOLD+">> Admin [" + admin + "] Un-Banned Player:[ "  + banned +  " ]" );
}
}

Please tell me bug!

HAve a Nice day!!
Hey, i m always at IRC and Forum you can comtact me at IRC channel :- #GDM @LUNet and Forum :- http://pro-fighter.tk/index.php

Diego^

Try this:

function DelBan( admin, banned )
{
local q = QuerySQL( db, "SELECT * FROM Ban WHERE Name='" + banned + "'" );
if ( GetSQLColumnData( q, 0 ) == banned )
{
QuerySQL( db, "DELETE FROM Ban WHERE Name='" + banned + "'" );
Message(RED+ "--> Admin [ " + admin.Name + " ] Un-Banned Player:[ "  + banned +  " ]" );
EchoMessage(ICOL_GREEN+ICOL_BOLD+">> Admin [" + admin.Name + "] Un-Banned Player:[ "  + banned +  " ]" );
}
}
BRL's Developer.

EK.IceFlake

if ( IsNoob( player, cmd ) )*condition true*
mainly because you need to tell us that ban table

Williams

Quote from: NE.CrystalBlue on Jan 03, 2016, 04:30 AMif ( IsNoob( player, cmd ) )*condition true*
mainly because you need to tell us that ban table
Quote from: Diego^ on Jan 03, 2016, 03:01 AMTry this:

function DelBan( admin, banned )
{
local q = QuerySQL( db, "SELECT * FROM Ban WHERE Name='" + banned + "'" );
if ( GetSQLColumnData( q, 0 ) == banned )
{
QuerySQL( db, "DELETE FROM Ban WHERE Name='" + banned + "'" );
Message(RED+ "--> Admin [ " + admin.Name + " ] Un-Banned Player:[ "  + banned +  " ]" );
EchoMessage(ICOL_GREEN+ICOL_BOLD+">> Admin [" + admin.Name + "] Un-Banned Player:[ "  + banned +  " ]" );
}
}

Thanks NE.CrystalBlue @Diego
Hey, i m always at IRC and Forum you can comtact me at IRC channel :- #GDM @LUNet and Forum :- http://pro-fighter.tk/index.php