Advertisement
Guest User

Mgd Pro Irc Script

a guest
Mar 6th, 2013
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 18.17 KB | None | 0 0
  1. #include <a_samp>
  2. #include <irc>
  3. #include <sscanf2>
  4.  
  5.  
  6. #define BOT_1_NICKNAME "youbotname"
  7. #define BOT_1_REALNAME "SA-MP Bot"
  8. #define BOT_1_USERNAME "bot"
  9.  
  10. #define BOT_2_NICKNAME "youbotname"
  11. #define BOT_2_REALNAME "SA-MP Bot"
  12. #define BOT_2_USERNAME "bot"
  13.  
  14. #define IRC_SERVER "your server"
  15. #define IRC_PORT (6667)
  16. #define IRC_CHANNEL "#yourchannel"
  17.  
  18. #define MAX_BOTS (2)
  19.  
  20. #define PLUGIN_VERSION "1.4.3"
  21.  
  22. new botIDs[MAX_BOTS], groupID;
  23.  
  24. public OnFilterScriptInit()
  25. {
  26.     botIDs[0] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
  27.     IRC_SetIntData(botIDs[0], E_IRC_CONNECT_DELAY, 20);
  28.     botIDs[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_2_NICKNAME, BOT_2_REALNAME, BOT_2_USERNAME);
  29.     IRC_SetIntData(botIDs[1], E_IRC_CONNECT_DELAY, 30);
  30.     groupID = IRC_CreateGroup();
  31. }
  32.  
  33. public OnFilterScriptExit()
  34. {
  35.     IRC_Quit(botIDs[0], "Filterscript exiting");
  36.     IRC_Quit(botIDs[1], "Filterscript exiting");
  37.     IRC_DestroyGroup(groupID);
  38. }
  39.  
  40. public OnPlayerConnect(playerid)
  41. {
  42.     new joinMsg[128], name[MAX_PLAYER_NAME];
  43.     GetPlayerName(playerid, name, sizeof(name));
  44.     format(joinMsg, sizeof(joinMsg), "02[%d] 03*** %s has joined the server.", playerid, name);
  45.     IRC_GroupSay(groupID, IRC_CHANNEL, joinMsg);
  46.     return 1;
  47. }
  48.  
  49. public OnPlayerDisconnect(playerid, reason)
  50. {
  51.     new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
  52.     switch(reason)
  53.     {
  54.         case 0: reasonMsg = "Timeout";
  55.         case 1: reasonMsg = "Leaving";
  56.         case 2: reasonMsg = "Kicked";
  57.     }
  58.     GetPlayerName(playerid, name, sizeof(name));
  59.     format(leaveMsg, sizeof(leaveMsg), "02[%d] 03*** %s has left the server. (%s)", playerid, name, reasonMsg);
  60.     IRC_GroupSay(groupID, IRC_CHANNEL, leaveMsg);
  61.     return 1;
  62. }
  63.  
  64. public OnPlayerDeath(playerid, killerid, reason)
  65. {
  66.     new msg[128], killerName[MAX_PLAYER_NAME], reasonMsg[32], playerName[MAX_PLAYER_NAME];
  67.     GetPlayerName(killerid, killerName, sizeof(killerName));
  68.     GetPlayerName(playerid, playerName, sizeof(playerName));
  69.     if (killerid != INVALID_PLAYER_ID)
  70.     {
  71.         switch (reason)
  72.         {
  73.             case 0: reasonMsg = "Unarmed";
  74.             case 1: reasonMsg = "Brass Knuckles";
  75.             case 2: reasonMsg = "Golf Club";
  76.             case 3: reasonMsg = "Night Stick";
  77.             case 4: reasonMsg = "Knife";
  78.             case 5: reasonMsg = "Baseball Bat";
  79.             case 6: reasonMsg = "Shovel";
  80.             case 7: reasonMsg = "Pool Cue";
  81.             case 8: reasonMsg = "Katana";
  82.             case 9: reasonMsg = "Chainsaw";
  83.             case 10: reasonMsg = "Dildo";
  84.             case 11: reasonMsg = "Dildo";
  85.             case 12: reasonMsg = "Vibrator";
  86.             case 13: reasonMsg = "Vibrator";
  87.             case 14: reasonMsg = "Flowers";
  88.             case 15: reasonMsg = "Cane";
  89.             case 22: reasonMsg = "Pistol";
  90.             case 23: reasonMsg = "Silenced Pistol";
  91.             case 24: reasonMsg = "Desert Eagle";
  92.             case 25: reasonMsg = "Shotgun";
  93.             case 26: reasonMsg = "Sawn-off Shotgun";
  94.             case 27: reasonMsg = "Combat Shotgun";
  95.             case 28: reasonMsg = "MAC-10";
  96.             case 29: reasonMsg = "MP5";
  97.             case 30: reasonMsg = "AK-47";
  98.             case 31: reasonMsg = "M4";
  99.             case 32: reasonMsg = "TEC-9";
  100.             case 33: reasonMsg = "Country Rifle";
  101.             case 34: reasonMsg = "Sniper Rifle";
  102.             case 37: reasonMsg = "Fire";
  103.             case 38: reasonMsg = "Minigun";
  104.             case 41: reasonMsg = "Spray Can";
  105.             case 42: reasonMsg = "Fire Extinguisher";
  106.             case 49: reasonMsg = "Vehicle Collision";
  107.             case 50: reasonMsg = "Vehicle Collision";
  108.             case 51: reasonMsg = "Explosion";
  109.             default: reasonMsg = "Unknown";
  110.         }
  111.         format(msg, sizeof(msg), "04*** %s killed %s. (%s)", killerName, playerName, reasonMsg);
  112.     }
  113.     else
  114.     {
  115.         switch (reason)
  116.         {
  117.             case 53: format(msg, sizeof(msg), "04*** %s died. (Drowned)", playerName);
  118.             case 54: format(msg, sizeof(msg), "04*** %s died. (Collision)", playerName);
  119.             default: format(msg, sizeof(msg), "04*** %s died.", playerName);
  120.         }
  121.     }
  122.     IRC_GroupSay(groupID, IRC_CHANNEL, msg);
  123.     return 1;
  124. }
  125.  
  126. public OnPlayerText(playerid, text[])
  127. {
  128.     new name[MAX_PLAYER_NAME], ircMsg[256];
  129.     GetPlayerName(playerid, name, sizeof(name));
  130.     format(ircMsg, sizeof(ircMsg), "02[%d] 07%s: %s", playerid, name, text);
  131.     IRC_GroupSay(groupID, IRC_CHANNEL, ircMsg);
  132.     return 1;
  133. }
  134.  
  135. public IRC_OnConnect(botid, ip[], port)
  136. {
  137.     printf("*** IRC_OnConnect: Bot ID %d connected to %s:%d", botid, ip, port);
  138.     IRC_JoinChannel(botid, IRC_CHANNEL);
  139.     IRC_AddToGroup(groupID, botid);
  140.     return 1;
  141. }
  142.  
  143. public IRC_OnDisconnect(botid, ip[], port, reason[])
  144. {
  145.     printf("*** IRC_OnDisconnect: Bot ID %d disconnected from %s:%d (%s)", botid, ip, port, reason);
  146.     IRC_RemoveFromGroup(groupID, botid);
  147.     return 1;
  148. }
  149.  
  150. public IRC_OnConnectAttempt(botid, ip[], port)
  151. {
  152.     printf("*** IRC_OnConnectAttempt: Bot ID %d attempting to connect to %s:%d...", botid, ip, port);
  153.     return 1;
  154. }
  155.  
  156. public IRC_OnConnectAttemptFail(botid, ip[], port, reason[])
  157. {
  158.     printf("*** IRC_OnConnectAttemptFail: Bot ID %d failed to connect to %s:%d (%s)", botid, ip, port, reason);
  159.     return 1;
  160. }
  161.  
  162. public IRC_OnJoinChannel(botid, channel[])
  163. {
  164.     printf("*** IRC_OnJoinChannel: Bot ID %d joined channel %s", botid, channel);
  165.     return 1;
  166. }
  167.  
  168. public IRC_OnLeaveChannel(botid, channel[], message[])
  169. {
  170.     printf("*** IRC_OnLeaveChannel: Bot ID %d left channel %s (%s)", botid, channel, message);
  171.     return 1;
  172. }
  173.  
  174. public IRC_OnInvitedToChannel(botid, channel[], invitinguser[], invitinghost[])
  175. {
  176.     printf("*** IRC_OnInvitedToChannel: Bot ID %d invited to channel %s by %s (%s)", botid, channel, invitinguser, invitinghost);
  177.     IRC_JoinChannel(botid, channel);
  178.     return 1;
  179. }
  180.  
  181. public IRC_OnKickedFromChannel(botid, channel[], oppeduser[], oppedhost[], message[])
  182. {
  183.     printf("*** IRC_OnKickedFromChannel: Bot ID %d kicked by %s (%s) from channel %s (%s)", botid, oppeduser, oppedhost, channel, message);
  184.     IRC_JoinChannel(botid, channel);
  185.     return 1;
  186. }
  187.  
  188. public IRC_OnUserDisconnect(botid, user[], host[], message[])
  189. {
  190.     printf("*** IRC_OnUserDisconnect (Bot ID %d): User %s (%s) disconnected (%s)", botid, user, host, message);
  191.     return 1;
  192. }
  193.  
  194. public IRC_OnUserJoinChannel(botid, channel[], user[], host[])
  195. {
  196.     printf("*** IRC_OnUserJoinChannel (Bot ID %d): User %s (%s) joined channel %s", botid, user, host, channel);
  197.     return 1;
  198. }
  199.  
  200. public IRC_OnUserLeaveChannel(botid, channel[], user[], host[], message[])
  201. {
  202.     printf("*** IRC_OnUserLeaveChannel (Bot ID %d): User %s (%s) left channel %s (%s)", botid, user, host, channel, message);
  203.     return 1;
  204. }
  205.  
  206. public IRC_OnUserKickedFromChannel(botid, channel[], kickeduser[], oppeduser[], oppedhost[], message[])
  207. {
  208.     printf("*** IRC_OnUserKickedFromChannel (Bot ID %d): User %s kicked by %s (%s) from channel %s (%s)", botid, kickeduser, oppeduser, oppedhost, channel, message);
  209. }
  210.  
  211. public IRC_OnUserNickChange(botid, oldnick[], newnick[], host[])
  212. {
  213.     printf("*** IRC_OnUserNickChange (Bot ID %d): User %s (%s) changed his/her nick to %s", botid, oldnick, host, newnick);
  214.     return 1;
  215. }
  216.  
  217. public IRC_OnUserSetChannelMode(botid, channel[], user[], host[], mode[])
  218. {
  219.     printf("*** IRC_OnUserSetChannelMode (Bot ID %d): User %s (%s) on %s set mode: %s", botid, user, host, channel, mode);
  220.     return 1;
  221. }
  222.  
  223. public IRC_OnUserSetChannelTopic(botid, channel[], user[], host[], topic[])
  224. {
  225.     printf("*** IRC_OnUserSetChannelTopic (Bot ID %d): User %s (%s) on %s set topic: %s", botid, user, host, channel, topic);
  226.     return 1;
  227. }
  228.  
  229. public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
  230. {
  231.     printf("*** IRC_OnUserSay (Bot ID %d): User %s (%s) sent message to %s: %s", botid, user, host, recipient, message);
  232.     if (!strcmp(recipient, BOT_1_NICKNAME))
  233.     {
  234.         IRC_Say(botid, user, "You sent me a PM!");
  235.     }
  236.     return 1;
  237. }
  238.  
  239. public IRC_OnUserNotice(botid, recipient[], user[], host[], message[])
  240. {
  241.     printf("*** IRC_OnUserNotice (Bot ID %d): User %s (%s) sent notice to %s: %s", botid, user, host, recipient, message);
  242.     if (!strcmp(recipient, BOT_2_NICKNAME))
  243.     {
  244.         IRC_Notice(botid, user, "You sent me a notice!");
  245.     }
  246.     return 1;
  247. }
  248.  
  249. public IRC_OnUserRequestCTCP(botid, user[], host[], message[])
  250. {
  251.     printf("*** IRC_OnUserRequestCTCP (Bot ID %d): User %s (%s) sent CTCP request: %s", botid, user, host, message);
  252.     if (!strcmp(message, "VERSION"))
  253.     {
  254.         IRC_ReplyCTCP(botid, user, "VERSION SA-MP IRC Plugin v" #PLUGIN_VERSION "");
  255.     }
  256.     return 1;
  257. }
  258.  
  259. public IRC_OnUserReplyCTCP(botid, user[], host[], message[])
  260. {
  261.     printf("*** IRC_OnUserReplyCTCP (Bot ID %d): User %s (%s) sent CTCP reply: %s", botid, user, host, message);
  262.     return 1;
  263. }
  264.  
  265. public IRC_OnReceiveRaw(botid, message[])
  266. {
  267.     new File:file;
  268.     if (!fexist("irc_log.txt"))
  269.     {
  270.         file = fopen("irc_log.txt", io_write);
  271.     }
  272.     else
  273.     {
  274.         file = fopen("irc_log.txt", io_append);
  275.     }
  276.     if (file)
  277.     {
  278.         fwrite(file, message);
  279.         fwrite(file, "\r\n");
  280.         fclose(file);
  281.     }
  282.     return 1;
  283. }
  284.  
  285. IRCCMD:say(botid, channel[], user[], host[], params[])
  286. {
  287.     if (IRC_IsVoice(botid, channel, user))
  288.     {
  289.         if (!isnull(params))
  290.         {
  291.             new msg[128];
  292.             format(msg, sizeof(msg), "02*** %s on IRC: %s", user, params);
  293.             IRC_GroupSay(groupID, channel, msg);
  294.             format(msg, sizeof(msg), "*** %s on IRC: %s", user, params);
  295.             SendClientMessageToAll(0x0000FFFF, msg);
  296.         }
  297.     }
  298.     return 1;
  299. }
  300.  
  301. IRCCMD:kick(botid, channel[], user[], host[], params[])
  302. {
  303.     if (IRC_IsHalfop(botid, channel, user))
  304.     {
  305.         new playerid, reason[64];
  306.         if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  307.         {
  308.             return 1;
  309.         }
  310.         if (IsPlayerConnected(playerid))
  311.         {
  312.             new msg[128], name[MAX_PLAYER_NAME];
  313.             GetPlayerName(playerid, name, sizeof(name));
  314.             format(msg, sizeof(msg), "02*** %s has been kicked by Administrator on IRC. (%s)", name, user, reason);
  315.             IRC_GroupSay(groupID, channel, msg);
  316.             format(msg, sizeof(msg), "*** %s has been kicked by Administrator on IRC. (%s)", name, user, reason);
  317.             SendClientMessageToAll(0x0000FFFF, msg);
  318.             Kick(playerid);
  319.         }
  320.     }
  321.     return 1;
  322. }
  323.  
  324. IRCCMD:ban(botid, channel[], user[], host[], params[])
  325. {
  326.     if (IRC_IsOp(botid, channel, user))
  327.     {
  328.         new playerid, reason[64];
  329.         if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  330.         {
  331.             return 1;
  332.         }
  333.         if (IsPlayerConnected(playerid))
  334.         {
  335.             new msg[128], name[MAX_PLAYER_NAME];
  336.             GetPlayerName(playerid, name, sizeof(name));
  337.             format(msg, sizeof(msg), "02*** %s has been banned by %s on IRC. (%s)", name, user, reason);
  338.             IRC_GroupSay(groupID, channel, msg);
  339.             format(msg, sizeof(msg), "*** %s has been banned by %s on IRC. (%s)", name, user, reason);
  340.             SendClientMessageToAll(0x0000FFFF, msg);
  341.             BanEx(playerid, reason);
  342.         }
  343.     }
  344.     return 1;
  345. }
  346.  
  347. IRCCMD:rcon(botid, channel[], user[], host[], params[])
  348. {
  349.     if (IRC_IsOp(botid, channel, user))
  350.     {
  351.         if (!isnull(params))
  352.         {
  353.             if (strcmp(params, "exit", true) != 0 && strfind(params, "loadfs irc", true) == -1)
  354.             {
  355.                 new msg[128];
  356.                 format(msg, sizeof(msg), "RCON command %s has been executed.", params);
  357.                 IRC_GroupSay(groupID, channel, msg);
  358.                 SendRconCommand(params);
  359.             }
  360.         }
  361.     }
  362.     return 1;
  363. }
  364. IRCCMD:respawncars(botid, channel[], user[], host[], params[])
  365. {
  366.     new string1[128], string2[128];
  367.  
  368.     if (IRC_IsVoice(botid, channel, user))
  369.     {
  370.         for(new i = 1; i <= MAX_VEHICLES; i++)
  371.         {
  372.             SetVehicleToRespawn(i);
  373.         }
  374.         format(string1, 128, "Administrator %s has respawned all vehicles", user);
  375.         format(string2, 128, "Administrator %s has respawned all vehicles", user);
  376.  
  377.         IRC_GroupSay(groupID, channel, string1);
  378.         SendClientMessageToAll(0x00E800C8, string2);
  379.     }
  380.     return 1;
  381. }
  382. IRCCMD:getname(botid, channel[], user[], host[], params[])
  383. {
  384.     new playerid;
  385.     //Playerid
  386.     if (sscanf(params, "d", playerid))
  387.     {
  388.         return 1;
  389.     }
  390.     if(IsPlayerConnected(playerid))
  391.     {
  392.         new msg[128], pname[MAX_PLAYER_NAME];
  393.         GetPlayerName(playerid, pname, sizeof(pname));
  394.         format(msg, sizeof(msg), "*** The player's name is %s", pname, user);
  395.         IRC_GroupSay(groupID, channel, msg);
  396.     }
  397.     return 1;
  398. }
  399. IRCCMD:giveallcash(botid, channel[], user[], host[], params[])
  400. {
  401.     new value;
  402.     new msg1[128];
  403.     new msg2[128];
  404.  
  405.     if(sscanf(params, "d", value) != 0)
  406.     {
  407.         return 1;
  408.     }
  409.     if (IRC_IsVoice(botid, channel, user))
  410.     {
  411.         for(new i=0; i<MAX_PLAYERS; i++)
  412.         {
  413.             if(IsPlayerConnected(i))
  414.             {
  415.                 GivePlayerMoney(i, value);
  416.                 format(msg1, sizeof(msg1), "Administrator %s on irc has given all players some cash!", user);
  417.                 IRC_GroupSay(groupID, channel, msg1);
  418.                 format(msg2, sizeof(msg2), "Administrator %s on irc has given all players some cash!", user);
  419.                 SendClientMessageToAll(0x00E600C8, msg2);
  420.             }
  421.         }
  422.     }
  423.     return 1;
  424. }
  425. IRCCMD:resetcash(botid, channel[], user[], host[], params[])
  426. {
  427.     new playerid, reason[64];
  428.     //Playerid
  429.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  430.     {
  431.         return 1;
  432.     }
  433.     if (IRC_IsHalfop(botid, channel, user))
  434.     {
  435.         if(IsPlayerConnected(playerid))
  436.         {
  437.             new msg[128], pname[MAX_PLAYER_NAME];
  438.             GetPlayerName(playerid, pname, sizeof(pname));
  439.             format(msg, sizeof(msg), "Admin Reseted Cash %s on IRC for reason: %s", pname, user, reason);
  440.             IRC_GroupSay(groupID, channel, msg);
  441.             format(msg, sizeof(msg), "Admin Reseted Cash %s on IRC for reason: %s", pname, user, reason);
  442.             SendClientMessageToAll(0xFF0000C8, msg);
  443.             ResetPlayerMoney(playerid);
  444.         }
  445.     }
  446.     return 1;
  447. }
  448. IRCCMD:explode(botid, channel[], user[], host[], params[])
  449. {
  450.     new playerid, reason[64];
  451.     new player1;
  452.     //Playerid
  453.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  454.     {
  455.         return 1;
  456.     }
  457.     if (IRC_IsHalfop(botid, channel, user))
  458.     {
  459.         if(IsPlayerConnected(playerid))
  460.         {
  461.             new msg[128], pname[MAX_PLAYER_NAME];
  462.             GetPlayerName(playerid, pname, sizeof(pname));
  463.             format(msg, sizeof(msg), "%s has been exploded by Administrator on IRC", pname, user, reason);
  464.             IRC_GroupSay(groupID, channel, msg);
  465.             format(msg, sizeof(msg), "%s has been exploded by Administrator on IRC", pname, user, reason);
  466.             SendClientMessageToAll(0xFF0000C8, msg);
  467.             new Float:x, Float:y, Float:z;
  468.             GetPlayerPos(player1,x,y,z);
  469.             CreateExplosion(x, y, z, 0, 10.0);
  470.         }
  471.     }
  472.     return 1;
  473. }
  474. IRCCMD:unfreeze(botid, channel[], user[], host[], params[])
  475. {
  476.     new playerid, reason[64];
  477.     //Playerid
  478.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  479.     {
  480.         return 1;
  481.     }
  482.     if (IRC_IsHalfop(botid, channel, user))
  483.     {
  484.         if(IsPlayerConnected(playerid))
  485.         {
  486.             new msg[128], pname[MAX_PLAYER_NAME];
  487.             GetPlayerName(playerid, pname, sizeof(pname));
  488.             format(msg, sizeof(msg), "%s has been unfrozen by Admin on IRC", pname, user, reason);
  489.             IRC_GroupSay(groupID, channel, msg);
  490.             format(msg, sizeof(msg), "%s has been unfrozen by Admin on IRC", pname, user, reason);
  491.             SendClientMessageToAll(0x00E600C8, msg);
  492.             TogglePlayerControllable(playerid, 1);
  493.         }
  494.     }
  495.     return 1;
  496. }
  497. IRCCMD:freeze(botid, channel[], user[], host[], params[])
  498. {
  499.     new playerid, reason[64];
  500.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  501.     {
  502.         return 1;
  503.     }
  504.     if (IRC_IsHalfop(botid, channel, user))
  505.     {
  506.         if(IsPlayerConnected(playerid))
  507.         {
  508.             new msg[128], pname[MAX_PLAYER_NAME];
  509.             GetPlayerName(playerid, pname, sizeof(pname));
  510.             format(msg, sizeof(msg), "%s has been frozen by Admin on IRC", pname, user, reason);
  511.             IRC_GroupSay(groupID, channel, msg);
  512.             format(msg, sizeof(msg), "%s has been frozen by Admin on IRC", pname, user, reason);
  513.             SendClientMessageToAll(0xFF0000C8, msg);
  514.             TogglePlayerControllable(playerid, 0);
  515.         }
  516.     }
  517.     return 1;
  518. }
  519. IRCCMD:warn(botid, channel[], user[], host[], params[])
  520. {
  521.     new playerid, reason[64];
  522.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  523.     {
  524.         return 1;
  525.     }
  526.     if (IRC_IsVoice(botid, channel, user))
  527.     {
  528.         if(IsPlayerConnected(playerid))
  529.         {
  530.             new msg[128], pname[MAX_PLAYER_NAME];
  531.             GetPlayerName(playerid, pname, sizeof(pname));
  532.             format(msg, sizeof(msg), "%s has been warned by Administrator on IRC", pname, user, reason);
  533.             IRC_GroupSay(groupID, channel, msg);
  534.             format(msg, sizeof(msg), "%s has been warned by Administrator on IRC", pname, user, reason);
  535.             SendClientMessageToAll(0xFFFF00C8, msg);
  536.         }
  537.     }
  538.     return 1;
  539. }
  540. IRCCMD:players( botid, channel[], user[], host[], params[] )
  541. {
  542.     new tempstr[128], string[200], count, name[24];
  543.     for( new i ,slots = GetMaxPlayers(); i < slots; i++ )
  544.     {
  545.         if(IsPlayerConnected(i))
  546.         {
  547.             count++;
  548.             GetPlayerName(i, name, sizeof(name));
  549.             format(tempstr, sizeof(tempstr), "%s , %s", tempstr, name);
  550.         }
  551.     }
  552.     if(count)
  553.     {
  554.         format(string, sizeof(string), "Connected Players[%d/%d]:- %s", count, GetMaxPlayers(), tempstr);
  555.         IRC_Say(botid, channel, string);
  556.     } else IRC_Say(botid, channel, "No players are online.");
  557.     return 1;
  558. }
  559. IRCCMD:clearchat(conn, channel[], user[], message[])
  560. {
  561.         if(IRC_IsHalfop(conn, channel, user) == 0) return IRC_Say(conn, channel, "Invalid Level");
  562.         {
  563.         for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll(0xFFFFFF, "" );
  564.         SendClientMessageToAll(0xFFFFFF, "An Admin As Cleared The Chat");
  565.         }
  566.         #pragma unused message
  567.         return 1;
  568. }
  569. IRCCMD:cmds(botid, channel[], user[], host[], params[])
  570. {
  571.     if(!strcmp(channel, channel, true))
  572.     {
  573.         IRC_Say(botid, user, "04      [IRC Commands]           ");
  574.         IRC_Say(groupID, user, "|    User: !players !credits !say    ");
  575.         {
  576.         if(IRC_IsHalfop(botid, channel, user))
  577.         {
  578.             IRC_Say(groupID, user, "|    Halfops: !slap !ban !kick !warn !freeze !unfreeze   ");
  579.         }
  580.         if(IRC_IsOp(botid, channel, user))
  581.         {
  582.             IRC_Say(groupID, user, "|    Operators: !explode !slap !ban !kick !clearchat !warn !freeze !unfreeze  ");
  583.         }
  584.         if(IRC_IsAdmin(botid, channel, user))
  585.         {
  586.             IRC_Say(groupID, user, "|    Administrators: !say !slap !ban !kick !clearchat !warn !freeze !unfreeze !resetcash    ");
  587.         }
  588.         if(IRC_IsOwner(botid, channel, user))
  589.         {
  590.             IRC_Say(groupID, user, "|    Owner: All Levels and cmds , !say !slap !ban !kick !clearchat !warn !freeze !unfreeze !resetcash !rcon  ");
  591.         }
  592.         }
  593.     }
  594.     return 1;
  595. }
  596. IRCCMD:credits(botid, channel[], user[], host[], params[])
  597. {
  598.     IRC_Notice(botid, user, "04___________________________________");
  599.     IRC_Notice(botid, user, "04       IRC script              ");
  600.     IRC_Notice(botid, user, "04    Made by Mr_King Or Mgd    ");
  601.     IRC_Notice(botid, user, "04    Thanks For Choose This Irc Script! ");
  602.     IRC_Notice(botid, user, "04___________________________________");
  603.     return 1;
  604. }
  605. //do not remove the credits please.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement