Advertisement
Guest User

Bot IRC (MaximilianoBot)

a guest
Dec 15th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.94 KB | None | 0 0
  1. const ICOL_WHITE = "\x000300";
  2. const ICOL_BLACK = "\x000301";
  3. const ICOL_BLUE = "\x000302";
  4. const ICOL_GREEN = "\x000303";
  5. const ICOL_RED = "\x000304";
  6. const ICOL_BROWN = "\x000305";
  7. const ICOL_PURPLE = "\x000306";
  8. const ICOL_ORANGE = "\x000307";
  9. const ICOL_YELLOW = "\x000308";
  10. const ICOL_LGREEN = "\x000309";
  11. const ICOL_CYAN = "\x000310";
  12. const ICOL_LCYAN = "\x000311";
  13. const ICOL_LBLUE = "\x000312";
  14. const ICOL_PINK = "\x000313";
  15. const ICOL_GREY = "\x000314";
  16. const ICOL_LGREY = "\x000315";
  17. const ICOL = "\x0003";
  18. const ICOL_BOLD = "\x0002";
  19. const ICOL_ULINE = "\x0031";
  20.  
  21. //Configuracion
  22. const FBS_NICK = "MaximilianoBot"; //Nome do Bot
  23. const FBS_BPASS = "88035093"; //Senha do Bot. Obs Voc� deve registrar o nick do bot para ele logar.
  24. const FBS_SERVER = "82.192.76.195"; //Endereco IP do Server IRC, j� esta configurado para a GtaNET.
  25. const FBS_PORT = 6667; //Porta, j� esta configurada.
  26. const FBS_CHAN = "#BRL"; //#Canal #1
  27. const FBS_SCHAN = "#MaximilianoBot"; //Canal #2
  28. const FBS_CPASS = ""; //Senha do Canal #1. Caso nao tenha deixe em branco.
  29. const FBS_SPASS = "lol123"; //Senha do Canal #2. Caso nao tenha deixe em branco.
  30.  
  31. const USER = 1;
  32. const VOICE = 2;
  33. const HALFOP = 3;
  34. const OP = 4;
  35. const SOP = 5;
  36. const OWNER = 6;
  37. class FBSLIST
  38. {
  39. Name = null;
  40. Level = 1;
  41. }
  42.  
  43. function FBSLIST::AddNick( szNick, iAdmin )
  44. {
  45. Name = szNick;
  46. Level = iAdmin;
  47. }
  48.  
  49. function ActivateEcho()
  50. {
  51. print( "Confirmando detalles del bot..." );
  52. FBS_BOT <- NewSocket( "FBSProcess" );
  53.  
  54. FBS_BOT.Connect( FBS_SERVER, FBS_PORT );
  55. FBS_BOT.SetNewConnFunc( "FBSLogin" );
  56. print( "Detalhes do Bot confirmado!" );
  57.  
  58. FBS_NICKS <- array( 50, null );
  59. }
  60.  
  61. function DisconnectBots()
  62. {
  63. print( "Desconectando Bot do IRC..." );
  64.  
  65. FBS_BOT.Send( "QUIT " + FBS_NICK + "\n" );
  66. FBS_BOT.Delete();
  67.  
  68. print( FBS_NICK + " foi desconectado do IRC." );
  69. }
  70.  
  71. function FBSLogin()
  72. {
  73. print( "Logeando en el Echo..." );
  74. FBS_BOT.Send( "USER " + FBS_NICK + " 0 * :Low Gravity Showdown Echo Bot\n" );
  75. FBS_BOT.Send( "NICK " + FBS_NICK + "\n" );
  76. FBS_BOT.Send( "MODE " + FBS_NICK + " +B\n" );
  77. print( "Logado com sucesso." );
  78. }
  79.  
  80. function FBSProcess( sz )
  81. {
  82. local raw = split( sz, "\r\n" ), a, z = raw.len(), line;
  83.  
  84. for ( a = 0; a < z; a++ )
  85. {
  86. line = raw[ a ];
  87.  
  88. local FBS_PING = GetTok( line, " ", 1 ), FBS_EVENT = GetTok( line, " ", 2 ), FBS_CHANEVENT = GetTok( line, " ", 3 ),
  89. Count = NumTok( line, " " ), Nick, Command, Prefix, Text;
  90.  
  91. if ( FBS_PING ) FBS_BOT.Send( "PONG " + FBS_PING + "\n" );
  92.  
  93. if ( FBS_EVENT == "001" )
  94. {
  95. if ( FBS_BOT )
  96. {
  97. FBS_BOT.Send( "PRIVMSG NickServ IDENTIFY " + FBS_BPASS + "\n" );
  98. FBS_BOT.Send( "MODE " + FBS_NICK + " +B\n" );
  99. FBS_BOT.Send( "JOIN " + FBS_CHAN + " " + FBS_CPASS + "\n" );
  100. print( "Entrou com sucesso no " + FBS_CHAN + "!" );
  101. FBS_BOT.Send( "JOIN " + FBS_SCHAN + " " + FBS_SPASS + "\n" );
  102. print( "Entrou com sucesso no " + FBS_SCHAN + "!" );
  103. }
  104. }
  105. else if ( FBS_EVENT == "353" ) FBSSortNicks( sz );
  106. else if ( ( FBS_EVENT == "MODE" ) || ( FBS_EVENT == "NICK" ) || ( FBS_EVENT == "JOIN" ) || ( FBS_EVENT == "PART" ) || ( FBS_EVENT == "QUIT" ) ) FBS_BOT.Send( "NAMES :" + FBS_CHAN + "\n" );
  107. else if ( ( FBS_EVENT == "MODE" ) || ( FBS_EVENT == "NICK" ) || ( FBS_EVENT == "JOIN" ) || ( FBS_EVENT == "PART" ) || ( FBS_EVENT == "QUIT" ) ) FBS_BOT.Send( "NAMES :" + FBS_SCHAN + "\n" );
  108. else if ( FBS_CHANEVENT == FBS_CHAN )
  109. {
  110. Nick = GetTok( line, "!", 1 ).slice( 1 );
  111. Command = GetTok( line, " ", 4 );
  112. if ( Command.find( "!" ) || Command.find( "." ) ) Prefix = Command.slice( 1, 2 );
  113. else Prefix = null;
  114. Command = Command.slice( 1 );
  115.  
  116. if ( NumTok( line, " " ) > 4 ) Text = GetTok( line, " ", 5, Count );
  117. else Command = split( Command, "\r\n" )[ 0 ];
  118.  
  119. if ( Prefix != null )
  120. {
  121. if (Nick && Command && Text) { FBSIrcCommand( Nick, Command, Text ); }
  122. else if (Nick && Command) { FBSIrcCommand( Nick, Command, null ); }
  123. }
  124. }
  125. else if ( FBS_CHANEVENT == FBS_SCHAN )
  126. {
  127. Nick = GetTok( line, "!", 1 ).slice( 1 );
  128. Command = GetTok( line, " ", 4 );
  129. if ( Command.find( "!" ) || Command.find( "." ) ) Prefix = Command.slice( 1, 2 );
  130. else Prefix = null;
  131. Command = Command.slice( 1 );
  132.  
  133. if ( NumTok( line, " " ) > 4 ) Text = GetTok( line, " ", 5, Count );
  134. else Command = split( Command, "\r\n" )[ 0 ];
  135.  
  136. if ( Prefix != null )
  137. {
  138. if (Nick && Command && Text) { FBSStaffCommand( Nick, Command, Text ); }
  139. else if (Nick && Command) { FBSStaffCommand( Nick, Command, null ); }
  140. }
  141. }
  142. }
  143. }
  144.  
  145. function LevelTag1(lvl) {
  146. lvl = (lvl ? lvl:0);
  147. switch (lvl) {
  148. case 2:
  149. return "Helper";
  150. case 3:
  151. return "Moderator";
  152. case 4:
  153. return "Admin";
  154. case 5:
  155. return "Scripter";
  156. case 6:
  157. return "Developer";
  158. default:
  159. return "User";
  160. }
  161. }
  162.  
  163. function lLevelTag(lvl) {
  164. lvl = (lvl ? lvl:0);
  165. switch (lvl) {
  166. case 2:
  167. return "9";
  168. case 3:
  169. return "5";
  170. case 4:
  171. return "13";
  172. case 5:
  173. return "8";
  174. case 6:
  175. return "6";
  176. default:
  177. return "2";
  178. }
  179. }
  180.  
  181.  
  182. function FBSIrcCommand( user, cmd, text )
  183. {
  184. {
  185. local a = NumTok( szList, " " );
  186. local NickList = GetTok( szList, " ", 6, a ), i = 1;
  187. local levelnick = GetTok( NickList, " ", i ), nick = levelnick.slice( 1 ), level = levelnick.slice( 0, 1 );
  188.  
  189. if ( cmd == "!test" )
  190. {
  191. if ((levelnick.slice(0,1) == "+"))
  192. {
  193. EchoMessage("TEST")
  194. }
  195. else { EchoMessage("TEST22") }
  196. }
  197.  
  198. else if ( cmd == "!bienvenido" )
  199. {
  200. if ( !text ) StaffNotice( sintaxe + cmd + " <nick> <idioma>", player );
  201. else if (user == "Maximiliano")
  202. {
  203. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  204. local p = ( GetTok( text, " ", 1 ) );
  205. local idioma = (GetTok( text," ", 2) );
  206. if ( idioma == "es" )
  207. {
  208. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le dio la bienvenida correctamente. 13By ( "+ user +" ) \n");
  209. _IRC.Send( "#BRL", ".[#98FB98]Hola y Bienvenido al servidor[#FFFF00] " + p+ "[#98FB98], para jugar en el servidor usted necesita registrarse, para registrarte tienes que usar el comando [#00FFFF]/register (contrasena)");
  210. _IRC.Send( "#BRL", ".[#98FB98]Ejemplo: [#FFFF00] [#00FFFF]/register " + p+ "123");
  211.  
  212. StaffMessage("Testeado correctamente (ESPAÑOL)");
  213. }
  214. else if ( idioma == "en" )
  215. {
  216.  
  217. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le dio la bienvenida correctamente. 13By ( "+ user +" ) \n");
  218. _IRC.Send( "#BRL", ".[#98FB98]Hello and Welcome to Server[#FFFF00] " + p+ "[#98FB98], For play in the server you need register, use [#00FFFF]/register (password) [#98FB98]for register! :D");
  219. _IRC.Send( "#BRL", ".[#98FB98]Example: [#FFFF00] [#00FFFF]/register " + p+ "123");
  220. StaffMessage("Testeado correctamente (INGLES)");
  221.  
  222. _IRC.Send( "#BRL", "Al Usuario " + p+ " se le dio la bienvenida correctamente. By ( "+ user +" )");
  223. }
  224. else if ( idioma == "pt" )
  225. {
  226.  
  227. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le dio la bienvenida correctamente. 13By ( "+ user +" ) \n");
  228. _IRC.Send( "#BRL", ".[#98FB98]Bem vindo ao servidor[#FFFF00]" + p+ "[#98FB98], para jogar no servidor voce precisa se registrar, para se registrar voce tem que usar o comando [#00FFFF]/register (senha)");
  229. _IRC.Send( "#BRL", ".[#98FB98]Exemplo: [#FFFF00] [#00FFFF]/register " + p+ "123");
  230. StaffMessage("Testeado correctamente (PORTUGUES) ");
  231.  
  232. }
  233. } else { EchoMessage("13"+ user +" 4Usted no tiene acceso"); }
  234.  
  235. }
  236.  
  237. else if ( cmd == "!nickregistrado" )
  238. {
  239. if ( !text ) StaffNotice( sintaxe + cmd + " <nick> <idioma>", player );
  240. else if (user == "Maximiliano")
  241. {
  242. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  243. local p = ( GetTok( text, " ", 1 ) );
  244. local idioma = (GetTok( text," ", 3) );
  245. local dias = (GetTok( text," ", 2) );
  246. if ( idioma == "es" )
  247. {
  248.  
  249. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo que la cuenta que esta usando ya esta registrada. 13By ( "+ user +" ) \n");
  250. _IRC.Send( "#BRL", ".[#98FB98]Hola y Bienvenido al servidor[#FFFF00]" + p+ "[#98FB98], Ese nick ya fue registrado hace [#00FFFF]" + dias+ " dias[#98FB98], Si usted no lo registro, cambiese el nick y regrese para poder jugar");
  251.  
  252. StaffMessage("Testeado correctamente (ESPAÑOL)");
  253. }
  254. else if ( idioma == "en" )
  255. {
  256.  
  257. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo que la cuenta que esta usando ya esta registrada. 13By ( "+ user +" ) \n");
  258. _IRC.Send( "#BRL", ".[#98FB98]Hello and Welcome to the Server, [#FFFF00]" + p+ "[#98FB98], That nick was already registered [#00FFFF]" + dias+ " days ago[#98FB98], If you did not register the nickname you are using, you must exit the server and change the nickname to play here.");
  259.  
  260.  
  261. StaffMessage("Testeado correctamente (INGLES)");
  262.  
  263. _IRC.Send( "#BRL", "Al Usuario " + p+ " se le dio la bienvenida correctamente. By ( "+ user +" )");
  264. }
  265. else if ( idioma == "pt" )
  266. {
  267.  
  268. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo que la cuenta que esta usando ya esta registrada. 13By ( "+ user +" ) \n");
  269. _IRC.Send( "#BRL", ".[#98FB98]Ola e bem-vindo ao servidor [#FFFF00]" + p+ "[#98FB98], Esse nick ja foi registrado faz [#00FFFF]" + dias+ " dias[#98FB98], Se voce nao registrou ele, mude o nick e volte para poder jogar");
  270. StaffMessage("Testeado correctamente (PORTUGUES) ");
  271.  
  272. }
  273. } else { EchoMessage("13"+ user +" 4Usted no tiene acceso"); }
  274. }
  275.  
  276. else if ( cmd == "!carros" )
  277. {
  278. if ( !text ) StaffNotice( sintaxe + cmd + " <nick> <idioma>", player );
  279. else if (user == "Maximiliano")
  280. {
  281. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  282. local p = ( GetTok( text, " ", 1 ) );
  283. local idioma = (GetTok( text," ", 2) );
  284. if ( idioma == "es" )
  285. {
  286.  
  287. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar vehiculos. 13By ( "+ user +" ) \n");
  288. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98], Los carros se compran en [#00FFFF]Sunshine Car[#98FB98], el carro mas barato tiene un costo de 110k.");
  289. StaffMessage("Testeado correctamente (ESPAÑOL)");
  290. }
  291. else if ( idioma == "en" )
  292. {
  293. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar vehiculos. 13By ( "+ user +" ) \n");
  294. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98] You can buy the cars in [#00FFFF]Sunshine Car[#98FB98], The cheapest car has a cost of 110k.");
  295. StaffMessage("Testeado correctamente (INGLES)");
  296.  
  297. }
  298. else if ( idioma == "pt" )
  299. {
  300. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar vehiculos. 13By ( "+ user +" ) \n");
  301. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98] Voce pode comprar os veiculos em [#00FFFF]Sunshine Car[#98FB98], o mais barato custa 110k.");
  302. StaffMessage("Testeado correctamente (PORTUGUES) ");
  303.  
  304. }
  305. } else { EchoMessage("13"+ user +" 4Usted no tiene acceso"); }
  306. }
  307.  
  308. else if ( cmd == "!props" )
  309. {
  310. if ( !text ) StaffNotice( sintaxe + cmd + " <nick> <idioma>", player );
  311. else if (user == "Maximiliano")
  312. {
  313. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  314. local p = ( GetTok( text, " ", 1 ) );
  315. local idioma = (GetTok( text," ", 2) );
  316. if ( idioma == "es" )
  317. {
  318. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar propiedades. 13By ( "+ user +" ) \n");
  319. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98], Las propiedades se compran si estan en [#00FFFF]OFERTA[#98FB98] o comprandonselas a otros [#00FFFF]Jugadores[#98FB98], Necesitas minimo 150k.");
  320. StaffMessage("Testeado correctamente (ESPAÑOL)");
  321. }
  322. else if ( idioma == "en" )
  323. {
  324. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar Propiedades. 13By ( "+ user +" ) \n");
  325. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98], The properties are purchased if they are on [#00FFFF]OFFER[#98FB98] or buying from other [#00FFFF]Players[#98FB98], you need a minimum of 150k.");
  326. StaffMessage("Testeado correctamente (INGLES)");
  327.  
  328. }
  329. else if ( idioma == "pt" )
  330. {
  331. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar vehiculos. 13By ( "+ user +" ) \n");
  332. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98], As propriedades são compradas a partir de [#00FFFF]ofertas[#98FB98] vindo de outros [#00FFFF]jogadores[#98FB98], voce precisara de no minimo 150k.");
  333. StaffMessage("Testeado correctamente (PORTUGUES) ");
  334.  
  335. }
  336. } else { EchoMessage("13"+ user +" 4Usted no tiene acceso"); }
  337. }
  338.  
  339.  
  340. else if ( cmd == "!maxibotcmds" )
  341. {
  342. EchoMessage("13!Bienvenido, !nickregistrado, !carros, !props, !botchat, ");
  343. }
  344.  
  345. else if ( cmd == "!botchat" )
  346. {
  347. if (user == "Maximiliano")
  348. {
  349. BRLMessage(text + " ( "+ user +" )");
  350. }else { EchoMessage("13"+ user +" 4Usted no tiene acceso"); }
  351. }
  352.  
  353. }
  354. }
  355.  
  356. //========== Cmds de Admin =============================
  357.  
  358. function FBSStaffCommand( user, cmd, text )
  359. {
  360. {
  361. local NickInfo = FindNick( user ), level, tLevel, p;
  362. if ( NickInfo ) level = NickInfo.Level.tointeger();
  363. if (cmd)
  364. {
  365. if ( cmd.slice(0,1) == "." && cmd.len() > 1 ) {
  366. local msg = "12[ADMIN CHAT]7 " + user + "0: " + cmd.slice(1);
  367. local msg2 = "[#0000CD][ADMIN CHAT][#FFD700] " + user + "[#FFFFFF]: " + cmd.slice(1);
  368. if (text) { msg = msg + " " + text; }
  369. else if (text) { msg2 = msg + " " + text; }
  370. StaffMessage("" + msg );
  371. Message("[#FFE4B5] " + msg2);
  372. }
  373. }
  374.  
  375.  
  376. if ( cmd == "!lock" )
  377. {
  378. if ( level < 2 ) StaffMessage("[Erro] - Voce nao tem acesso a este comando.");
  379. else if ( !text ) StaffMessage("[Sintaxe] - !lock <senha>");
  380. else {
  381. SetPassword( " + text + " );
  382. MSG("Server Trancado");
  383. }
  384. }
  385.  
  386. else if ( cmd == "!infp" )
  387. {
  388. if ( !text ) StaffNotice( user,"Syntax: " + cmd + " <Nick>");
  389. else
  390. {
  391. local Nick = GetTok( text, " ", 1);
  392. local q = QuerySQL(db, "SELECT * FROM Contas WHERE Nome='" + Nick + "'");
  393. if (GetSQLColumnData(q, 0) != Nick) StaffNotice(user ,"[Error] " + Nick + "'s nao existe.");
  394. else if ( GetSQLColumnData(q ,0 ) == null ) StaffNotice(user ,""+Nick+" Nao existe no sistema.")
  395. else
  396. {
  397. local name = GetSQLColumnData(q, 0), Reg = GetSQLColumnData(q, 7), Join = GetSQLColumnData(q, 8);
  398. StaffNotice( user, "6Nome0: "+Nick+"." );
  399. StaffNotice( user, "6Data De Registro0: "+Reg+"" );
  400. StaffNotice( user, "6Ultima vez que foi visto online0: "+Join+"" );
  401. }
  402. }
  403. }
  404.  
  405.  
  406. else if ( cmd == "!sname" )
  407. {
  408. if ( level < 2 ) StaffMessage("[Erro] - Voce nao tem acesso a este comando.");
  409. else if ( !text ) StaffMessage("[Sintaxe] - !sname <senha>");
  410. else {
  411. SetServerName( "" + text + "" );
  412. EchoNotice(user,"7Voce alterou o nome do servidor para " + text + " ");
  413. }
  414. }
  415.  
  416. else if ( cmd == "!unlock" )
  417. {
  418. if ( level < 2 ) StaffMessage("[Erro] - Voce nao tem acesso a este comando.");
  419. else {
  420. SetPassword( "" );
  421. MSG("Server Destrancado");
  422. }
  423. }
  424.  
  425.  
  426. else if( cmd == "!bans" || cmd == "!banlist" || cmd == "!listaban" )
  427. {
  428. if ( level < 2 ) StaffMessage("[Erro] - Voce nao tem acesso a este comando.");
  429. else
  430. {
  431. local listQuery = QuerySQL( db, "SELECT * FROM Bans" );
  432. local count = 0;
  433. while ( GetSQLNextRow( listQuery ) )
  434. {
  435. count++;
  436. StaffNotice(user,"[BAN-#" + count + "]: Nome: " + GetSQLColumnData( listQuery, 0 ) + ", Admin: " + GetSQLColumnData( listQuery, 2 ) + ", Motivo: " + GetSQLColumnData( listQuery, 3 ) + ", Data: " + GetSQLColumnData( listQuery, 4 ));
  437. }
  438. FreeSQLQuery( listQuery );
  439. if( count == 0 ) return StaffNotice(user, "4[BAN-LIST]0: Sem jogadores banidos!");
  440. }
  441. }
  442.  
  443. else if ( cmd == "!setvip" )
  444. {
  445. if ( level < 5 ) StaffMessage( "4[Erro] - Voce nao tem acesso a este comando." );
  446. else if ( !text ) StaffMessage( "9[Sintaxe] - !setvip <Nick/ID> <Level>");
  447. else
  448. {
  449. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  450. if ( !plr ) StaffMessage("4Jogador Desconhecido." );
  451. else
  452. {
  453. local lvl = GetTok( text, " ", 2 );
  454. if ( !lvl ) StaffMessage( "9[Sintaxe] - !setlevel <Nick/ID> <Level>");
  455. else if ( !IsNum( lvl ) ) StaffMessage( "4[Erro] - Use Numeros." );
  456. else
  457. {
  458. status[ plr.ID ].Levelvip = lvl.tointeger();
  459. StaffNotice( user, "12Voce alterou o level de " + plr.Name + " para: " + lvl + " - " + Levelvip( plr ) + "." );
  460. I_MSG( "Admin " + user + " alterou seu level para: " + lvl + " - " + Levelvip( plr ) + ".", plr );
  461. MSG("Admin " + user + " deu uma vip para o jogador " + plr.Name + " Level: " + lvl + " - " + Levelvip( plr ) + ".");
  462. }
  463. }
  464. }
  465. }
  466.  
  467. else if ( cmd == "!dp" )
  468. {
  469. if ( level < 2 ) EchoNotice( user,"Error - Your Level is not Enough." );
  470. else if ( !text ) EchoNotice( user,"Error - Syntax: " + cmd + " <Nombre Full>");
  471. else
  472. {
  473. local Nick = GetTok( text, " ", 1);
  474. local q = QuerySQL(db, "SELECT * FROM Contas WHERE Nome='" + Nick + "'");
  475. if (GetSQLColumnData(q, 0) != Nick) EchoNotice(user ,"[Error] " + Nick + "'s cuenta no existe.");
  476. else if ( GetSQLColumnData(q ,0 ) == null ) EchoNotice(user ,""+Nick+" No existe en la base de datos")
  477. else
  478. {
  479. local name = GetSQLColumnData(q, 0), level = GetSQLColumnData(q, 6), cash = GetSQLColumnData(q, 4), bank = GetSQLColumnData(q, 5), IP = GetSQLColumnData(q,1), UID = GetSQLColumnData(q,2);
  480. EchoNotice( user, "4[INFO-PLR]6 Name0: "+Nick+", 6Level0: "+level+", 6Cash0: "+cash+", 6Bank0: "+bank+"." );
  481. EchoNotice( user, "6IP0: "+IP+"" );
  482. EchoNotice( user, "6UID0: "+UID+"" );
  483. }
  484. }
  485. }
  486.  
  487. else if ( cmd == "!cp" )
  488. {
  489. if ( level < 3 ) EchoNotice( user,"[ERROR] Usted no tiene acceso a este comando ");
  490. else if ( !text ) EchoNotice( user,"Error - Syntax: " + cmd + " <Nick/ID> ");
  491. else
  492. {
  493. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  494. if ( !plr ) EchoNotice( user, "Jugador no esta en linea" );
  495. else
  496. {
  497. EchoNotice( user ,"[ACCOUNT-DATA] " + plr.Name + "" );
  498. EchoNotice( user ,"[ACCOUNT-UID] "+plr.UID+"")
  499. EchoNotice( user ,"[ACCOUNT-UID2] "+plr.UID2+"")
  500. }
  501. }
  502. }
  503.  
  504.  
  505. else if ( cmd == "!p" || cmd == "!players" )
  506. {
  507. local plr, buffer = "", MAX_PLAYERS = GetMaxPlayers();
  508. for( local i=0; i < MAX_PLAYERS; ++i )
  509. {
  510. plr = FindPlayer( i );
  511. if ( plr ) buffer = buffer + "12[" + plr.ID + "]" + plr.Name + "(Ping: " + plr.Ping + "),";
  512. }
  513. if ( buffer != "" ) StaffMessage( "2Jogadores Online: " + strip(buffer) );
  514. StaffMessage( "10Total de Jogadores0: " + GetPlayers() );
  515. }
  516.  
  517. else if ( cmd == "!setpass" )
  518. {
  519. if ( level < 4 ) StaffMessage( "Voce nao tem acesso a este comando." );
  520. else if ( !text ) StaffMessage( cmd + " <Nick/ID> <Nova Senha>" );
  521. else
  522. {
  523. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  524. if ( !plr ) StaffMessage( "Jogador Desconhecido." );
  525. //else if ( Checar( player, plr ) ) return 0;
  526. else
  527. {
  528. local senha = GetTok( text, " ", 2);
  529. if ( !senha ) StaffMessage( cmd + " <Nick/ID> <Nova Senha>" );
  530. else
  531. {
  532. local pass = e(senha);
  533. QuerySQL( db, "UPDATE Contas SET Senha='" + pass + "' WHERE Nome='" + plr.Name + "'" );
  534. StaffNotice( user, "8Voce mudou a senha de4 " + plr.Name + " 8para:4 " + senha );
  535. }
  536. }
  537. }
  538. }
  539.  
  540. else if ( cmd == "!ban" )
  541. {
  542. if ( level < 4 ) StaffMessage( "4[Erro] - Voce nao tem acesso a este comando." );
  543. else if ( !text ) StaffMessage( cmd + " <Nick/ID> <Motivo>" );
  544. else
  545. {
  546. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  547. if ( !plr ) StaffMessage("4Jogador Desconhecido." );
  548. else
  549. {
  550. local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
  551. if ( reason == null ) reason = "4Nenhum";
  552. Ban( user, plr, reason );
  553. }
  554. }
  555. }
  556.  
  557.  
  558. else if ( cmd == "!setlevel" )
  559. {
  560. if ( level < 5 ) StaffMessage( "4[Erro] - Voce nao tem acesso a este comando." );
  561. else if ( !text ) StaffMessage( "9[Sintaxe] - !setlevel <Nick/ID> <Level>");
  562. else
  563. {
  564. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  565. if ( !plr ) StaffMessage("4Jogador Desconocido." );
  566. else
  567. {
  568. local lvl = GetTok( text, " ", 2 );
  569. if ( !lvl ) StaffMessage( "9[Sintaxe] - !setlevel <Nick/ID> <Level>");
  570. else if ( !IsNum( lvl ) ) StaffMessage( "4[Erro] - Use Numeros." );
  571. else
  572. {
  573. status[ plr.ID ].Level = lvl.tointeger();
  574. StaffNotice( user, "12Voce alterou o level de " + plr.Name + " para: " + lvl + " - " + LevelTag( plr ) + "." );
  575. I_MSG( "Admin " + user + " alterou seu level para: " + lvl + " - " + LevelTag( plr ) + ".", plr );
  576. }
  577. }
  578. }
  579. }
  580.  
  581. else if ( cmd == "!kick" )
  582. {
  583. if ( level < 2 ) StaffMessage( "4[Erro] - Voce nao tem acesso a este comando." );
  584. else if ( !text ) StaffMessage( "9[Sintaxe] - !kick <Nick/ID> <Motivo>");
  585. else
  586. {
  587. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  588. if ( !plr ) StaffMessage("4Jogador Desconhecido." );
  589. else
  590. {
  591. local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
  592. if ( reason == null ) reason = "4Nenhum";
  593. Kick( user, plr, reason );
  594. }
  595. }
  596. }
  597.  
  598. else if (cmd == "!salvartudo" || cmd == "!saveall")
  599. {
  600. if ( level < 5 ) StaffMessage( "4Voce nao tem acesso a este comando.", player);
  601. else{
  602. ADMIN( user + " Salvou dados do servidor... ");
  603. SalvarTudo();
  604. StaffMessage("4*** Voce salvou o dados do servidor... ");
  605. }
  606. }
  607.  
  608. else if ( cmd == "!ban" )
  609. {
  610. if ( level < 4 ) StaffMessage( "4[Erro] - Voce nao tem acesso a este comando." );
  611. else if ( !text ) StaffMessage( "9[Sintaxe] - !ban <Nick/ID> <Motivo>");
  612. else
  613. {
  614. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  615. if ( !plr ) StaffMessage("4Jogador Desconhecido." );
  616. else
  617. {
  618. local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
  619. if ( reason == null ) reason = "4Nenhum";
  620. Ban( user, plr, reason );
  621. }
  622. }
  623. }
  624. else if( cmd == "!reload" || cmd == "!r" )
  625. { Reload();
  626. }
  627.  
  628.  
  629. else if( cmd == "!exe" )
  630. {
  631. if ( !text ) StaffNotice( user, "13[Sintaxe] - !exe <Codigo SQ>" );
  632. else
  633. {
  634. try
  635. {
  636. local script = compilestring( text );
  637. if(script)
  638. {
  639. script();
  640. StaffMessage( "4Comando executado com sucesso." );
  641. }
  642. else StaffNotice( user, "4Erro!" );
  643. }
  644. catch(e) StaffNotice( user, "Erro:" + e );
  645. }
  646. }
  647. else if ( cmd == "!brl" )
  648. {
  649. StaffNotice( user, "13Bot Joined" );
  650. FBS_BOT.Send( "JOIN #BRL \n" );
  651. }
  652. else if ( cmd == "!test" )
  653. {
  654. _IRC.Send( "#BRL", "7Testeado correctamente. 13By ( "+ user +" ) \n");
  655. BRLMessage(".Test");
  656. }
  657.  
  658. else if ( cmd == "!bienvenido" )
  659. {
  660. if ( !text ) StaffNotice( sintaxe + cmd + " <nick> <idioma>", player );
  661. else
  662. {
  663. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  664. local p = ( GetTok( text, " ", 1 ) );
  665. local idioma = (GetTok( text," ", 2) );
  666. if ( idioma == "es" )
  667. {
  668. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le dio la bienvenida correctamente. 13By ( "+ user +" ) \n");
  669. _IRC.Send( "#BRL", ".[#98FB98]Hola y Bienvenido al servidor[#FFFF00] " + p+ "[#98FB98], para jugar en el servidor usted necesita registrarse, para registrarte tienes que usar el comando [#00FFFF]/register (contrasena)");
  670. _IRC.Send( "#BRL", ".[#98FB98]Ejemplo: [#FFFF00] [#00FFFF]/register " + p+ "123");
  671.  
  672. StaffMessage("Testeado correctamente (ESPAÑOL)");
  673. }
  674. else if ( idioma == "en" )
  675. {
  676.  
  677. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le dio la bienvenida correctamente. 13By ( "+ user +" ) \n");
  678. _IRC.Send( "#BRL", ".[#98FB98]Hello and Welcome to Server[#FFFF00] " + p+ "[#98FB98], For play in the server you need register, use [#00FFFF]/register (password) [#98FB98]for register! :D");
  679. _IRC.Send( "#BRL", ".[#98FB98]Example: [#FFFF00] [#00FFFF]/register " + p+ "123");
  680. StaffMessage("Testeado correctamente (INGLES)");
  681.  
  682. _IRC.Send( "#BRL", "Al Usuario " + p+ " se le dio la bienvenida correctamente. By ( "+ user +" )");
  683. }
  684. else if ( idioma == "pt" )
  685. {
  686.  
  687. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le dio la bienvenida correctamente. 13By ( "+ user +" ) \n");
  688. _IRC.Send( "#BRL", ".[#98FB98]Bem vindo ao servidor[#FFFF00]" + p+ "[#98FB98], para jogar no servidor voce precisa se registrar, para se registrar voce tem que usar o comando [#00FFFF]/register (senha)");
  689. _IRC.Send( "#BRL", ".[#98FB98]Exemplo: [#FFFF00] [#00FFFF]/register " + p+ "123");
  690. StaffMessage("Testeado correctamente (PORTUGUES) ");
  691.  
  692. }
  693.  
  694. }
  695. }
  696. else if ( cmd == "!nickregistrado" )
  697. {
  698. if ( !text ) S_MSG( sintaxe + cmd + " <nick> <idioma> <dias>", player );
  699. else
  700. {
  701. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  702. local p = ( GetTok( text, " ", 1 ) );
  703. local dias = (GetTok( text," ", 2) );
  704. local idioma = (GetTok( text," ", 3) );
  705. if ( idioma == "es" )
  706. {
  707.  
  708. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo que la cuenta que esta usando ya esta registrada. 13By ( "+ user +" ) \n");
  709. _IRC.Send( "#BRL", "Al Usuario " + p+ " se le informo que su nick ya fue registrado, Mensaje Enviado Correctamente. By ( "+ user +" )");
  710. _IRC.Send( "#BRL", ".[#98FB98]Hola y Bienvenido al servidor[#FFFF00]" + p+ "[#98FB98], Ese nick ya fue registrado hace [#00FFFF]" + dias+ " dias[#98FB98], Si usted no lo registro, cambiese el nick y regrese para poder jugar");
  711. StaffMessage("Testeado correctamente (ESPAÑOL)");
  712. }
  713. if ( idioma == "en" )
  714. {
  715.  
  716. StaffMessage("Pronto (INGLES)");
  717. }
  718. if ( idioma == "pt" )
  719. {
  720. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo que la cuenta que esta usando ya esta registrada. 13By ( "+ user +" ) \n");
  721. _IRC.Send( "#BRL", "Al Usuario " + p+ " se le informo que su nick ya fue registrado, Mensaje Enviado Correctamente. By ( "+ user +" )");
  722. _IRC.Send( "#BRL", ".[#98FB98]Ola e bem-vindo ao servidor [#FFFF00]" + p+ "[#98FB98], Esse nick ja foi registrado faz [#00FFFF]" + dias+ " dias[#98FB98], Se voce nao registrou ele, mude o nick e volte para poder jogar");
  723. StaffMessage("Testeado correctamente (PORTUGUES) ");
  724. }
  725. }
  726. }
  727.  
  728. else if ( cmd == "!helpercmds" )
  729. {
  730. StaffMessage(" !Bienvenido, !nickregistrado, !carros, !props, !helplogin");
  731. }
  732.  
  733. else if ( cmd == "!me" )
  734. {
  735. BRLMessage(text + " ( "+ user +" )");
  736. }
  737.  
  738. else if ( cmd == "!carros" )
  739. {
  740. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  741. local p = ( GetTok( text, " ", 1 ) );
  742. local idioma = (GetTok( text," ", 2) );
  743.  
  744. if ( !text ) StaffNotice( sintaxe + cmd + " <nick> <idioma> <dias>", player );
  745. else
  746. {
  747. local p = ( GetTok( text, " ", 1 ) );
  748. local idioma = (GetTok( text," ", 2) );
  749. if ( idioma == "es" )
  750. {
  751.  
  752. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar vehiculos. 13By ( "+ user +" ) \n");
  753. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98], Los carros se compran en [#00FFFF]Sunshine Car[#98FB98], el carro mas barato tiene un costo de 110k.");
  754. StaffMessage("Testeado correctamente (ESPAÑOL)");
  755. }
  756. if ( idioma == "en" )
  757. {
  758.  
  759. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar vehiculos. 13By ( "+ user +" ) \n");
  760. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98] You can buy the cars in [#00FFFF]Sunshine Car[#98FB98], The cheapest car has a cost of 110k.");
  761. StaffMessage("Testeado correctamente (INGLES)");
  762. }
  763. if ( idioma == "pt" )
  764. {
  765.  
  766. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar vehiculos. 13By ( "+ user +" ) \n");
  767.  
  768. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98] Voce pode comprar os veiculos em [#00FFFF]Sunshine Car[#98FB98], o mais barato custa 110k.");
  769. StaffMessage("Testeado correctamente (PORTUGUES) ");
  770. }
  771. }
  772. }
  773. else if ( cmd == "!props" )
  774. {
  775. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  776. local p = ( GetTok( text, " ", 1 ) );
  777. local idioma = (GetTok( text," ", 2) );
  778.  
  779. if ( !text ) StaffNotice( sintaxe + cmd + " <nick> <idioma> <dias>", player );
  780. else
  781. {
  782. if ( idioma == "es" )
  783. {
  784.  
  785. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar propiedades. 13By ( "+ user +" ) \n");
  786. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98], Las carros se compran si estan en [#00FFFF]OFERTA[#98FB98] o comprandonselas a otros [#00FFFF]Jugadores[#98FB98], Necesitas minimo 150k.");
  787. StaffMessage("Testeado correctamente (ESPAÑOL)");
  788. BRLMessage("Al Usuario " + p+ " se le informo como comprar Propiedades. Mensaje Enviado Correctamente. By ( "+ user +" )");
  789. }
  790. if ( idioma == "en" )
  791. {
  792.  
  793. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar propiedades. 13By ( "+ user +" ) \n");
  794. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98] You can buy the cars in [#00FFFF]Sunshine Car[#98FB98], The cheapest car has a cost of 110k.");
  795. StaffMessage("Testeado correctamente (INGLES)");
  796. BRLMessage("Al Usuario " + p+ " se le informo como comprar Propiedades. Mensaje Enviado Correctamente. By ( "+ user +" )");
  797. }
  798. if ( idioma == "pt" )
  799. {
  800.  
  801. _IRC.Send( "#BRL", "7Al Usuario 12" + p+ " 7se le informo como comprar propiedades. 13By ( "+ user +" ) \n");
  802.  
  803. _IRC.Send( "#BRL", ".[#98FB98][#FFFF00]" + p+ "[#98FB98] Voce pode comprar as veiculos em [#00FFFF]Sunshine Car[#98FB98], o mais barato custa 110k.");
  804. StaffMessage("Testeado correctamente (PORTUGUES) ");
  805. BRLMessage("Al Usuario " + p+ " se le informo como comprar Propiedades. Mensaje Enviado Correctamente. By ( "+ user +" )");
  806. }
  807. }
  808. }
  809. else if ( cmd == "!unbanip" )
  810. {
  811. if ( level < 2 ) StaffMessage("[Erro] - Voce nao tem acesso a este comando.");
  812. else if ( !text ) StaffNotice( user, "13[Sintaxe] - " + cmd + " <Ip>" );
  813. else
  814. {
  815. UnbanIP("" + text + "");
  816. StaffMessage("6Admin0 " + user + " 6desbaniu o ip0 -> " + text +" ");
  817. }
  818. }
  819. else if ( cmd == "!cmds" )
  820. {
  821. if ( level < 2 ) StaffMessage( user, "4[Erro] - Voce nao tem acesso a este comando." );
  822. else StaffNotice( user, "12!exe, !ip, !kick, !lockserver, !unlockserver, !ban, !unban, !reload, !setlevel, !drown, !salvartudo, !banlist, !cp, !dp, !sban, !banuid, !unbanuid, warn, warnstaff." );
  823. }
  824.  
  825. else if ( cmd == "!ip")
  826. {
  827. if( level < 3 ) StaffNotice( user, ICOL_RED + "4[Erro] - Voce nao tem acesso a este comando." );
  828. else if ( !text ) StaffNotice( user, ICOL_RED + "[Sintaxe] - !ip <Nick/ID>" );
  829. else
  830. {
  831. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  832. if (!plr) StaffNotice( user, "[Erro] - Jogador Desconhecido." );
  833. else StaffNotice( user, "7IP de0 " + plr.Name + "7: [ " + plr.IP + " ]." );
  834. }
  835. }
  836.  
  837. else if(cmd=="!sban")
  838. {
  839. if ( level < 2 ) StaffMessage( user, "4[Erro] - Voce nao tem acesso a este comando." );
  840. else if (!text) EchoNotice( user,"[Syntax] - /" + cmd + " <Nick Full> <Motivo>");
  841. else
  842. {
  843. local plr = GetPlayer(GetTok(text, " ", 1));
  844. local playerJ = GetTok( text, " ", 1);
  845. local motivo = GetTok(text, " ", 2 NumTok(text, " "));
  846. local q = QuerySQL(db, "SELECT * FROM Contas WHERE Nome='" + playerJ + "'");
  847. local q2 = QuerySQL(db, "SELECT * FROM Bans WHERE Nome='" + playerJ + "'");
  848. if (GetSQLColumnData(q, 0) != playerJ) EchoNotice(user,"[Error] - " + playerJ + "'s Conta nao existe.", player);
  849. else if ( GetSQLColumnData(q ,0 ) == null ) EchoNotice( user,"Esse jogador nao existe.")
  850. else if (plr) EchoNotice( user,"[ATT-BAN] O Jogador esta online. use !ban "+plr+".")
  851. else if(!motivo)EchoNotice( user,"[ERROR] Voce deve colocar o motivo.")
  852. else if (GetSQLColumnData(q2, 0) == playerJ) EchoNotice(user,"[BAN] "+playerJ+" ja esta banido.")
  853. else
  854. {
  855. QuerySQL(db, "SELECT * FROM Contas WHERE Name='" + playerJ + "'");
  856. local name = GetSQLColumnData(q, 0), Ip = GetSQLColumnData(q, 1), UID = GetSQLColumnData(q, 2), Cash = GetSQLColumnData(q, 4), bank = GetSQLColumnData(q, 5), Level = GetSQLColumnData(q,6), Reg = GetSQLColumnData(q,7)
  857.  
  858. QuerySQL( db, "INSERT INTO Bans ( Nome, UID, Admin, Motivo, Data ) VALUES ( '" + name + "', '" + UID + "', '" + user + "', '"+motivo+"', '" + GetFullTime() + "' )" );
  859. ADMIN( user + " baniu " + name + " Motivo: "+motivo+"" );
  860. }
  861. }
  862. }
  863.  
  864. else if ( cmd == "!banuid" )
  865. {
  866. if ( level < 4 ) EchoNotice( user,"Usted no tiene acceso a este comando.");
  867. else if(!text || NumTok(text, " ") < 3) EchoNotice(user,"Error: Use /"+cmd+" <player> <days 1 - 100> <reason>");
  868. else
  869. {
  870. local now = date();
  871. local dat = now.day + "/" + now.month + "/" + now.year + " " + now.hour + ":" + now.min + ":" + now.sec;
  872. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  873. local reason = GetTok(text, " ", 3 NumTok(text, " "));
  874. if ( !plr ) EchoNotice( user,"Jugador Desconocido.");
  875. else if ( level < status[ plr.ID ].Level ) EchoNotice( user,"Usted no puede banear a alguien con nivel superior a usted." );
  876. else
  877. {
  878. QuerySQL( db, "INSERT INTO UIDs ( NOMBRE, UID, UID2, IP, ADMIN, DATA, TIME, RAZON ) VALUES ( '" + plr.Name + "', '" + plr.UniqueID + "', '" + plr.UID2 + "', '"+plr.IP+"', '"+user+"', '" + dat + "', '"+addbantime(GetTok(text, " ", 2).tointeger())+"', '"+reason+"' )")
  879. Message("[#00FFFF][BAN-UID] [#00FFFF]"+user+" [#FFFFFF]prohibio a [#00FFFF]"+plr.Name+" [#FFFFFF]Dias: [#00FFFF]"+(GetTok(text, " ", 2).tointeger())+" [#FFFFFF]razon: [#00FFFF]"+reason+"." )
  880. EchoMessage("4[BAN-UID] "+user+" prohibio a "+plr.Name+" Dias: "+(GetTok(text, " ", 2).tointeger())+" razon: "+reason+"." )
  881. plr.Kick();
  882. }
  883. }
  884. }
  885.  
  886. else if ( cmd == "!unbanuid" )
  887. {
  888. local q = QuerySQL(db, "SELECT * FROM UIDs WHERE NOMBRE='" + text + "'" );
  889. if ( level < 4 ) EchoNotice( user,"Error - Tu level no es acto para este comando." );
  890. else if ( !text ) EchoNotice( user,"Error Syntax: " + cmd + " <nombre completo>");
  891. else if ( GetSQLColumnData( q, 0 ) != text ) EchoMessage(user,text + " el no esta baneado.");
  892. else
  893. {
  894. QuerySQL( db, "DELETE FROM UIDs WHERE NOMBRE LIKE '" + text + "'" );
  895. MSG( "[#00FFFF][PACK-UNBANNED] [#FFFFFF]Admin [#00FFFF]" + user + " [#FFFFFF]Quito prohibicion a " + text + "." );
  896. EchoMessage( "4>> [UNBAN] " + user + " quito prohibicion de UID a " + text + "." );
  897. }
  898. }
  899.  
  900. else if ( cmd == "!uid")
  901. {
  902. if( level < 3 ) StaffNotice( user, ICOL_RED + "4[Erro] - Voce nao tem acesso a este comando." );
  903. else if ( !text ) StaffNotice( user, ICOL_RED + "[Sintaxe] - !uid <Nick/ID>" );
  904. else
  905. {
  906. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  907. if (!plr) Staffnotice( user, "[Erro] - Jogador Desconhecido." );
  908. else StaffNotice( user, ICOL_BLUE + "IP de " + plr.Name + ": [ " + plr.UniqueID + " ]." );
  909. }
  910. }
  911.  
  912. else if ( cmd == "!drown" )
  913. {
  914. if( level < 3 ) StaffNotice( user, ICOL_RED + "4[Erro] - Voce nao tem acesso a este comando." );
  915. else if ( !text ) StaffNotice( user, ICOL_RED + "[Sintaxe] - 4!drown <Nick/ID> <Motivo> " );
  916. else
  917. {
  918. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  919. if ( !plr ) StaffNotice( user, "4Error - Jogador Desconhecido.", player );
  920. else
  921. {
  922. local msg = GetTok( text, " ", 2, NumTok( text, " " ) );
  923. if ( !msg ) StaffNotice( user, "4Erro - Qual o motivo?" );
  924. else
  925. {
  926. ADMIN( user + " Afogou o Jogador " + plr.Name +". Motivo: " + msg + " " );
  927. plr.Pos = Vector( 283.521 , -1574.3 , 7.19846 );
  928. }
  929. }
  930. }
  931. }
  932. else if ( cmd == "!warn" )
  933. {
  934. if ( level < 4 ) StaffMessage( "4[Erro] - Voce nao tem acesso a este comando." );
  935. else if ( !text ) StaffMessage( "9[Sintaxe] - !warn <Nick/ID> <Motivo>");
  936. else
  937. {
  938. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  939. if ( !plr ) StaffMessage("4Jogador Desconhecido." );
  940. else
  941. {
  942. local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
  943. if ( reason == null ) reason = "4Nenhum";
  944. status[ plr.ID ].Warns ++;
  945. if ( status[ plr.ID ].Warns == 5 ) Ban( "Server", plr, "[5/5] Warns" );
  946. I_MSG("Maximo de warns sao 5, cuidado para nao ser banido. [" + status[ plr.ID ].Warns + "/5]", plr );
  947. ADMIN( user + " advertiu o jogador " + plr.Name + " Motivo: " + reason + ". [" + status[ plr.ID ].Warns + "/5]");
  948. }
  949. }
  950. }
  951.  
  952. else if ( cmd == "!warnstaff" )
  953. {
  954. if ( level < 4 ) StaffMessage( "4[Erro] - Voce nao tem acesso a este comando." );
  955. else if ( !text ) StaffMessage( "9[Sintaxe] - !warnstaff <Nick/ID> <Motivo>");
  956. else
  957. {
  958. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  959. if ( !plr ) StaffMessage("4Jogador Desconhecido." );
  960. else
  961. {
  962. local motivo = GetTok( text, " ", 2 NumTok( text, " " ) );
  963. if ( motivo == null ) motivo = "Nenhum";
  964. if ( status[ plr.ID ].Level <= 2 ) StaffMessage("Jogador nao e administrador");
  965. status[ plr.ID ].warn_staff ++;
  966. if ( status[ plr.ID ].warn_staff == 5 ) status[ plr.ID ].Level = 1;
  967. I_MSG("Maximo de warns sao 5, voce pode ser removido da staff. [" + status[ plr.ID ].warn_staff + "/5]", plr );
  968. ADMIN( user + " advertiu o jogador " + plr.Name + " no cargo administrativo. Motivo: " + motivo + ". [" + status[ plr.ID ].warn_staff + "/5]");
  969. }
  970. }
  971. }
  972. }
  973. }
  974.  
  975. function EchoNotice( nick, text )
  976. {
  977. FBS_BOT.Send( "NOTICE " + nick + " " + text + "\n" );
  978. }
  979.  
  980. function EchoMessage( text )
  981. {
  982. FBS_BOT.Send( "PRIVMSG " + FBS_CHAN + " :" + text + "\n" );
  983. }
  984.  
  985. function StaffNotice( nick, text )
  986. {
  987. FBS_BOT.Send( "NOTICE " + nick + " " + text + "\n" );
  988. }
  989.  
  990. function StaffMessage( text )
  991. {
  992.  
  993. FBS_BOT.Send( "PRIVMSG " + FBS_SCHAN + " :" + text + "\n" );
  994. }
  995. function BRLMessage ( text )
  996. {
  997. _IRC <- { function Join(n="*"){ FBS_BOT.Send( "JOIN " + n + "\n" ); }, function Send(c,m) { FBS_BOT.Send( "PRIVMSG " + c + " " + m + "\n" ); } };
  998.  
  999. _IRC.Send( "#BRL", text);
  1000. }
  1001.  
  1002. function FBSSortNicks( szList )
  1003. {
  1004. local a = NumTok( szList, " " );
  1005. local NickList = GetTok( szList, " ", 6, a ), i = 1;
  1006.  
  1007. FBS_NICKS <- array( 50, null );
  1008.  
  1009. while( GetTok( NickList, " ", i ) != "366" )
  1010. {
  1011. local levelnick = GetTok( NickList, " ", i ), nick = levelnick.slice( 1 ), level = levelnick.slice( 0, 1 );
  1012.  
  1013. if ( level == ":" ) { level = nick.slice( 0, 1 ); nick = nick.slice( 1 ); }
  1014.  
  1015. if ( level == "+" ) AddNewNick( nick, 2 );
  1016. else if ( level == "%" ) AddNewNick( nick, 3 );
  1017. else if ( level == "@" ) AddNewNick( nick, 4 );
  1018. else if ( level == "&" ) AddNewNick( nick, 5 );
  1019. else if ( level == "~" ) AddNewNick( nick, 7 );
  1020. else AddNewNick( nick, 1 );
  1021. i ++;
  1022. }
  1023. }
  1024.  
  1025. function AddNewNick( szName, iLevel )
  1026. {
  1027. local i = FindFreeNickSlot();
  1028.  
  1029. if ( i != -1 )
  1030. {
  1031. FBS_NICKS[ i ] = FBSLIST();
  1032. FBS_NICKS[ i ].AddNick( szName, iLevel );
  1033. }
  1034. }
  1035.  
  1036. function FindFreeNickSlot()
  1037. {
  1038. for ( local i = 0; i < FBS_NICKS.len(); i++ )
  1039. {
  1040. if ( !FBS_NICKS[ i ] ) return i;
  1041. }
  1042. return -1;
  1043. }
  1044.  
  1045. function FindNick( szName )
  1046. {
  1047. for ( local i = 0; i < FBS_NICKS.len(); i++ )
  1048. {
  1049. if ( FBS_NICKS[ i ] )
  1050. {
  1051. if ( FBS_NICKS[ i ].Name == szName ) return FBS_NICKS[ i ];
  1052. }
  1053. }
  1054. return null;
  1055.  
  1056. function GetIRCLevel( Level )
  1057. {
  1058. local Name = "User";
  1059. switch( Level )
  1060. {
  1061. case 1:
  1062. Name = "User";
  1063. break;
  1064. case 2:
  1065. Name = "Helper";
  1066. break;
  1067. case 3:
  1068. Name = "Half-Op";
  1069. break;
  1070. case 4:
  1071. Name = "Op";
  1072. break;
  1073. case 5:
  1074. Name = "Manager";
  1075. break;
  1076. case 6:
  1077. Name = "Owner";
  1078. break;
  1079. }
  1080. return Name;
  1081. }
  1082.  
  1083. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement