MegastoRM

Untitled

Jan 13th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <fakemeta>
  5. #include <cstrike>
  6. #include <codmod>
  7.  
  8. new const nazwa[] = "Zwinne Palce";
  9. new const opis[] = "Natychmiastowe przeladowanie";
  10.  
  11. new bool:ma_perk[33];
  12.  
  13. new const max_clip[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
  14. 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };
  15.  
  16. public plugin_init()
  17. {
  18. register_plugin(nazwa, "1.0", "QTM_Peyote");
  19.  
  20. cod_register_perk(nazwa, opis);
  21.  
  22. register_forward(FM_CmdStart, "CmdStart");
  23. }
  24.  
  25. public cod_perk_enabled(id)
  26. ma_perk[id] = true;
  27.  
  28. public cod_perk_disabled(id)
  29. ma_perk[id] = false;
  30.  
  31. public CmdStart(id, uc_handle)
  32. {
  33. if(!is_user_alive(id) || !ma_perk[id])
  34. return FMRES_IGNORED;
  35.  
  36. new buttons = get_uc(uc_handle, UC_Buttons);
  37. new oldbuttons = pev(id, pev_oldbuttons);
  38. new clip, ammo, weapon = get_user_weapon(id, clip, ammo);
  39.  
  40. if(max_clip[weapon] == -1 || !ammo)
  41. return FMRES_IGNORED;
  42.  
  43. if(informacije_predmet_igraca[ id ][ 0 ] == neki tamo broj)
  44. {
  45. if((buttons & IN_RELOAD && !(oldbuttons & IN_RELOAD) && !(buttons & IN_ATTACK)) || !clip)
  46. {
  47. cs_set_user_bpammo(id, weapon, ammo-(max_clip[weapon]-clip));
  48. new new_ammo = (max_clip[weapon] > ammo)? clip+ammo: max_clip[weapon]
  49. set_user_clip(id, new_ammo);
  50. }
  51. }
  52. return FMRES_IGNORED;
  53. }
  54.  
  55. stock set_user_clip(id, ammo)
  56. {
  57. new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
  58. get_weaponname(weapon, weaponname, 31);
  59. while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
  60. if (pev(weaponid, pev_owner) == id) {
  61. set_pdata_int(weaponid, 51, ammo, 4);
  62. return weaponid;
  63. }
  64. return 0;
  65. }
  66. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  67. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
  68. */
Advertisement
Add Comment
Please, Sign In to add comment