Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }
- const BotName = "iPwn3r";
- const BotPass = "password";
- const IRCServerIP = "94.23.201.99";
- const IRCServerPort = 6667;
- const EchoChannel = "#test";
- const StaffChan = "#test.staff";
- const StaffPass = "password";
- const EchoPass = "password";
- function LoadIRCEcho()
- {
- IRCBot <- NewSocket( "IRCProcess" );
- IRCBot.Connect( IRCServerIP, IRCServerPort );
- IRCBot.SetNewConnFunc( "IRCLogin" );
- print( "[Loaded] Echo Script connecte to Channel: " + EchoChannel );
- print( "Bot " + BotName + " Connected." );
- }
- function SendSMsg( msg )
- {
- try
- {
- if ( IRCBot ) IRCBot.Send( msg );
- }
- catch( E )
- {
- print( "Error Sending a message to the socket: " + E );
- return 1;
- }
- }
- function EVTC( value1, value2, value3 )
- {
- if ( value1 < value2 ) return 0;
- else return value3;
- }
- function IRCProcess( Data )
- {
- if ( GetTok( Data, " ", 2 ) == "JOIN" )
- {
- local par = split( Data, " " );
- if ( par[ 0 ].find( "@" ) != null )
- {
- SendSMsg( "NAMES :" + EchoChannel + "\n" );
- local proto = split( par[ 0 ], "@" ), plr = split( GetTok( Data, " ", 1 ), "!" );
- PlayerJoin_IRC( plr[ 0 ].slice( 1 ), proto[ 1 ] );
- }
- }
- local player = split( GetTok( Data, " ", 1 ), "!" );
- if ( ( GetTok( Data, " ", 2 ) == "PRIVMSG" ) && ( GetTok( Data, " ", 3 ) == EchoChannel ) && ( player[ 0 ].slice( 1 ) ) )
- {
- PlayerChat_IRC( player[ 0 ].slice( 1 ), Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + 4 ) );
- }
- if ( ( GetTok( Data, " ", 2 ) == "PRIVMSG" ) && ( GetTok( Data, " ", 3 ) != EchoChannel ) )
- {
- local plr = split( GetTok( Data, " ", 1 ), "!" );
- FromPlayerPM_IRC( plr[ 0 ].slice( 1 ), GetTok( Data, " ", 3 ), Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + 4 ) );
- }
- if ( GetTok( Data, " ", 2 ) == "NICK" )
- {
- SendSMsg( "NAMES :" + EchoChannel + "\n" );
- local plr = split( GetTok( Data, " ", 1 ), "!" );
- PlayerChangeNick_IRC( plr[ 0 ].slice( 1 ), GetTok( Data, " ", 3 ).slice( 1 ) );
- }
- if ( GetTok( Data, " ", 2 ) == "MODE" )
- {
- SendSMsg( "NAMES :" + EchoChannel + "\n" );
- }
- if ( GetTok( Data, " ", 2 ) == "TOPIC" )
- {
- local plr = split( GetTok( Data, " ", 1 ), "!" );
- PlayerChangedTopic_IRC( plr[ 0 ].slice( 1 ), Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + 4 ) );
- }
- if ( GetTok( Data, " ", 2 ) == "PART" )
- {
- SendSMsg( "NAMES :" + EchoChannel + "\n" );
- local plr = split( GetTok( Data, " ", 1 ), "!" );
- if ( !GetTok( Data, " ", 4 ) ) PlayerPart_IRC( plr[ 0 ].slice( 1 ), "PART", "Niguno" );
- else PlayerPart_IRC( plr[ 0 ].slice( 1 ), "PART", Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + 4 ) );
- }
- if ( GetTok( Data, " ", 2 ) == "QUIT" )
- {
- SendSMsg( "NAMES :" + EchoChannel + "\n" );
- local plr = split( GetTok( Data, " ", 1 ), "!" );
- PlayerPart_IRC( plr[ 0 ].slice( 1 ), "QUIT", Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + 3 ) );
- }
- if ( GetTok( Data, " ", 2 ) == "KICK" )
- {
- local plr = split( GetTok( Data, " ", 4 ), " " );
- PlayerPart_IRC( plr[ 0 ], "KICK", Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + GetTok( Data, " ", 4 ).len() + 5 ) );
- }
- local params = split( Data, " " ), Channel = EchoChannel;
- if ( params[ 1 ] == "KICK" && params[ 2 ].tolower() == Channel.tolower() ) SendSMsg( "JOIN " + Channel + " " + EchoPass + "\n" );
- else if ( params[ 1 ] == "353" ) IRCSaveNicks( Data );
- else if ( params[ 0 ] == "PING" )
- {
- SendSMsg( "PONG " + params[ 1 ] + "\n" );
- SendSMsg( "NAMES :" + EchoChannel + "\n" );
- }
- else if ( params[ 1 ] == "001" )
- {
- NewTimer( "SendSMsg", 5000, 1, "PRIVMSG NICKSERV IDENTIFY " + BotPass + "\n" );
- NewTimer( "SendSMsg", 7000, 1, "JOIN " + EchoChannel + " " + EchoPass + "\n" );
- NewTimer( "SendSMsg", 9000, 1, "JOIN " + StaffChan + " " + StaffPass + "\n" );
- NewTimer( "print", 8000, 1, "Bot succesfully joined the echo channel." );
- }
- }
- function DisconnectBot()
- {
- IRCBot.Delete();
- print( "Now can quit your server with out errors." );
- }
- function IRCLogin()
- {
- SendSMsg( "USER " + BotName + " 0 * : " + BotName + " \n" );
- SendSMsg( "NICK " + BotName + "\n" );
- NewTimer( "SendSMsg", 2000, 1, "PRIVMSG NickServ IDENTIFY " + BotPass + "\n" );
- SendSMsg( "MODE " + BotName + " +B\n" );
- NewTimer( "SendSMsg", 3000, 1, "JOIN " + EchoChannel + " " + EchoPass + "\n" );
- NewTimer( "SendSMsg", 3000, 1, "JOIN " + StaffChan + " " + StaffPass + "\n" );
- NewTimer( "EchoMessage", 4000, 1, "5->14 Public Enemy is now connected. 5<-" );
- NewTimer( "PMessage", 4000, 1, "12->5 Public Enemy Staff Channel is now connected.12 <-" );
- Print( "Connected." );
- }
- function EchoMessage( text )
- {
- SendSMsg( "PRIVMSG " + EchoChannel + " " + text + "\n" );
- }
- function StaffMessage( text )
- {
- print( text );
- }
- function PMessage( text )
- {
- SendSMsg( "PRIVMSG " + StaffChan + " " + text + "\n" );
- }
- function StaffNotice( text )
- {
- SendSMsg("NOTICE " + StaffChan + " :" + text + "\n" );
- }
- function EchoPrivMessage( text, player )
- {
- SendSMsg( "PRIVMSG " + player + " " + text + "\n" );
- }
- function EchoNotice( text, user )
- {
- SendSMsg("NOTICE " + user + " :" + text + "\n" );
- }
- function EMessage( text )
- {
- EchoMessage( text );
- ClientMessageToAll( text.slice( 3 ), 240, 240, 0 );
- }
- function NoticeIRCToServer( text )
- {
- ClientMessageToAll( text, 240, 240, 0 );
- }
- function Table( hz )
- {
- local v;
- if ( hz >= 100 ) v = "[IIIIIIIIIII]";
- else if ( hz >= 90 ) v = "[IIIIIIIII-]";
- else if ( hz >= 80 ) v = "[IIIIIIII--]";
- else if ( hz >= 70 ) v = "[IIIIIII---]";
- else if ( hz >= 60 ) v = "[IIIIII----]";
- else if ( hz >= 50 ) v = "[IIIII-----]";
- else if ( hz >= 40 ) v = "[IIII------]";
- else if ( hz >= 30 ) v = "[III-------]";
- else if ( hz >= 20 ) v = "[II--------]";
- else if ( hz >= 10 ) v = "[I---------]";
- else v = "[-----------]";
- return v;
- }
- function MPing( hz )
- {
- local ping;
- if ( hz >= 300 ) ping = "[Hight]";
- else if ( hz >= 180 ) ping = "[Medium]";
- else if ( hz >= 0 ) ping = "[Low]";
- else ping = "[Unknown]";
- return ping;
- }
- function TWeather( hz )
- {
- local t;
- if ( hz >= 10 ) t = "Cloudy";
- else if ( hz == 9 ) t = "Semi-Dark";
- else if ( hz == 8 ) t = "Cloudy Dark";
- else if ( hz == 7 ) t = "Sunny";
- else if ( hz == 6 ) t = "Dark Night";
- else if ( hz == 5 ) t = "Rainy #2";
- else if ( hz == 4 ) t = "Day #2";
- else if ( hz == 3 ) t = "Foggy";
- else if ( hz == 2 ) t = "Rainy";
- else if ( hz == 1 ) t = "Night";
- else if ( hz == 0 ) t = "Default";
- return t;
- }
- //======================= EVENTOS EN EL ECHO IRC =========================//
- function PlayerJoin_IRC( player, proto )
- {
- print( "[IRC] " + player + " has join to " + EchoChannel + "." );
- ClientMessageToAll( "** [IRC] ( " + player + " ) has joined the echo channel.", 997, 481, 541 );
- }
- function PlayerPart_IRC( player, reason, quote )
- {
- if ( reason == "PART" )
- {
- print( "[IRC] " + player + " has leaving " + EchoChannel + ". ( " + quote + " )." );
- ClientMessageToAll( "** [IRC] ( " + player + " ) has left the echo channel.", 997, 481, 541 );
- }
- else if ( reason == "QUIT" )
- {
- print( "[IRC] " + player + " has disconnected" + EchoChannel + ". ( " + quote + " )." );
- ClientMessageToAll( "** [IRC] ( " + player + " ) has quit the echo channel.", 997, 481, 541 );
- }
- else if ( reason == "KICK" )
- {
- print( "[IRC] " + player + " has kicked " + EchoChannel + ". Reason: ( " + quote + " )." );
- ClientMessageToAll( "** [IRC] ( " + player + " ) has kicked from the echo channel.", 997, 481, 541 );
- }
- }
- function PlayerChangeNick_IRC( oldnick, newnick )
- {
- print( "[IRC] " + oldnick + " now is: " + newnick + "." );
- ClientMessageToAll( "** [IRC] ( " + oldnick + " ) is now known as ( " + newnick + ")", 997, 481, 541 );
- }
- function PlayerChangedTopic_IRC( player, topic )
- {
- print( "[IRC] " + player + " changed topic: " + topic + "." );
- }
- function FromPlayerPM_IRC( player, topm, texto )
- {
- print( "[IRC] [PM] " + player + ": " + texto + "." );
- PMessage( "[IRC] [PM] " + player + ": " + texto + "." );
- }
- function PlayerChat_IRC( player, text )
- {
- print( "[IRC] <" + player + "> " + text + "." );
- ClientMessageToAll( "**(IRC) " + player + " :" + text + ".", 997, 481, 541 );
- if ( text ) text = text.slice( 0, text.len() - 2 );
- if ( NumTok( text, " " ) == 1 ) return PlayerCommand_IRC( player, text, null );
- else
- {
- local command = GetTok( text, " ", 1 ), txt = GetTok( text, " ", 2, NumTok( text, " " ) );
- return PlayerCommand_IRC( player, command, EVTC( NumTok( text, " " ), 2, txt ) );
- }
- }
- /* AQUI PONES LOS COMMANDOS QUE SERAN PARA IRC */
- function PlayerCommand_IRC( player, command, text )
- {
- if ( command == "!pm" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id> <text>" );
- else if ( NumTok( text, " " ) < 2 ) EchoMessage( "4Error:1 " + command + " <nick/id> <text>" );
- else
- {
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- SendSMsg( "NOTICE " + player + " " + "PM to " + plr + ": " + GetTok( text, " ", 2, NumTok( text, " " ) ) + "" + "\n" );
- PrivMessage( "(IRC-PM) " + player + ": " + GetTok( text, " ", 2, NumTok( text, " " ) ) + "", plr );
- Announce( "~h~Read PM", plr );
- }
- }
- }
- else if ( command == "!banlist" )
- {
- if ( !GetSQLColumnData( QuerySQL( SQLDataBase, "SELECT User FROM Banneds" ), 0 ) ) EchoMessage( "Error: Banlist is empty." );
- else if ( QuerySQL( SQLDataBase, "SELECT User FROM Banneds" ) )
- {
- local q = QuerySQL( SQLDataBase, "SELECT User FROM Banneds" );
- EchoMessage( "List of banned players on the server:" );
- while ( GetSQLColumnData( q, 0 ) != null )
- {
- local User = GetSQLColumnData( q, 0 );
- if ( User ) EchoMessage( "Name: " + User + ", IP: " + GetPlayerBannedIP( User ) + ", Reason: " + GetReasonBannedIP( User ) + "." );
- q = GetSQLNextRow( q );
- if ( !q )
- {
- EchoMessage( "End of Ban List." );
- break;
- }
- }
- }
- }
- else if ( command == "!commands" )
- {
- EchoNotice( "3Commands:1 !say !me !pm !players !hp !armour !ping !weather !forum !score !id !spawned !cash !level !stats !wstats !bstats !admin !loc !skin !car !cars !props !rank !spree", player );
- }
- else if ( command == "!players" )
- {
- local t = null;
- for ( local a = 0; a < GetMaxPlayers(); a ++ )
- {
- local plr = FindPlayer( a );
- if ( plr )
- {
- if ( t ) t = t + " - 14[" + plr.ID + "]2 " + plr.Name + " ";
- else t = "14[" + plr.ID + "]2 " + plr.Name + " ";
- }
- }
- if ( t ) EchoMessage( "**12 Players Online:[10 " + GetPlayers() + "/" + GetMaxPlayers() + "12 ]" ), EchoMessage( "** " + t );
- else EchoMessage( "**5 There are no players ingame." );
- }
- else if ( command == "!hp" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( !plr.IsSpawned ) EchoMessage( "4Error:1 This player hasn't spawned." );
- else
- {
- EchoMessage( "**12 " + plr.Name + "'s Health: " + Table( plr.Health ) + " " + plr.Health + "%" );
- }
- }
- }
- else if ( command == "!armour" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( !plr.IsSpawned ) EchoMessage( "4Error:1 This player hasn't spawned." );
- else
- {
- EchoMessage( "**12 " + plr.Name + "'s Armour: " + Table( plr.Armour ) + " " + plr.Armour + "%" );
- }
- }
- }
- else if ( command == "!spree" )
- {
- local s = null;
- for ( local p = 0; p < GetMaxPlayers(); p ++ )
- {
- local plr = FindPlayer( p );
- if ( ( plr ) && ( GetPlayerSpree( plr ) >= 5 ) )
- {
- if ( s ) s = s + " - " + plr.Name + " (" + GetPlayerSpree( plr ) + ")";
- else s = plr.Name + " (" + GetPlayerSpree( plr ) + ")";
- }
- }
- if ( s ) EchoMessage( "4>>12 Players on a killing spree:[10 " + s + " 12]" );
- else EchoMessage( "**4 No players with a killing spree." );
- }
- else if ( command == "!ping" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- EchoMessage( "**12 " + plr.Name + "'s Ping: " + plr.Ping + " - " + MPing( plr.Ping ) );
- }
- }
- else if ( command == "!weather" )
- {
- EchoMessage( "**12 Current weather:[" + TWeather( GetWeather() ) + "]" );
- ClientMessageToAll( "** Current weather:[" + TWeather( GetWeather() ) + "]", 0, 111, 0 );
- }
- else if ( command == "!forum" )
- {
- EchoMessage( "**7 Homepage:[" + forum + "]" );
- ClientMessageToAll( "** Homepage:[" + forum + "]", 0, 255, 0 );
- }
- else if ( command == "!me" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <text>" );
- else
- {
- EchoMessage( "*7 " + player + " " + text );
- ClientMessageToAll( "*** " + player + " " + text, 254, 136, 235 );
- }
- }
- else if ( command == "!say" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <text>" );
- else if ( level < 3 ) EchoMessage( " We have removed the use of !say or, you can chat assually and it will echo to server" );
- else
- {
- EchoMessage( "12IRC >> " + player + ":1 " + text );
- ClientMessageToAll("-IRC- " + player + ": " + text, 254, 136, 0 );
- }
- }
- else if ( command == "!score" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- EchoMessage( "**12 " + plr.Name + "'s score:[" + plr.Score + "]" );
- }
- }
- else if ( command == "!id" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- EchoMessage( "**12 " + plr.Name + "'s ID:[" + plr.ID + "]" );
- }
- }
- else if ( command == "!spawned" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( plr.IsSpawned ) EchoMessage( "**12 " + plr.Name + "'s spawned status:[True]" );
- else EchoMessage( "**12 " + plr.Name + "'s spawned status:[False]" );
- }
- }
- else if ( command == "!cash" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
- else EchoMessage( "**12 " + plr.Name + "'s Cash:[$" + GetPlayerCash( plr ) + "] Bank:[$" + GetPlayerBank( plr ) + "]" );
- }
- }
- else if ( command == "!level" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
- else EchoMessage( "**12 " + plr.Name + "'s Level:[" + GetPlayerLevel( plr ) + "]" );
- }
- }
- else if ( command == "!stats" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
- else if ( GetPlayerToggleStats( plr ) == "false" ) EchoMessage( "4Error:1 " + plr + " has off his stats." );
- else EchoMessage( "**12 " + plr.Name + "'s stats: " + GetPlayerStats( plr ) );
- }
- }
- else if ( command == "!wstats" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
- else if ( GetPlayerToggleStats( plr ) == "false" ) EchoMessage( "4Error:1 " + plr + " has off his stats." );
- else EchoMessage( "**12 " + plr.Name + "'s wstats: " + GetPlayerWStats( plr ) );
- }
- }
- else if ( command == "!bstats" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
- else if ( GetPlayerToggleStats( plr ) == "false" ) EchoMessage( "4Error:1 " + plr + " has off his stats." );
- else EchoMessage( "**12 " + plr.Name + "'s bstats: " + GetPlayerBStats( plr ) );
- }
- }
- else if (( command == "!admins" ) || ( command == "!admin" ))
- {
- local esp = null;
- for ( local p = 0; p < GetMaxPlayers(); p ++ )
- {
- local plr = FindPlayer( p );
- if ( ( plr ) && ( GetPlayerLevel( plr ) > 2 ) )
- {
- if ( esp ) esp = esp + " - " + plr.Name + " (" + LevelTag( GetPlayerLevel( plr ) ) + ")";
- else esp = plr.Name + " (" + LevelTag( GetPlayerLevel( plr ) ) + ")";
- }
- }
- if ( esp ) EchoMessage( "**13 Admins Online:[ " + esp + " ]" );
- else EchoMessage( "4-->1 No admins ingame." );
- }
- else if ( command == "!loc" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else if ( !plr.IsSpawned ) EchoMessage( "4Error:1 " + plr + " hasn't spawned." );
- else
- {
- if ( GetPlayerNoloc( plr ) == "true" ) EchoMessage( "4Error:1 " + plr + " has noloc turned on." );
- else EchoMessage( "**12 " + plr.Name + "'s location:[" + GetPlayerLocation( plr ) + "]" );
- }
- }
- else if ( command == "!skin" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else if ( !plr.IsSpawned ) EchoNotice( "4Error:1 " + plr + " hasn't spawned." );
- else
- {
- EchoMessage( "**12 " + plr.Name + "'s skin:[" + GetSkinName( plr.Skin ) + "]" );
- }
- }
- else if ( command == "!car" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- if ( !plr.Vehicle ) EchoMessage( "4Error:1 " + plr + " is not in a car." );
- else EInfoCar( plr, plr.Vehicle );
- }
- }
- else if ( command == "!cars" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- local b = null;
- for ( local v = 1; v <= GetMaxVehicles(); v ++ )
- {
- local veh = FindVehicle( v );
- if ( veh && IsVehicleOwnerHead( veh.ID, plr ) )
- {
- if ( b ) b = b + ", " + veh.ID + " - " + GetVehicleName( veh.ID );
- else b = veh.ID + " - " + GetVehicleName( veh.ID );
- }
- }
- if ( b ) EchoMessage( "**12 " + plr + "'s own cars:[" + b + "]" );
- else EchoMessage( "4Error:1 " + plr + " doesn't have cars." );
- }
- }
- else if ( command == "!banlist" )
- {
- if ( !GetSQLColumnData( QuerySQL( SQLDataBase, "SELECT User FROM Banneds" ), 0 ) ) EchoMessage( "Error: Banlist is empty." );
- else if ( QuerySQL( SQLDataBase, "SELECT User FROM Banneds" ) )
- {
- local q = QuerySQL( SQLDataBase, "SELECT User FROM Banneds" );
- EchoMessage( "List of banned players on the server:" );
- while ( GetSQLColumnData( q, 0 ) != null )
- {
- local User = GetSQLColumnData( q, 0 );
- if ( User ) EchoMessage( "Name: " + User + ", IP: " + GetPlayerBannedIP( User ) + ", Reason: " + GetReasonBannedIP( User ) + "." );
- q = GetSQLNextRow( q );
- if ( !q )
- {
- EchoMessage( "End of Ban List." );
- break;
- }
- }
- }
- else if ( command == "!props" )
- {
- if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
- local plr = FindPlayer2( GetTok( text, " ", 1 ) );
- if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
- else
- {
- local b = null;
- for ( local p = 1; p <= GetMaxPickups(); p ++ )
- {
- if ( ( FindPickup( p ) ) && ( IsPropOwnerHead( p, plr ) ) )
- {
- if ( b ) b = b + ", " + GetPropID( p.tointeger() ) + " - " + GetPropertyName( p );
- else b = GetPropID( p.tointeger() ) + " - " + GetPropertyName( p );
- }
- }
- if ( b ) EchoMessage( "**12 " + plr + "'s own props:[" + b + "]" );
- else EchoMessage( "** " + plr + " doesn't have props." );
- }
- }
- else if ( command == "!rank" )
- {
- GetERank();
- }
- }
Add Comment
Please, Sign In to add comment