Advertisement
Tibers

Weapons Skins System

Mar 11th, 2024 (edited)
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 60.47 KB | Source Code | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <nvault>
  4. #include <engine>
  5. #include <cstrike>
  6.  
  7. #define PLUGIN  "Weapons Skins System"
  8. #define VERZIJA "1.4"
  9. #define AUTOR   "Pićunak & Tibers"
  10. #define Prefiks "!g[!ySkins-System!g]"
  11. #define MaxLevel 520
  12. new bool:hud[33];
  13. const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0;
  14. new iCountUnlockLevel[33];
  15. new iCountIndividualKNIFE[33][11]; // A two-dimensional array to store the level of each knife for each player
  16. new model_knife[33];
  17. new iCountIndividualAWP[33][21]; // A two-dimensional array to store the level of each AWP for each player
  18. new model_awp[33];
  19. new iCountIndividualAK47[33][21]; // A two-dimensional array to store the level of each AK47 for each player
  20. new model_ak47[33];
  21. new iCountIndividualM4A1[33][21]; // A two-dimensional array to store the level of each M4A1 for each player
  22. new model_m4a1[33];
  23. new iCountIndividualDEAGLE[33][16]; // A two-dimensional array to store the level of each Deagle for each player
  24. new model_deagle[33];
  25. new iCountIndividualGLOCK18[33][11]; // A two-dimensional array to store the level of each Glock18 for each player
  26. new model_glock18[33];
  27. new iCountIndividualUSP[33][11]; // A two-dimensional array to store the level of each USP for each player
  28. new model_usp[33];
  29.  
  30. enum SkinDataKNIFE
  31. {
  32.     NameKNIFE,
  33.     UnlockLevelKNIFE,
  34.     V_KNIFE,
  35.     P_KNIFE,
  36.     IndividualLevelKNIFE
  37. };
  38.  
  39. new const SkinsDataKNIFE[11][SkinDataKNIFE][] =
  40. {
  41.     {"Karambit|Default",           0, "models/Skins-System/knives/v_knife_0.mdl", "models/Skins-System/knives/p_knife_0.mdl", 0},
  42.     {"Karambit|Automatic Blue",   10, "models/Skins-System/knives/v_knife_1.mdl", "models/Skins-System/knives/p_knife_1.mdl", 0},
  43.     {"Karambit|Case Hardened",    20, "models/Skins-System/knives/v_knife_2.mdl", "models/Skins-System/knives/p_knife_2.mdl", 0},
  44.     {"Karambit|Fade",             15, "models/Skins-System/knives/v_knife_3.mdl", "models/Skins-System/knives/p_knife_3.mdl", 0},
  45.     {"Karambit|Fever Dream",      40, "models/Skins-System/knives/v_knife_4.mdl", "models/Skins-System/knives/p_knife_4.mdl", 0},
  46.     {"Karambit|Lore",             50, "models/Skins-System/knives/v_knife_5.mdl", "models/Skins-System/knives/p_knife_5.mdl", 0},
  47.     {"Karambit|Paw",              60, "models/Skins-System/knives/v_knife_6.mdl", "models/Skins-System/knives/p_knife_6.mdl", 0},
  48.     {"Karambit|Printstream 1",    70, "models/Skins-System/knives/v_knife_7.mdl", "models/Skins-System/knives/p_knife_7.mdl", 0},
  49.     {"Karambit|Printstream 2",    80, "models/Skins-System/knives/v_knife_8.mdl", "models/Skins-System/knives/p_knife_8.mdl", 0},
  50.     {"Karambit|Tiger Tooth",      90, "models/Skins-System/knives/v_knife_9.mdl", "models/Skins-System/knives/p_knife_9.mdl", 0},
  51.     {"Karambit|Water Elemental", 100, "models/Skins-System/knives/v_knife_10.mdl", "models/Skins-System/knives/p_knife_10.mdl", 0}
  52. };
  53.  
  54. enum SkinDataAWP
  55. {
  56.     NameAWP,
  57.     UnlockLevelAWP,
  58.     V_AWP,
  59.     P_AWP,
  60.     IndividualLevelAWP
  61. };
  62.  
  63. new const SkinsDataAWP[21][SkinDataAWP][] =
  64. {
  65.     {"AWP|Default",                 0,  "models/Skins-System/awp/v_awp_0.mdl", "models/Skins-System/awp/p_awp_0.mdl", 0},
  66.     {"AWP|Asiimov",                10,  "models/Skins-System/awp/v_awp_1.mdl", "models/Skins-System/awp/p_awp_1.mdl", 0},
  67.     {"AWP|Atheris",                20,  "models/Skins-System/awp/v_awp_2.mdl", "models/Skins-System/awp/p_awp_2.mdl", 0},
  68.     {"AWP|Bloodsport",             30,  "models/Skins-System/awp/v_awp_3.mdl", "models/Skins-System/awp/p_awp_3.mdl", 0},
  69.     {"AWP|Chromatic Aberration",   40,  "models/Skins-System/awp/v_awp_4.mdl", "models/Skins-System/awp/p_awp_4.mdl", 0},
  70.     {"AWP|Containment Breach",     50,  "models/Skins-System/awp/v_awp_5.mdl", "models/Skins-System/awp/p_awp_5.mdl", 0},
  71.     {"AWP|Desert Hydra",           60,  "models/Skins-System/awp/v_awp_6.mdl", "models/Skins-System/awp/p_awp_6.mdl", 0},
  72.     {"AWP|Dragon Lore",            70,  "models/Skins-System/awp/v_awp_7.mdl", "models/Skins-System/awp/p_awp_7.mdl", 0},
  73.     {"AWP|Fade",                   80,  "models/Skins-System/awp/v_awp_8.mdl", "models/Skins-System/awp/p_awp_8.mdl", 0},
  74.     {"AWP|Fever Dream",            90,  "models/Skins-System/awp/v_awp_9.mdl", "models/Skins-System/awp/p_awp_9.mdl", 0},
  75.     {"AWP|Gungnir",               100, "models/Skins-System/awp/v_awp_10.mdl", "models/Skins-System/awp/p_awp_10.mdl", 0},
  76.     {"AWP|Hyper Beast",           110, "models/Skins-System/awp/v_awp_11.mdl", "models/Skins-System/awp/p_awp_11.mdl", 0},
  77.     {"AWP|Neo-Noir",              120, "models/Skins-System/awp/v_awp_12.mdl", "models/Skins-System/awp/p_awp_12.mdl", 0},
  78.     {"AWP|Nightwish",             130, "models/Skins-System/awp/v_awp_13.mdl", "models/Skins-System/awp/p_awp_13.mdl", 0},
  79.     {"AWP|Paw",                   140, "models/Skins-System/awp/v_awp_14.mdl", "models/Skins-System/awp/p_awp_14.mdl", 0},
  80.     {"AWP|Printstream",           150, "models/Skins-System/awp/v_awp_15.mdl", "models/Skins-System/awp/p_awp_15.mdl", 0},
  81.     {"AWP|Slither",               160, "models/Skins-System/awp/v_awp_16.mdl", "models/Skins-System/awp/p_awp_16.mdl", 0},
  82.     {"AWP|Smoke MID",             170, "models/Skins-System/awp/v_awp_17.mdl", "models/Skins-System/awp/p_awp_17.mdl", 0},
  83.     {"AWP|SnowMan",               180, "models/Skins-System/awp/v_awp_18.mdl", "models/Skins-System/awp/p_awp_18.mdl", 0},
  84.     {"AWP|The Empress",           190, "models/Skins-System/awp/v_awp_19.mdl", "models/Skins-System/awp/p_awp_19.mdl", 0},
  85.     {"AWP|The Prince",            200, "models/Skins-System/awp/v_awp_20.mdl", "models/Skins-System/awp/p_awp_20.mdl", 0}
  86. };
  87.  
  88. enum SkinDataAK47
  89. {
  90.     NameAK47,
  91.     UnlockLevelAK47,
  92.     V_AK47,
  93.     P_AK47,
  94.     IndividualLevelAK47
  95. };
  96.  
  97. new const SkinsDataAK47[21][SkinDataAK47][] =
  98. {
  99.     {"AK-47|Default",               0, "models/Skins-System/ak47/v_ak47_0.mdl", "models/Skins-System/ak47/p_ak47_0.mdl", 0},
  100.     {"AK-47|Asiimov",              10, "models/Skins-System/ak47/v_ak47_1.mdl", "models/Skins-System/ak47/p_ak47_1.mdl", 0},
  101.     {"AK-47|Bloodsport",           20, "models/Skins-System/ak47/v_ak47_2.mdl", "models/Skins-System/ak47/p_ak47_2.mdl", 0},
  102.     {"AK-47|Cartel",               30, "models/Skins-System/ak47/v_ak47_3.mdl", "models/Skins-System/ak47/p_ak47_3.mdl", 0},
  103.     {"AK-47|Chromatic Aberration", 40, "models/Skins-System/ak47/v_ak47_4.mdl", "models/Skins-System/ak47/p_ak47_4.mdl", 0},
  104.     {"AK-47|Dragon Lore",          50, "models/Skins-System/ak47/v_ak47_5.mdl", "models/Skins-System/ak47/p_ak47_5.mdl", 0},
  105.     {"AK-47|Fade",                 60, "models/Skins-System/ak47/v_ak47_6.mdl", "models/Skins-System/ak47/p_ak47_6.mdl", 0},
  106.     {"AK-47|Fallen Warrior",       70, "models/Skins-System/ak47/v_ak47_7.mdl", "models/Skins-System/ak47/p_ak47_7.mdl", 0},
  107.     {"AK-47|Fire Serpent",         80, "models/Skins-System/ak47/v_ak47_8.mdl", "models/Skins-System/ak47/p_ak47_8.mdl", 0},
  108.     {"AK-47|Ice Coaled",           90, "models/Skins-System/ak47/v_ak47_9.mdl", "models/Skins-System/ak47/p_ak47_9.mdl", 0},
  109.     {"AK-47|Leet Museo",          100, "models/Skins-System/ak47/v_ak47_10.mdl", "models/Skins-System/ak47/p_ak47_10.mdl", 0},
  110.     {"AK-47|Master Kush",         110, "models/Skins-System/ak47/v_ak47_11.mdl", "models/Skins-System/ak47/p_ak47_11.mdl", 0},
  111.     {"AK-47|Neon Revolution",     120, "models/Skins-System/ak47/v_ak47_12.mdl", "models/Skins-System/ak47/p_ak47_12.mdl", 0},
  112.     {"AK-47|Neon Rider",          130, "models/Skins-System/ak47/v_ak47_13.mdl", "models/Skins-System/ak47/p_ak47_13.mdl", 0},
  113.     {"AK-47|Nightwish",           140, "models/Skins-System/ak47/v_ak47_14.mdl", "models/Skins-System/ak47/p_ak47_14.mdl", 0},
  114.     {"AK-47|Panthera onca",       150, "models/Skins-System/ak47/v_ak47_15.mdl", "models/Skins-System/ak47/p_ak47_15.mdl", 0},
  115.     {"AK-47|Printstream",         160, "models/Skins-System/ak47/v_ak47_16.mdl", "models/Skins-System/ak47/p_ak47_16.mdl", 0},
  116.     {"AK-47|Smoke MID",           170, "models/Skins-System/ak47/v_ak47_17.mdl", "models/Skins-System/ak47/p_ak47_17.mdl", 0},
  117.     {"AK-47|The Empress",         180, "models/Skins-System/ak47/v_ak47_18.mdl", "models/Skins-System/ak47/p_ak47_18.mdl", 0},
  118.     {"AK-47|Wild Lotus",          190, "models/Skins-System/ak47/v_ak47_19.mdl", "models/Skins-System/ak47/p_ak47_19.mdl", 0},
  119.     {"AK-47|Wolverine",           200, "models/Skins-System/ak47/v_ak47_20.mdl", "models/Skins-System/ak47/p_ak47_20.mdl", 0}
  120. };
  121.  
  122. enum SkinDataM4A1
  123. {
  124.     NameM4A1,
  125.     UnlockLevelM4A1,
  126.     V_M4A1,
  127.     P_M4A1,
  128.     IndividualLevelM4A1
  129. };
  130.  
  131. new const SkinsDataM4A1[21][SkinDataM4A1][] =
  132. {
  133.     {"M4A1-S|Default",                 0, "models/Skins-System/m4a1/v_m4a1_0.mdl", "models/Skins-System/m4a1/p_m4a1_0.mdl", 0},
  134.     {"M4A1-S|Bloodsport",             10, "models/Skins-System/m4a1/v_m4a1_1.mdl", "models/Skins-System/m4a1/p_m4a1_1.mdl", 0},
  135.     {"M4A1-S|Chantico's Fire",        20, "models/Skins-System/m4a1/v_m4a1_2.mdl", "models/Skins-System/m4a1/p_m4a1_2.mdl", 0},
  136.     {"M4A1-S|Chromatic Aberration",   30, "models/Skins-System/m4a1/v_m4a1_3.mdl", "models/Skins-System/m4a1/p_m4a1_3.mdl", 0},
  137.     {"M4A1-S|Control Panel",          40, "models/Skins-System/m4a1/v_m4a1_4.mdl", "models/Skins-System/m4a1/p_m4a1_4.mdl", 0},
  138.     {"M4A1-S|Cutter",                 50, "models/Skins-System/m4a1/v_m4a1_5.mdl", "models/Skins-System/m4a1/p_m4a1_5.mdl", 0},
  139.     {"M4A1-S|Decimator",              60, "models/Skins-System/m4a1/v_m4a1_6.mdl", "models/Skins-System/m4a1/p_m4a1_6.mdl", 0},
  140.     {"M4A1-S|Dragon Lore",            70, "models/Skins-System/m4a1/v_m4a1_7.mdl", "models/Skins-System/m4a1/p_m4a1_7.mdl", 0},
  141.     {"M4A1-S|Flashback",              80, "models/Skins-System/m4a1/v_m4a1_8.mdl", "models/Skins-System/m4a1/p_m4a1_8.mdl", 0},
  142.     {"M4A1-S|Golden Coil",            90, "models/Skins-System/m4a1/v_m4a1_9.mdl", "models/Skins-System/m4a1/p_m4a1_9.mdl", 0},
  143.     {"M4A1-S|Hyper Beast",           100, "models/Skins-System/m4a1/v_m4a1_10.mdl", "models/Skins-System/m4a1/p_m4a1_10.mdl", 0},
  144.     {"M4A1-S|Imminent Danger",       110, "models/Skins-System/m4a1/v_m4a1_11.mdl", "models/Skins-System/m4a1/p_m4a1_11.mdl", 0},
  145.     {"M4A1-S|Kill Confirmed",        120, "models/Skins-System/m4a1/v_m4a1_12.mdl", "models/Skins-System/m4a1/p_m4a1_12.mdl", 0},
  146.     {"M4A1-S|Light Of King",         130, "models/Skins-System/m4a1/v_m4a1_13.mdl", "models/Skins-System/m4a1/p_m4a1_13.mdl", 0},
  147.     {"M4A1-S|Marble Fade",           140, "models/Skins-System/m4a1/v_m4a1_14.mdl", "models/Skins-System/m4a1/p_m4a1_14.mdl", 0},
  148.     {"M4A1-S|Mecha Industries",      150, "models/Skins-System/m4a1/v_m4a1_15.mdl", "models/Skins-System/m4a1/p_m4a1_15.mdl", 0},
  149.     {"M4A1-S|Neo-Noir",              160, "models/Skins-System/m4a1/v_m4a1_16.mdl", "models/Skins-System/m4a1/p_m4a1_16.mdl", 0},
  150.     {"M4A1-S|Nightmare",             170, "models/Skins-System/m4a1/v_m4a1_17.mdl", "models/Skins-System/m4a1/p_m4a1_17.mdl", 0},
  151.     {"M4A1-S|Player Two",            180, "models/Skins-System/m4a1/v_m4a1_18.mdl", "models/Skins-System/m4a1/p_m4a1_18.mdl", 0},
  152.     {"M4A1-S|Printstream",           190, "models/Skins-System/m4a1/v_m4a1_19.mdl", "models/Skins-System/m4a1/p_m4a1_19.mdl", 0},
  153.     {"M4A1-S|Welcome to the Jungle", 200, "models/Skins-System/m4a1/v_m4a1_20.mdl", "models/Skins-System/m4a1/p_m4a1_20.mdl", 0}
  154. };
  155.  
  156. enum SkinDataDEAGLE
  157. {
  158.     NameDEAGLE,
  159.     UnlockLevelDEAGLE,
  160.     V_DEAGLE,
  161.     P_DEAGLE,
  162.     IndividualLevelDEAGLE
  163. };
  164.  
  165. new const SkinsDataDEAGLE[16][SkinDataDEAGLE][] =
  166. {
  167.     {"DEAGLE|Default",                  0, "models/Skins-System/deagle/v_deagle_0.mdl", "models/Skins-System/deagle/p_deagle_0.mdl", 0},
  168.     {"DEAGLE|Bloodsport",              10, "models/Skins-System/deagle/v_deagle_1.mdl", "models/Skins-System/deagle/p_deagle_1.mdl", 0},
  169.     {"DEAGLE|Blue Polygon",            20, "models/Skins-System/deagle/v_deagle_2.mdl", "models/Skins-System/deagle/p_deagle_2.mdl", 0},
  170.     {"DEAGLE|Chromatic Aberration",    30, "models/Skins-System/deagle/v_deagle_3.mdl", "models/Skins-System/deagle/p_deagle_3.mdl", 0},
  171.     {"DEAGLE|Code Red",                40, "models/Skins-System/deagle/v_deagle_4.mdl", "models/Skins-System/deagle/p_deagle_4.mdl", 0},
  172.     {"DEAGLE|Dragon Lore",             50, "models/Skins-System/deagle/v_deagle_5.mdl", "models/Skins-System/deagle/p_deagle_5.mdl", 0},
  173.     {"DEAGLE|Fade",                    60, "models/Skins-System/deagle/v_deagle_6.mdl", "models/Skins-System/deagle/p_deagle_6.mdl", 0},
  174.     {"DEAGLE|Fennec Fox",              70, "models/Skins-System/deagle/v_deagle_7.mdl", "models/Skins-System/deagle/p_deagle_7.mdl", 0},
  175.     {"DEAGLE|HS Level",                80, "models/Skins-System/deagle/v_deagle_8.mdl", "models/Skins-System/deagle/p_deagle_8.mdl", 0},
  176.     {"DEAGLE|Kill Confirmed",          90, "models/Skins-System/deagle/v_deagle_9.mdl", "models/Skins-System/deagle/p_deagle_9.mdl", 0},
  177.     {"DEAGLE|Kumicho Dragon",         100, "models/Skins-System/deagle/v_deagle_10.mdl", "models/Skins-System/deagle/p_deagle_10.mdl", 0},
  178.     {"DEAGLE|Mecha Industries",       110, "models/Skins-System/deagle/v_deagle_11.mdl", "models/Skins-System/deagle/p_deagle_11.mdl", 0},
  179.     {"DEAGLE|Ocean Drive",            120, "models/Skins-System/deagle/v_deagle_12.mdl", "models/Skins-System/deagle/p_deagle_12.mdl", 0},
  180.     {"DEAGLE|Oxide Blaze",            130, "models/Skins-System/deagle/v_deagle_13.mdl", "models/Skins-System/deagle/p_deagle_13.mdl", 0},
  181.     {"DEAGLE|Prinstream",             140, "models/Skins-System/deagle/v_deagle_14.mdl", "models/Skins-System/deagle/p_deagle_14.mdl", 0},
  182.     {"DEAGLE|Trigger Discipline",     150, "models/Skins-System/deagle/v_deagle_15.mdl", "models/Skins-System/deagle/p_deagle_15.mdl", 0}
  183. };
  184.  
  185. enum SkinDataGLOCK18
  186. {
  187.     NameGLOCK18,
  188.     UnlockLevelGLOCK18,
  189.     V_GLOCK18,
  190.     P_GLOCK18,
  191.     IndividualLevelGLOCK18
  192. };
  193.  
  194. new const SkinsDataGLOCK18[11][SkinDataGLOCK18][] =
  195. {
  196.     {"GLOCK-18|Default",                0, "models/Skins-System/glock18/v_glock18_0.mdl", "models/Skins-System/glock18/p_glock18_0.mdl", 0},
  197.     {"GLOCK-18|Bullet Queen",          10, "models/Skins-System/glock18/v_glock18_1.mdl", "models/Skins-System/glock18/p_glock18_1.mdl", 0},
  198.     {"GLOCK-18|Chromatic Aberration",  20, "models/Skins-System/glock18/v_glock18_2.mdl", "models/Skins-System/glock18/p_glock18_2.mdl", 0},
  199.     {"GLOCK-18|Eagle",                 30, "models/Skins-System/glock18/v_glock18_3.mdl", "models/Skins-System/glock18/p_glock18_3.mdl", 0},
  200.     {"GLOCK-18|Fade",                  40, "models/Skins-System/glock18/v_glock18_4.mdl", "models/Skins-System/glock18/p_glock18_4.mdl", 0},
  201.     {"GLOCK-18|Hornet",                50, "models/Skins-System/glock18/v_glock18_5.mdl", "models/Skins-System/glock18/p_glock18_5.mdl", 0},
  202.     {"GLOCK-18|Neo-Noir",              60, "models/Skins-System/glock18/v_glock18_6.mdl", "models/Skins-System/glock18/p_glock18_6.mdl", 0},
  203.     {"GLOCK-18|Sacrifice",             70, "models/Skins-System/glock18/v_glock18_7.mdl", "models/Skins-System/glock18/p_glock18_7.mdl", 0},
  204.     {"GLOCK-18|Vogue",                 80, "models/Skins-System/glock18/v_glock18_8.mdl", "models/Skins-System/glock18/p_glock18_8.mdl", 0},
  205.     {"GLOCK-18|Water Elemental",       90, "models/Skins-System/glock18/v_glock18_9.mdl", "models/Skins-System/glock18/p_glock18_9.mdl", 0},
  206.     {"GLOCK-18|Weasel",               100, "models/Skins-System/glock18/v_glock18_10.mdl", "models/Skins-System/glock18/p_glock18_10.mdl", 0}
  207. };
  208.  
  209. enum SkinDataUSP
  210. {
  211.     NameUSP,
  212.     UnlockLevelUSP,
  213.     V_USP,
  214.     P_USP,
  215.     IndividualLevelUSP
  216. };
  217.  
  218. new const SkinsDataUSP[11][SkinDataUSP][] =
  219. {
  220.     {"USP-S|Default",                0, "models/Skins-System/usp/v_usp_0.mdl", "models/Skins-System/usp/p_usp_0.mdl", 0},
  221.     {"USP-S|Bloodsport",            10, "models/Skins-System/usp/v_usp_1.mdl", "models/Skins-System/usp/p_usp_1.mdl", 0},
  222.     {"USP-S|Burnished",             20, "models/Skins-System/usp/v_usp_2.mdl", "models/Skins-System/usp/p_usp_2.mdl", 0},
  223.     {"USP-S|Chromatic Aberration",  30, "models/Skins-System/usp/v_usp_3.mdl", "models/Skins-System/usp/p_usp_3.mdl", 0},
  224.     {"USP-S|Cortex",                40, "models/Skins-System/usp/v_usp_4.mdl", "models/Skins-System/usp/p_usp_4.mdl", 0},
  225.     {"USP-S|Flashback",             50, "models/Skins-System/usp/v_usp_5.mdl", "models/Skins-System/usp/p_usp_5.mdl", 0},
  226.     {"USP-S|Kill Confirmed",        60, "models/Skins-System/usp/v_usp_6.mdl", "models/Skins-System/usp/p_usp_6.mdl", 0},
  227.     {"USP-S|Neo-Noir",              70, "models/Skins-System/usp/v_usp_7.mdl", "models/Skins-System/usp/p_usp_7.mdl", 0},
  228.     {"USP-S|Printstream",           80, "models/Skins-System/usp/v_usp_8.mdl", "models/Skins-System/usp/p_usp_8.mdl", 0},
  229.     {"USP-S|Revenge is Sweet",      90, "models/Skins-System/usp/v_usp_9.mdl", "models/Skins-System/usp/p_usp_9.mdl", 0},
  230.     {"USP-S|The Traitor",          100, "models/Skins-System/usp/v_usp_10.mdl", "models/Skins-System/usp/p_usp_10.mdl", 0}
  231. };
  232.  
  233. new g_msgsync;
  234. new g_Vault;
  235.  
  236. public plugin_precache()
  237. {
  238.     // Precache for SkinsDataKNIFE
  239.     for (new i = 0; i < sizeof(SkinsDataKNIFE); i++)
  240.     {
  241.         precache_model(SkinsDataKNIFE[i][V_KNIFE]);
  242.         precache_model(SkinsDataKNIFE[i][P_KNIFE]);
  243.     }
  244.  
  245.     // Precache for SkinsDataAWP
  246.     for (new i = 0; i < sizeof(SkinsDataAWP); i++)
  247.     {
  248.         precache_model(SkinsDataAWP[i][V_AWP]);
  249.         precache_model(SkinsDataAWP[i][P_AWP]);
  250.     }
  251.  
  252.     // Precache for SkinsDataAK47
  253.     for (new i = 0; i < sizeof(SkinsDataAK47); i++)
  254.     {
  255.         precache_model(SkinsDataAK47[i][V_AK47]);
  256.         precache_model(SkinsDataAK47[i][P_AK47]);
  257.     }
  258.  
  259.     // Precache for SkinsDataM4A1
  260.     for (new i = 0; i < sizeof(SkinsDataM4A1); i++)
  261.     {
  262.         precache_model(SkinsDataM4A1[i][V_M4A1]);
  263.         precache_model(SkinsDataM4A1[i][P_M4A1]);
  264.     }
  265.  
  266.     // Precache for SkinsDataDEAGLE
  267.     for (new i = 0; i < sizeof(SkinsDataDEAGLE); i++)
  268.     {
  269.         precache_model(SkinsDataDEAGLE[i][V_DEAGLE]);
  270.         precache_model(SkinsDataDEAGLE[i][P_DEAGLE]);
  271.     }
  272.  
  273.     // Precache for SkinsDataGLOCK18
  274.     for (new i = 0; i < sizeof(SkinsDataGLOCK18); i++)
  275.     {
  276.         precache_model(SkinsDataGLOCK18[i][V_GLOCK18]);
  277.         precache_model(SkinsDataGLOCK18[i][P_GLOCK18]);
  278.     }
  279.  
  280.     // Precache for SkinsDataUSP
  281.     for (new i = 0; i < sizeof(SkinsDataUSP); i++)
  282.     {
  283.         precache_model(SkinsDataUSP[i][V_USP]);
  284.         precache_model(SkinsDataUSP[i][P_USP]);
  285.     }
  286. }
  287.  
  288. public plugin_init()
  289. {
  290.     register_plugin(PLUGIN, VERZIJA, AUTOR);
  291.     register_clcmd("say /knife", "ChangeKnife");
  292.     register_clcmd("say_team /knife", "ChangeKnife");
  293.     register_clcmd("say /awp", "ChangeAwp");
  294.     register_clcmd("say_team /awp", "ChangeAwp");
  295.     register_clcmd("say /ak47", "ChangeAk47");
  296.     register_clcmd("say_team /ak47", "ChangeAk47");
  297.     register_clcmd("say /m4a1", "ChangeM4a1");
  298.     register_clcmd("say_team /m4a1", "ChangeM4a1");
  299.     register_clcmd("say /deagle", "ChangeDeagle");
  300.     register_clcmd("say_team /deagle", "ChangeDeagle");
  301.     register_clcmd("say /glock18", "ChangeGlock18");
  302.     register_clcmd("say_team /glock18", "ChangeGlock18");
  303.     register_clcmd("say /usp", "ChangeUsp");
  304.     register_clcmd("say_team /usp", "ChangeUsp");
  305.     register_concmd("give_level", "amx_addlevel", ADMIN_RCON, "<nick> <num> - Adds levels to a player.");
  306.     register_concmd("set_level", "amx_setlevel", ADMIN_RCON, "<nick> <num> - Sets levels for players.");
  307.     register_event("DeathMsg", "CountLevelUnlock", "a");
  308.     register_event("DeathMsg", "CountIndividual", "a", "1>0", "1!2");
  309.     register_event("CurWeapon", "CurWeapon", "be", "1=1");
  310.     register_menu("Weapons Skins", KEYSMENU, "weapons_skins");
  311.     register_clcmd("nightvision", "WeaponSkins");
  312.     register_clcmd("say /skins", "WeaponSkins");
  313.     register_clcmd("say /hudk", "ToggleHud"); // Calls ToggleHud on the "/hudk" command
  314.     g_msgsync = CreateHudSyncObj();
  315.     g_Vault = nvault_open("SkinsSystem");
  316. }
  317.  
  318. public client_disconnected(id)
  319. {
  320.     // Save player data when disconnected
  321.     SaveData(id);
  322.     remove_task(id);
  323. }
  324. // Function called when a client is authorized
  325. public client_authorized(id)
  326. {
  327.     // Load player data when authorized
  328.     LoadData(id);
  329.     set_task(1.0, "show_hud", id, _, _, "b");
  330. }
  331.  
  332. public show_hud(id) {
  333.     if (!hud[id]) {
  334.         if (is_user_alive(id)) {
  335.             set_hudmessage(0, 127, 255, -1.0, 0.85, 0, 6.0, 1.2);
  336.             if (get_user_weapon(id) == CSW_KNIFE) {
  337.                 ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataKNIFE[model_knife[id]][NameKNIFE], iCountIndividualKNIFE[id][model_knife[id]]);
  338.             } else if (get_user_weapon(id) == CSW_AWP) {
  339.                 ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataAWP[model_awp[id]][NameAWP], iCountIndividualAWP[id][model_awp[id]]);
  340.             } else if (get_user_weapon(id) == CSW_AK47) {
  341.                 ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataAK47[model_ak47[id]][NameAK47], iCountIndividualAK47[id][model_ak47[id]]);
  342.             } else if (get_user_weapon(id) == CSW_M4A1) {
  343.                 ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataM4A1[model_m4a1[id]][NameM4A1], iCountIndividualM4A1[id][model_m4a1[id]]);
  344.             } else if (get_user_weapon(id) == CSW_DEAGLE) {
  345.                 ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataDEAGLE[model_deagle[id]][NameDEAGLE], iCountIndividualDEAGLE[id][model_deagle[id]]);
  346.             } else if (get_user_weapon(id) == CSW_GLOCK18) {
  347.                 ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataGLOCK18[model_glock18[id]][NameGLOCK18], iCountIndividualGLOCK18[id][model_glock18[id]]);
  348.             } else if (get_user_weapon(id) == CSW_USP) {
  349.                 ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataUSP[model_usp[id]][NameUSP], iCountIndividualUSP[id][model_usp[id]]);
  350.             }
  351.         } else {
  352.             new SpecPlayer = entity_get_int(id, EV_INT_iuser2);
  353.             if (is_user_alive(SpecPlayer)) {
  354.                 set_hudmessage(0, 127, 255, -1.0, 0.85, 0, 6.0, 1.1);
  355.                 if (get_user_weapon(SpecPlayer) == CSW_KNIFE) {
  356.                     ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataKNIFE[model_knife[SpecPlayer]][NameKNIFE], iCountIndividualKNIFE[SpecPlayer][model_knife[SpecPlayer]]);
  357.                 } else if (get_user_weapon(SpecPlayer) == CSW_AWP) {
  358.                     ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataAWP[model_awp[SpecPlayer]][NameAWP], iCountIndividualAWP[SpecPlayer][model_awp[SpecPlayer]]);
  359.                 } else if (get_user_weapon(SpecPlayer) == CSW_AK47) {
  360.                     ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataAK47[model_ak47[SpecPlayer]][NameAK47], iCountIndividualAK47[SpecPlayer][model_ak47[SpecPlayer]]);
  361.                 } else if (get_user_weapon(SpecPlayer) == CSW_M4A1) {
  362.                     ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataM4A1[model_m4a1[SpecPlayer]][NameM4A1], iCountIndividualM4A1[SpecPlayer][model_m4a1[SpecPlayer]]);
  363.                 } else if (get_user_weapon(SpecPlayer) == CSW_DEAGLE) {
  364.                     ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataDEAGLE[model_deagle[SpecPlayer]][NameDEAGLE], iCountIndividualDEAGLE[SpecPlayer][model_deagle[SpecPlayer]]);
  365.                 } else if (get_user_weapon(SpecPlayer) == CSW_GLOCK18) {
  366.                     ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataGLOCK18[model_glock18[SpecPlayer]][NameGLOCK18], iCountIndividualGLOCK18[SpecPlayer][model_glock18[SpecPlayer]]);
  367.                 } else if (get_user_weapon(SpecPlayer) == CSW_USP) {
  368.                     ShowSyncHudMsg(id, g_msgsync, "%s^n%d confirmed kills", SkinsDataUSP[model_usp[SpecPlayer]][NameUSP], iCountIndividualUSP[SpecPlayer][model_usp[SpecPlayer]]);
  369.                 }
  370.             }
  371.         }
  372.     }
  373. }
  374.  
  375. public CurWeapon(id)
  376. {
  377.     SetSkinKNIFE(id, model_knife[id]);
  378.     SetSkinAWP(id, model_awp[id]);
  379.     SetSkinAK47(id, model_ak47[id]);
  380.     SetSkinM4A1(id, model_m4a1[id]);
  381.     SetSkinDEAGLE(id, model_deagle[id]);
  382.     SetSkinGLOCK18(id, model_glock18[id]);
  383.     SetSkinUSP(id, model_usp[id]);
  384. }
  385. //ChangeKnife-START=========================================================================================================================
  386. public ChangeKnife(id)
  387. {
  388.     if(!is_user_connected(id))
  389.         return PLUGIN_HANDLED;
  390.  
  391.     new menu = menu_create("Choose your KNIFE skin" , "select_knife_handler");
  392.     new MenuKNIFE[256];
  393.     for (new i = 0; i < sizeof(SkinsDataKNIFE); i++)
  394.     {
  395.         if(iCountUnlockLevel[id] < SkinsDataKNIFE[i][UnlockLevelKNIFE][0])
  396.         {
  397.             formatex(MenuKNIFE, charsmax(MenuKNIFE), "%s \r[Level %i/%i]", SkinsDataKNIFE[i][NameKNIFE], iCountUnlockLevel[id], SkinsDataKNIFE[i][UnlockLevelKNIFE]);
  398.         }
  399.         else
  400.             formatex(MenuKNIFE, charsmax(MenuKNIFE), "%s \y[Unlocked] [Level %i]", SkinsDataKNIFE[i][NameKNIFE], iCountIndividualKNIFE[id][i]);
  401.         menu_additem(menu, MenuKNIFE);
  402.     }
  403.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  404.     menu_setprop(menu, MPROP_BACKNAME, "Previous page");
  405.     menu_setprop(menu, MPROP_NEXTNAME, "Next page");
  406.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  407.     menu_display(id, menu);
  408.     return PLUGIN_HANDLED;
  409. }
  410.  
  411. public select_knife_handler(id, menu, item)
  412. {
  413.     if(item == MENU_EXIT)
  414.     {
  415.         menu_destroy(menu);
  416.         return PLUGIN_HANDLED;
  417.     }
  418.    
  419.     if(item == model_knife[id])
  420.     {
  421.         ColorChat(id, "%s !yYou already use !gKNIFE !yskin!g %s", Prefiks, SkinsDataKNIFE[item][NameKNIFE]);
  422.         return PLUGIN_HANDLED;
  423.     }
  424.  
  425.     new command[6], name[64], access, callback;
  426.     menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  427.    
  428.     if(iCountUnlockLevel[id] < SkinsDataKNIFE[item][UnlockLevelKNIFE][0])
  429.         ColorChat(id, "%s !yYou don't have the required level to use!g %s !yskin.", Prefiks, SkinsDataKNIFE[item][NameKNIFE]);
  430.     else
  431.     {
  432.         SetSkinKNIFE(id, item);
  433.         ColorChat(id, "%s !yYou set !gKNIFE !yskin!g %s", Prefiks, SkinsDataKNIFE[item][NameKNIFE]);
  434.     }
  435.  
  436.     SaveData(id);    
  437.     ChangeKnife(id);
  438.     menu_destroy(menu);
  439.     return PLUGIN_HANDLED;
  440. }
  441.  
  442. SetSkinKNIFE(id , KNIFE)
  443. {
  444.     model_knife[id] = KNIFE;
  445.     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo);
  446.     if(Weapon != CSW_KNIFE)
  447.         return PLUGIN_HANDLED;  
  448.  
  449.     new vModel[56];
  450.     new pModel[56];
  451.     format(vModel, 55, SkinsDataKNIFE[KNIFE][V_KNIFE]);
  452.     format(pModel, 55, SkinsDataKNIFE[KNIFE][P_KNIFE]);
  453.     entity_set_string(id, EV_SZ_viewmodel, vModel);
  454.     entity_set_string(id, EV_SZ_weaponmodel, pModel);
  455.     return PLUGIN_HANDLED;      
  456. }
  457. //ChangeKnife-END=========================================================================================================================
  458. //ChangeAwp-START=========================================================================================================================
  459. public ChangeAwp(id)
  460. {
  461.     if(!is_user_connected(id))
  462.         return PLUGIN_HANDLED;
  463.  
  464.     new menu = menu_create("Choose your AWP skin" , "select_awp_handler");
  465.     new MenuAWP[256];
  466.     for (new i = 0; i < sizeof(SkinsDataAWP); i++)
  467.     {
  468.         if(iCountUnlockLevel[id] < SkinsDataAWP[i][UnlockLevelAWP][0])
  469.         {
  470.             formatex(MenuAWP, charsmax(MenuAWP), "%s \r[Level %i/%i]", SkinsDataAWP[i][NameAWP], iCountUnlockLevel[id], SkinsDataAWP[i][UnlockLevelAWP]);
  471.         }
  472.         else
  473.             formatex(MenuAWP, charsmax(MenuAWP), "%s \y[Unlocked] [Level %i]", SkinsDataAWP[i][NameAWP], iCountIndividualAWP[id][i]);
  474.         menu_additem(menu, MenuAWP);
  475.     }
  476.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  477.     menu_setprop(menu, MPROP_BACKNAME, "Previous page");
  478.     menu_setprop(menu, MPROP_NEXTNAME, "Next page");
  479.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  480.     menu_display(id, menu);
  481.     return PLUGIN_HANDLED;
  482. }
  483.  
  484. public select_awp_handler(id, menu, item)
  485. {
  486.     if(item == MENU_EXIT)
  487.     {
  488.         menu_destroy(menu);
  489.         return PLUGIN_HANDLED;
  490.     }
  491.    
  492.     if(item == model_awp[id])
  493.     {
  494.         ColorChat(id, "%s !yYou already use!g AWP !yskin!g %s", Prefiks, SkinsDataAWP[item][NameAWP]);
  495.         return PLUGIN_HANDLED;
  496.     }
  497.  
  498.     new command[6], name[64], access, callback;
  499.     menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  500.    
  501.     if(iCountUnlockLevel[id] < SkinsDataAWP[item][UnlockLevelAWP][0])
  502.         ColorChat(id, "%s !yYou don't have the required level to use!g %s !yskin.", Prefiks, SkinsDataAWP[item][NameAWP]);    
  503.     else
  504.     {
  505.         SetSkinAWP(id, item);
  506.         ColorChat(id, "%s !yYou set!g AWP !yskin!g %s", Prefiks, SkinsDataAWP[item][NameAWP]);
  507.     }
  508.  
  509.     SaveData(id);    
  510.     ChangeAwp(id);
  511.     menu_destroy(menu);
  512.     return PLUGIN_HANDLED;
  513. }
  514.  
  515. SetSkinAWP(id , AWP)
  516. {
  517.     model_awp[id] = AWP;
  518.     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo);
  519.     if(Weapon != CSW_AWP)
  520.         return PLUGIN_HANDLED;  
  521.  
  522.     new vModel[56];
  523.     new pModel[56];
  524.     format(vModel, 55, SkinsDataAWP[AWP][V_AWP]);
  525.     format(pModel, 55, SkinsDataAWP[AWP][P_AWP]);
  526.     entity_set_string(id, EV_SZ_viewmodel, vModel);
  527.     entity_set_string(id, EV_SZ_weaponmodel, pModel);
  528.  
  529.     return PLUGIN_HANDLED;      
  530. }
  531. //ChangeAwp-END=========================================================================================================================
  532. //ChangeAk47-START=========================================================================================================================
  533. public ChangeAk47(id)
  534. {
  535.     if(!is_user_connected(id))
  536.         return PLUGIN_HANDLED;
  537.  
  538.     new menu = menu_create("Choose your AK47 skin" , "select_ak47_handler");
  539.     new MenuAK47[256];
  540.     for (new i = 0; i < sizeof(SkinsDataAK47); i++)
  541.     {
  542.         if(iCountUnlockLevel[id] < SkinsDataAK47[i][UnlockLevelAK47][0])
  543.         {
  544.             formatex(MenuAK47, charsmax(MenuAK47), "%s \r[Level %i/%i]", SkinsDataAK47[i][NameAK47], iCountUnlockLevel[id], SkinsDataAK47[i][UnlockLevelAK47]);
  545.         }
  546.         else
  547.             formatex(MenuAK47, charsmax(MenuAK47), "%s \y[Unlocked] [Level %i]", SkinsDataAK47[i][NameAK47], iCountIndividualAK47[id][i]);
  548.         menu_additem(menu, MenuAK47);
  549.     }
  550.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  551.     menu_setprop(menu, MPROP_BACKNAME, "Previous page");
  552.     menu_setprop(menu, MPROP_NEXTNAME, "Next page");
  553.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  554.     menu_display(id, menu);
  555.     return PLUGIN_HANDLED;
  556. }
  557.  
  558. public select_ak47_handler(id, menu, item)
  559. {
  560.     if(item == MENU_EXIT)
  561.     {
  562.         menu_destroy(menu);
  563.         return PLUGIN_HANDLED;
  564.     }
  565.    
  566.     if(item == model_ak47[id])
  567.     {
  568.         ColorChat(id, "%s !yYou already use!g AK47 !yskin!g %s", Prefiks, SkinsDataAK47[item][NameAK47]);
  569.         return PLUGIN_HANDLED;
  570.     }
  571.  
  572.     new command[6], name[64], access, callback;
  573.     menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  574.    
  575.     if(iCountUnlockLevel[id] < SkinsDataAK47[item][UnlockLevelAK47][0])
  576.         ColorChat(id, "%s !yYou don't have the required level to use!g %s !yskin.", Prefiks, SkinsDataAK47[item][NameAK47]);    
  577.     else
  578.     {
  579.         SetSkinAK47(id, item);
  580.         ColorChat(id, "%s !yYou set!g AK47 !yskin!g %s", Prefiks, SkinsDataAK47[item][NameAK47]);
  581.     }
  582.  
  583.     SaveData(id);    
  584.     ChangeAk47(id);
  585.     menu_destroy(menu);
  586.     return PLUGIN_HANDLED;
  587. }
  588.  
  589. SetSkinAK47(id , AK47)
  590. {
  591.     model_ak47[id] = AK47;
  592.     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo);
  593.     if(Weapon != CSW_AK47)
  594.         return PLUGIN_HANDLED;  
  595.  
  596.     new vModel[56];
  597.     new pModel[56];
  598.     format(vModel, 55, SkinsDataAK47[AK47][V_AK47]);
  599.     format(pModel, 55, SkinsDataAK47[AK47][P_AK47]);
  600.     entity_set_string(id, EV_SZ_viewmodel, vModel);
  601.     entity_set_string(id, EV_SZ_weaponmodel, pModel);
  602.  
  603.     return PLUGIN_HANDLED;      
  604. }
  605. //ChangeAk47-END=========================================================================================================================
  606. //ChangeM4a1-START=========================================================================================================================
  607. public ChangeM4a1(id)
  608. {
  609.     if(!is_user_connected(id))
  610.         return PLUGIN_HANDLED;
  611.  
  612.     new menu = menu_create("Choose your M4A1 skin" , "select_m4a1_handler");
  613.     new MenuM4A1[256];
  614.     for (new i = 0; i < sizeof(SkinsDataM4A1); i++)
  615.     {
  616.         if(iCountUnlockLevel[id] < SkinsDataM4A1[i][UnlockLevelM4A1][0])
  617.         {
  618.             formatex(MenuM4A1, charsmax(MenuM4A1), "%s \r[Level %i/%i]", SkinsDataM4A1[i][NameM4A1], iCountUnlockLevel[id], SkinsDataM4A1[i][UnlockLevelM4A1]);
  619.         }
  620.         else
  621.             formatex(MenuM4A1, charsmax(MenuM4A1), "%s \y[Unlocked] [Level %i]", SkinsDataM4A1[i][NameM4A1], iCountIndividualM4A1[id][i]);
  622.         menu_additem(menu, MenuM4A1);
  623.     }
  624.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  625.     menu_setprop(menu, MPROP_BACKNAME, "Previous page");
  626.     menu_setprop(menu, MPROP_NEXTNAME, "Next page");
  627.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  628.     menu_display(id, menu);
  629.     return PLUGIN_HANDLED;
  630. }
  631.  
  632. public select_m4a1_handler(id, menu, item)
  633. {
  634.     if(item == MENU_EXIT)
  635.     {
  636.         menu_destroy(menu);
  637.         return PLUGIN_HANDLED;
  638.     }
  639.    
  640.     if(item == model_m4a1[id])
  641.     {
  642.         ColorChat(id, "%s !yYou already use!g M4A1 !yskin!g %s", Prefiks, SkinsDataM4A1[item][NameM4A1]);
  643.         return PLUGIN_HANDLED;
  644.     }
  645.  
  646.     new command[6], name[64], access, callback;
  647.     menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  648.    
  649.     if(iCountUnlockLevel[id] < SkinsDataM4A1[item][UnlockLevelM4A1][0])
  650.         ColorChat(id, "%s !yYou don't have the required level to use!g %s !yskin.", Prefiks, SkinsDataM4A1[item][NameM4A1]);    
  651.     else
  652.     {
  653.         SetSkinM4A1(id, item);
  654.         ColorChat(id, "%s !yYou set!g M4A1 !yskin!g %s", Prefiks, SkinsDataM4A1[item][NameM4A1]);
  655.     }
  656.  
  657.     SaveData(id);    
  658.     ChangeM4a1(id);
  659.     menu_destroy(menu);
  660.     return PLUGIN_HANDLED;
  661. }
  662.  
  663. SetSkinM4A1(id , M4A1)
  664. {
  665.     model_m4a1[id] = M4A1;
  666.     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo);
  667.     if(Weapon != CSW_M4A1)
  668.         return PLUGIN_HANDLED;  
  669.  
  670.     new vModel[56];
  671.     new pModel[56];
  672.     format(vModel, 55, SkinsDataM4A1[M4A1][V_M4A1]);
  673.     format(pModel, 55, SkinsDataM4A1[M4A1][P_M4A1]);
  674.     entity_set_string(id, EV_SZ_viewmodel, vModel);
  675.     entity_set_string(id, EV_SZ_weaponmodel, pModel);
  676.     return PLUGIN_HANDLED;      
  677. }
  678. //ChangeM4a1-END=========================================================================================================================
  679. //ChangeDeagle-START=========================================================================================================================
  680. public ChangeDeagle(id)
  681. {
  682.     if(!is_user_connected(id))
  683.         return PLUGIN_HANDLED;
  684.  
  685.     new menu = menu_create("Choose your DEAGLE skin" , "select_deagle_handler");
  686.     new MenuDEAGLE[256];
  687.     for (new i = 0; i < sizeof(SkinsDataDEAGLE); i++)
  688.     {
  689.         if(iCountUnlockLevel[id] < SkinsDataDEAGLE[i][UnlockLevelDEAGLE][0])
  690.         {
  691.             formatex(MenuDEAGLE, charsmax(MenuDEAGLE), "%s \r[Level %i/%i]", SkinsDataDEAGLE[i][NameDEAGLE], iCountUnlockLevel[id], SkinsDataDEAGLE[i][UnlockLevelDEAGLE]);
  692.         }
  693.         else
  694.             formatex(MenuDEAGLE, charsmax(MenuDEAGLE), "%s \y[Unlocked] [Level %i]", SkinsDataDEAGLE[i][NameDEAGLE], iCountIndividualDEAGLE[id][i]);
  695.         menu_additem(menu, MenuDEAGLE);
  696.     }
  697.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  698.     menu_setprop(menu, MPROP_BACKNAME, "Previous page");
  699.     menu_setprop(menu, MPROP_NEXTNAME, "Next page");
  700.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  701.     menu_display(id, menu);
  702.     return PLUGIN_HANDLED;
  703. }
  704.  
  705. public select_deagle_handler(id, menu, item)
  706. {
  707.     if(item == MENU_EXIT)
  708.     {
  709.         menu_destroy(menu);
  710.         return PLUGIN_HANDLED;
  711.     }
  712.    
  713.     if(item == model_deagle[id])
  714.     {
  715.         ColorChat(id, "%s !yYou already use!g DEAGLE !yskin!g %s", Prefiks, SkinsDataDEAGLE[item][NameDEAGLE]);
  716.         return PLUGIN_HANDLED;
  717.     }
  718.  
  719.     new command[6], name[64], access, callback;
  720.     menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  721.    
  722.     if(iCountUnlockLevel[id] < SkinsDataDEAGLE[item][UnlockLevelDEAGLE][0])
  723.         ColorChat(id, "%s !yYou don't have the required level to use!g %s !yskin.", Prefiks, SkinsDataDEAGLE[item][NameDEAGLE]);    
  724.     else
  725.     {
  726.         SetSkinDEAGLE(id, item);
  727.         ColorChat(id, "%s !yYou set!g DEAGLE !yskin!g %s", Prefiks, SkinsDataDEAGLE[item][NameDEAGLE]);
  728.     }
  729.  
  730.     SaveData(id);    
  731.     ChangeDeagle(id);
  732.     menu_destroy(menu);
  733.     return PLUGIN_HANDLED;
  734. }
  735.  
  736. SetSkinDEAGLE(id , DEAGLE)
  737. {
  738.     model_deagle[id] = DEAGLE;
  739.     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo);
  740.     if(Weapon != CSW_DEAGLE)
  741.         return PLUGIN_HANDLED;  
  742.  
  743.     new vModel[56];
  744.     new pModel[56];
  745.     format(vModel, 55, SkinsDataDEAGLE[DEAGLE][V_DEAGLE]);
  746.     format(pModel, 55, SkinsDataDEAGLE[DEAGLE][P_DEAGLE]);
  747.     entity_set_string(id, EV_SZ_viewmodel, vModel);
  748.     entity_set_string(id, EV_SZ_weaponmodel, pModel);
  749.     return PLUGIN_HANDLED;      
  750. }
  751. //ChangeDeagle-END=========================================================================================================================
  752. //ChangeGlock18-START=========================================================================================================================
  753. public ChangeGlock18(id)
  754. {
  755.     if(!is_user_connected(id))
  756.         return PLUGIN_HANDLED;
  757.  
  758.     new menu = menu_create("Choose your GLOCK18 skin" , "select_glock18_handler");
  759.     new MenuGLOCK18[256];
  760.     for (new i = 0; i < sizeof(SkinsDataGLOCK18); i++)
  761.     {
  762.         if(iCountUnlockLevel[id] < SkinsDataGLOCK18[i][UnlockLevelGLOCK18][0])
  763.         {
  764.             formatex(MenuGLOCK18, charsmax(MenuGLOCK18), "%s \r[Level %i/%i]", SkinsDataGLOCK18[i][NameGLOCK18], iCountUnlockLevel[id], SkinsDataGLOCK18[i][UnlockLevelGLOCK18]);
  765.         }
  766.         else
  767.             formatex(MenuGLOCK18, charsmax(MenuGLOCK18), "%s \y[Unlocked] [Level %i]", SkinsDataGLOCK18[i][NameGLOCK18], iCountIndividualGLOCK18[id][i]);
  768.         menu_additem(menu, MenuGLOCK18);
  769.     }
  770.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  771.     menu_setprop(menu, MPROP_BACKNAME, "Previous page");
  772.     menu_setprop(menu, MPROP_NEXTNAME, "Next page");
  773.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  774.     menu_display(id, menu);
  775.     return PLUGIN_HANDLED;
  776. }
  777.  
  778. public select_glock18_handler(id, menu, item)
  779. {
  780.     if(item == MENU_EXIT)
  781.     {
  782.         menu_destroy(menu);
  783.         return PLUGIN_HANDLED;
  784.     }
  785.    
  786.     if(item == model_glock18[id])
  787.     {
  788.         ColorChat(id, "%s !yYou already use!g GLOCK18 !yskin!g %s", Prefiks, SkinsDataGLOCK18[item][NameGLOCK18]);
  789.         return PLUGIN_HANDLED;
  790.     }
  791.  
  792.     new command[6], name[64], access, callback;
  793.     menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  794.    
  795.     if(iCountUnlockLevel[id] < SkinsDataGLOCK18[item][UnlockLevelGLOCK18][0])
  796.         ColorChat(id, "%s !yYou don't have the required level to use!g %s !yskin.", Prefiks, SkinsDataGLOCK18[item][NameGLOCK18]);    
  797.     else
  798.     {
  799.         SetSkinGLOCK18(id, item);
  800.         ColorChat(id, "%s !yYou set!g GLOCK18 !yskin!g %s", Prefiks, SkinsDataGLOCK18[item][NameGLOCK18]);
  801.     }
  802.  
  803.     SaveData(id);    
  804.     ChangeGlock18(id);
  805.     menu_destroy(menu);
  806.     return PLUGIN_HANDLED;
  807. }
  808.  
  809. SetSkinGLOCK18(id , GLOCK18)
  810. {
  811.     model_glock18[id] = GLOCK18;
  812.     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo);
  813.     if(Weapon != CSW_GLOCK18)
  814.         return PLUGIN_HANDLED;  
  815.  
  816.     new vModel[56];
  817.     new pModel[56];
  818.     format(vModel, 55, SkinsDataGLOCK18[GLOCK18][V_GLOCK18]);
  819.     format(pModel, 55, SkinsDataGLOCK18[GLOCK18][P_GLOCK18]);
  820.     entity_set_string(id, EV_SZ_viewmodel, vModel);
  821.     entity_set_string(id, EV_SZ_weaponmodel, pModel);
  822.     return PLUGIN_HANDLED;      
  823. }
  824. //ChangeGlock18-END=========================================================================================================================
  825. //ChangeUsp-START=========================================================================================================================
  826. public ChangeUsp(id)
  827. {
  828.     if(!is_user_connected(id))
  829.         return PLUGIN_HANDLED;
  830.  
  831.     new menu = menu_create("Choose your USP skin" , "select_usp_handler");
  832.     new MenuUSP[256];
  833.     for (new i = 0; i < sizeof(SkinsDataUSP); i++)
  834.     {
  835.         if(iCountUnlockLevel[id] < SkinsDataUSP[i][UnlockLevelUSP][0])
  836.         {
  837.             formatex(MenuUSP, charsmax(MenuUSP), "%s \r[Level %i/%i]", SkinsDataUSP[i][NameUSP], iCountUnlockLevel[id], SkinsDataUSP[i][UnlockLevelUSP]);
  838.         }
  839.         else
  840.             formatex(MenuUSP, charsmax(MenuUSP), "%s \y[Unlocked] [Level %i]", SkinsDataUSP[i][NameUSP], iCountIndividualUSP[id][i]);
  841.         menu_additem(menu, MenuUSP);
  842.     }
  843.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  844.     menu_setprop(menu, MPROP_BACKNAME, "Previous page");
  845.     menu_setprop(menu, MPROP_NEXTNAME, "Next page");
  846.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  847.     menu_display(id, menu);
  848.     return PLUGIN_HANDLED;
  849. }
  850.  
  851. public select_usp_handler(id, menu, item)
  852. {
  853.     if(item == MENU_EXIT)
  854.     {
  855.         menu_destroy(menu);
  856.         return PLUGIN_HANDLED;
  857.     }
  858.    
  859.     if(item == model_usp[id])
  860.     {
  861.         ColorChat(id, "%s !yYou already use!g USP !yskin!g %s", Prefiks, SkinsDataUSP[item][NameUSP]);
  862.         return PLUGIN_HANDLED;
  863.     }
  864.  
  865.     new command[6], name[64], access, callback;
  866.     menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  867.    
  868.     if(iCountUnlockLevel[id] < SkinsDataUSP[item][UnlockLevelUSP][0])
  869.         ColorChat(id, "%s !yYou don't have the required level to use!g %s !yskin.", Prefiks, SkinsDataUSP[item][NameUSP]);    
  870.     else
  871.     {
  872.         SetSkinUSP(id, item);
  873.         ColorChat(id, "%s !yYou set!g USP !yskin!g %s", Prefiks, SkinsDataUSP[item][NameUSP]);
  874.     }
  875.  
  876.     SaveData(id);    
  877.     ChangeUsp(id);
  878.     menu_destroy(menu);
  879.     return PLUGIN_HANDLED;
  880. }
  881.  
  882. SetSkinUSP(id , USP)
  883. {
  884.     model_usp[id] = USP;
  885.     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo);
  886.     if(Weapon != CSW_USP)
  887.         return PLUGIN_HANDLED;  
  888.  
  889.     new vModel[56];
  890.     new pModel[56];
  891.     format(vModel, 55, SkinsDataUSP[USP][V_USP]);
  892.     format(pModel, 55, SkinsDataUSP[USP][P_USP]);
  893.     entity_set_string(id, EV_SZ_viewmodel, vModel);
  894.     entity_set_string(id, EV_SZ_weaponmodel, pModel);
  895.  
  896.     return PLUGIN_HANDLED;      
  897. }
  898. //ChangeUsp-END=========================================================================================================================
  899. public CountIndividual() {
  900.     new iAttacker = read_data(1);
  901.  
  902.     if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE) {
  903.         iCountIndividualKNIFE[iAttacker][model_knife[iAttacker]]++;
  904.     } else if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_AWP) {
  905.         iCountIndividualAWP[iAttacker][model_awp[iAttacker]]++;
  906.     } else if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_AK47) {
  907.         iCountIndividualAK47[iAttacker][model_ak47[iAttacker]]++;
  908.     } else if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_M4A1) {
  909.         iCountIndividualM4A1[iAttacker][model_m4a1[iAttacker]]++;
  910.     } else if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_DEAGLE) {
  911.         iCountIndividualDEAGLE[iAttacker][model_deagle[iAttacker]]++;
  912.     } else if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_GLOCK18) {
  913.         iCountIndividualGLOCK18[iAttacker][model_glock18[iAttacker]]++;
  914.     } else if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_USP) {
  915.         iCountIndividualUSP[iAttacker][model_usp[iAttacker]]++;
  916.     }
  917.  
  918.     SaveData(iAttacker);
  919. }
  920.  
  921. public CountLevelUnlock()
  922. {
  923.     new Killer = read_data(1), Victim = read_data(2);
  924.  
  925.     if (Killer != Victim && is_user_connected(Killer) && is_user_alive(Killer))
  926.     {
  927.         // Increment the level
  928.         iCountUnlockLevel[Killer]++;
  929.        
  930.         // Limit to MaxLevel
  931.         if (iCountUnlockLevel[Killer] > MaxLevel)
  932.             iCountUnlockLevel[Killer] = MaxLevel;
  933.  
  934.         // Save the data
  935.         SaveData(Killer);
  936.     }
  937. }
  938.  
  939. SaveData(id)
  940. {
  941.     new AuthID[35], VaultKey[512], VaultData[1024];
  942.     get_user_authid(id, AuthID, charsmax(AuthID));
  943.     // Save individual levels for each knife
  944.     for (new i = 0; i < sizeof(SkinsDataKNIFE); i++)
  945.     {
  946.         formatex(VaultKey, charsmax(VaultKey), "%s-knife-%d", AuthID, i);
  947.         formatex(VaultData, charsmax(VaultData), "%d", iCountIndividualKNIFE[id][i]);
  948.         nvault_set(g_Vault, VaultKey, VaultData);
  949.     }
  950.     // Save individual levels for each AWP
  951.     for (new i = 0; i < sizeof(SkinsDataAWP); i++)
  952.     {
  953.         formatex(VaultKey, charsmax(VaultKey), "%s-awp-%d", AuthID, i);
  954.         formatex(VaultData, charsmax(VaultData), "%d", iCountIndividualAWP[id][i]);
  955.         nvault_set(g_Vault, VaultKey, VaultData);
  956.     }
  957.     // Save individual levels for each AK47
  958.     for (new i = 0; i < sizeof(SkinsDataAK47); i++)
  959.     {
  960.         formatex(VaultKey, charsmax(VaultKey), "%s-ak47-%d", AuthID, i);
  961.         formatex(VaultData, charsmax(VaultData), "%d", iCountIndividualAK47[id][i]);
  962.         nvault_set(g_Vault, VaultKey, VaultData);
  963.     }
  964.     // Save individual levels for each M4A1
  965.     for (new i = 0; i < sizeof(SkinsDataM4A1); i++)
  966.     {
  967.         formatex(VaultKey, charsmax(VaultKey), "%s-m4a1-%d", AuthID, i);
  968.         formatex(VaultData, charsmax(VaultData), "%d", iCountIndividualM4A1[id][i]);
  969.         nvault_set(g_Vault, VaultKey, VaultData);
  970.     }
  971.     // Save individual levels for each Deagle
  972.     for (new i = 0; i < sizeof(SkinsDataDEAGLE); i++)
  973.     {
  974.         formatex(VaultKey, charsmax(VaultKey), "%s-deagle-%d", AuthID, i);
  975.         formatex(VaultData, charsmax(VaultData), "%d", iCountIndividualDEAGLE[id][i]);
  976.         nvault_set(g_Vault, VaultKey, VaultData);
  977.     }
  978.     // Save individual levels for each Glock18
  979.     for (new i = 0; i < sizeof(SkinsDataGLOCK18); i++)
  980.     {
  981.         formatex(VaultKey, charsmax(VaultKey), "%s-glock18-%d", AuthID, i);
  982.         formatex(VaultData, charsmax(VaultData), "%d", iCountIndividualGLOCK18[id][i]);
  983.         nvault_set(g_Vault, VaultKey, VaultData);
  984.     }
  985.     // Save individual levels for each USP
  986.     for (new i = 0; i < sizeof(SkinsDataUSP); i++)
  987.     {
  988.         formatex(VaultKey, charsmax(VaultKey), "%s-usp-%d", AuthID, i);
  989.         formatex(VaultData, charsmax(VaultData), "%d", iCountIndividualUSP[id][i]);
  990.         nvault_set(g_Vault, VaultKey, VaultData);
  991.     }
  992.     // Save selected knife model after disconnecting
  993.     formatex(VaultKey, charsmax(VaultKey), "%s-knife", AuthID);
  994.     formatex(VaultData, charsmax(VaultData), "%d", model_knife[id]);
  995.     nvault_set(g_Vault, VaultKey, VaultData);
  996.     // Save selected AWP model after disconnecting
  997.     formatex(VaultKey, charsmax(VaultKey), "%s-awp", AuthID);
  998.     formatex(VaultData, charsmax(VaultData), "%d", model_awp[id]);
  999.     nvault_set(g_Vault, VaultKey, VaultData);
  1000.     // Save selected AK47 model after disconnecting
  1001.     formatex(VaultKey, charsmax(VaultKey), "%s-ak47", AuthID);
  1002.     formatex(VaultData, charsmax(VaultData), "%d", model_ak47[id]);
  1003.     nvault_set(g_Vault, VaultKey, VaultData);
  1004.     // Save selected M4A1 model after disconnecting
  1005.     formatex(VaultKey, charsmax(VaultKey), "%s-m4a1", AuthID);
  1006.     formatex(VaultData, charsmax(VaultData), "%d", model_m4a1[id]);
  1007.     nvault_set(g_Vault, VaultKey, VaultData);
  1008.     // Save selected Deagle model after disconnecting
  1009.     formatex(VaultKey, charsmax(VaultKey), "%s-deagle", AuthID);
  1010.     formatex(VaultData, charsmax(VaultData), "%d", model_deagle[id]);
  1011.     nvault_set(g_Vault, VaultKey, VaultData);
  1012.     // Save selected Glock18 model after disconnecting
  1013.     formatex(VaultKey, charsmax(VaultKey), "%s-glock18", AuthID);
  1014.     formatex(VaultData, charsmax(VaultData), "%d", model_glock18[id]);
  1015.     nvault_set(g_Vault, VaultKey, VaultData);
  1016.     // Save selected USP model after disconnecting
  1017.     formatex(VaultKey, charsmax(VaultKey), "%s-usp", AuthID);
  1018.     formatex(VaultData, charsmax(VaultData), "%d", model_usp[id]);
  1019.     nvault_set(g_Vault, VaultKey, VaultData);
  1020.     // Save general level iCountUnlockLevel
  1021.     formatex(VaultKey, charsmax(VaultKey), "%s-lvl", AuthID);
  1022.     formatex(VaultData, charsmax(VaultData), "%d", iCountUnlockLevel[id]);
  1023.     nvault_set(g_Vault, VaultKey, VaultData);
  1024.     // Save Hud Option
  1025.     formatex(VaultKey, charsmax(VaultKey), "%s-hud", AuthID);
  1026.     formatex(VaultData, charsmax(VaultData), "%d", hud[id]);
  1027.     nvault_set(g_Vault, VaultKey, VaultData);
  1028. }
  1029.  
  1030. LoadData(id)
  1031. {
  1032.     new AuthID[35], VaultKey[512], VaultData[1024], PlayerData[9][32];  
  1033.     get_user_authid(id, AuthID, charsmax(AuthID));
  1034.     // Load individual levels for each knife
  1035.     for (new i = 0; i < sizeof(SkinsDataKNIFE); i++)
  1036.     {
  1037.         formatex(VaultKey, charsmax(VaultKey), "%s-knife-%d", AuthID, i);
  1038.         nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1039.         iCountIndividualKNIFE[id][i] = str_to_num(VaultData);
  1040.     }
  1041.     // Load individual levels for each AWP
  1042.     for (new i = 0; i < sizeof(SkinsDataAWP); i++)
  1043.     {
  1044.         formatex(VaultKey, charsmax(VaultKey), "%s-awp-%d", AuthID, i);
  1045.         nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1046.         iCountIndividualAWP[id][i] = str_to_num(VaultData);
  1047.     }
  1048.     // Load individual levels for each AK47
  1049.     for (new i = 0; i < sizeof(SkinsDataAK47); i++)
  1050.     {
  1051.         formatex(VaultKey, charsmax(VaultKey), "%s-ak47-%d", AuthID, i);
  1052.         nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1053.         iCountIndividualAK47[id][i] = str_to_num(VaultData);
  1054.     }
  1055.     // Load individual levels for each M4A1
  1056.     for (new i = 0; i < sizeof(SkinsDataM4A1); i++)
  1057.     {
  1058.         formatex(VaultKey, charsmax(VaultKey), "%s-m4a1-%d", AuthID, i);
  1059.         nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1060.         iCountIndividualM4A1[id][i] = str_to_num(VaultData);
  1061.     }
  1062.     // Load individual levels for each Deagle
  1063.     for (new i = 0; i < sizeof(SkinsDataDEAGLE); i++)
  1064.     {
  1065.         formatex(VaultKey, charsmax(VaultKey), "%s-deagle-%d", AuthID, i);
  1066.         nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1067.         iCountIndividualDEAGLE[id][i] = str_to_num(VaultData);
  1068.     }
  1069.     // Load individual levels for each Glock18
  1070.     for (new i = 0; i < sizeof(SkinsDataGLOCK18); i++)
  1071.     {
  1072.         formatex(VaultKey, charsmax(VaultKey), "%s-glock18-%d", AuthID, i);
  1073.         nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1074.         iCountIndividualGLOCK18[id][i] = str_to_num(VaultData);
  1075.     }
  1076.     // Load individual levels for each USP
  1077.     for (new i = 0; i < sizeof(SkinsDataUSP); i++)
  1078.     {
  1079.         formatex(VaultKey, charsmax(VaultKey), "%s-usp-%d", AuthID, i);
  1080.         nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1081.         iCountIndividualUSP[id][i] = str_to_num(VaultData);
  1082.     }
  1083.     // Load selected knife model after disconnecting
  1084.     formatex(VaultKey, charsmax(VaultKey), "%s-knife", AuthID);
  1085.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1086.  
  1087.     replace_all(VaultData, charsmax(VaultData), "#", " ");
  1088.  
  1089.     parse(VaultData, PlayerData[0], 31);
  1090.  
  1091.     // Assign the values from the PlayerData array to the corresponding variables for knife
  1092.     model_knife[id] = str_to_num(PlayerData[0]);
  1093.  
  1094.     // Load selected AWP model after disconnecting
  1095.     formatex(VaultKey, charsmax(VaultKey), "%s-awp", AuthID);
  1096.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1097.  
  1098.     replace_all(VaultData, charsmax(VaultData), "#", " ");
  1099.  
  1100.     parse(VaultData, PlayerData[1], 31);
  1101.  
  1102.     // Assign the values from the PlayerData array to the corresponding variables for AWP
  1103.     model_awp[id] = str_to_num(PlayerData[1]);
  1104.  
  1105.     // Load selected AK47 model after disconnecting
  1106.     formatex(VaultKey, charsmax(VaultKey), "%s-ak47", AuthID);
  1107.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1108.  
  1109.     replace_all(VaultData, charsmax(VaultData), "#", " ");
  1110.  
  1111.     parse(VaultData, PlayerData[2], 31);
  1112.  
  1113.     // Assign the values from the PlayerData array to the corresponding variables for AK47
  1114.     model_ak47[id] = str_to_num(PlayerData[2]);
  1115.  
  1116.     // Load selected M4A1 model after disconnecting
  1117.     formatex(VaultKey, charsmax(VaultKey), "%s-m4a1", AuthID);
  1118.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1119.  
  1120.     replace_all(VaultData, charsmax(VaultData), "#", " ");
  1121.  
  1122.     parse(VaultData, PlayerData[3], 31);
  1123.  
  1124.     // Assign the values from the PlayerData array to the corresponding variables for M4A1
  1125.     model_m4a1[id] = str_to_num(PlayerData[3]);
  1126.  
  1127.     // Load selected Deagle model after disconnecting
  1128.     formatex(VaultKey, charsmax(VaultKey), "%s-deagle", AuthID);
  1129.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1130.  
  1131.     replace_all(VaultData, charsmax(VaultData), "#", " ");
  1132.  
  1133.     parse(VaultData, PlayerData[4], 31);
  1134.  
  1135.     // Assign the values from the PlayerData array to the corresponding variables for Deagle
  1136.     model_deagle[id] = str_to_num(PlayerData[4]);
  1137.  
  1138.     // Load selected Glock18 model after disconnecting
  1139.     formatex(VaultKey, charsmax(VaultKey), "%s-glock18", AuthID);
  1140.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1141.  
  1142.     replace_all(VaultData, charsmax(VaultData), "#", " ");
  1143.  
  1144.     parse(VaultData, PlayerData[5], 31);
  1145.  
  1146.     // Assign the values from the PlayerData array to the corresponding variables for Glock18
  1147.     model_glock18[id] = str_to_num(PlayerData[5]);
  1148.  
  1149.     // Load selected USP model after disconnecting
  1150.     formatex(VaultKey, charsmax(VaultKey), "%s-usp", AuthID);
  1151.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1152.  
  1153.     replace_all(VaultData, charsmax(VaultData), "#", " ");
  1154.  
  1155.     parse(VaultData, PlayerData[6], 31);
  1156.  
  1157.     // Assign the values from the PlayerData array to the corresponding variables for USP
  1158.     model_usp[id] = str_to_num(PlayerData[6]);
  1159.  
  1160.     // Load general level iCountUnlockLevel
  1161.     formatex(VaultKey, charsmax(VaultKey), "%s-lvl", AuthID);
  1162.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1163.  
  1164.     parse(VaultData, PlayerData[7], 31);
  1165.  
  1166.     // Load general level iCountUnlockLevel
  1167.     iCountUnlockLevel[id] = str_to_num(PlayerData[7]);
  1168.  
  1169.     // Load Hud Option
  1170.     formatex(VaultKey, charsmax(VaultKey), "%s-hud", AuthID);
  1171.     nvault_get(g_Vault, VaultKey, VaultData, charsmax(VaultData));
  1172.  
  1173.     parse(VaultData, PlayerData[8], 31);
  1174.  
  1175.     hud[id] = str_to_num(PlayerData[8]) == 1;
  1176. }
  1177.  
  1178. public plugin_end()
  1179. {
  1180.     nvault_close(g_Vault);
  1181. }
  1182.  
  1183. stock ColorChat(const id, const input[], any:...)
  1184. {
  1185.     new count = 1, players[32];
  1186.     static msg[191];
  1187.     vformat(msg, 190, input, 3);
  1188.  
  1189.     replace_all(msg, 190, "!g", "^x04"); // Green Color
  1190.     replace_all(msg, 190, "!y", "^x01"); // Default Color
  1191.     replace_all(msg, 190, "!t", "^x03"); // Team Color
  1192.  
  1193.     if (id) players[0] = id; else get_players(players, count, "ch");
  1194.     {
  1195.         for (new i = 0; i < count; i++)
  1196.         {
  1197.             if (is_user_connected(players[i]))
  1198.             {
  1199.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  1200.                 write_byte(players[i]);
  1201.                 write_string(msg);
  1202.                 message_end();
  1203.             }
  1204.         }
  1205.     }
  1206. }
  1207.  
  1208. public amx_addlevel(id, level, cid) {
  1209.     if(!cmd_access(id, level, cid, 3))
  1210.         return PLUGIN_HANDLED;
  1211.  
  1212.     new szFArg[35], szSArg[16];
  1213.     read_argv(1, szFArg, charsmax(szFArg));
  1214.     read_argv(2, szSArg, charsmax(szSArg));
  1215.     new iNum = str_to_num(szSArg);
  1216.     new gTarget = cmd_target(id, szFArg, CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS | CMDTARGET_OBEY_IMMUNITY);
  1217.  
  1218.     if(!is_user_connected(gTarget))
  1219.         return PLUGIN_HANDLED;
  1220.  
  1221.     new szPlName[35], szAdmName[35];
  1222.     get_user_name(id, szAdmName, charsmax(szAdmName));
  1223.     get_user_name(gTarget, szPlName, charsmax(szPlName));
  1224.  
  1225.     new iRemainingLevels = MaxLevel - iCountUnlockLevel[gTarget];
  1226.  
  1227.     if (iRemainingLevels <= 0) {
  1228.         ColorChat(id, "^4[Levels]^1 You cannot add more levels to the player^4 %s^1. Maximum level reached.", szPlName);
  1229.         return PLUGIN_HANDLED;
  1230.     }
  1231.  
  1232.     if (iNum > iRemainingLevels) {
  1233.         ColorChat(id, "^4[Levels]^1 You can add a maximum of^4 %i^1 level(s) to the player^4 %s", iRemainingLevels, szPlName);
  1234.         return PLUGIN_HANDLED;
  1235.     }
  1236.  
  1237.     iCountUnlockLevel[gTarget] += iNum;
  1238.  
  1239.     ColorChat(id, "^4[Levels]^1 You added^4 %i^1 level(s) to the player^4 %s. ^3New level^1:^4 %d", iNum, szPlName, iCountUnlockLevel[gTarget]);
  1240.     ColorChat(gTarget, "^4[Levels]^1 Admin^4 %s^1 has added^4 %i^1 level(s) to you. ^3New level^1:^4 %d", szAdmName, iNum, iCountUnlockLevel[gTarget]);
  1241.     SaveData(gTarget);
  1242.  
  1243.     return PLUGIN_HANDLED;
  1244. }
  1245.  
  1246. public amx_setlevel(id, level, cid) {
  1247.     if(!cmd_access(id, level, cid, 3))
  1248.         return PLUGIN_HANDLED;
  1249.  
  1250.     new szFArg[35], szSArg[16];
  1251.     read_argv(1, szFArg, charsmax(szFArg));
  1252.     read_argv(2, szSArg, charsmax(szSArg));
  1253.     new iNum = str_to_num(szSArg);
  1254.     new gTarget = cmd_target(id, szFArg, CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS | CMDTARGET_OBEY_IMMUNITY);
  1255.  
  1256.     if(!is_user_connected(gTarget))
  1257.         return PLUGIN_HANDLED;
  1258.  
  1259.     new szPlName[35], szAdmName[35];
  1260.     get_user_name(id, szAdmName, charsmax(szAdmName));
  1261.     get_user_name(gTarget, szPlName, charsmax(szPlName));
  1262.  
  1263.     if (iNum > MaxLevel) {
  1264.         ColorChat(id, "^4[Levels]^1 The specified level^4 %i^1 is higher than the maximum allowed level^4 %i.", iNum, MaxLevel);
  1265.         return PLUGIN_HANDLED;
  1266.     }
  1267.  
  1268.     iCountUnlockLevel[gTarget] = iNum;
  1269.  
  1270.     ColorChat(id, "^4[Levels]^1 You set to the player^4 %s^1 level to^4 %i", szPlName, iNum);
  1271.     ColorChat(gTarget, "^4[Levels]^1 Admin^4 %s^1 has set your level to^4 %i", szAdmName, iNum);
  1272.     SaveData(gTarget);
  1273.  
  1274.     return PLUGIN_HANDLED;
  1275. }
  1276.  
  1277. public WeaponSkins(id)
  1278. {
  1279.     static menu[512], iLen;
  1280.     //iLen = 0;
  1281.    
  1282.     iLen = formatex(menu[iLen], charsmax(menu) - iLen, "\w>>>>>\d\r Skins Menu\d\w >>>>>^n^n");
  1283.  
  1284.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\r1\y]\r\y KNIFE\r •^n");
  1285.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\r2\y]\r\y AWP\r •^n");
  1286.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\r3\y]\r\y AK47\r •^n");
  1287.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\r4\y]\r\y M4A1\r •^n");
  1288.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\r5\y]\r\y DEAGLE\r •^n");
  1289.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\r6\y]\r\y GLOCK-18\r •^n");
  1290.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\r7\y]\r\y USP\r •^n^n");
  1291.  
  1292.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\r8\y]\r\y Hud:\r%s", hud[id] ? "\w[\yOFF\w]^n^n" : "\d[\rON\d]^n^n");
  1293.  
  1294.     iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\d[\y0\d]\w <<<<< • Exit • >>>>>^n");
  1295.    
  1296.     show_menu(id, KEYSMENU, menu, -1, "Weapons Skins");
  1297. }
  1298.  
  1299. public weapons_skins(id, key)
  1300. {
  1301.     switch (key)
  1302.     {
  1303.         case 0:
  1304.         {
  1305.             ChangeKnife(id);
  1306.         }
  1307.        
  1308.         case 1:
  1309.         {
  1310.             ChangeAwp(id);
  1311.         }
  1312.  
  1313.         case 2:
  1314.         {
  1315.             ChangeAk47(id);
  1316.         }
  1317.  
  1318.         case 3:
  1319.         {
  1320.             ChangeM4a1(id);
  1321.         }
  1322.  
  1323.         case 4:
  1324.         {
  1325.             ChangeDeagle(id);
  1326.         }
  1327.  
  1328.         case 5:
  1329.         {
  1330.             ChangeGlock18(id);
  1331.         }
  1332.  
  1333.         case 6:
  1334.         {
  1335.             ChangeUsp(id);
  1336.         }
  1337.  
  1338.         case 7:
  1339.         {
  1340.             if (!hud[id])
  1341.             {
  1342.                 hud[id] = true;
  1343.                 WeaponSkins(id);
  1344.                 ColorChat(id, "!g>>>!y You have!g disabled!y Hud Skins Info.");
  1345.             }
  1346.             else
  1347.             {
  1348.                 hud[id] = false;
  1349.                 WeaponSkins(id);
  1350.                 ColorChat(id, "!g>>>!y You have!g enabled!y Hud Skins Info.");
  1351.             }
  1352.         }
  1353.     }
  1354.    
  1355.     SaveData(id);
  1356.     return PLUGIN_HANDLED;
  1357. }
  1358.  
  1359. public ToggleHud(id)
  1360. {
  1361.     hud[id] = !hud[id];
  1362.  
  1363.     if (hud[id])
  1364.     {
  1365.         client_print(id, print_chat, "[HUD] You have disabled Hud Skins Info.");
  1366.     }
  1367.     else
  1368.     {
  1369.         client_print(id, print_chat, "[HUD] You have enabled Hud Skins Info." );
  1370.     }
  1371.     // Save player data and refresh the menu
  1372.     WeaponSkins(id);
  1373.     SaveData(id); // Save the player's data after toggling the HUD
  1374. }
  1375.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement