Guest User

Untitled

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