daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <sourcemod>
  2. #include <ccsplayer>
  3. #include <sdktools>
  4. #include <sdkhooks>
  5.  
  6. #pragma semicolon 1
  7.  
  8. #define DEBUG
  9.  
  10. #define PLUGIN_AUTHOR "Jadow"
  11. #define PLUGIN_VERSION "0.10"
  12. #define prefix " \x0A[\x0Bx\x08G\x0A]\x01 "
  13.  
  14. #include <sourcemod>
  15. #include <sdktools>
  16.  
  17. #pragma newdecls required
  18.  
  19. public Plugin myinfo =
  20. {
  21.     name = "loadouts",
  22.     author = PLUGIN_AUTHOR,
  23.     description = "",
  24.     version = PLUGIN_VERSION,
  25.     url = ""
  26. };
  27.  
  28. char displayp[128];
  29. char displays[128];
  30. char selectedp[128] = "M4A4";
  31. char selectedp2[128];
  32. char selecteds[128] = "Glock";
  33. char selecteds2[128];
  34.  
  35. public void OnPluginStart(){
  36.     RegConsoleCmd("sm_loadouts", Command_Loadouts);
  37.     RegConsoleCmd("sm_loadout", Command_Loadouts);
  38.     RegConsoleCmd("sm_guns", Command_Loadouts);
  39.     RegConsoleCmd("sm_gun", Command_Loadouts);
  40.     HookEvent("round_start", Event_RoundStart);
  41. }
  42.  
  43. public Action Event_RoundStart(Event hEvent, const char[] sName, bool bDontBroadcast){
  44.     for(CCSPlayer p = CCSPlayer(0); CCSPlayer.Next(p);){
  45.         if(p.InGame && p.Team == CS_TEAM_CT && p.Alive){
  46.             for(int i = 0; i <= CS_SLOT_C4;i++){
  47.                 CWeapon wep;
  48.                 while((wep = p.GetWeapon(i)) != NULL_CWEAPON){
  49.                     p.RemoveItem(wep);
  50.                     wep.Kill();
  51.                 }
  52.             }
  53.             GivePlayerWeapon(p, selectedp2);
  54.             GivePlayerWeapon(p, selecteds2);
  55.             GivePlayerWeapon(p, "weapon_knife");
  56.         }
  57.     }
  58. }
  59.  
  60. public Action Command_Loadouts(int client, int args){
  61.     CCSPlayer p = CCSPlayer(client);
  62.     if (CS_TEAM_CT == p.Team){
  63.         Menu menu = new Menu(Menu_Loadouts);
  64.         menu.SetTitle("Loadouts");
  65.         Format(displayp, sizeof(displayp), "Primary: %s", selectedp);
  66.         menu.AddItem("primary", displayp);
  67.         Format(displays, sizeof(displays), "Secondary: %s", selecteds);
  68.         menu.AddItem("secondary", displays);
  69.         menu.Display(client, MENU_TIME_FOREVER);
  70.         return Plugin_Handled;
  71.     }
  72.     else{
  73.         PrintToChat(client, prefix..."You must be on CT to use this!");
  74.     }
  75.     return Plugin_Handled;
  76. }
  77.  
  78. public int Menu_Loadouts(Menu menu, MenuAction action, int client, int itemNum){
  79.     if (action == MenuAction_Select){
  80.         char info[32], display[64];
  81.         menu.GetItem(itemNum, info, sizeof(info), _, display, sizeof(display));
  82.         if(StrEqual(info, "primary")){
  83.             Menu primarymenu = new Menu(Menu_Primary);
  84.             primarymenu.SetTitle("Primaries");
  85.             primarymenu.AddItem("heavy", "Heavy");
  86.             primarymenu.AddItem("smg", "SMG");
  87.             primarymenu.AddItem("rifle", "Rifle");
  88.             primarymenu.Display(client, MENU_TIME_FOREVER);
  89.         }
  90.         else if(StrEqual(info, "secondary")){
  91.             Menu secondarymenu = new Menu(Menu_Secondary);
  92.             secondarymenu.SetTitle("Secondaries");
  93.             secondarymenu.AddItem("none", "None");
  94.             secondarymenu.AddItem("weapon_glock", "Glock");
  95.             secondarymenu.AddItem("weapon_usp_silencer", "USP");
  96.             secondarymenu.AddItem("weapon_hkp2000", "P2000");
  97.             secondarymenu.AddItem("weapon_p250", "P250");
  98.             secondarymenu.AddItem("weapon_elite", "Dualies");
  99.             secondarymenu.AddItem("weapon_tec9", "Tec-9");
  100.             secondarymenu.AddItem("weapon_fiveseven", "Five-Seven");
  101.             secondarymenu.AddItem("weapon_cz75a", "CZ75A");
  102.             secondarymenu.AddItem("weapon_deagle", "Deagle");
  103.             secondarymenu.AddItem("weapon_revolver", "Revolver");
  104.             secondarymenu.Display(client, MENU_TIME_FOREVER);
  105.         }
  106.     }
  107.     else if (action == MenuAction_End){
  108.         delete menu;
  109.     }
  110. }
  111.  
  112. public int Menu_Primary(Menu menu, MenuAction action, int client, int itemNum){
  113.     if (action == MenuAction_Select){
  114.         char info[32], display[64];
  115.         menu.GetItem(itemNum, info, sizeof(info), _, display, sizeof(display));
  116.         if(StrEqual(info, "heavy")){
  117.             Menu hmenu = new Menu(Menu_Heavy);
  118.             hmenu.SetTitle("Heavy");
  119.             hmenu.AddItem("none", "None");
  120.             hmenu.AddItem("weapon_nova", "Nova");
  121.             hmenu.AddItem("weapon_xm1014", "XM1014");
  122.             hmenu.AddItem("weapon_mag7", "Mag7");
  123.             hmenu.AddItem("weapon_sawedoff", "SawedOff");
  124.             hmenu.AddItem("weapon_m249", "M249");
  125.             hmenu.AddItem("weapon_negev", "Negev");
  126.             hmenu.Display(client, MENU_TIME_FOREVER);
  127.         }
  128.         else if(StrEqual(info, "smg")){
  129.             Menu smgmenu = new Menu(Menu_SMG);
  130.             smgmenu.AddItem("none", "None");
  131.             smgmenu.SetTitle("SMG");
  132.             smgmenu.AddItem("weapon_mac10", "MAC-10");
  133.             smgmenu.AddItem("weapon_mp9", "MP9");
  134.             smgmenu.AddItem("weapon_mp5sd", "MP5-SD");
  135.             smgmenu.AddItem("weapon_mp7", "MP7");
  136.             smgmenu.AddItem("weapon_ump45", "UMP-45");
  137.             smgmenu.AddItem("weapon_p90", "P90");
  138.             smgmenu.AddItem("weapon_bizon", "PP-Bizon");
  139.             smgmenu.Display(client, MENU_TIME_FOREVER);
  140.         }
  141.         else if(StrEqual(info, "rifle")){
  142.             Menu rmenu = new Menu(Menu_Rifle);
  143.             rmenu.SetTitle("Rifle");
  144.             rmenu.AddItem("none", "None");
  145.             rmenu.AddItem("weapon_galil", "Galil AR");
  146.             rmenu.AddItem("weapon_famas", "Famas");
  147.             rmenu.AddItem("weapon_ak47", "AK-47");
  148.             rmenu.AddItem("weapon_m4a1", "M4A4");
  149.             rmenu.AddItem("weapon_m4a1_silencer", "M4A1-S");
  150.             rmenu.AddItem("weapon_sg553", "SG553");
  151.             rmenu.AddItem("weapon_aug", "AUG");
  152.             rmenu.AddItem("weapon_ssg08", "SSG08");
  153.             rmenu.AddItem("weapon_awp", "AWP");
  154.             rmenu.AddItem("weapon_g3sg1", "G3SG1");
  155.             rmenu.AddItem("weapon_scar20", "SCAR-20");
  156.             rmenu.Display(client, MENU_TIME_FOREVER);
  157.         }
  158.     }
  159.     else if (action == MenuAction_End){
  160.         delete menu;
  161.     }
  162. }
  163.  
  164. public int Menu_Secondary(Menu menu, MenuAction action, int client, int itemNum){
  165.     if (action == MenuAction_Select){
  166.         char info[32], display[64];
  167.         menu.GetItem(itemNum, info, sizeof(info), _, display, sizeof(display));
  168.         if(StrEqual(info, "weapon_glock")){
  169.             selecteds = "Glock";
  170.             selecteds2 = "weapon_glock";
  171.         }
  172.         else if(StrEqual(info, "weapon_usp_silencer")){
  173.             selecteds = "USP-S";
  174.             selecteds2 = "weapon_usp_silencer";
  175.         }
  176.         else if(StrEqual(info, "weapon_hkp2000")){
  177.             selecteds = "P2000";
  178.             selecteds2 = "weapon_hkp2000";
  179.         }
  180.         else if(StrEqual(info, "weapon_p250")){
  181.             selecteds = "P250";
  182.             selecteds2 = "weapon_p250";
  183.         }
  184.         else if(StrEqual(info, "weapon_elite")){
  185.             selecteds = "Dualies";
  186.             selecteds2 = "weapon_elite";
  187.         }
  188.         else if(StrEqual(info, "weapon_tec9")){
  189.             selecteds = "Tec-9";
  190.             selecteds2 = "weapon_tec9";
  191.         }
  192.         else if(StrEqual(info, "weapon_fiveseven")){
  193.             selecteds = "Five-Seven";
  194.             selecteds2 = "weapon_fiveseven";
  195.         }
  196.         else if(StrEqual(info, "weapon_cz75a")){
  197.             selecteds = "CZ75A";
  198.             selecteds2 = "weapon_cz75a";
  199.         }
  200.         else if(StrEqual(info, "weapon_deagle")){
  201.             selecteds = "Deagle";
  202.             selecteds2 = "weapon_deagle";
  203.         }
  204.         else if(StrEqual(info, "weapon_revolver")){
  205.             selecteds = "Revolver";
  206.             selecteds2 = "weapon_revolver";
  207.         }
  208.     }
  209.     else if (action == MenuAction_End){
  210.         delete menu;
  211.     }
  212. }
  213.  
  214. public int Menu_Heavy(Menu menu, MenuAction action, int client, int itemNum){
  215.     if (action == MenuAction_Select){
  216.         char info[32], display[64];
  217.         menu.GetItem(itemNum, info, sizeof(info), _, display, sizeof(display));
  218.         if(StrEqual(info, "weapon_nova")){
  219.             selectedp = "Nova";
  220.             selectedp2 = "weapon_nova";
  221.         }
  222.         else if(StrEqual(info, "weapon_xm1014")){
  223.             selectedp = "XM1014";
  224.             selectedp2 = "weapon_xm1014";
  225.         }
  226.         else if(StrEqual(info, "weapon_mag7")){
  227.             selectedp = "Mag7";
  228.             selectedp2 = "weapon_mag7";
  229.         }
  230.         else if(StrEqual(info, "weapon_sawedoff")){
  231.             selectedp = "Sawed Off";
  232.             selectedp2 = "weapon_sawedoff";
  233.         }
  234.         else if(StrEqual(info, "weapon_m249")){
  235.             selectedp = "M249";
  236.             selectedp2 = "weapon_M249";
  237.         }
  238.         else if(StrEqual(info, "weapon_negev")){
  239.             selectedp = "Negev";
  240.             selectedp2 = "weapon_Negev";
  241.         }
  242.     }
  243.     else if (action == MenuAction_End){
  244.         delete menu;
  245.     }
  246. }
  247.  
  248. public int Menu_SMG(Menu menu, MenuAction action, int client, int itemNum){
  249.     if (action == MenuAction_Select){
  250.         char info[32], display[64];
  251.         menu.GetItem(itemNum, info, sizeof(info), _, display, sizeof(display));
  252.         if(StrEqual(info, "weapon_mac10")){
  253.             selectedp = "MAC-10";
  254.             selectedp2 = "weapon_mac10";
  255.         }
  256.         else if(StrEqual(info, "weapon_mp9")){
  257.             selectedp = "MP9";
  258.             selectedp2 = "weapon_mp9";
  259.         }
  260.         else if(StrEqual(info, "weapon_mp5sd")){
  261.             selectedp = "MP5-SD";
  262.             selectedp2 = "weapon_mp5sd";
  263.         }
  264.         else if(StrEqual(info, "weapon_mp7")){
  265.             selectedp = "MP7";
  266.             selectedp2 = "weapon_mp7";
  267.         }
  268.         else if(StrEqual(info, "weapon_ump45")){
  269.             selectedp = "UMP-45";
  270.             selectedp2 = "weapon_ump45";
  271.         }
  272.         else if(StrEqual(info, "weapon_p90")){
  273.             selectedp = "P90";
  274.             selectedp2 = "weapon_p90";
  275.         }
  276.         else if(StrEqual(info, "weapon_bizon")){
  277.             selectedp = "PP-Bizon";
  278.             selectedp2 = "weapon_bizon";
  279.         }
  280.     }
  281.     else if (action == MenuAction_End){
  282.         delete menu;
  283.     }
  284. }
  285.  
  286. public int Menu_Rifle(Menu menu, MenuAction action, int client, int itemNum){
  287.     if (action == MenuAction_Select){
  288.         char info[32], display[64];
  289.         menu.GetItem(itemNum, info, sizeof(info), _, display, sizeof(display));
  290.         if(StrEqual(info, "weapon_galil")){
  291.             selectedp = "Galil AR";
  292.             selectedp2 = "weapon_galil";
  293.         }
  294.         else if(StrEqual(info, "weapon_famas")){
  295.             selectedp = "Famas";
  296.             selectedp2 = "weapon_famas";
  297.         }
  298.         else if(StrEqual(info, "weapon_ak47")){
  299.             selectedp = "AK-47";
  300.             selectedp2 = "weapon_ak47";
  301.         }
  302.         else if(StrEqual(info, "weapon_m4a1")){
  303.             selectedp = "M4A4";
  304.             selectedp2 = "weapon_m4a1";
  305.         }
  306.         else if(StrEqual(info, "weapon_m4a1_silencer")){
  307.             selectedp = "M4A1-S";
  308.             selectedp2 = "weapon_m4a1_silencer";
  309.         }
  310.         else if(StrEqual(info, "weapon_sg553")){
  311.             selectedp = "SG553";
  312.             selectedp2 = "weapon_sg553";
  313.         }
  314.         else if(StrEqual(info, "weapon_aug")){
  315.             selectedp = "AUG";
  316.             selectedp2 = "weapon_aug";
  317.         }
  318.         else if(StrEqual(info, "weapon_ssg08")){
  319.             selectedp = "SSG08";
  320.             selectedp2 = "weapon_ssg08";
  321.         }
  322.         else if(StrEqual(info, "weapon_awp")){
  323.             selectedp = "AWP";
  324.             selectedp2 = "weapon_awp";
  325.         }
  326.         else if(StrEqual(info, "weapon_g3sg1")){
  327.             selectedp = "G3SG1";
  328.             selectedp2 = "weapon_g3sg1";
  329.         }
  330.         else if(StrEqual(info, "weapon_scar20")){
  331.             selectedp = "SCAR-20";
  332.             selectedp2 = "weapon_scar20";
  333.         }
  334.     }
  335.     else if (action == MenuAction_End){
  336.         delete menu;
  337.     }
  338. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top