daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Apr 26th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const BotName = "nothing";
  2. const BotPass = "****";
  3. const IRCServerIP = "85.17.189.153";
  4. const IRCServerPort = 6667;
  5. const EchoChannel = "#RZ";
  6. const StaffChan = "";
  7. const StaffPass = "1752156465";
  8. const EchoPass = "";
  9.  
  10. function LoadIRCEcho()
  11. {
  12.         IRCBot <- NewSocket( "IRCProcess" );
  13.         IRCBot.Connect( IRCServerIP, IRCServerPort );
  14.         IRCBot.SetNewConnFunc( "IRCLogin" );
  15.         print( "[Loaded] Echo Script connecte to Channel: " + EchoChannel  );
  16.         print( "Bot " + BotName + " Connected." );
  17. }
  18.  
  19. function SendSMsg( msg )
  20. {
  21.         try
  22.         {
  23.             if ( IRCBot ) IRCBot.Send( msg );
  24.         }
  25.         catch( E )
  26.         {
  27.                 print( "Error Sending a message to the socket: " + E );
  28.                 return 1;
  29.         }
  30. }
  31.  
  32. function EVTC( value1, value2, value3 )
  33. {
  34.         if ( value1 < value2 ) return 0;
  35.         else return value3;
  36. }
  37.  
  38. function IRCProcess( Data )
  39. {
  40.         if ( GetTok( Data, " ", 2 ) == "JOIN" )
  41.         {
  42.                 local par = split( Data, " " );
  43.                 if ( par[ 0 ].find( "@" ) != null )
  44.                 {
  45.                        SendSMsg( "NAMES :" + EchoChannel + "\n" );
  46.                        local proto = split( par[ 0 ], "@" ), plr = split( GetTok( Data, " ", 1 ), "!" );
  47.                        PlayerJoin_IRC( plr[ 0 ].slice( 1 ), proto[ 1 ] );
  48.                 }
  49.                
  50.         }
  51.  
  52.         local player = split( GetTok( Data, " ", 1 ), "!" );
  53.     if ( ( GetTok( Data, " ", 2 ) == "PRIVMSG" ) && ( GetTok( Data, " ", 3 ) == EchoChannel ) && ( player[ 0 ].slice( 1 ) ) )
  54.         {
  55.                 PlayerChat_IRC( player[ 0 ].slice( 1 ), Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + 4 ) );
  56.         }
  57.  
  58.     if ( ( GetTok( Data, " ", 2 ) == "PRIVMSG" ) && ( GetTok( Data, " ", 3 ) != EchoChannel ) )
  59.         {
  60.                 local plr = split( GetTok( Data, " ", 1 ), "!" );
  61.                 FromPlayerPM_IRC( plr[ 0 ].slice( 1 ), GetTok( Data, " ", 3 ), Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + 4 ) );
  62.         }
  63.  
  64.     if ( GetTok( Data, " ", 2 ) == "NICK" )
  65.     {
  66.                 SendSMsg( "NAMES :" + EchoChannel + "\n" );
  67.                 local plr = split( GetTok( Data, " ", 1 ), "!" );
  68.         PlayerChangeNick_IRC( plr[ 0 ].slice( 1 ), GetTok( Data, " ", 3 ).slice( 1 ) );
  69.     }
  70.  
  71.     if ( GetTok( Data, " ", 2 ) == "MODE" )
  72.         {
  73.                 SendSMsg( "NAMES :" + EchoChannel + "\n" );
  74.         }
  75.  
  76.     if ( GetTok( Data, " ", 2 )  == "TOPIC" )
  77.     {
  78.                 local plr = split( GetTok( Data, " ", 1 ), "!" );
  79.                 PlayerChangedTopic_IRC( plr[ 0 ].slice( 1 ), Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + 4 ) );
  80.     }
  81.  
  82.     if ( GetTok( Data, " ", 2 ) == "PART" )
  83.     {
  84.                 SendSMsg( "NAMES :" + EchoChannel + "\n" );
  85.                 local plr = split( GetTok( Data, " ", 1 ), "!" );
  86.         if ( !GetTok( Data, " ", 4 ) ) PlayerPart_IRC( plr[ 0 ].slice( 1 ), "PART", "Niguno" );
  87.         else PlayerPart_IRC( plr[ 0 ].slice( 1 ), "PART", Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + 4 ) );
  88.     }
  89.  
  90.     if ( GetTok( Data, " ", 2 ) == "QUIT" )
  91.     {
  92.                 SendSMsg( "NAMES :" + EchoChannel + "\n" );
  93.                 local plr = split( GetTok( Data, " ", 1 ), "!" );
  94.         PlayerPart_IRC( plr[ 0 ].slice( 1 ), "QUIT", Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + 3 ) );
  95.     }
  96.  
  97.     if ( GetTok( Data, " ", 2 ) == "KICK" )
  98.     {
  99.                 local plr = split( GetTok( Data, " ", 4 ), " " );
  100.         PlayerPart_IRC( plr[ 0 ], "KICK", Data.slice( GetTok( Data, " ", 1 ).len() + GetTok( Data, " ", 2 ).len() + GetTok( Data, " ", 3 ).len() + GetTok( Data, " ", 4 ).len() + 5 ) );
  101.     }
  102.  
  103.         local params = split( Data, " " ), Channel = EchoChannel;
  104.     if ( params[ 1 ] == "KICK" && params[ 2 ].tolower() == Channel.tolower() ) SendSMsg( "JOIN " + Channel + " " + EchoPass + "\n" );
  105.     else if ( params[ 1 ] == "353" ) IRCSaveNicks( Data );
  106.     else if ( params[ 0 ] == "PING" )
  107.         {
  108.                 SendSMsg( "PONG " + params[ 1 ] + "\n" );
  109.                 SendSMsg( "NAMES :" + EchoChannel + "\n" );
  110.         }
  111.     else if ( params[ 1 ] == "001" )
  112.         {
  113.                 NewTimer( "SendSMsg", 5000, 1, "PRIVMSG NICKSERV IDENTIFY " + BotPass + "\n" );
  114.                 NewTimer( "SendSMsg", 7000, 1, "JOIN " + EchoChannel + " " + EchoPass + "\n" );
  115.                 NewTimer( "SendSMsg", 9000, 1, "JOIN " + StaffChan + " " + StaffPass + "\n" );                
  116.                 NewTimer( "print", 8000, 1, "Bot succesfully joined the echo channel." );
  117.                
  118.     }
  119. }
  120.  
  121. function DisconnectBot()
  122. {
  123.         IRCBot.Delete();
  124.         print( "Now can quit your server with out errors." );
  125. }
  126.  
  127. function IRCLogin()
  128. {
  129.         SendSMsg( "USER " + BotName + " 0 * : " + BotName + " \n" );
  130.     SendSMsg( "NICK " + BotName + "\n" );
  131.     NewTimer( "SendSMsg", 2000, 1, "PRIVMSG NickServ IDENTIFY " + BotPass + "\n" );
  132.     SendSMsg( "MODE " + BotName + " +B\n" );
  133.         NewTimer( "SendSMsg", 3000, 1, "JOIN " + EchoChannel + " " + EchoPass + "\n" );
  134.         NewTimer( "SendSMsg", 3000, 1, "JOIN " + StaffChan + " " + StaffPass + "\n" );
  135.         NewTimer( "EchoMessage", 4000, 1, "5->14 Scripts are now connected. 5<-" );
  136.         NewTimer( "PMessage", 4000, 1, "12->5 Staff is now connected.12 <-" );
  137.         Print( "Connected." );
  138. }
  139.  
  140. function EchoMessage( text )
  141. {
  142.     SendSMsg( "PRIVMSG " + EchoChannel + " " + text + "\n" );
  143. }
  144.  
  145. function StaffMessage( text )
  146. {
  147.     print( text );
  148. }  
  149.  
  150. function PMessage( text )
  151. {
  152.          SendSMsg( "PRIVMSG " + StaffChan + " " + text + "\n" );
  153. }
  154.  
  155. function StaffNotice( text )
  156. {
  157.     SendSMsg("NOTICE " + StaffChan + " :" + text + "\n" );
  158. }
  159.  
  160. function EchoPrivMessage( text, player )
  161. {
  162.         SendSMsg( "PRIVMSG " + player + " " + text + "\n" );
  163. }
  164.  
  165. function EchoNotice( text, user )
  166. {
  167.         SendSMsg("NOTICE " + user + " :" + text + "\n" );
  168. }
  169.  
  170. function EMessage( text )
  171. {
  172.     EchoMessage( text );
  173.     ClientMessageToAll( text.slice( 3 ), 240, 240, 0 );
  174. }
  175.  
  176. function NoticeIRCToServer( text )
  177. {
  178.     ClientMessageToAll( text, 240, 240, 0 );
  179. }
  180.  
  181. function Table( hz )
  182. {
  183.     local v;
  184.     if ( hz >= 100 ) v = "[IIIIIIIIIII]";
  185.     else if ( hz >= 90 ) v = "[IIIIIIIII-]";
  186.     else if ( hz >= 80 ) v = "[IIIIIIII--]";
  187.     else if ( hz >= 70 ) v = "[IIIIIII---]";
  188.     else if ( hz >= 60 ) v = "[IIIIII----]";
  189.     else if ( hz >= 50 ) v = "[IIIII-----]";
  190.     else if ( hz >= 40 ) v = "[IIII------]";
  191.     else if ( hz >= 30 ) v = "[III-------]";
  192.     else if ( hz >= 20 ) v = "[II--------]";
  193.     else if ( hz >= 10 ) v = "[I---------]";
  194.     else v = "[-----------]";
  195.     return v;
  196. }
  197.  
  198. function MPing( hz )
  199. {
  200.     local ping;
  201.     if ( hz >= 300 ) ping = "[Hight]";
  202.     else if ( hz >= 180 ) ping = "[Medium]";
  203.     else if ( hz >= 0 ) ping = "[Low]";
  204.     else ping = "[Unknown]";
  205.     return ping;
  206. }
  207.  
  208. function TWeather( hz )
  209. {
  210.     local t;
  211.     if ( hz >= 10 ) t = "Cloudy";
  212.     else if ( hz == 9 ) t = "Semi-Dark";
  213.     else if ( hz == 8 ) t = "Cloudy Dark";
  214.     else if ( hz == 7 ) t = "Sunny";
  215.     else if ( hz == 6 ) t = "Dark Night";
  216.     else if ( hz == 5 ) t = "Rainy #2";
  217.     else if ( hz == 4 ) t = "Day #2";
  218.     else if ( hz == 3 ) t = "Foggy";
  219.     else if ( hz == 2 ) t = "Rainy";
  220.     else if ( hz == 1 ) t = "Night";
  221.     else if ( hz == 0 ) t = "Default";
  222.     return t;
  223. }        
  224.  
  225.  
  226. function PlayerJoin_IRC( player, proto )
  227. {
  228.         print( "[IRC] " + player + " has join to " + EchoChannel + "." );
  229.         ClientMessageToAll( "** [IRC] ( " + player + " ) has joined the echo channel.", 997, 481, 541 );
  230. }
  231.  
  232. function PlayerPart_IRC( player, reason, quote )
  233. {
  234.         if ( reason == "PART" )
  235.         {
  236.                 print( "[IRC] " + player + " has leaving " + EchoChannel + ". ( " + quote + " )." );
  237.                 ClientMessageToAll( "** [IRC] ( " + player + " ) has left the echo channel.", 997, 481, 541 );
  238.         }
  239.         else if ( reason == "QUIT" )
  240.         {
  241.                 print( "[IRC] " + player + " has disconnected" + EchoChannel + ". ( " + quote + " )." );
  242.                 ClientMessageToAll( "** [IRC] ( " + player + " ) has quit the echo channel.", 997, 481, 541 );
  243.         }
  244.         else if ( reason == "KICK" )
  245.         {
  246.                 print( "[IRC] " + player + " has kicked " + EchoChannel + ". Reason: ( " + quote + " )." );
  247.                 ClientMessageToAll( "** [IRC] ( " + player + " ) has kicked from the echo channel.", 997, 481, 541 );
  248.         }
  249. }
  250.  
  251. function PlayerChangeNick_IRC( oldnick, newnick )
  252. {
  253.         print( "[IRC] " + oldnick + " now is: " + newnick + "." );
  254.         ClientMessageToAll( "** [IRC] ( " + oldnick + " ) is now known as ( " + newnick + ")", 997, 481, 541 );
  255. }
  256.  
  257. function PlayerChangedTopic_IRC( player, topic )
  258. {
  259.         print( "[IRC] " + player + " changed topic: " + topic + "." );
  260. }
  261.  
  262. function FromPlayerPM_IRC( player, topm, texto )
  263. {
  264.         print( "[IRC] [PM] " + player + ": " + texto + "." );
  265. }
  266.  
  267. function PlayerChat_IRC( player, text )
  268. {
  269.         print( "[IRC] <" + player + "> " + text + "." );
  270.         ClientMessageToAll( "[IRC] " + player + ": " + text, 225, 36, 105 );
  271.  
  272.         if ( text ) text = text.slice( 0, text.len() - 2 );
  273.         if ( NumTok( text, " " ) == 1 ) return PlayerCommand_IRC( player, text, null );
  274.         else
  275.         {
  276.                 local command = GetTok( text, " ", 1 ), txt = GetTok( text, " ", 2,  NumTok( text, " " ) );
  277.                 return PlayerCommand_IRC( player, command, EVTC( NumTok( text, " " ), 2, txt ) );
  278.         }
  279. }
  280.  
  281. /* AQUI PONES LOS COMMANDOS QUE SERAN PARA IRC */
  282. function PlayerCommand_IRC( player, command, text )
  283. {
  284.       if ( command == "!pm" )
  285.       {
  286.          if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id> <text>" );
  287.          else if ( NumTok( text, " " ) < 2 ) EchoMessage( "4Error:1 " + command + " <nick/id> <text>" );
  288.          else
  289.          {
  290.          local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  291.      if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  292.          else
  293.          {
  294.              SendSMsg( "NOTICE " + player + " " + "PM to " + plr + ": " + GetTok( text, " ", 2, NumTok( text, " " ) ) + "" + "\n" );
  295.              PrivMessage( "(IRC-PM) " + player + ": " + GetTok( text, " ", 2, NumTok( text, " " ) ) + "", plr );
  296.              Announce( "~h~Read PM", plr );
  297.            }
  298.       }
  299. }
  300.  
  301.          else if ( command == "!banlist" )
  302.             {
  303.        if ( !GetSQLColumnData( QuerySQL( SQLDataBase, "SELECT User FROM Banneds" ), 0 ) ) EchoMessage( "Error: Banlist is empty." );
  304.      else if ( QuerySQL( SQLDataBase, "SELECT User FROM Banneds" ) )
  305.      {
  306.      local q = QuerySQL( SQLDataBase, "SELECT User FROM Banneds" );
  307.  EchoMessage( "List of banned players on the server:" );
  308.      while ( GetSQLColumnData( q, 0 ) != null )
  309.      {
  310.          local User = GetSQLColumnData( q, 0 );
  311.          if ( User ) EchoMessage( "Name: " + User + ", IP: " + GetPlayerBannedIP( User ) + ", Reason: " + GetReasonBannedIP( User ) + "." );
  312.                        q = GetSQLNextRow( q ); 
  313.          if ( !q )
  314.             {
  315.               EchoMessage( "End of Ban List." );
  316.          break;
  317. }
  318.          }
  319.      }
  320.  }
  321.  
  322.      else if ( command == "!commands" )
  323.      {
  324.         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 );
  325.      } 
  326.  
  327.      else if ( command == "!players" )
  328.      {
  329.         local t = null;
  330.                   for ( local a = 0; a < GetMaxPlayers(); a ++ )
  331.         {
  332.             local plr = FindPlayer( a );
  333.             if ( plr )
  334.             {              
  335.                 if ( t ) t = t + " - 14[" + plr.ID + "]2 " + plr.Name + " ";
  336.                 else t = "14[" + plr.ID + "]2 " + plr.Name + " ";
  337.             }
  338.         }
  339.        
  340.         if ( t ) EchoMessage( "**12 Players Online:[10 " + GetPlayers() + "/" + GetMaxPlayers() + "12 ]" ), EchoMessage( "** " + t );
  341.         else EchoMessage( "**5 There are no players ingame." );
  342. }          
  343.  
  344.  
  345.    else if ( command == "!hp" )
  346.    {
  347.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  348.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  349.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  350.         else
  351.         {
  352.            if ( !plr.IsSpawned ) EchoMessage( "4Error:1 This player hasn't spawned." );
  353.            else
  354.            {
  355.                EchoMessage( "**12 " + plr.Name + "'s Health: " + Table( plr.Health ) + " " + plr.Health + "%" );
  356.            }
  357.         }
  358.     }        
  359.              
  360.    else if ( command == "!armour" )
  361.    {
  362.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  363.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  364.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  365.         else
  366.         {
  367.            if ( !plr.IsSpawned ) EchoMessage( "4Error:1 This player hasn't spawned." );
  368.            else
  369.            {
  370.                EchoMessage( "**12 " + plr.Name + "'s Armour: " + Table( plr.Armour ) + " " + plr.Armour + "%" );
  371.            }
  372.         }
  373.     }
  374.  
  375.     else if ( command == "!spree" )
  376.     {
  377.                 local s = null;
  378.                 for ( local p = 0; p < GetMaxPlayers(); p ++ )
  379.                 {
  380.             local plr = FindPlayer( p );
  381.             if ( ( plr ) && ( GetPlayerSpree( plr ) >= 5 ) )
  382.             {          
  383.                     if ( s ) s = s + " - " + plr.Name + " (" + GetPlayerSpree( plr ) + ")";
  384.                 else s = plr.Name + " (" + GetPlayerSpree( plr ) + ")";
  385.             }
  386.         }
  387.        
  388.         if ( s ) EchoMessage( "4>>12 Players on a killing spree:[10 " + s + " 12]" );
  389.         else EchoMessage( "**4 No players with a killing spree." );
  390.      }
  391.    
  392.    else if ( command == "!ping" )
  393.    {
  394.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  395.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  396.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  397.         else
  398.         {
  399.                EchoMessage( "**12 " + plr.Name + "'s Ping: " + plr.Ping + " - " + MPing( plr.Ping ) );          
  400.         }
  401.     }
  402.    
  403.     else if ( command == "!weather" )
  404.     {
  405.          EchoMessage( "**12 Current weather:[" + TWeather( GetWeather() ) + "]" );
  406.          ClientMessageToAll( "** Current weather:[" + TWeather( GetWeather() ) + "]", 0, 111, 0 );
  407.     }
  408.    
  409.     else if ( command == "!forum" )
  410.     {
  411.        EchoMessage( "**7 Homepage:[" + forum + "]" );
  412.        ClientMessageToAll( "** Homepage:[" + forum + "]", 0, 255, 0 );
  413.     }
  414.  
  415.    else if ( command == "!me" )
  416.    {
  417.         if ( !text ) EchoMessage( "4Error:1 " + command + " <text>" );
  418.         else
  419.         {
  420.              EchoMessage( "*7 " + player + " " + text );
  421.              ClientMessageToAll( "*** " + player + " " + text, 254, 136, 235 );        
  422.         }
  423.     }
  424.    
  425.     else if ( command == "!say" )
  426.     {
  427.         if ( !text ) EchoMessage( "4Error:1 " + command + " <text>" );
  428.         else
  429.         {
  430.              EchoMessage( "12IRC >> " + player + ":1 " + text );
  431.              ClientMessageToAll("-IRC- " + player + ": " + text, 254, 136, 0 );        
  432.         }
  433.     }
  434.    
  435.    else if ( command == "!score" )
  436.    {
  437.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  438.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  439.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  440.         else
  441.         {
  442.                EchoMessage( "**12 " + plr.Name + "'s score:[" + plr.Score + "]" );          
  443.         }
  444.     }    
  445.  
  446.    else if ( command == "!id" )
  447.    {
  448.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  449.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  450.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  451.         else
  452.         {
  453.                EchoMessage( "**12 " + plr.Name + "'s ID:[" + plr.ID + "]" );          
  454.         }
  455.     }
  456.      
  457.    else if ( command == "!spawned" )
  458.    {
  459.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  460.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  461.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  462.         else
  463.         {
  464.                if ( plr.IsSpawned ) EchoMessage( "**12 " + plr.Name + "'s spawned status:[True]" );
  465.                else EchoMessage( "**12 " + plr.Name + "'s spawned status:[False]" );          
  466.         }
  467.     }
  468.  
  469.    else if ( command == "!cash" )
  470.    {
  471.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  472.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  473.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  474.         else
  475.         {
  476.              if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
  477.              else EchoMessage( "**12 " + plr.Name + "'s Cash:[$" + GetPlayerCash( plr ) + "] Bank:[$" + GetPlayerBank( plr ) + "]" );
  478.         }                    
  479.    }  
  480.    
  481.    else if ( command == "!level" )
  482.    {
  483.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  484.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  485.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  486.         else
  487.         {
  488.              if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
  489.              else EchoMessage( "**12 " + plr.Name + "'s Level:[" + GetPlayerLevel( plr ) + "]" );
  490.         }                    
  491.    }
  492.    
  493.    else if ( command == "!stats" )
  494.    {
  495.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  496.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  497.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  498.         else
  499.         {
  500.              if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
  501.              else if ( GetPlayerToggleStats( plr ) == "false" ) EchoMessage( "4Error:1 " + plr + " has off his stats." );
  502.              else EchoMessage( "**12 " + plr.Name + "'s stats: " + GetPlayerStats( plr ) );
  503.         }                    
  504.    }
  505.    
  506.    else if ( command == "!wstats" )
  507.    {
  508.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  509.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  510.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  511.         else
  512.         {
  513.              if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
  514.              else if ( GetPlayerToggleStats( plr ) == "false" ) EchoMessage( "4Error:1 " + plr + " has off his stats." );
  515.              else EchoMessage( "**12 " + plr.Name + "'s wstats: " + GetPlayerWStats( plr ) );
  516.         }                    
  517.    }
  518.        
  519.    else if ( command == "!bstats" )
  520.    {
  521.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  522.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  523.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  524.         else
  525.         {
  526.              if ( !GetPlayerLevel( plr ) ) EchoMessage( "4Error:1 " + plr + " is not registered." );
  527.              else if ( GetPlayerToggleStats( plr ) == "false" ) EchoMessage( "4Error:1 " + plr + " has off his stats." );
  528.              else EchoMessage( "**12 " + plr.Name + "'s bstats: " + GetPlayerBStats( plr ) );
  529.         }                    
  530.    }
  531.    
  532.     else if (( command == "!admins" ) || ( command == "!admin" ))
  533.     {
  534.         local esp = null;
  535.                 for ( local p = 0; p < GetMaxPlayers(); p ++ )
  536.         {
  537.             local plr = FindPlayer( p );
  538.             if ( ( plr ) && ( GetPlayerLevel( plr ) > 2  ) )
  539.             {          
  540.                     if ( esp ) esp = esp + " - " + plr.Name + " (" + LevelTag( GetPlayerLevel( plr ) ) + ")";
  541.                 else esp = plr.Name + " (" + LevelTag( GetPlayerLevel( plr ) ) + ")";
  542.             }
  543.         }
  544.        
  545.         if ( esp ) EchoMessage( "**13 Admins Online:[ " + esp + " ]" );
  546.         else EchoMessage( "4Error:1 No admins ingame." );
  547.     }    
  548.  
  549.    else if ( command == "!loc" )
  550.    {
  551.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  552.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  553.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  554.         else if ( !plr.IsSpawned ) EchoMessage( "4Error:1 " + plr + " hasn't spawned." );
  555.         else
  556.         {
  557.              if ( GetPlayerNoloc( plr ) == "true" ) EchoMessage( "4Error:1 " + plr + " has noloc turned on." );
  558.              else EchoMessage( "**12 " + plr.Name + "'s location:[" + GetPlayerLocation( plr ) + "]" );
  559.         }                    
  560.    }
  561.  
  562.    else if ( command == "!skin" )
  563.    {
  564.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  565.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  566.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  567.         else if ( !plr.IsSpawned ) EchoMessage( "4Error:1 " + plr + " hasn't spawned." );
  568.         else
  569.         {
  570.             EchoMessage( "**12 " + plr.Name + "'s skin:[" + GetSkinName( plr.Skin ) + "]" );  
  571.         }                    
  572.    }
  573.  
  574.    else if ( command == "!car" )
  575.    {
  576.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  577.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  578.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  579.         else
  580.         {
  581.             if ( !plr.Vehicle ) EchoMessage( "4Error:1 " + plr + " is not in a car." );
  582.             else EInfoCar( plr, plr.Vehicle );
  583.         }
  584.    }
  585.    
  586.     else if ( command == "!cars" )
  587.     {
  588.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  589.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  590.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );                
  591.         else
  592.         {
  593.                 local b = null;
  594.                         for ( local v = 1; v <= GetMaxVehicles(); v ++ )
  595.                 {
  596.                                 local veh = FindVehicle( v );
  597.                     if ( veh && IsVehicleOwnerHead( veh.ID, plr ) )
  598.                                 {              
  599.                         if ( b ) b = b + ", " + veh.ID + " - " + GetVehicleName( veh.ID );
  600.                         else b = veh.ID + " - " + GetVehicleName( veh.ID );
  601.                                 }
  602.                 }
  603.                        
  604.                 if ( b ) EchoMessage( "**12 " + plr + "'s own cars:[" + b + "]" );
  605.                 else EchoMessage( "4Error:1 " + plr + " doesn't have cars." );
  606.                 }
  607.            }
  608.  
  609.  
  610.        else if ( command == "!banlist" )
  611.        {
  612.                if ( !GetSQLColumnData( QuerySQL( SQLDataBase, "SELECT User FROM Banneds" ), 0 ) ) EchoMessage( "Error: Banlist is empty." );
  613.      else if ( QuerySQL( SQLDataBase, "SELECT User FROM Banneds" ) )
  614.          {
  615.      local q = QuerySQL( SQLDataBase, "SELECT User FROM Banneds" );
  616.            EchoMessage( "List of banned players on the server:" );
  617.      while ( GetSQLColumnData( q, 0 ) != null )
  618.      {
  619.          local User = GetSQLColumnData( q, 0 );
  620.          if ( User ) EchoMessage( "Name: " + User + ", IP: " + GetPlayerBannedIP( User ) + ", Reason: " + GetReasonBannedIP( User ) + "." );
  621.            q = GetSQLNextRow( q ); 
  622.          if ( !q )
  623.             {
  624.                     EchoMessage( "End of Ban List." );
  625.                break;
  626.            }
  627.          
  628.      }
  629.         }
  630.  
  631.  
  632.     else if ( command == "!props" )
  633.     {
  634.         if ( !text ) EchoMessage( "4Error:1 " + command + " <nick/id>" );
  635.         local plr = FindPlayer2( GetTok( text, " ", 1 ) );
  636.         if ( !plr ) EchoMessage( "4Error:1 Invalid nick/id." );
  637.         else
  638.         {
  639.                 local b = null;
  640.                         for ( local p = 1; p <= GetMaxPickups(); p ++ )
  641.                 {
  642.                     if ( ( FindPickup( p ) ) && ( IsPropOwnerHead( p, plr ) ) )
  643.                     {      
  644.                         if ( b ) b = b + ", " + GetPropID( p.tointeger() ) + " - " + GetPropertyName( p );
  645.                         else b = GetPropID( p.tointeger() )  + " - " + GetPropertyName( p );
  646.                     }
  647.                 }
  648.                      
  649.                 if ( b ) EchoMessage( "**12 " + plr + "'s own props:[" + b + "]" );
  650.                 else EchoMessage( "4Error:1 " + plr + " doesn't have props." );
  651.                 }
  652.     }
  653.    
  654.     else if ( command == "!rank" )
  655.     {
  656.          GetERank();
  657.     }
  658. }
  659.  
  660. function onConsoleInput( cmd, text )
  661. {
  662.         if ( ( cmd == cmd ) && ( cmd.find( "/" ) == null ) )
  663.         {
  664.                 if( !text ) EchoMessage( cmd );
  665.                 else EchoMessage( cmd + " " + text );
  666.         }
  667.        
  668.         if ( cmd == "/q" )
  669.         {
  670.                 if ( IRCBot )
  671.             {
  672.                         NewTimer( "DisconnectBot", 3000, 1 );
  673.                         if ( !text ) SendSMsg( "QUIT Mich v2.0\n" );
  674.                         else SendSMsg( "QUIT " + text + "\n" );
  675.             }
  676.                 else return 0;
  677.         }
  678.  
  679.         else if ( cmd == "/kick" )
  680.         {      
  681.                 if ( !text ) print( "Se usa: " + cmd + " <nick>." );
  682.                 {
  683.                         SendSMsg( "PRIVMSG CHANSERV KICK " + EchoChannel + " " + text + "\n" );
  684.                 }
  685.         }
  686.  
  687.         else if ( cmd == "/priv" )
  688.         {      
  689.                 if ( !text ) print( "Se usa: " + cmd + " <nick> <mensaje>." );
  690.                 else if ( NumTok( text, " " ) < 2 ) print( "Se usa: " + cmd + " <nick> <mensaje>." );
  691.                 else
  692.                 {
  693.                         local player = GetTok( text, " ", 1 ), message = GetTok( text, " ", 2, NumTok( text, " " ) );
  694.                     EchoPrivMessage( message, player )
  695.                 }
  696.             }
  697.          }
  698. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top