Vikshay

IRC Script - 1.4.4

Apr 26th, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 27.52 KB | None | 0 0
  1. #include <a_samp>
  2. #include <irc>
  3. #include <sscanf2>
  4. #pragma tabsize 0
  5. #define BOT_1_NICKNAME "Elvis1"
  6. #define BOT_1_REALNAME "Elvis1"
  7. #define BOT_1_USERNAME "Elvis1"
  8.  
  9. #define BOT_2_NICKNAME "Elvis2"
  10. #define BOT_2_REALNAME "Elvis2"
  11. #define BOT_2_USERNAME "Elvis2"
  12.  
  13. #define IRC_SERVER "irc.tl"
  14. #define IRC_PORT 6667
  15. #define IRC_CHANNEL "#Vikshay"
  16. #define BotPass "Cheese"
  17.  
  18. #define MAX_BOTS (2)
  19. #define MAX_WARNINGS 3
  20. #define PLUGIN_VERSION "1.4.4"
  21.  
  22. new botIDs[MAX_BOTS], groupID;
  23. new Warns[MAX_PLAYERS];
  24. stock FlipVehicle(playerid)
  25. {
  26.     new VehicleID, Float:X, Float:Y, Float:Z, Float:Angle;
  27.     GetPlayerPos(playerid, X, Y, Z);
  28.     VehicleID = GetPlayerVehicleID(playerid);
  29.     GetVehicleZAngle(VehicleID, Angle);
  30.     SetVehiclePos(VehicleID, X, Y, Z);
  31.     SetVehicleZAngle(VehicleID, Angle);
  32. }
  33.  
  34.  
  35. public OnFilterScriptInit()
  36. {
  37.     botIDs[0] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
  38.     IRC_SetIntData(botIDs[0], E_IRC_CONNECT_DELAY, 20);
  39.     botIDs[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_2_NICKNAME, BOT_2_REALNAME, BOT_2_USERNAME);
  40.     IRC_SetIntData(botIDs[1], E_IRC_CONNECT_DELAY, 30);
  41.     groupID = IRC_CreateGroup();
  42. }
  43.  
  44.  
  45. public OnFilterScriptExit()
  46. {
  47.     IRC_Quit(botIDs[0], "Filterscript Exiting");
  48.     IRC_Quit(botIDs[1], "Filterscript Exiting");
  49.     IRC_DestroyGroup(groupID);
  50. }
  51.  
  52.  
  53.  
  54. public OnPlayerConnect(playerid)
  55. {
  56.     new joinMsg[128], name[MAX_PLAYER_NAME];
  57.     GetPlayerName(playerid, name, sizeof(name));
  58.     format(joinMsg, sizeof(joinMsg), "02[%d] 03*** %s has joined the server.", playerid, name);
  59.     IRC_GroupSay(groupID, IRC_CHANNEL, joinMsg);
  60.     Warns[playerid] = 0;
  61.     return 1;
  62. }
  63.  
  64. public OnPlayerDisconnect(playerid, reason)
  65. {
  66.     new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
  67.     switch(reason)
  68.     {
  69.         case 0: reasonMsg = "Timeout";
  70.         case 1: reasonMsg = "Leaving";
  71.         case 2: reasonMsg = "Kicked";
  72.     }
  73.     Warns[playerid] = 0;
  74.     GetPlayerName(playerid, name, sizeof(name));
  75.     format(leaveMsg, sizeof(leaveMsg), "02[%d] 03*** %s has left the server. (%s)", playerid, name, reasonMsg);
  76.     IRC_GroupSay(groupID, IRC_CHANNEL, leaveMsg);
  77.     return 1;
  78. }
  79.  
  80. public OnPlayerDeath(playerid, killerid, reason)
  81. {
  82.     new msg[128], killerName[MAX_PLAYER_NAME], reasonMsg[32], playerName[MAX_PLAYER_NAME];
  83.     GetPlayerName(killerid, killerName, sizeof(killerName));
  84.     GetPlayerName(playerid, playerName, sizeof(playerName));
  85.     if (killerid != INVALID_PLAYER_ID)
  86.     {
  87.         switch (reason)
  88.         {
  89.             case 0: reasonMsg = "Unarmed";
  90.             case 1: reasonMsg = "Brass Knuckles";
  91.             case 2: reasonMsg = "Golf Club";
  92.             case 3: reasonMsg = "Night Stick";
  93.             case 4: reasonMsg = "Knife";
  94.             case 5: reasonMsg = "Baseball Bat";
  95.             case 6: reasonMsg = "Shovel";
  96.             case 7: reasonMsg = "Pool Cue";
  97.             case 8: reasonMsg = "Katana";
  98.             case 9: reasonMsg = "Chainsaw";
  99.             case 10: reasonMsg = "Dildo";
  100.             case 11: reasonMsg = "Dildo";
  101.             case 12: reasonMsg = "Vibrator";
  102.             case 13: reasonMsg = "Vibrator";
  103.             case 14: reasonMsg = "Flowers";
  104.             case 15: reasonMsg = "Cane";
  105.             case 22: reasonMsg = "Pistol";
  106.             case 23: reasonMsg = "Silenced Pistol";
  107.             case 24: reasonMsg = "Desert Eagle";
  108.             case 25: reasonMsg = "Shotgun";
  109.             case 26: reasonMsg = "Sawn-off Shotgun";
  110.             case 27: reasonMsg = "Combat Shotgun";
  111.             case 28: reasonMsg = "MAC-10";
  112.             case 29: reasonMsg = "MP5";
  113.             case 30: reasonMsg = "AK-47";
  114.             case 31: reasonMsg = "M4";
  115.             case 32: reasonMsg = "TEC-9";
  116.             case 33: reasonMsg = "Country Rifle";
  117.             case 34: reasonMsg = "Sniper Rifle";
  118.             case 37: reasonMsg = "Fire";
  119.             case 38: reasonMsg = "Minigun";
  120.             case 41: reasonMsg = "Spray Can";
  121.             case 42: reasonMsg = "Fire Extinguisher";
  122.             case 49: reasonMsg = "Vehicle Collision";
  123.             case 50: reasonMsg = "Vehicle Collision";
  124.             case 51: reasonMsg = "Explosion";
  125.             default: reasonMsg = "Unknown";
  126.         }
  127.         format(msg, sizeof(msg), "04*** %s killed %s. (%s)", killerName, playerName, reasonMsg);
  128.     }
  129.     else
  130.     {
  131.         switch (reason)
  132.         {
  133.             case 53: format(msg, sizeof(msg), "04*** %s died. (Drowned)", playerName);
  134.             case 54: format(msg, sizeof(msg), "04*** %s died. (Collision)", playerName);
  135.             default: format(msg, sizeof(msg), "04*** %s died.", playerName);
  136.         }
  137.     }
  138.     IRC_GroupSay(groupID, IRC_CHANNEL, msg);
  139.     return 1;
  140. }
  141.  
  142. public OnPlayerText(playerid, text[])
  143. {
  144.     new name[MAX_PLAYER_NAME], ircMsg[256];
  145.     GetPlayerName(playerid, name, sizeof(name));
  146.     format(ircMsg, sizeof(ircMsg), "02[%d] 07%s: %s", playerid, name, text);
  147.     IRC_GroupSay(groupID, IRC_CHANNEL, ircMsg);
  148.     return 1;
  149. }
  150.  
  151.  
  152.  
  153. public IRC_OnConnect(botid, ip[], port)
  154. {
  155.     printf("*** IRC_OnConnect: Bot ID %d connected to %s:%d", botid, ip, port);
  156.     IRC_JoinChannel(botid, IRC_CHANNEL);
  157.     IRC_AddToGroup(groupID, botid);
  158.     return 1;
  159. }
  160.  
  161.  
  162. public IRC_OnDisconnect(botid, ip[], port, reason[])
  163. {
  164.     printf("*** IRC_OnDisconnect: Bot ID %d disconnected from %s:%d (%s)", botid, ip, port, reason);
  165.     IRC_RemoveFromGroup(groupID, botid);
  166.     return 1;
  167. }
  168.  
  169.  
  170. public IRC_OnConnectAttempt(botid, ip[], port)
  171. {
  172.     printf("*** IRC_OnConnectAttempt: Bot ID %d attempting to connect to %s:%d...", botid, ip, port);
  173.     return 1;
  174. }
  175.  
  176.  
  177.  
  178. public IRC_OnConnectAttemptFail(botid, ip[], port, reason[])
  179. {
  180.     printf("*** IRC_OnConnectAttemptFail: Bot ID %d failed to connect to %s:%d (%s)", botid, ip, port, reason);
  181.     return 1;
  182. }
  183.  
  184.  
  185.  
  186. public IRC_OnJoinChannel(botid, channel[])
  187. {
  188.     printf("*** IRC_OnJoinChannel: Bot ID %d joined channel %s", botid, channel);
  189.     return 1;
  190. }
  191.  
  192.  
  193.  
  194. public IRC_OnLeaveChannel(botid, channel[], message[])
  195. {
  196.     printf("*** IRC_OnLeaveChannel: Bot ID %d left channel %s (%s)", botid, channel, message);
  197.     return 1;
  198. }
  199.  
  200.  
  201. public IRC_OnInvitedToChannel(botid, channel[], invitinguser[], invitinghost[])
  202. {
  203.     printf("*** IRC_OnInvitedToChannel: Bot ID %d invited to channel %s by %s (%s)", botid, channel, invitinguser, invitinghost);
  204.     IRC_JoinChannel(botid, channel);
  205.     return 1;
  206. }
  207.  
  208.  
  209.  
  210. public IRC_OnKickedFromChannel(botid, channel[], oppeduser[], oppedhost[], message[])
  211. {
  212.     printf("*** IRC_OnKickedFromChannel: Bot ID %d kicked by %s (%s) from channel %s (%s)", botid, oppeduser, oppedhost, channel, message);
  213.     IRC_JoinChannel(botid, channel);
  214.     return 1;
  215. }
  216.  
  217. public IRC_OnUserDisconnect(botid, user[], host[], message[])
  218. {
  219.     printf("*** IRC_OnUserDisconnect (Bot ID %d): User %s (%s) disconnected (%s)", botid, user, host, message);
  220.     return 1;
  221. }
  222.  
  223. public IRC_OnUserJoinChannel(botid, channel[], user[], host[])
  224. {
  225.     printf("*** IRC_OnUserJoinChannel (Bot ID %d): User %s (%s) joined channel %s", botid, user, host, channel);
  226.     IRC_IsVoice(botid, IRC_CHANNEL, "+v");
  227.     return 1;
  228. }
  229.  
  230. public IRC_OnUserLeaveChannel(botid, channel[], user[], host[], message[])
  231. {
  232.     printf("*** IRC_OnUserLeaveChannel (Bot ID %d): User %s (%s) left channel %s (%s)", botid, user, host, channel, message);
  233.     return 1;
  234. }
  235.  
  236. public IRC_OnUserKickedFromChannel(botid, channel[], kickeduser[], oppeduser[], oppedhost[], message[])
  237. {
  238.     printf("*** IRC_OnUserKickedFromChannel (Bot ID %d): User %s kicked by %s (%s) from channel %s (%s)", botid, kickeduser, oppeduser, oppedhost, channel, message);
  239. }
  240.  
  241. public IRC_OnUserNickChange(botid, oldnick[], newnick[], host[])
  242. {
  243.     printf("*** IRC_OnUserNickChange (Bot ID %d): User %s (%s) changed his/her nick to %s", botid, oldnick, host, newnick);
  244.     return 1;
  245. }
  246.  
  247. public IRC_OnUserSetChannelMode(botid, channel[], user[], host[], mode[])
  248. {
  249.     printf("*** IRC_OnUserSetChannelMode (Bot ID %d): User %s (%s) on %s set mode: %s", botid, user, host, channel, mode);
  250.     if(IRC_IsOp(botid, IRC_CHANNEL, user))
  251.     {
  252.         IRC_IsVoice(botid, IRC_CHANNEL, "+v");
  253.         return 1;
  254.     }
  255.     return 1;
  256. }
  257.  
  258. public IRC_OnUserSetChannelTopic(botid, channel[], user[], host[], topic[])
  259. {
  260.     printf("*** IRC_OnUserSetChannelTopic (Bot ID %d): User %s (%s) on %s set topic: %s", botid, user, host, channel, topic);
  261.     return 1;
  262. }
  263.  
  264. public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
  265. {
  266.     printf("*** IRC_OnUserSay (Bot ID %d): User %s (%s) sent message to %s: %s", botid, user, host, recipient, message);
  267.     if (!strcmp(recipient, BOT_1_NICKNAME))
  268.     {
  269.         IRC_Say(botid, user, "You sent me a PM!");
  270.     }
  271.     return 1;
  272. }
  273.  
  274. public IRC_OnUserNotice(botid, recipient[], user[], host[], message[])
  275. {
  276.     printf("*** IRC_OnUserNotice (Bot ID %d): User %s (%s) sent notice to %s: %s", botid, user, host, recipient, message);
  277.     if (!strcmp(recipient, BOT_2_NICKNAME))
  278.     {
  279.         IRC_Notice(botid, user, "You sent me a notice!");
  280.     }
  281.     return 1;
  282. }
  283.  
  284. public IRC_OnUserRequestCTCP(botid, user[], host[], message[])
  285. {
  286.     printf("*** IRC_OnUserRequestCTCP (Bot ID %d): User %s (%s) sent CTCP request: %s", botid, user, host, message);
  287.     if (!strcmp(message, "VERSION"))
  288.     {
  289.         IRC_ReplyCTCP(botid, user, "VERSION SA-MP IRC Plugin v" #PLUGIN_VERSION "");
  290.     }
  291.     return 1;
  292. }
  293.  
  294. public IRC_OnUserReplyCTCP(botid, user[], host[], message[])
  295. {
  296.     printf("*** IRC_OnUserReplyCTCP (Bot ID %d): User %s (%s) sent CTCP reply: %s", botid, user, host, message);
  297.     return 1;
  298. }
  299.  
  300.  
  301.  
  302. public IRC_OnReceiveRaw(botid, message[])
  303. {
  304.     new File:file;
  305.     if (!fexist("irc_log.txt"))
  306.     {
  307.         file = fopen("irc_log.txt", io_write);
  308.     }
  309.     else
  310.     {
  311.         file = fopen("irc_log.txt", io_append);
  312.     }
  313.     if (file)
  314.     {
  315.         fwrite(file, message);
  316.         fwrite(file, "\r\n");
  317.         fclose(file);
  318.     }
  319.     return 1;
  320. }
  321.  
  322.  
  323. IRCCMD:say(botid, channel[], user[], host[], params[])
  324. {
  325.         if (!isnull(params))
  326.         {
  327.             new msg[128];
  328.             format(msg, sizeof(msg), "02*** %s on IRC: %s", user, params);
  329.             IRC_GroupSay(groupID, channel, msg);
  330.             format(msg, sizeof(msg), "{FFFFFF}*** %s on IRC: %s", user, params);
  331.             SendClientMessageToAll(0xFFFFFFFF, msg);
  332.         }
  333.     return 1;
  334. }
  335.  
  336.  
  337. IRCCMD:asay(botid, channel[], user[], host[], params[])
  338. {
  339.         if (IRC_IsHalfop(botid, channel, user))
  340.         {
  341.                 // Check if the user entered any text
  342.                 if (!isnull(params))
  343.                 {
  344.                         new msg[128];
  345.                         // Echo the formatted message
  346.                         format(msg, sizeof(msg), "12Administrator %s on IRC: %s", user, params);
  347.                         IRC_GroupSay(groupID, channel, msg);
  348.                         format(msg, sizeof(msg), "Administrator %s on IRC: %s", user, params);
  349.                         SendClientMessageToAll(0x00CCCCFF, msg);
  350.                 }
  351.         }
  352.         return 1;
  353. }
  354.  
  355. IRCCMD:warn(botid, channel[], user[], host[], params[])
  356. {
  357.     // Check if the user is at least a halfop in the channel
  358.     if (IRC_IsOp(botid, channel, user))
  359.     {
  360.         new playerid, reason[64];
  361.         // Check if the user at least entered a player ID
  362.         if (sscanf(params, "dS(No reason)[64]", playerid, reason)) return IRC_GroupSay(groupID, channel, "Syntax: !warn playerid reason");
  363.         // Check if the player is connected
  364.         if (IsPlayerConnected(playerid))
  365.         {
  366.             // warns the player
  367.             // Echo the formatted message
  368.  
  369.             new msg[128], name[MAX_PLAYER_NAME];
  370.             Warns[playerid]++;
  371.             GetPlayerName(playerid, name, sizeof(name));
  372.             format(msg, sizeof(msg), "02*** %s has been warned by %s on IRC.(warning: %d/3)  (Reason: %s)", name, user, Warns[playerid],reason);
  373.             IRC_GroupSay(groupID, channel, msg);
  374.             format(msg, sizeof(msg), "*** %s has been warned by %s on IRC.(warning: %d/3)  (Reason: %s)", name, user, Warns[playerid],reason);
  375.             SendClientMessageToAll(0x0000FFFF, msg);
  376.  
  377.             if(Warns[playerid] == MAX_WARNINGS)
  378.             {
  379.                 GetPlayerName(playerid, name, sizeof(name));
  380.                 format(msg, sizeof(msg), "02*** %s has been kicked by %s on IRC. reason: warning 3/3", name, user);
  381.                 IRC_GroupSay(groupID, channel, msg);
  382.                 format(msg, sizeof(msg), "*** %s has been warned by %s on IRC. reason: warning 3/3", name, user);
  383.                 SendClientMessageToAll(0x0000FFFF, msg);
  384.                 Kick(playerid);
  385.             }
  386.         }
  387.     }
  388.     return 1;
  389. }
  390.  
  391. IRCCMD:acmds(botid, channel[], user[], host[], params[])
  392. {
  393.     if (IRC_IsHalfop(botid, channel, user))
  394.     {
  395.         new string[18];
  396.         new string2[230];
  397.         new string3[80];
  398.         new string4[80];
  399.  
  400.         format(string, sizeof(string), "IRC COMMANDS:");
  401.         format(string2, sizeof(string2), "12!say, !asay, !warn, !givecar, !kick, !ban, !resetcash, !disarm, !acmds");
  402.         format(string3, sizeof(string3), "12!getinfo, !respawncars, !pm, !ann, !admin, !announce, !explode, !cmds");
  403.         format(string3, sizeof(string4), "12!giveallcash, !getname, !spawn, !forum, !players, !slap, !freeze, !unfreeze");
  404.  
  405.         IRC_Say(botid, channel, string);
  406.         IRC_Say(botid, channel, string2);
  407.         IRC_Say(botid, channel, string3);
  408.         IRC_Say(botid, channel, string4);
  409.         }
  410.         return 1;
  411. }
  412.  
  413. IRCCMD:cmds(botid, channel[], user[], host[], params[])
  414. {
  415.         new string[18];
  416.         new string2[230];
  417.  
  418.         format(string, sizeof(string), "IRC COMMANDS:");
  419.         format(string2, sizeof(string2), "12!say, !getinfo, !pm, !cmds, !getname, !forum, !players");
  420.  
  421.         IRC_Say(botid, channel, string);
  422.         IRC_Say(botid, channel, string2);
  423.         return 1;
  424. }
  425.  
  426.  
  427. IRCCMD:givecar(botid, channel[], user[], host[], params[])
  428. {
  429.     if (IRC_IsOp(botid, channel, user))
  430.     {
  431.         new playerid;
  432.         // Check if the user at least entered a player ID
  433.         if (sscanf(params, "d", playerid)) return IRC_GroupSay(groupID, channel, "Syntax: !givecar playerid");
  434.         // Check if the player is connected
  435.         if (IsPlayerConnected(playerid))
  436.         {
  437.             // warns the player
  438.             // Echo the formatted message
  439.             if(!IsPlayerInAnyVehicle(playerid))
  440.             {
  441.                 new msg[128], name[MAX_PLAYER_NAME];
  442.                 Warns[playerid]++;
  443.                 GetPlayerName(playerid, name, sizeof(name));
  444.                 format(msg, sizeof(msg), "02*** %s has given %s a car on IRC.", user, name);
  445.                 IRC_GroupSay(groupID, channel, msg);
  446.                 format(msg, sizeof(msg), "*** %s has given %s a car on IRC.", user, name);
  447.                 SendClientMessageToAll(0x0000FFFF, msg);
  448.                 new Float:x, Float:y, Float:z, Float:a;
  449.                 GetPlayerPos(playerid, x, y, z);
  450.                 GetPlayerFacingAngle(playerid, a);
  451.                 PutPlayerInVehicle(playerid, CreateVehicle(411, x, y, z, a, -1, -1, 50), 0);
  452.                 SendClientMessage(playerid, 0x00FF00FF, "Enjoy your new car");
  453.             }
  454.             else return IRC_GroupSay(groupID, channel, "this player already has a Vehicle");
  455.         }
  456.     }
  457.     return 1;
  458. }
  459. IRCCMD:kick(botid, channel[], user[], host[], params[])
  460. {
  461.     // Check if the user is at least a halfop in the channel
  462.     if (IRC_IsHalfop(botid, channel, user))
  463.     {
  464.         new playerid, reason[64];
  465.         // Check if the user at least entered a player ID
  466.         if (sscanf(params, "dS(No reason)[64]", playerid, reason)) return IRC_GroupSay(groupID, channel, "Syntax: !kick playerid reason");
  467.         // Check if the player is connected
  468.         if (IsPlayerConnected(playerid))
  469.         {
  470.             // Echo the formatted message
  471.             new msg[128], name[MAX_PLAYER_NAME];
  472.             GetPlayerName(playerid, name, sizeof(name));
  473.             format(msg, sizeof(msg), "02*** %s has been kicked by %s on IRC. (%s)", name, user, reason);
  474.             IRC_GroupSay(groupID, channel, msg);
  475.             format(msg, sizeof(msg), "*** %s has been kicked by %s on IRC. (%s)", name, user, reason);
  476.             SendClientMessageToAll(0x0000FFFF, msg);
  477.             // Kick the player
  478.             Kick(playerid);
  479.         }
  480.     }
  481.     return 1;
  482. }
  483.  
  484. IRCCMD:ban(botid, channel[], user[], host[], params[])
  485. {
  486.     // Check if the user is at least an op in the channel
  487.     if (IRC_IsOp(botid, channel, user))
  488.     {
  489.         new playerid, reason[64];
  490.         // Check if the user at least entered a player ID
  491.         if (sscanf(params, "dS(No reason)[64]", playerid, reason)) return IRC_GroupSay(groupID, channel, "Syntax: !ban playerid reason");
  492.         // Check if the player is connected
  493.         if (IsPlayerConnected(playerid))
  494.         {
  495.             // Echo the formatted message
  496.             new msg[128], name[MAX_PLAYER_NAME];
  497.             GetPlayerName(playerid, name, sizeof(name));
  498.             format(msg, sizeof(msg), "02*** %s has been banned by %s on IRC. (%s)", name, user, reason);
  499.             IRC_GroupSay(groupID, channel, msg);
  500.             format(msg, sizeof(msg), "*** %s has been banned by %s on IRC. (%s)", name, user, reason);
  501.             SendClientMessageToAll(0x0000FFFF, msg);
  502.             // Ban the player
  503.             BanEx(playerid, reason);
  504.         }
  505.     }
  506.     return 1;
  507. }
  508.  
  509. IRCCMD:explode(botid, channel[], user[], host[], params[])
  510. {
  511.         new playerid, reason[64];
  512.         new player1;
  513.         if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  514.         {
  515.                 return 1;
  516.         }
  517.     if (IRC_IsHalfop(botid, channel, user))
  518.         {
  519.                 if(IsPlayerConnected(playerid))
  520.                 {
  521.                         new msg[128], pname[MAX_PLAYER_NAME];
  522.                         GetPlayerName(playerid, pname, sizeof(pname));
  523.                         format(msg, sizeof(msg), "*** %s has been exploded by Staff Member %s on IRC for reason: %s", pname, user, reason);
  524.                         IRC_GroupSay(groupID, channel, msg);
  525.                         format(msg, sizeof(msg), "*** %s has been exploded by Staff Member %s on IRC for reason: %s", pname, user, reason);
  526.                         SendClientMessageToAll(0xFF0000C8, msg);
  527.                         new Float:x, Float:y, Float:z;
  528.                         GetPlayerPos(player1,x,y,z);
  529.                         CreateExplosion(x, y, z, 0, 10.0);
  530.                 }
  531.         }
  532.         return 1;
  533. }
  534.  
  535.  
  536. IRCCMD:resetcash(botid, channel[], user[], host[], params[])
  537. {
  538.     new playerid, reason[64];
  539.     //Playerid
  540.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  541.     {
  542.         return 1;
  543.     }
  544.     if (IRC_IsHalfop(botid, channel, user))
  545.     {
  546.         if(IsPlayerConnected(playerid))
  547.         {
  548.             new msg[128], name[MAX_PLAYER_NAME];
  549.             GetPlayerName(playerid, name, sizeof(name));
  550.             format(msg, sizeof(msg), "*** %s their cash has been removed cash by Admin %s on IRC for reason: %s", name, user, reason);
  551.             IRC_GroupSay(groupID, channel, msg);
  552.             format(msg, sizeof(msg), "*** %s their cash has been removed by Admin %s on IRC for reason: %s", name, user, reason);
  553.             SendClientMessageToAll(0xFF0000C8, msg);
  554.             ResetPlayerMoney(playerid);
  555.         }
  556.     }
  557.     return 1;
  558. }
  559. IRCCMD:disarm(botid, channel[], user[], host[], params[])
  560. {
  561.     new playerid, reason[64];
  562.     //Playerid
  563.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  564.     {
  565.         return 1;
  566.     }
  567.     if (IRC_IsHalfop(botid, channel, user))
  568.     {
  569.         if(IsPlayerConnected(playerid))
  570.         {
  571.             new msg[128], name[MAX_PLAYER_NAME];
  572.             GetPlayerName(playerid, name, sizeof(name));
  573.             format(msg, sizeof(msg), "*** %s has been disarmed by Admin %s on IRC for reason: %s", name, user, reason);
  574.             IRC_GroupSay(groupID, channel, msg);
  575.             format(msg, sizeof(msg), "*** %s has been disarmed by Admin %s on IRC for reason: %s", name, user, reason);
  576.             SendClientMessageToAll(0xFF0000C8, msg);
  577.             ResetPlayerWeapons(playerid);
  578.         }
  579.     }
  580.     return 1;
  581. }
  582.  
  583. IRCCMD:giveallcash(botid, channel[], user[], host[], params[])
  584. {
  585.     new value;
  586.     new msg1[128];
  587.     new msg2[128];
  588.  
  589.     if(sscanf(params, "d", value) != 0)
  590.     {
  591.         return 1;
  592.     }
  593.     if (IRC_IsHalfop(botid, channel, user))
  594.     {
  595.         for(new i=0; i<MAX_PLAYERS; i++)
  596.         {
  597.             if(IsPlayerConnected(i))
  598.             {
  599.                 GivePlayerMoney(i, value);
  600.                 format(msg1, sizeof(msg1), "*** Admin %s has given all players some cash!", user);
  601.                 IRC_GroupSay(groupID, channel, msg1);
  602.                 format(msg2, sizeof(msg2), "*** Admin %s has given all players some cash!", user);
  603.                 SendClientMessageToAll(0x00E600C8, msg2);
  604.             }
  605.         }
  606.     }
  607.     return 1;
  608. }
  609. IRCCMD:getname(botid, channel[], user[], host[], params[])
  610. {
  611.     new playerid;
  612.     //Playerid
  613.     if (sscanf(params, "d", playerid))
  614.     {
  615.         return 1;
  616.     }
  617.     if(IsPlayerConnected(playerid))
  618.     {
  619.         new msg[128], name[MAX_PLAYER_NAME];
  620.         GetPlayerName(playerid, name, sizeof(name));
  621.         format(msg, sizeof(msg), "*** Online player's name %s", name, user);
  622.         IRC_GroupSay(groupID, channel, msg);
  623.     }
  624.     return 1;
  625. }
  626. IRCCMD:spawn(botid, channel[], user[], host[], params[])
  627. {
  628.     new playerid, reason[64];
  629.     //Playerid
  630.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  631.     {
  632.         return 1;
  633.     }
  634.     if (IRC_IsHalfop(botid, channel, user))
  635.     {
  636.         if(IsPlayerConnected(playerid))
  637.         {
  638.             new msg[128], name[MAX_PLAYER_NAME];
  639.             GetPlayerName(playerid, name, sizeof(name));
  640.             format(msg, sizeof(msg), "*** %s has been spawned by Admin %s on IRC for reason: %s", name, user, reason);
  641.             IRC_GroupSay(groupID, channel, msg);
  642.             format(msg, sizeof(msg), "*** %s has been spawned by Admin %s on IRC for reason: %s", name, user, reason);
  643.             SendClientMessageToAll(0xFF0000C8, msg);
  644.             SpawnPlayer(playerid);
  645.         }
  646.     }
  647.     return 1;
  648. }
  649. IRCCMD:forum(botid, channel[], user[], host[], params[])
  650. {
  651.     new string29[128];
  652.     new string30[128];
  653.         format(string29, 128, "Sign up at our Forum today! 12www.emrgaming.forumsr.com");
  654.         format(string30, 128, "Sign up at our Forum today! 12www.emrgaming.forumsr.com");
  655.  
  656.         IRC_GroupSay(groupID, channel, string29);
  657.  
  658.         SendClientMessageToAll(0x00E800C8, string30);
  659.     return 1;
  660. }
  661. IRCCMD:players( botid, channel[], user[], host[], params[] )
  662. {
  663.     new tempstr[128], string[200], count, name[24];
  664.     for( new i ,slots = GetMaxPlayers(); i < slots; i++ )
  665.     {
  666.         if(IsPlayerConnected(i))
  667.         {
  668.             count++;
  669.             GetPlayerName(i, name, sizeof(name));
  670.             format(tempstr, sizeof(tempstr), "%s , %s", tempstr, name);
  671.         }
  672.     }
  673.     if(count)
  674.     {
  675.         format(string, sizeof(string), "Total Connected Players [%d/%d]:- %s", count, GetMaxPlayers(), tempstr);
  676.         IRC_Say(botid, channel, string);
  677.     } else IRC_Say(botid, channel, "No players are online.");
  678.     return 1;
  679. }
  680.  
  681. IRCCMD:slap(botid, channel[], user[], host[], params[])
  682. {
  683.     new playerid, reason[64];
  684.     new player1;
  685.  
  686.     if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  687.     {
  688.         return 1;
  689.     }
  690.     if (IRC_IsHalfop(botid, channel, user))
  691.     {
  692.         if(IsPlayerConnected(playerid))
  693.         {
  694.             new msg[128], name[MAX_PLAYER_NAME];
  695.             GetPlayerName(playerid, name, sizeof(name));
  696.             format(msg, sizeof(msg), "*** %s has been slapped by Admin %s on IRC for reason: %s", name, user, reason);
  697.             IRC_GroupSay(groupID, channel, msg);
  698.             format(msg, sizeof(msg), "*** %s has been slapped by Admin %s on IRC for reason: %s", name, user, reason);
  699.             SendClientMessageToAll(0xFF0000C8, msg);
  700.  
  701.             new Float:Health;
  702.             new Float:x, Float:y, Float:z;
  703.             GetPlayerHealth(player1,Health);
  704.             SetPlayerHealth(player1,Health-25);
  705.             GetPlayerPos(player1,x,y,z);
  706.             SetPlayerPos(player1,x,y,z+7);
  707.             PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
  708.             PlayerPlaySound(player1,1190,0.0,0.0,0.0);
  709.         }
  710.     }
  711.     return 1;
  712. }
  713.  
  714. IRCCMD:freeze(botid, channel[], user[], host[], params[])
  715. {
  716.         new playerid, reason[64];
  717.         //Playerid
  718.         if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  719.         {
  720.                 return 1;
  721.         }
  722.     if (IRC_IsVoice(botid, channel, user))
  723.         {
  724.                 if(IsPlayerConnected(playerid))
  725.                 {
  726.                         new msg[128], pname[MAX_PLAYER_NAME];
  727.                         GetPlayerName(playerid, pname, sizeof(pname));
  728.                         format(msg, sizeof(msg), "*** %s has been frozen by Staff Member %s on IRC for reason: %s", pname, user, reason);
  729.                         IRC_GroupSay(groupID, channel, msg);
  730.                         format(msg, sizeof(msg), "*** %s has been frozen by Staff Member %s on IRC for reason: %s", pname, user, reason);
  731.                         SendClientMessageToAll(0xFF0000C8, msg);
  732.                         //Freeze.
  733.                         TogglePlayerControllable(playerid, 0);
  734.                 }
  735.         }
  736.         return 1;
  737. }
  738.  
  739. IRCCMD:unfreeze(botid, channel[], user[], host[], params[])
  740. {
  741.         new playerid, reason[64];
  742.         //Playerid
  743.         if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
  744.         {
  745.                 return 1;
  746.         }
  747.     if (IRC_IsVoice(botid, channel, user))
  748.         {
  749.                 if(IsPlayerConnected(playerid))
  750.                 {
  751.                         new msg[128], pname[MAX_PLAYER_NAME];
  752.                         GetPlayerName(playerid, pname, sizeof(pname));
  753.                         format(msg, sizeof(msg), "*** %s has been unfrozen by Staff Member %s on IRC for reason: %s", pname, user, reason);
  754.                         IRC_GroupSay(groupID, channel, msg);
  755.                         format(msg, sizeof(msg), "*** %s has been unfrozen by Staff Member %s on IRC for reason: %s", pname, user, reason);
  756.                         SendClientMessageToAll(0x00E600C8, msg);
  757.                 TogglePlayerControllable(playerid, 1);
  758.                 }
  759.         }
  760.         return 1;
  761. }
  762.  
  763. IRCCMD:getinfo(botid, channel[], user[], host[], params[])
  764. {
  765.     new playerid, pIP[128], Float:health, Float:armour;
  766.  
  767.     if (sscanf(params, "d", playerid))
  768.     {
  769.         return 1;
  770.     }
  771.     if(IsPlayerConnected(playerid))
  772.     {
  773.         new msg[128], name[MAX_PLAYER_NAME];
  774.         GetPlayerName(playerid, name, sizeof(name));
  775.         GetPlayerIp(playerid, pIP, 128);
  776.         GetPlayerHealth(playerid, health);
  777.         GetPlayerArmour(playerid, armour);
  778.         new ping;
  779.         ping = GetPlayerPing(playerid);
  780.         format(msg, sizeof(msg), "*** %s's info: IP: %s | Health: %d | Armour: %d | Ping: %d", name, pIP, floatround(health), floatround(armour), ping);
  781.         IRC_GroupSay(groupID, channel, msg);
  782.     }
  783.     return 1;
  784. }
  785. IRCCMD:respawncars(botid, channel[], user[], host[], params[])
  786. {
  787.     new string1[128], string2[128];
  788.  
  789.     if (IRC_IsHalfop(botid, channel, user))
  790.     {
  791.         for(new i = 1; i <= MAX_VEHICLES; i++)
  792.         {
  793.             SetVehicleToRespawn(i);
  794.         }
  795.         format(string1, 128, " Admin %s has respawned all vehicles", user);
  796.         format(string2, 128, "Admin  %s has respawned all vehicles", user);
  797.  
  798.         IRC_GroupSay(groupID, channel, string1);
  799.         SendClientMessageToAll(0x00E800C8, string2);
  800.     }
  801.     return 1;
  802. }
  803. IRCCMD:pm(botid, channel[], user[], host[], params[])
  804.  {
  805.      if (IRC_IsVoice(botid, channel, user))
  806.     {
  807.         new playerid, reason[64];
  808.         if (sscanf(params, "dz", playerid, reason))
  809.         {
  810.             return IRC_GroupSay(groupID,"channel","!pm <id> <message>");
  811.         }
  812.         if (IsPlayerConnected(playerid))
  813.         {
  814.             new msg[128], name[MAX_PLAYER_NAME];
  815.             GetPlayerName(playerid, name, sizeof(name));
  816.             format(msg, sizeof(msg), "02>> %s has sent a PM to %s from IRC: %s", user, name, reason);
  817.             IRC_GroupSay(groupID, "channel", msg);
  818.             format(msg, sizeof(msg), "012>> PM from %s on IRC: %s!", user, reason);
  819.             SendClientMessage(playerid, 0xFF9900AA, msg);
  820.         }
  821.         else
  822.         {
  823.             return IRC_GroupSay(groupID,"channel","Wrong ID!");
  824.         }
  825.     }
  826.      return 1;
  827.  }
  828.  IRCCMD:ann( botid, channel[], user[], host[], params[])
  829. {
  830.     if(IRC_IsOp(botid,channel,user))
  831.     {
  832.         new text[128];
  833.         if(sscanf(params,"s[120]",text)) return IRC_GroupNotice(groupID,user, "**Usage: !ann <text>");
  834.         if( 0 > strlen(text) > 140 ) return IRC_GroupNotice(groupID,user,"** Message Size Invalid");
  835.         new str[150];
  836.         GameTextForAll(text,7600,3);
  837.         format(str,64,"->Admin (%s) Announced: %s",text);
  838.         IRC_GroupSay(groupID,"#Sexy",str);
  839.     }
  840.     return 1;
  841. }
  842. IRCCMD:admin(botid, channel[], user[], host[], params[])
  843. {
  844.     // Check if the user has at least voice in the channel
  845.     if (IRC_IsOp(botid, channel, user))
  846.     {
  847.         // Check if the user entered any text
  848.         if (!isnull(params))
  849.         {
  850.             new msg[128];
  851.             // Echo the formatted message
  852.             format(msg, sizeof(msg), "02***Admin %s on IRC: %s", user, params);
  853.             IRC_GroupSay(groupID, "#Sx", msg);
  854.             format(msg, sizeof(msg), "***Admin %s on IRC: %s", user, params);
  855.             SendClientMessageToAll(0x15005EAA, msg);
  856.         }
  857.     }
  858.     return 1;
  859. }
  860.  IRCCMD:announce( botid, channel[], user[], host[], params[])
  861. {
  862.     if(IRC_IsOp(botid,channel,user))
  863.     {
  864.         new text[128];
  865.         if(sscanf(params,"s[120]",text)) return IRC_GroupNotice(groupID,user, "**Usage: !ann <text>");
  866.         if( 0 > strlen(text) > 140 ) return IRC_GroupNotice(groupID,user,"** Message Size Invalid");
  867.         new str[150];
  868.         GameTextForAll(text,7600,3);
  869.         format(str,64,"->Admin (%s) Announced: %s",text);
  870.         IRC_GroupSay(groupID,"#Sexy",str);
  871.     }
  872.     return 1;
  873. }
Add Comment
Please, Sign In to add comment