Advertisement
Guest User

Untitled

a guest
May 16th, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.06 KB | None | 0 0
  1. #pragma semicolon 1
  2.  
  3. #include <sourcemod>
  4. #include <sdktools>
  5. #include <cstrike>
  6. #include <zombiereloaded>
  7. #include <clientprefs>
  8.  
  9. #define VERSION "3.1"
  10.  
  11.  
  12. new Handle:Timers[MAXPLAYERS + 1] = INVALID_HANDLE;
  13.  
  14. new bool:newWeaponsSelected[MAXPLAYERS+1];
  15. new bool:rememberChoice[MAXPLAYERS+1];
  16. new bool:weaponsGivenThisRound[MAXPLAYERS + 1] = { false, ... };
  17.  
  18. // Menus
  19. new Handle:optionsMenu1 = INVALID_HANDLE;
  20. new Handle:optionsMenu2 = INVALID_HANDLE;
  21. new Handle:optionsMenu3 = INVALID_HANDLE;
  22. new Handle:optionsMenu4 = INVALID_HANDLE;
  23.  
  24. new String:primaryWeapon[MAXPLAYERS + 1][24];
  25. new String:secondaryWeapon[MAXPLAYERS + 1][24];
  26.  
  27. new Handle:cvar_smoke;
  28. new Handle:cvar_hegrenade;
  29. new Handle:cvar_decoy;
  30. new Handle:cvar_molotov;
  31. new Handle:cvar_flash;
  32.  
  33. new b_smoke;
  34. new b_hegrenade;
  35. new b_decoy;
  36. new b_molotov;
  37. new b_flash;
  38.  
  39. // Grenade Defines
  40. #define NADE_FLASHBANG 0
  41. #define NADE_MOLOTOV 1
  42. #define NADE_SMOKE 2
  43. #define NADE_HE 3
  44. #define NADE_DECOY 4
  45. #define NADE_INCENDIARY 5
  46.  
  47. new const g_iaGrenadeOffsets[] = {15, 17, 16, 14, 18, 17};
  48.  
  49.  
  50. enum Armas
  51. {
  52. String:nombre[64],
  53. String:desc[64]
  54. }
  55.  
  56. new Handle:array_primarias;
  57. new Handle:array_secundarias;
  58.  
  59. public Plugin:myinfo =
  60. {
  61. name = "SM Franug Weapons",
  62. author = "Franc1sco franug",
  63. description = "plugin",
  64. version = VERSION,
  65. url = "http://www.zeuszombie.com/"
  66. };
  67.  
  68. new Handle:weapons1 = INVALID_HANDLE;
  69. new Handle:weapons2 = INVALID_HANDLE;
  70. //new Handle:remember = INVALID_HANDLE;
  71.  
  72. public OnPluginStart()
  73. {
  74. array_primarias = CreateArray(128);
  75. array_secundarias = CreateArray(128);
  76. ListaArmas();
  77.  
  78. // Create menus
  79. optionsMenu1 = BuildOptionsMenu(true);
  80. optionsMenu2 = BuildOptionsMenu(false);
  81. optionsMenu3 = BuildOptionsMenuWeapons(true);
  82. optionsMenu4 = BuildOptionsMenuWeapons(false);
  83.  
  84. HookEvent("player_spawn", Event_PlayerSpawn);
  85.  
  86. AddCommandListener(Event_Say, "say");
  87. AddCommandListener(Event_Say, "say_team");
  88.  
  89. weapons1 = RegClientCookie("Primary Weapons", "", CookieAccess_Private);
  90. weapons2 = RegClientCookie("Secondary Weapons", "", CookieAccess_Private);
  91. //remember = RegClientCookie("Remember Weapons", "", CookieAccess_Private);
  92.  
  93. cvar_smoke = CreateConVar("sm_zeusweapons_smoke", "1", "Number of smoke");
  94. cvar_hegrenade = CreateConVar("sm_zeusweapons_hegrenade", "1", "Number of hegrenade");
  95. cvar_decoy = CreateConVar("sm_zeusweapons_decoy", "0", "Number of decoy");
  96. cvar_molotov = CreateConVar("sm_zeusweapons_molotov", "0", "Number of molotov");
  97. cvar_flash = CreateConVar("sm_zeusweapons_flash", "0", "Number of flashbang");
  98.  
  99. b_smoke = GetConVarInt(cvar_smoke);
  100. b_hegrenade = GetConVarInt(cvar_hegrenade);
  101. b_decoy = GetConVarInt(cvar_decoy);
  102. b_molotov = GetConVarInt(cvar_molotov);
  103. b_flash = GetConVarInt(cvar_flash);
  104.  
  105. HookConVarChange(cvar_smoke, OnConVarChanged);
  106. HookConVarChange(cvar_hegrenade, OnConVarChanged);
  107. HookConVarChange(cvar_decoy, OnConVarChanged);
  108. HookConVarChange(cvar_molotov, OnConVarChanged);
  109. HookConVarChange(cvar_flash, OnConVarChanged);
  110.  
  111. LoadTranslations("franug_weapons.phrases");
  112. }
  113.  
  114. public OnConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
  115. {
  116. if (convar == cvar_smoke)
  117. {
  118. b_smoke = StringToInt(newValue);
  119. }
  120. else if (convar == cvar_hegrenade)
  121. {
  122. b_hegrenade = StringToInt(newValue);
  123. }
  124. else if (convar == cvar_decoy)
  125. {
  126. b_decoy = StringToInt(newValue);
  127. }
  128. else if (convar == cvar_molotov)
  129. {
  130. b_molotov = StringToInt(newValue);
  131. }
  132. else if (convar == cvar_flash)
  133. {
  134. b_flash = StringToInt(newValue);
  135. }
  136. }
  137.  
  138. Handle:BuildOptionsMenu(bool:sameWeaponsEnabled)
  139. {
  140. new sameWeaponsStyle = (sameWeaponsEnabled) ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED;
  141. new Handle:menu3 = CreateMenu(Menu_Options, MENU_ACTIONS_DEFAULT | MenuAction_DisplayItem );
  142. SetMenuTitle(menu3, "Weapon Menu:");
  143. SetMenuExitButton(menu3, true);
  144. AddMenuItem(menu3, "New", "New weapons");
  145. AddMenuItem(menu3, "Same 1", "Same weapons", sameWeaponsStyle);
  146. AddMenuItem(menu3, "Same All", "Same weapons every round", sameWeaponsStyle);
  147. AddMenuItem(menu3, "Random 1", "Random weapons");
  148. AddMenuItem(menu3, "Random All", "Random weapons every round");
  149. return menu3;
  150. }
  151.  
  152. DisplayOptionsMenu(clientIndex)
  153. {
  154. if (strcmp(primaryWeapon[clientIndex], "") == 0 || strcmp(secondaryWeapon[clientIndex], "") == 0)
  155. DisplayMenu(optionsMenu2, clientIndex, MENU_TIME_FOREVER);
  156. else
  157. DisplayMenu(optionsMenu1, clientIndex, MENU_TIME_FOREVER);
  158. }
  159.  
  160. Handle:BuildOptionsMenuWeapons(bool:primary)
  161. {
  162. new Handle:menu;
  163. new Items[Armas];
  164. if(primary)
  165. {
  166. menu = CreateMenu(Menu_Primary);
  167. SetMenuTitle(menu, "Primary Weapon:");
  168. SetMenuExitButton(menu, true);
  169. for(new i=0;i<GetArraySize(array_primarias);++i)
  170. {
  171. GetArrayArray(array_primarias, i, Items[0]);
  172. AddMenuItem(menu, Items[nombre], Items[desc]);
  173. }
  174. }
  175. else
  176. {
  177. menu = CreateMenu(Menu_Secondary);
  178. SetMenuTitle(menu, "Secundary Weapon:");
  179. SetMenuExitButton(menu, true);
  180. for(new i=0;i<GetArraySize(array_secundarias);++i)
  181. {
  182. GetArrayArray(array_secundarias, i, Items[0]);
  183. AddMenuItem(menu, Items[nombre], Items[desc]);
  184. }
  185. }
  186.  
  187. return menu;
  188.  
  189. }
  190.  
  191.  
  192. public Menu_Options(Handle:menu, MenuAction:action, param1, param2)
  193. {
  194. if (action == MenuAction_Select)
  195. {
  196. decl String:info[24];
  197. GetMenuItem(menu, param2, info, sizeof(info));
  198.  
  199. if (StrEqual(info, "New"))
  200. {
  201. if (weaponsGivenThisRound[param1])
  202. newWeaponsSelected[param1] = true;
  203. DisplayMenu(optionsMenu3, param1, MENU_TIME_FOREVER);
  204. rememberChoice[param1] = false;
  205. }
  206. else if (StrEqual(info, "Same 1"))
  207. {
  208. if (weaponsGivenThisRound[param1])
  209. {
  210. newWeaponsSelected[param1] = true;
  211. PrintToChat(param1, "[\x04GUNS\x01] %t.", "Same");
  212. }
  213. GiveSavedWeapons(param1);
  214. rememberChoice[param1] = false;
  215. }
  216. else if (StrEqual(info, "Same All"))
  217. {
  218. if (weaponsGivenThisRound[param1])
  219. PrintToChat(param1, "[\x04GUNS\x01] %t.", "Same_All");
  220. GiveSavedWeapons(param1);
  221. rememberChoice[param1] = true;
  222. }
  223. else if (StrEqual(info, "Random 1"))
  224. {
  225. if (weaponsGivenThisRound[param1])
  226. {
  227. newWeaponsSelected[param1] = true;
  228. PrintToChat(param1, "[\x04GUNS\x01] %t.", "Random");
  229. }
  230. primaryWeapon[param1] = "random";
  231. secondaryWeapon[param1] = "random";
  232. GiveSavedWeapons(param1);
  233. rememberChoice[param1] = false;
  234. }
  235. else if (StrEqual(info, "Random All"))
  236. {
  237. if (weaponsGivenThisRound[param1])
  238. PrintToChat(param1, "[\x04GUNS\x01] %t.", "Random_All");
  239. primaryWeapon[param1] = "random";
  240. secondaryWeapon[param1] = "random";
  241. GiveSavedWeapons(param1);
  242. rememberChoice[param1] = true;
  243. }
  244. }
  245. else if (action == MenuAction_DisplayItem)
  246. {
  247. decl String:Display[128];
  248. switch(param2)
  249. {
  250. case 0: FormatEx(Display, sizeof(Display), "%T", "Menu_NewWeapons", param1);
  251. case 1: FormatEx(Display, sizeof(Display), "%T", "Menu_SameWeapons", param1);
  252. case 2: FormatEx(Display, sizeof(Display), "%T", "Menu_SameWeapons_all", param1);
  253. case 3: FormatEx(Display, sizeof(Display), "%T", "Menu_Random", param1);
  254. case 4: FormatEx(Display, sizeof(Display), "%T", "Menu_Random_All", param1);
  255. }
  256. return RedrawMenuItem(Display);
  257. }
  258. return 0;
  259. }
  260.  
  261. public Menu_Primary(Handle:menu, MenuAction:action, param1, param2)
  262. {
  263. if (action == MenuAction_Select)
  264. {
  265. decl String:info[24];
  266. GetMenuItem(menu, param2, info, sizeof(info));
  267. primaryWeapon[param1] = info;
  268. DisplayMenu(optionsMenu4, param1, MENU_TIME_FOREVER);
  269. }
  270. }
  271.  
  272. public Menu_Secondary(Handle:menu, MenuAction:action, param1, param2)
  273. {
  274. if (action == MenuAction_Select)
  275. {
  276. decl String:info[24];
  277. GetMenuItem(menu, param2, info, sizeof(info));
  278. secondaryWeapon[param1] = info;
  279. GiveSavedWeapons(param1);
  280. if (!IsPlayerAlive(param1))
  281. newWeaponsSelected[param1] = true;
  282. if (newWeaponsSelected[param1])
  283. PrintToChat(param1, "[\x04GUNS\x01] %t.", "New_weapons");
  284. }
  285. }
  286.  
  287. public OnMapStart()
  288. {
  289. SetBuyZones("Disable");
  290. }
  291.  
  292. public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  293. {
  294. new clientIndex = GetClientOfUserId(GetEventInt(event, "userid"));
  295.  
  296. //CancelClientMenu(clientIndex);
  297. MatarTimer(clientIndex);
  298. Timers[clientIndex] = CreateTimer(2.0, Aparecer, clientIndex);
  299. }
  300.  
  301. public Action:Aparecer(Handle:timer, any:clientIndex)
  302. {
  303. Timers[clientIndex] = INVALID_HANDLE;
  304. if (GetClientTeam(clientIndex) > 1 && IsPlayerAlive(clientIndex) && !ZR_IsClientZombie(clientIndex))
  305. {
  306. // Give weapons or display menu.
  307. weaponsGivenThisRound[clientIndex] = false;
  308. if (newWeaponsSelected[clientIndex])
  309. {
  310. GiveSavedWeapons(clientIndex);
  311. newWeaponsSelected[clientIndex] = false;
  312. }
  313. else if (rememberChoice[clientIndex])
  314. {
  315. GiveSavedWeapons(clientIndex);
  316. }
  317. else
  318. {
  319. DisplayOptionsMenu(clientIndex);
  320. }
  321. }
  322. }
  323.  
  324. SetBuyZones(const String:status[])
  325. {
  326. new maxEntities = GetMaxEntities();
  327. decl String:class[24];
  328.  
  329. for (new i = MaxClients + 1; i < maxEntities; i++)
  330. {
  331. if (IsValidEdict(i))
  332. {
  333. GetEdictClassname(i, class, sizeof(class));
  334. if (StrEqual(class, "func_buyzone"))
  335. AcceptEntityInput(i, status);
  336. }
  337. }
  338. }
  339.  
  340. public Action:Event_Say(clientIndex, const String:command[], arg)
  341. {
  342. static String:menuTriggers[][] = { "gun", "!gun", "/gun", "guns", "!guns", "/guns", "menu", "!menu", "/menu", "weapon", "!weapon", "/weapon", "weapons", "!weapons", "/weapons" };
  343.  
  344. if (clientIndex > 0 && IsClientInGame(clientIndex))
  345. {
  346. // Retrieve and clean up text.
  347. decl String:text[24];
  348. GetCmdArgString(text, sizeof(text));
  349. StripQuotes(text);
  350. TrimString(text);
  351.  
  352. for(new i = 0; i < sizeof(menuTriggers); i++)
  353. {
  354. if (StrEqual(text, menuTriggers[i], false))
  355. {
  356. rememberChoice[clientIndex] = false;
  357. DisplayOptionsMenu(clientIndex);
  358. return Plugin_Handled;
  359. }
  360. }
  361. }
  362. return Plugin_Continue;
  363. }
  364.  
  365. GiveSavedWeapons(clientIndex)
  366. {
  367. decl String:weapons[128];
  368. new weaponindex;
  369. if (!weaponsGivenThisRound[clientIndex] && IsPlayerAlive(clientIndex) && !ZR_IsClientZombie(clientIndex))
  370. {
  371. //StripAllWeapons(clientIndex);
  372. weaponindex = GetPlayerWeaponSlot(clientIndex, CS_SLOT_PRIMARY);
  373. if (StrEqual(primaryWeapon[clientIndex], "random"))
  374. {
  375. if(weaponindex != -1)
  376. {
  377. RemovePlayerItem(clientIndex, weaponindex);
  378. AcceptEntityInput(weaponindex, "Kill");
  379. }
  380. // Select random menu item (excluding "Random" option)
  381. new random = GetRandomInt(0, GetArraySize(array_primarias)-1);
  382. new Items[Armas];
  383. GetArrayArray(array_primarias, random, Items[0]);
  384. GivePlayerItem(clientIndex, Items[nombre]);
  385. }
  386. else
  387. {
  388. if(weaponindex != -1)
  389. {
  390. GetEdictClassname(weaponindex, weapons, 128);
  391. if(!StrEqual(weapons, primaryWeapon[clientIndex]))
  392. {
  393. RemovePlayerItem(clientIndex, weaponindex);
  394. AcceptEntityInput(weaponindex, "Kill");
  395.  
  396. GivePlayerItem(clientIndex, primaryWeapon[clientIndex]);
  397. }
  398. }
  399. else
  400. {
  401.  
  402. GivePlayerItem(clientIndex, primaryWeapon[clientIndex]);
  403. }
  404. }
  405.  
  406. // next
  407.  
  408. weaponindex = GetPlayerWeaponSlot(clientIndex, CS_SLOT_SECONDARY);
  409. if (StrEqual(secondaryWeapon[clientIndex], "random"))
  410. {
  411. if(weaponindex != -1)
  412. {
  413. RemovePlayerItem(clientIndex, weaponindex);
  414. AcceptEntityInput(weaponindex, "Kill");
  415. }
  416. // Select random menu item (excluding "Random" option)
  417. new random = GetRandomInt(0, GetArraySize(array_secundarias)-1);
  418. new Items[Armas];
  419. GetArrayArray(array_secundarias, random, Items[0]);
  420. GivePlayerItem(clientIndex, Items[nombre]);
  421. }
  422. else
  423. {
  424. if(weaponindex != -1)
  425. {
  426. GetEdictClassname(weaponindex, weapons, 128);
  427. if(!StrEqual(weapons, secondaryWeapon[clientIndex]))
  428. {
  429. RemovePlayerItem(clientIndex, weaponindex);
  430. AcceptEntityInput(weaponindex, "Kill");
  431.  
  432. GivePlayerItem(clientIndex, secondaryWeapon[clientIndex]);
  433. }
  434. }
  435. else
  436. {
  437.  
  438. GivePlayerItem(clientIndex, secondaryWeapon[clientIndex]);
  439. }
  440. }
  441.  
  442. /* new iEnt;
  443. while ((iEnt = GetPlayerWeaponSlot(clientIndex, CS_SLOT_GRENADE)) != -1)
  444. {
  445. RemovePlayerItem(clientIndex, iEnt);
  446. AcceptEntityInput(iEnt, "Kill");
  447. } */
  448.  
  449.  
  450. RemoveNades(clientIndex);
  451.  
  452. if(b_hegrenade > 0)
  453. {
  454. GivePlayerItem(clientIndex, "weapon_hegrenade");
  455. SetEntProp(clientIndex, Prop_Send, "m_iAmmo", b_hegrenade, _, g_iaGrenadeOffsets[NADE_HE]);
  456. }
  457. if(b_decoy > 0)
  458. {
  459. GivePlayerItem(clientIndex, "weapon_decoy");
  460. SetEntProp(clientIndex, Prop_Send, "m_iAmmo", b_decoy, _, g_iaGrenadeOffsets[NADE_DECOY]);
  461. }
  462. if(b_molotov > 0)
  463. {
  464. GivePlayerItem(clientIndex, "weapon_molotov");
  465. SetEntProp(clientIndex, Prop_Send, "m_iAmmo", b_molotov, _, g_iaGrenadeOffsets[NADE_MOLOTOV]);
  466. }
  467. if(b_smoke > 0)
  468. {
  469. GivePlayerItem(clientIndex, "weapon_smokegrenade");
  470. SetEntProp(clientIndex, Prop_Send, "m_iAmmo", b_smoke, _, g_iaGrenadeOffsets[NADE_SMOKE]);
  471. }
  472. if(b_flash > 0)
  473. {
  474. GivePlayerItem(clientIndex, "weapon_flashbang");
  475. SetEntProp(clientIndex, Prop_Send, "m_iAmmo", b_flash, _, g_iaGrenadeOffsets[NADE_FLASHBANG]);
  476. }
  477. weaponsGivenThisRound[clientIndex] = true;
  478.  
  479. if(GetPlayerWeaponSlot(clientIndex, 2) == -1) GivePlayerItem(clientIndex, "weapon_knife");
  480. FakeClientCommand(clientIndex,"use weapon_knife");
  481. PrintToChat(clientIndex, "[\x04GUNS\x01] %t.", "Change_Weapons");
  482. //PrintToChat(clientIndex, "Primary weapons is %s secondary weapons is %s y valor primary es %i",primaryWeapon[clientIndex], secondaryWeapon[clientIndex], strcmp(primaryWeapon[clientIndex], ""));
  483. }
  484. }
  485.  
  486. /* stock StripAllWeapons(iClient)
  487. {
  488. new iEnt;
  489. for (new i = 0; i <= 4; i++)
  490. {
  491. while ((iEnt = GetPlayerWeaponSlot(iClient, i)) != -1)
  492. {
  493. RemovePlayerItem(iClient, iEnt);
  494. AcceptEntityInput(iEnt, "Kill");
  495. }
  496. }
  497. } */
  498.  
  499. public OnClientPutInServer(client)
  500. {
  501. ResetClientSettings(client);
  502. }
  503.  
  504. public OnClientCookiesCached(client)
  505. {
  506. GetClientCookie(client, weapons1, primaryWeapon[client], 24);
  507. GetClientCookie(client, weapons2, secondaryWeapon[client], 24);
  508. //rememberChoice[client] = GetCookie(client);
  509. rememberChoice[client] = false;
  510. }
  511.  
  512. ResetClientSettings(clientIndex)
  513. {
  514. weaponsGivenThisRound[clientIndex] = false;
  515. newWeaponsSelected[clientIndex] = false;
  516. }
  517.  
  518. public OnClientDisconnect(clientIndex)
  519. {
  520. MatarTimer(clientIndex);
  521.  
  522. SetClientCookie(clientIndex, weapons1, primaryWeapon[clientIndex]);
  523. SetClientCookie(clientIndex, weapons2, secondaryWeapon[clientIndex]);
  524.  
  525. /* if(rememberChoice[clientIndex]) SetClientCookie(clientIndex, remember, "On");
  526. else SetClientCookie(clientIndex, remember, "Off"); */
  527. }
  528.  
  529. MatarTimer(client)
  530. {
  531. if (Timers[client] != INVALID_HANDLE)
  532. {
  533. KillTimer(Timers[client]);
  534. Timers[client] = INVALID_HANDLE;
  535. }
  536. }
  537.  
  538.  
  539. ListaArmas()
  540. {
  541. ClearArray(array_primarias);
  542. ClearArray(array_secundarias);
  543.  
  544. new Items[Armas];
  545.  
  546. Format(Items[nombre], 64, "weapon_bizon");
  547. Format(Items[desc], 64, "PP-Bizon");
  548. PushArrayArray(array_primarias, Items[0]);
  549.  
  550. Format(Items[nombre], 64, "weapon_p90");
  551. Format(Items[desc], 64, "P90");
  552. PushArrayArray(array_primarias, Items[0]);
  553.  
  554. Format(Items[nombre], 64, "weapon_m4a1");
  555. Format(Items[desc], 64, "M4A1");
  556. PushArrayArray(array_primarias, Items[0]);
  557.  
  558. Format(Items[nombre], 64, "weapon_m4a1_silencer");
  559. Format(Items[desc], 64, "M4A1-S");
  560. PushArrayArray(array_primarias, Items[0]);
  561.  
  562. Format(Items[nombre], 64, "weapon_ak47");
  563. Format(Items[desc], 64, "AK-47");
  564. PushArrayArray(array_primarias, Items[0]);
  565.  
  566. Format(Items[nombre], 64, "weapon_aug");
  567. Format(Items[desc], 64, "AUG");
  568. PushArrayArray(array_primarias, Items[0]);
  569.  
  570. Format(Items[nombre], 64, "weapon_galilar");
  571. Format(Items[desc], 64, "Galil AR");
  572. PushArrayArray(array_primarias, Items[0]);
  573.  
  574. Format(Items[nombre], 64, "weapon_sg556");
  575. Format(Items[desc], 64, "SG 553");
  576. PushArrayArray(array_primarias, Items[0]);
  577.  
  578. Format(Items[nombre], 64, "weapon_ump45");
  579. Format(Items[desc], 64, "UMP-45");
  580. PushArrayArray(array_primarias, Items[0]);
  581.  
  582. Format(Items[nombre], 64, "weapon_mp7");
  583. Format(Items[desc], 64, "MP7");
  584. PushArrayArray(array_primarias, Items[0]);
  585.  
  586. Format(Items[nombre], 64, "weapon_famas");
  587. Format(Items[desc], 64, "FAMAS");
  588. PushArrayArray(array_primarias, Items[0]);
  589.  
  590. Format(Items[nombre], 64, "weapon_mp9");
  591. Format(Items[desc], 64, "MP9");
  592. PushArrayArray(array_primarias, Items[0]);
  593.  
  594. Format(Items[nombre], 64, "weapon_mac10");
  595. Format(Items[desc], 64, "MAC-10");
  596. PushArrayArray(array_primarias, Items[0]);
  597.  
  598. Format(Items[nombre], 64, "weapon_ssg08");
  599. Format(Items[desc], 64, "SSG 08");
  600. PushArrayArray(array_primarias, Items[0]);
  601.  
  602. Format(Items[nombre], 64, "weapon_nova");
  603. Format(Items[desc], 64, "Nova");
  604. PushArrayArray(array_primarias, Items[0]);
  605.  
  606. Format(Items[nombre], 64, "weapon_xm1014");
  607. Format(Items[desc], 64, "XM1014");
  608. PushArrayArray(array_primarias, Items[0]);
  609.  
  610. Format(Items[nombre], 64, "weapon_sawedoff");
  611. Format(Items[desc], 64, "Sawed-Off");
  612. PushArrayArray(array_primarias, Items[0]);
  613.  
  614. Format(Items[nombre], 64, "weapon_mag7");
  615. Format(Items[desc], 64, "MAG-7");
  616. PushArrayArray(array_primarias, Items[0]);
  617.  
  618.  
  619.  
  620. // Secondary weapons
  621. Format(Items[nombre], 64, "weapon_elite");
  622. Format(Items[desc], 64, "Dual Berettas");
  623. PushArrayArray(array_secundarias, Items[0]);
  624.  
  625. Format(Items[nombre], 64, "weapon_deagle");
  626. Format(Items[desc], 64, "Desert Eagle");
  627. PushArrayArray(array_secundarias, Items[0]);
  628.  
  629. Format(Items[nombre], 64, "weapon_tec9");
  630. Format(Items[desc], 64, "Tec-9");
  631. PushArrayArray(array_secundarias, Items[0]);
  632.  
  633. Format(Items[nombre], 64, "weapon_fiveseven");
  634. Format(Items[desc], 64, "Five-SeveN");
  635. PushArrayArray(array_secundarias, Items[0]);
  636.  
  637. Format(Items[nombre], 64, "weapon_cz75a");
  638. Format(Items[desc], 64, "CZ75-Auto");
  639. PushArrayArray(array_secundarias, Items[0]);
  640.  
  641. Format(Items[nombre], 64, "weapon_glock");
  642. Format(Items[desc], 64, "Glock-18");
  643. PushArrayArray(array_secundarias, Items[0]);
  644.  
  645. Format(Items[nombre], 64, "weapon_usp_silencer");
  646. Format(Items[desc], 64, "USP-S");
  647. PushArrayArray(array_secundarias, Items[0]);
  648.  
  649. Format(Items[nombre], 64, "weapon_p250");
  650. Format(Items[desc], 64, "P250");
  651. PushArrayArray(array_secundarias, Items[0]);
  652.  
  653. Format(Items[nombre], 64, "weapon_hkp2000");
  654. Format(Items[desc], 64, "P2000");
  655. PushArrayArray(array_secundarias, Items[0]);
  656.  
  657. Format(Items[nombre], 64, "weapon_revolver");
  658. Format(Items[desc], 64, "Revolver");
  659. PushArrayArray(array_secundarias, Items[0]);
  660.  
  661. }
  662.  
  663. /* bool:GetCookie(client)
  664. {
  665. decl String:buffer[10];
  666. GetClientCookie(client, remember, buffer, sizeof(buffer));
  667.  
  668. return StrEqual(buffer, "On");
  669. } */
  670.  
  671. stock RemoveNades(iClient)
  672. {
  673. while(RemoveWeaponBySlot(iClient, 3)){}
  674. for(new i = 0; i < 6; i++)
  675. SetEntProp(iClient, Prop_Send, "m_iAmmo", 0, _, g_iaGrenadeOffsets[i]);
  676. }
  677.  
  678. stock bool:RemoveWeaponBySlot(iClient, iSlot)
  679. {
  680. new iEntity = GetPlayerWeaponSlot(iClient, iSlot);
  681. if(IsValidEdict(iEntity)) {
  682. RemovePlayerItem(iClient, iEntity);
  683. AcceptEntityInput(iEntity, "Kill");
  684. return true;
  685. }
  686. return false;
  687. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement