Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CheckBan( player )
- {
- local q = QuerySQL( db, "SELECT * FROM Bans WHERE UID='" + player.UniqueID + "' COLLATE NOCASE" );
- local uid = GetSQLColumnData( q, 5 ), b_time =GetSQLColumnData( q, 1 ), b_exp = GetSQLColumnData(q, 2 );
- if ( uid )
- {
- if ( time() - b_time >= b_exp )
- {
- QuerySQL( db, "DELETE FROM Bans WHERE UID=" + player.UniqueID + "'" );
- MessagePlayer("Your ban has been expired, stick to the rules.", player );
- EchoMessage1(ICOL_BLUE+"> "+player.Name+"'s UID was unbanned." );
- }
- else
- {
- local t_left = time() - b_time;
- local t_left_ = b_exp - t_left;
- ServerMessage( "Auto kicking "+player.Name+" as he is currently banned in server, Timeleft: "+Duration( t_left_ )+"." );
- EchoMessage( ICOL_RED+"Auto kicking "+player.Name+" as he is currently banned in server. Timeleft: "+Duration( t_left_ )+"." );
- EchoMessage1( ICOL_RED+"Auto kicking "+player.Name+" as he is currently banned in server. Timeleft: "+Duration( t_left_ )+"." );
- SendMessage( "Banned by: [ "+GetSQLColumnData(q, 4)+" ] Reason: [ "+GetSQLColumnData(q, 3)+" ] For unban appeals apply on forum, Forum: " +Forum+ ".", player );
- KickPlayer( player );
- }
- }
- FreeSQLQuery( q );
- }
- else if ( cmd == "!baninfo" )
- {
- if ( level < 2 ) EchoNotice1( user, ICOL_RED + "Error - Your level is not high enough to use that command." );
- else if ( !text ) EchoNotice1( user, ICOL_RED + "Error - Syntax: " + cmd + " <FullNick> ");
- local q = QuerySQL( db, "SELECT * FROM Bans WHERE Name='" + text + "' COLLATE NOCASE" );
- if ( !GetSQLColumnData( q, 0 ) ) EchoNotice1( user, ICOL_RED + "Error "+text+" -is not in our banlist ");
- else
- {
- local b_time = GetSQLColumnData( q, 1 ), b_exp = GetSQLColumnData( q, 2 );
- local t_left = time() - b_time;
- local t_left_ = b_exp - t_left;
- EchoNotice1( user, "Player [ " +text+ " ] Banned by: [ " +GetSQLColumnData(q, 4 )+ " ] for Reason: [ " +GetSQLColumnData(q, 3 )+ " ] TimeLeft: [ " +Duration( t_left_ )+ " ]." );
- GetSQLNextRow( q );
- }
- }
Add Comment
Please, Sign In to add comment