Advertisement
Guest User

Untitled

a guest
May 27th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.82 KB | None | 0 0
  1. //--CONFIG--[EDIT THIS]-----------------------------
  2.  
  3. #define EchoBot "USC-BOT" //your bots name
  4. #define EchoServer "79.99.128.203" //irc hoster
  5. #define EchoChan "#usc" //server channel
  6. #define EchoPort 6667 //this port is used by default
  7. #define CmdChar '!' //used for commands, as in !ikick
  8.  
  9. //--CONFIG--END--[NO NEED TO EDIT PAST THIS POINT]--
  10.  
  11. #include <a_samp>
  12. #include <a_irc>
  13.  
  14. #pragma unused sztmp
  15.  
  16. #define yellow 0xFFFF00AA
  17. #define red 0xFF0000AA
  18. #define white 0xFFFFFFFF
  19.  
  20. forward ircOnConnect(conn);
  21. forward ircOnUserSay(conn, channel[], user[], message[]);
  22. forward ircOnUserPart(conn, channel[], user[]);
  23. forward ircOnUserJoin(conn, channel[], user[]);
  24.  
  25. forward EventTimer(); //do not remove
  26.  
  27. forward ircConn();
  28. forward ircJoin(conn);
  29.  
  30. new EchoConnection;
  31.  
  32. new wire[MAX_PLAYERS];
  33. new jail[MAX_PLAYERS];
  34.  
  35. //connection crap
  36.  
  37. public OnFilterScriptInit()
  38. {
  39. SetTimer("ircConn", 10000, 0);
  40. SetTimer("EventTimer", 500, 1);
  41. return 1;
  42. }
  43.  
  44. public OnFilterScriptExit()
  45. {
  46. ircDisconnect(EchoConnection);
  47. return 1;
  48. }
  49.  
  50. public ircOnConnect(conn)
  51. {
  52. SetTimerEx("ircJoin", 10000, 0, "i", conn);
  53. return 1;
  54. }
  55.  
  56. public ircConn()
  57. {
  58. new string[100];
  59. format(string, sizeof(string), "a%d", random(50));
  60. EchoConnection = ircConnect(EchoServer, EchoPort, string);
  61. return 1;
  62. }
  63.  
  64. public ircJoin(conn)
  65. {
  66. new string[256];
  67. ircJoinChan(conn, EchoChan);
  68. format(string, sizeof(string), "nick %s", EchoBot);
  69. ircSendRawData(conn, string);
  70. return 1;
  71. }
  72.  
  73. public EventTimer()
  74. {
  75. ircPollEvents();
  76. return 1;
  77. }
  78.  
  79. //connection crap end
  80.  
  81. //irc crap
  82.  
  83. public ircOnUserSay(conn, channel[], user[], message[])
  84. {
  85. new string[256];
  86. format(string, sizeof(string), "[IRC]%s: %s", user, message);
  87. SendClientMessageToAll(white, string);
  88.  
  89. if(message[0] == CmdChar)
  90. {
  91. irccmd(ikick, 5, conn, channel, user, message);
  92. irccmd(crash, 5, conn, channel, user, message);
  93. irccmd(iban, 4, conn, channel, user, message);
  94. irccmd(rangeban, 8, conn, channel, user, message);
  95. irccmd(wire, 4, conn, channel, user, message);
  96. irccmd(unwire, 6, conn, channel, user, message);
  97. irccmd(ann, 3, conn, channel, user, message);
  98. irccmd(getinfo, 7, conn, channel, user, message);
  99. irccmd(jail, 4, conn, channel, user, message);
  100. irccmd(unjail, 6, conn, channel, user, message);
  101. irccmd(getid, 5, conn, channel, user, message);
  102. irccmd(gmx, 3, conn, channel, user, message);
  103. irccmd(clearchat, 9, conn, channel, user, message);
  104. irccmd(slap, 4, conn, channel, user, message);
  105. irccmd(freeze, 6, conn, channel, user, message);
  106. irccmd(unfreeze, 8, conn, channel, user, message);
  107. irccmd(tele, 4, conn, channel, user, message);
  108. irccmd(eject, 5, conn, channel, user, message);
  109. irccmd(sethealth, 9, conn, channel, user, message);
  110. irccmd(disarm, 6, conn, channel, user, message);
  111. irccmd(explode, 7, conn, channel, user, message);
  112. irccmd(givemoney, 9, conn, channel, user, message);
  113. irccmd(setscore, 8, conn, channel, user, message);
  114. irccmd(setname, 7, conn, channel, user, message);
  115. irccmd(akill, 5, conn, channel, user, message);
  116. irccmd(giveweapon, 10, conn, channel, user, message);
  117. irccmd(players, 7, conn, channel, user, message);
  118. }
  119. return 1;
  120. }
  121.  
  122. //end of irc crap
  123.  
  124. //commands
  125.  
  126. irccmd_ikick(conn, channel[], user[], message[])
  127. {
  128. new tmp[256];
  129. tmp = zcmd(1, message);
  130.  
  131. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  132. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  133. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  134.  
  135. new oname[MAX_PLAYER_NAME];
  136. GetPlayerName(strval(tmp), oname, sizeof(oname));
  137.  
  138. new string[256];
  139. format(string, sizeof(string), "\"%s\" has been kicked from the game by IRC admin \"%s\"", oname, user);
  140.  
  141. SendClientMessageToAll(yellow, string);
  142. ircSay(conn, channel, string);
  143.  
  144. Kick(strval(tmp));
  145. return 1;
  146. }
  147.  
  148. irccmd_crash(conn, channel[], user[], message[])
  149. {
  150. new tmp[256];
  151. tmp = zcmd(1, message);
  152.  
  153. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  154. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  155. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  156.  
  157. new oname[MAX_PLAYER_NAME];
  158. GetPlayerName(strval(tmp), oname, sizeof(oname));
  159.  
  160. new string[256];
  161. format(string, sizeof(string), "\"%s\" has been crashed from the game by IRC admin \"%s\"", oname, user);
  162.  
  163. SendClientMessageToAll(yellow, string);
  164. ircSay(conn, channel, string);
  165.  
  166. new Float:X, Float:Y, Float:Z;
  167. GetPlayerPos(strval(tmp), X, Y, Z);
  168.  
  169. new objectcrash = CreatePlayerObject(strval(tmp), 11111111, X, Y, Z, 0, 0, 0); // credits to ThePro
  170. DestroyObject(objectcrash);
  171. return 1;
  172. }
  173.  
  174. irccmd_iban(conn, channel[], user[], message[])
  175. {
  176. new tmp[256];
  177. tmp = zcmd(1, message);
  178.  
  179. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  180. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  181. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  182.  
  183. new oname[MAX_PLAYER_NAME];
  184. GetPlayerName(strval(tmp), oname, sizeof(oname));
  185.  
  186. new string[256];
  187. format(string, sizeof(string), "\"%s\" has been banned from the game by IRC admin \"%s\"", oname, user);
  188.  
  189. SendClientMessageToAll(yellow, string);
  190. ircSay(conn, channel, string);
  191.  
  192. Ban(strval(tmp));
  193. return 1;
  194. }
  195.  
  196. irccmd_rangeban(conn, channel[], user[], message[])
  197. {
  198. new tmp[256];
  199. tmp = zcmd(1, message);
  200.  
  201. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  202. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  203. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  204.  
  205. new oname[MAX_PLAYER_NAME];
  206. GetPlayerName(strval(tmp), oname, sizeof(oname));
  207.  
  208. new string[256];
  209. format(string, sizeof(string), "\"%s\" has been range banned from the game by IRC admin \"%s\"", oname, user);
  210.  
  211. SendClientMessageToAll(yellow, string);
  212. ircSay(conn, channel, string);
  213.  
  214. RangeBan(strval(tmp));
  215. return 1;
  216. }
  217.  
  218. irccmd_wire(conn, channel[], user[], message[])
  219. {
  220. new tmp[256];
  221. tmp = zcmd(1, message);
  222.  
  223. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  224. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  225. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  226.  
  227. new oname[MAX_PLAYER_NAME];
  228. GetPlayerName(strval(tmp), oname, sizeof(oname));
  229.  
  230. wire[strval(tmp)] == 1;
  231.  
  232. new string[256];
  233. format(string, sizeof(string), "\"%s\" has been wired by admin \"%s\"", oname, user);
  234.  
  235. SendClientMessageToAll(yellow, string);
  236. ircSay(conn, channel, string);
  237. return 1;
  238. }
  239.  
  240. irccmd_unwire(conn, channel[], user[], message[])
  241. {
  242. new tmp[256];
  243. tmp = zcmd(1, message);
  244.  
  245. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  246. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  247. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  248.  
  249. new oname[MAX_PLAYER_NAME];
  250. GetPlayerName(strval(tmp), oname, sizeof(oname));
  251.  
  252. wire[strval(tmp)] == 0;
  253.  
  254. new string[256];
  255. format(string, sizeof(string), "\"%s\" has been unwired by admin \"%s\"", oname, user);
  256.  
  257. SendClientMessageToAll(yellow, string);
  258. ircSay(conn, channel, string);
  259. return 1;
  260. }
  261.  
  262. irccmd_ann(conn, channel[], user[], message[])
  263. {
  264. new tmp[256];
  265. tmp = zcmd(1, message);
  266.  
  267. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  268. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in a msg");
  269.  
  270. new string[256];
  271. format(string, sizeof(string), "%s", message[6]);
  272. GameTextForAll(string, 5000, 3);
  273. return 1;
  274. }
  275.  
  276. irccmd_getinfo(conn, channel[], user[], message[])
  277. {
  278. new tmp[256];
  279. tmp = zcmd(1, message);
  280.  
  281. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  282. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  283. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  284.  
  285. new oname[MAX_PLAYER_NAME];
  286. GetPlayerName(strval(tmp), oname, sizeof(oname));
  287.  
  288. new string[256];
  289.  
  290. format(string, sizeof(string), "Name: %s", oname);
  291. ircSay(conn, channel, string);
  292.  
  293. format(string, sizeof(string), "ID: %d", strval(tmp));
  294. ircSay(conn, channel, string);
  295.  
  296. format(string, sizeof(string), "Cash: %d", GetPlayerMoney(strval(tmp)));
  297. ircSay(conn, channel, string);
  298.  
  299. format(string, sizeof(string), "Score: %d", GetPlayerScore(strval(tmp)));
  300. ircSay(conn, channel, string);
  301. return 1;
  302. }
  303.  
  304. irccmd_jail(conn, channel[], user[], message[])
  305. {
  306. new tmp[256];
  307. tmp = zcmd(1, message);
  308.  
  309. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  310. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  311. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  312.  
  313. new oname[MAX_PLAYER_NAME];
  314. GetPlayerName(strval(tmp), oname, sizeof(oname));
  315.  
  316. jail[strval(tmp)] = 1;
  317.  
  318. TeleportPlayer(strval(tmp), 197.6661,173.8179,1003.0234, 0, 3); //location credits to XtremeAdmin2
  319. SetPlayerHealth(strval(tmp), 100);
  320.  
  321. new string[256];
  322. format(string, sizeof(string), "\"%s\" has been jailed by admin \"%s\"", oname, user);
  323.  
  324. SendClientMessageToAll(yellow, string);
  325. ircSay(conn, channel, string);
  326. return 1;
  327. }
  328.  
  329. irccmd_unjail(conn, channel[], user[], message[])
  330. {
  331. new tmp[256];
  332. tmp = zcmd(1, message);
  333.  
  334. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  335. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  336. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  337.  
  338. new oname[MAX_PLAYER_NAME];
  339. GetPlayerName(strval(tmp), oname, sizeof(oname));
  340.  
  341. jail[strval(tmp)] = 0;
  342.  
  343. SetPlayerHealth(strval(tmp), 0);
  344.  
  345. new string[256];
  346. format(string, sizeof(string), "\"%s\" has been unjailed by admin \"%s\"", oname, user);
  347.  
  348. SendClientMessageToAll(yellow, string);
  349. ircSay(conn, channel, string);
  350. return 1;
  351. }
  352.  
  353. irccmd_getid(conn, channel[], user[], message[])
  354. {
  355. new tmp[256], id;
  356. tmp = zcmd(1, message);
  357.  
  358. id = GetPlayerIDFromName(tmp);
  359.  
  360. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  361. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not give a name");
  362. if(id == -1) return ircSay(conn, channel, "That player name was not found");
  363.  
  364. new pname[MAX_PLAYER_NAME];
  365. GetPlayerName(strval(tmp), pname, sizeof(pname));
  366.  
  367. new string[256];
  368. format(string, sizeof(string), "%s: %d", pname, id);
  369.  
  370. ircSay(conn, channel, string);
  371. return 1;
  372. }
  373.  
  374. irccmd_gmx(conn, channel[], user[], message[])
  375. {
  376. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  377.  
  378. new string[256];
  379. format(string, sizeof(string), "IRC admin \"%s\" has done a /GMX (server restart)", user);
  380.  
  381. SendClientMessageToAll(yellow, string);
  382. ircSay(conn, channel, string);
  383.  
  384. #pragma unused message
  385. return 1;
  386. }
  387.  
  388. irccmd_clearchat(conn, channel[], user[], message[])
  389. {
  390. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  391.  
  392. new string[256];
  393. format(string, sizeof(string), "IRC admin \"%s\" has cleared the chat", user);
  394.  
  395. SendClientMessageToAll(yellow, string);
  396. ircSay(conn, channel, string);
  397.  
  398. #pragma unused message
  399. return 1;
  400. }
  401.  
  402. irccmd_slap(conn, channel[], user[], message[])
  403. {
  404. new tmp[256];
  405. tmp = zcmd(1, message);
  406.  
  407. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  408. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  409. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  410.  
  411. new Float:x, Float:y, Float:z;
  412. GetPlayerPos(strval(tmp), x, y, z);
  413. SetPlayerPos(strval(tmp), x, y, z + 10);
  414.  
  415. new oname[MAX_PLAYER_NAME];
  416. GetPlayerName(strval(tmp), oname, sizeof(oname));
  417.  
  418. new string[256];
  419. format(string, sizeof(string), "\"%s\" has been slapped by IRC admin \"%s\"", oname, user);
  420.  
  421. SendClientMessageToAll(yellow, string);
  422. ircSay(conn, channel, string);
  423. return 1;
  424. }
  425.  
  426. irccmd_freeze(conn, channel[], user[], message[])
  427. {
  428. new tmp[256];
  429. tmp = zcmd(1, message);
  430.  
  431. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  432. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  433. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  434.  
  435. TogglePlayerControllable(strval(tmp), 0);
  436.  
  437. new oname[MAX_PLAYER_NAME];
  438. GetPlayerName(strval(tmp), oname, sizeof(oname));
  439.  
  440. new string[256];
  441. format(string, sizeof(string), "\"%s\" has been frozen by IRC admin \"%s\"", oname, user);
  442.  
  443. SendClientMessageToAll(yellow, string);
  444. ircSay(conn, channel, string);
  445. return 1;
  446. }
  447.  
  448. irccmd_unfreeze(conn, channel[], user[], message[])
  449. {
  450. new tmp[256];
  451. tmp = zcmd(1, message);
  452.  
  453. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  454. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  455. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  456.  
  457. TogglePlayerControllable(strval(tmp), 0);
  458.  
  459. new oname[MAX_PLAYER_NAME];
  460. GetPlayerName(strval(tmp), oname, sizeof(oname));
  461.  
  462. new string[256];
  463. format(string, sizeof(string), "\"%s\" has been unfrozen by IRC admin \"%s\"", oname, user);
  464.  
  465. SendClientMessageToAll(yellow, string);
  466. ircSay(conn, channel, string);
  467. return 1;
  468. }
  469.  
  470. irccmd_tele(conn, channel[], user[], message[])
  471. {
  472. new tmp[256], tmp2[256];
  473. tmp = zcmd(1, message);
  474. tmp2 = zcmd(2, message);
  475.  
  476. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  477. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in the first id");
  478. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "The first player is not connected");
  479. if(strlen(tmp2) == 0) return ircSay(conn, channel, "You did not put in the second id");
  480. if(IsPlayerConnected(strval(tmp2)) == 0) return ircSay(conn, channel, "The second player is not connected");
  481.  
  482. new Float:X, Float:Y, Float:Z;
  483. GetPlayerPos(strval(tmp2), X, Y, Z);
  484. Teleport(strval(tmp), X, Y, Z + 2, random(360), GetPlayerInterior(strval(tmp2)));
  485.  
  486. new oname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
  487. GetPlayerName(strval(tmp), pname, sizeof(pname));
  488. GetPlayerName(strval(tmp2), oname, sizeof(oname));
  489.  
  490. new string[256];
  491. format(string, sizeof(string), "\"%s\" has been teled to \"%s\" by IRC admin \"%s\"", pname, oname, user);
  492.  
  493. SendClientMessageToAll(yellow, string);
  494. ircSay(conn, channel, string);
  495. return 1;
  496. }
  497.  
  498. irccmd_eject(conn, channel[], user[], message[])
  499. {
  500. new tmp[256];
  501. tmp = zcmd(1, message);
  502.  
  503. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  504. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  505. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  506.  
  507. RemovePlayerFromVehicle(strval(tmp));
  508.  
  509. new oname[MAX_PLAYER_NAME];
  510. GetPlayerName(strval(tmp), oname, sizeof(oname));
  511.  
  512. new string[256];
  513. format(string, sizeof(string), "\"%s\" has been ejected by IRC admin \"%s\"", oname, user);
  514.  
  515. SendClientMessageToAll(yellow, string);
  516. ircSay(conn, channel, string);
  517. return 1;
  518. }
  519.  
  520. irccmd_sethealth(conn, channel[], user[], message[])
  521. {
  522. new tmp[256], tmp2[256], Float:health;
  523. tmp = zcmd(1, message);
  524. tmp2 = zcmd(2, message);
  525.  
  526. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  527. if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /sethealth [ID] [HEALTH]");
  528. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  529. if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /sethealth [ID] [HEALTH]");
  530.  
  531. health = strval(tmp2);
  532.  
  533. SetPlayerHealth(strval(tmp), health);
  534.  
  535. new oname[MAX_PLAYER_NAME];
  536. GetPlayerName(strval(tmp), oname, sizeof(oname));
  537.  
  538. new string[256];
  539. format(string, sizeof(string), "\"%s\" has had his health set to \"%0.0f\" by IRC admin \"%s\"", oname, health, user);
  540.  
  541. SendClientMessageToAll(yellow, string);
  542. ircSay(conn, channel, string);
  543. return 1;
  544. }
  545.  
  546. irccmd_disarm(conn, channel[], user[], message[])
  547. {
  548. new tmp[256];
  549. tmp = zcmd(1, message);
  550.  
  551. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  552. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  553. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  554.  
  555. ResetPlayerWeapons(strval(tmp));
  556.  
  557. new oname[MAX_PLAYER_NAME];
  558. GetPlayerName(strval(tmp), oname, sizeof(oname));
  559.  
  560. new string[256];
  561. format(string, sizeof(string), "\"%s\" has had his weapons reset by IRC admin \"%s\"", oname, user);
  562.  
  563. SendClientMessageToAll(yellow, string);
  564. ircSay(conn, channel, string);
  565. return 1;
  566. }
  567.  
  568. irccmd_explode(conn, channel[], user[], message[])
  569. {
  570. new tmp[256];
  571. tmp = zcmd(1, message);
  572.  
  573. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  574. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  575. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  576.  
  577. new Float:x, Float:y, Float:z;
  578. GetPlayerPos(strval(tmp), x, y, z);
  579. CreateExplosion(x, y, z, 10, 0);
  580.  
  581. new oname[MAX_PLAYER_NAME];
  582. GetPlayerName(strval(tmp), oname, sizeof(oname));
  583.  
  584. new string[256];
  585. format(string, sizeof(string), "\"%s\" has been exploded by IRC admin \"%s\"", oname, user);
  586.  
  587. SendClientMessageToAll(yellow, string);
  588. ircSay(conn, channel, string);
  589. return 1;
  590. }
  591.  
  592. irccmd_givemoney(conn, channel[], user[], message[])
  593. {
  594. new tmp[256], tmp2[256];
  595. tmp = zcmd(1, message);
  596. tmp2 = zcmd(2, message);
  597.  
  598. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  599. if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /givemoney [ID] [AMMOUNT]");
  600. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  601. if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /givemoney [ID] [AMMOUNT]");
  602.  
  603. GivePlayerMoney(strval(tmp), strval(tmp2));
  604.  
  605. new oname[MAX_PLAYER_NAME];
  606. GetPlayerName(strval(tmp), oname, sizeof(oname));
  607.  
  608. new string[256];
  609. format(string, sizeof(string), "\"%s\" has been given $%d by IRC admin \"%s\"", oname, strval(tmp2), user);
  610.  
  611. SendClientMessageToAll(yellow, string);
  612. ircSay(conn, channel, string);
  613. return 1;
  614. }
  615.  
  616. irccmd_setscore(conn, channel[], user[], message[])
  617. {
  618. new tmp[256], tmp2[256];
  619. tmp = zcmd(1, message);
  620. tmp2 = zcmd(2, message);
  621.  
  622. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  623. if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /setscore [ID] [AMMOUNT]");
  624. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  625. if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /setscore [ID] [AMMOUNT]");
  626.  
  627. SetPlayerScore(strval(tmp), strval(tmp2));
  628.  
  629. new oname[MAX_PLAYER_NAME];
  630. GetPlayerName(strval(tmp), oname, sizeof(oname));
  631.  
  632. new string[256];
  633. format(string, sizeof(string), "\"%s\"'s score has been set to %d by IRC admin \"%s\"", oname, strval(tmp2), user);
  634.  
  635. SendClientMessageToAll(yellow, string);
  636. ircSay(conn, channel, string);
  637. return 1;
  638. }
  639.  
  640. irccmd_setname(conn, channel[], user[], message[])
  641. {
  642. new tmp[256], tmp2[256];
  643. tmp = zcmd(1, message);
  644. tmp2 = zcmd(2, message);
  645.  
  646. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  647. if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /setname [ID] [NAME]");
  648. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  649. if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /setname [ID] [NAME]");
  650.  
  651. new oname[MAX_PLAYER_NAME];
  652. GetPlayerName(strval(tmp), oname, sizeof(oname));
  653.  
  654. new string[256];
  655. format(string, sizeof(string), "\"%s\"'s score has had his name set to \"%s\" by IRC admin \"%s\"", oname, tmp2, user);
  656.  
  657. SetPlayerName(strval(tmp), tmp2);
  658.  
  659. SendClientMessageToAll(yellow, string);
  660. ircSay(conn, channel, string);
  661. return 1;
  662. }
  663.  
  664. irccmd_akill(conn, channel[], user[], message[])
  665. {
  666. new tmp[256];
  667. tmp = zcmd(1, message);
  668.  
  669. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  670. if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
  671. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  672.  
  673. SetPlayerHealth(strval(tmp), 0);
  674.  
  675. new oname[MAX_PLAYER_NAME];
  676. GetPlayerName(strval(tmp), oname, sizeof(oname));
  677.  
  678. new string[256];
  679. format(string, sizeof(string), "\"%s\" has been killed by IRC admin \"%s\"", oname, user);
  680.  
  681. SendClientMessageToAll(yellow, string);
  682. ircSay(conn, channel, string);
  683. return 1;
  684. }
  685.  
  686. irccmd_giveweapon(conn, channel[], user[], message[])
  687. {
  688. new tmp[256], tmp2[256], tmp3[256];
  689. tmp = zcmd(1, message);
  690. tmp2 = zcmd(2, message);
  691. tmp3 = zcmd(3, message);
  692.  
  693. if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
  694. if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
  695. if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /giveweapon [ID] [WEPID] [AMMO]");
  696. if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /giveweapon [ID] [WEPID] [AMMO]");
  697. if(strlen(tmp3) == 0) return ircSay(conn, channel, "Use: /giveweapon [ID] [WEPID] [AMMO]");
  698.  
  699. GivePlayerWeapon(strval(tmp), strval(tmp2), strval(tmp3));
  700.  
  701. new oname[MAX_PLAYER_NAME];
  702. GetPlayerName(strval(tmp), oname, sizeof(oname));
  703.  
  704. new string[256];
  705. format(string, sizeof(string), "\"%s\"'s has been given weapon ID %d with %d ammo by IRC admin \"%s\"", oname, strval(tmp2), strval(tmp3), user);
  706.  
  707. SendClientMessageToAll(yellow, string);
  708. ircSay(conn, channel, string);
  709. return 1;
  710. }
  711.  
  712. irccmd_players(conn, channel[], user[], params[]) //made by Grove, taken from CYS Echo Bot 1.2
  713. {
  714. new count, PlayerNames[512], string[256];
  715. for(new i=0; i<=MAX_PLAYERS; i++)
  716. {
  717. if(IsPlayerConnected(i))
  718. {
  719. if(count == 0)
  720. {
  721. new PlayerName1[MAX_PLAYER_NAME];
  722. GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
  723. format(PlayerNames, sizeof(PlayerNames),"2%s1", PlayerName1);
  724. count++;
  725. }
  726. else
  727. {
  728. new PlayerName1[MAX_PLAYER_NAME];
  729. GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
  730. format(PlayerNames, sizeof(PlayerNames),"%s, 2%s1", PlayerNames, PlayerName1);
  731. count++;
  732. }
  733. }
  734. else { if(count == 0) format(PlayerNames, sizeof(PlayerNames), "1No Players Online!"); }
  735. }
  736.  
  737. new counter = 0;
  738. for(new i=0; i<=MAX_PLAYERS; i++)
  739. {
  740. if(IsPlayerConnected(i)) counter++;
  741. }
  742.  
  743. format(string, 256, "6Connected Players[%d]:1 %s", counter, PlayerNames);
  744. ircSay(conn, channel, string);
  745. #pragma unused params,user
  746. return true;
  747. }
  748.  
  749. //end of commands
  750.  
  751. //SA-MP functions
  752.  
  753. public OnPlayerConnect(playerid)
  754. {
  755. wire[playerid] = 0;
  756. jail[playerid] = 0;
  757.  
  758. new string[256], pname[MAX_PLAYER_NAME];
  759. GetPlayerName(playerid, pname, sizeof(pname));
  760. format(string, sizeof(string), "2%s has joined the server", pname);
  761. ircSay(EchoConnection, EchoChan, string);
  762. }
  763.  
  764. public OnPlayerDisconnect(playerid)
  765. {
  766. new string[256], pname[MAX_PLAYER_NAME];
  767. GetPlayerName(playerid, pname, sizeof(pname));
  768. format(string, sizeof(string), "2%s has left the server", pname);
  769. ircSay(EchoConnection, EchoChan, string);
  770. }
  771.  
  772. public OnPlayerText(playerid, text[])
  773. {
  774. if(wire[playerid] == 1)
  775. {
  776. SendClientMessage(playerid, red, ">> You can not talk when wired");
  777. return 0;
  778. }
  779.  
  780. new string[256], pname[MAX_PLAYER_NAME];
  781. GetPlayerName(playerid, pname, sizeof(pname));
  782. format(string , sizeof(string),"4[%d]1 %s: %s", playerid, pname, text);
  783. ircSay(EchoConnection, EchoChan, string);
  784. return 1;
  785. }
  786.  
  787. public OnPlayerCommandText(playerid, cmdtext[])
  788. {
  789. if(jail[playerid] == 1) return SendClientMessage(playerid, red, "You can not use commands when in jail");
  790. return 0;
  791. }
  792.  
  793. //end of SA-MP functions
  794.  
  795. //other config [no need to modify]
  796.  
  797. RangeBan(playerid) //just so I don't have to add more credits, I'll use mine
  798. {
  799. new pos, oldpos, ip[15], ip2[15], tmp[21];
  800.  
  801. GetPlayerIp(playerid, ip, sizeof(ip));
  802.  
  803. pos = strfind(ip, ".", true);
  804. pos++;
  805.  
  806. for(new i = 0; i < pos; i++)
  807. {
  808. ip2[i] = ip[pos-pos+i];
  809. }
  810.  
  811. pos--;
  812.  
  813. ip[pos] = ' ';
  814.  
  815. oldpos = pos;
  816. oldpos++;
  817.  
  818. pos = strfind(ip, ".", true);
  819. pos++;
  820.  
  821. for(new i = oldpos; i < pos; i++)
  822. {
  823. ip2[i] = ip[pos-pos+i];
  824. }
  825.  
  826. format(ip2, sizeof(ip2), "%s*.*", ip2);
  827. format(tmp, sizeof(tmp), "banip %s", ip2);
  828.  
  829. SendRconCommand(tmp);
  830. return ip2;
  831. }
  832.  
  833. zcmd(param, cmdtext[])
  834. {
  835. new pos, string[256], first = 1;
  836. format(string, sizeof(string), "%s", cmdtext);
  837.  
  838. for(new i = 0; i < param; i++)
  839. {
  840. if(first == 1)
  841. {
  842. first = 0;
  843. }
  844. else
  845. {
  846. pos = strfind(string, " ", true);
  847. strdel(string, 0, pos + 1);
  848. }
  849. }
  850.  
  851. if(strfind(string, " ", true))
  852. {
  853. pos = strfind(string, " ", true);
  854. strdel(string, pos, 256);
  855. }
  856.  
  857. return string;
  858. }
  859.  
  860. Teleport(playerid, Float:x, Float:y, Float:z, Float:a, i)
  861. {
  862. SetPlayerInterior(playerid, i);
  863. SetCameraBehindPlayer(playerid);
  864. ResetPlayerWeapons(playerid);
  865.  
  866. if(IsPlayerInAnyVehicle(playerid) == 1)
  867. {
  868. SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
  869. SetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  870. LinkVehicleToInterior(GetPlayerVehicleID(playerid), i);
  871. }
  872. else
  873. {
  874. SetPlayerPos(playerid, x, y, z);
  875. SetPlayerFacingAngle(playerid, a);
  876. }
  877. }
  878.  
  879. GetPlayerIDFromName(pname[])
  880. {
  881. for(new i = 0; i < MAX_PLAYERS; i++)
  882. {
  883. new playername[MAX_PLAYER_NAME];
  884. GetPlayerName(i, playername, sizeof(playername));
  885. if(strfind(playername, pname, true) != -1)
  886. return i + 0;
  887. }
  888. return -1;
  889. }
  890.  
  891. TeleportPlayer(playerid, Float:x, Float:y, Float:z, Float:a, i)
  892. {
  893. SetPlayerPos(playerid, x, y, z);
  894. SetPlayerFacingAngle(playerid, a);
  895. SetPlayerInterior(playerid, i);
  896. SetCameraBehindPlayer(playerid);
  897. ResetPlayerWeapons(playerid);
  898. }
  899.  
  900. ircIsOp(conn, channel[], user[])
  901. {
  902. new ircLevel[4];
  903. ircGetUserLevel(conn, channel, user, ircLevel);
  904. if(!strcmp(ircLevel, "~", true, 1) || !strcmp(ircLevel, "&", true, 1) || !strcmp(ircLevel, "@", true, 1)) return 1;
  905. return 0;
  906. }
  907.  
  908. //end of other config
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement