hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.06.17. 08:41



Jelenlévő felhasználók

Jelenleg 220 felhasználó van jelen :: 3 regisztrált, 0 rejtett és 217 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot], Majestic-12 [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 6 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: örök lőszer
HozzászólásElküldve: 2012.07.10. 14:13 
Offline
Őstag
Avatar

Csatlakozott: 2010.04.16. 16:50
Hozzászólások: 1342
Megköszönt másnak: 42 alkalommal
Megköszönték neki: 58 alkalommal
A zp-s örök lőszer plugint átírná nekem valaki, pubra? 1000$ ba kerüljön és halálig maradjon meg
Ezzel a parancsal lehessen megvenni: /orokloszer

Kód:
  1. /*================================================================================

  2.        

  3.         -------------------------------------------

  4.         -*- [ZP] Extra Item: Unlimited Clip 1.0 -*-

  5.         -------------------------------------------

  6.        

  7.         ~~~~~~~~~~~~~~~

  8.         - Description -

  9.         ~~~~~~~~~~~~~~~

  10.        

  11.         This item/upgrade gives players unlimited clip ammo for a single round.

  12.        

  13. ================================================================================*/

  14.  

  15. #include <amxmodx>

  16. #include <fakemeta>

  17. #include <zombieplague>

  18.  

  19. /*================================================================================

  20.  [Plugin Customization]

  21. =================================================================================*/

  22.  

  23. new const g_item_name[] = { "Orok tolteny (Egyszeri kor)" }

  24. const g_item_cost = 10

  25.  

  26. /*============================================================================*/

  27.  

  28. // CS Offsets

  29. #if cellbits == 32

  30. const OFFSET_CLIPAMMO = 51

  31. #else

  32. const OFFSET_CLIPAMMO = 65

  33. #endif

  34. const OFFSET_LINUX_WEAPONS = 4

  35.  

  36. // Max Clip for weapons

  37. new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,

  38.                         10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

  39.  

  40. new g_itemid_infammo, g_has_unlimited_clip[33]

  41.  

  42. public plugin_init()

  43. {

  44.         register_plugin("[ZP] Extra: Unlimited Clip", "1.0", "MeRcyLeZZ")

  45.        

  46.         g_itemid_infammo = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)     

  47.        

  48.         register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

  49.         register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")

  50. }

  51.  

  52. // Player buys our upgrade, set the unlimited ammo flag

  53. public zp_extra_item_selected(player, itemid)

  54. {

  55.         if (itemid == g_itemid_infammo)

  56.                 g_has_unlimited_clip[player] = true

  57. }

  58.  

  59. // Reset flags for all players on newround

  60. public event_round_start()

  61. {

  62.         for (new id; id <= 32; id++) g_has_unlimited_clip[id] = false;

  63. }

  64.  

  65. // Unlimited clip code

  66. public message_cur_weapon(msg_id, msg_dest, msg_entity)

  67. {

  68.         // Player doesn't have the unlimited clip upgrade

  69.         if (!g_has_unlimited_clip[msg_entity])

  70.                 return;

  71.        

  72.         // Player not alive or not an active weapon

  73.         if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)

  74.                 return;

  75.        

  76.         static weapon, clip

  77.         weapon = get_msg_arg_int(2) // get weapon ID

  78.         clip = get_msg_arg_int(3) // get weapon clip

  79.        

  80.         // Unlimited Clip Ammo

  81.         if (MAXCLIP[weapon] > 2) // skip grenades

  82.         {

  83.                 set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time

  84.                

  85.                 if (clip < 2) // refill when clip is nearly empty

  86.                 {

  87.                         // Get the weapon entity

  88.                         static wname[32], weapon_ent

  89.                         get_weaponname(weapon, wname, sizeof wname - 1)

  90.                         weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)

  91.                        

  92.                         // Set max clip on weapon

  93.                         fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])

  94.                 }

  95.         }

  96. }

  97.  

  98. // Find entity by its owner (from fakemeta_util)

  99. stock fm_find_ent_by_owner(entity, const classname[], owner)

  100. {

  101.         while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}

  102.        

  103.         return entity;

  104. }

  105.  

  106. // Set Weapon Clip Ammo

  107. stock fm_set_weapon_ammo(entity, amount)

  108. {

  109.         set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);

  110. }

  111. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE

  112. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }

  113. */

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: örök lőszer
HozzászólásElküldve: 2012.07.10. 14:20 
Offline
Őskövület
Avatar

Csatlakozott: 2011.09.17. 17:54
Hozzászólások: 2350
Megköszönt másnak: 40 alkalommal
Megköszönték neki: 57 alkalommal
Áthelyezve.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: örök lőszer
HozzászólásElküldve: 2012.07.10. 14:49 
Offline
Nagyúr
Avatar

Csatlakozott: 2011.12.18. 10:40
Hozzászólások: 671
Megköszönt másnak: 5 alkalommal
Megköszönték neki: 20 alkalommal
Teszt nemvolt.
Kód:
  1. #include <amxmodx>

  2. #include <fakemeta>

  3. #include <cstrike>

  4.  

  5.  

  6.  

  7.  

  8. /*================================================================================

  9.  

  10. [Plugin Customization]

  11.  

  12. =================================================================================*/

  13.  

  14.  

  15.  

  16. const g_item_cost = 10

  17.  

  18.  

  19.  

  20. /*============================================================================*/

  21.  

  22.  

  23.  

  24. // CS Offsets

  25.  

  26. #if cellbits == 32

  27.  

  28. const OFFSET_CLIPAMMO = 51

  29.  

  30. #else

  31.  

  32. const OFFSET_CLIPAMMO = 65

  33.  

  34. #endif

  35.  

  36. const OFFSET_LINUX_WEAPONS = 4

  37.  

  38.  

  39.  

  40. // Max Clip for weapons

  41.  

  42. new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,

  43.        

  44. 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

  45.  

  46.  

  47.  

  48. new g_itemid_infammo, g_has_unlimited_clip[33]

  49.  

  50.  

  51.  

  52. public plugin_init()

  53.        

  54. {

  55.  

  56. register_plugin("[ZP] Extra: Unlimited Clip", "1.0", "MeRcyLeZZ")

  57.  

  58.  

  59.  

  60. register_clcmd("say /orokloszer", "loszer")

  61.  

  62.  

  63.  

  64. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

  65.  

  66. register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")

  67.  

  68. }

  69.  

  70.  

  71.  

  72. // Player buys our upgrade, set the unlimited ammo flag

  73.  

  74. public loszer(player, itemid, id)

  75.  

  76. {

  77.        

  78. new penzem = cs_get_user_money(id)

  79. cs_set_user_money(id, penzem - 1000)

  80.  

  81. if (itemid == g_itemid_infammo)

  82.        

  83.         g_has_unlimited_clip[player] = true

  84.        

  85. }

  86.  

  87.  

  88.  

  89. // Reset flags for all players on newround

  90.  

  91. public event_round_start()

  92.        

  93. {

  94.  

  95. for (new id; id <= 32; id++) g_has_unlimited_clip[id] = false;

  96.  

  97. }

  98.  

  99.  

  100.  

  101. // Unlimited clip code

  102.  

  103. public message_cur_weapon(msg_id, msg_dest, msg_entity)

  104.  

  105. {

  106.  

  107. // Player doesn't have the unlimited clip upgrade

  108.  

  109.         if (!g_has_unlimited_clip[msg_entity])

  110.         return;

  111.  

  112.         if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)

  113.         return;

  114.        

  115.        

  116.        

  117.         static weapon, clip

  118.        

  119.         weapon = get_msg_arg_int(2) // get weapon ID

  120.        

  121.         clip = get_msg_arg_int(3) // get weapon clip

  122.        

  123.        

  124.        

  125.         // Unlimited Clip Ammo

  126.        

  127.         if (MAXCLIP[weapon] > 2) // skip grenades

  128.                

  129. {

  130.        

  131.         set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time

  132.        

  133.        

  134.        

  135.         if (clip < 2) // refill when clip is nearly empty

  136.                

  137.         {

  138.                

  139.                 // Get the weapon entity

  140.                

  141.                 static wname[32], weapon_ent

  142.                

  143.                 get_weaponname(weapon, wname, sizeof wname - 1)

  144.                

  145.                 weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)

  146.                

  147.                

  148.                

  149.                 // Set max clip on weapon

  150.                

  151.                 fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])

  152.                

  153.         }

  154.        

  155. }

  156.  

  157. }

  158.  

  159.  

  160.  

  161. // Find entity by its owner (from fakemeta_util)

  162.  

  163. stock fm_find_ent_by_owner(entity, const classname[], owner)

  164.  

  165. {

  166.  

  167. while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}

  168.  

  169.  

  170.  

  171. return entity;

  172.  

  173. }

  174.  

  175.  

  176.  

  177. // Set Weapon Clip Ammo

  178.  

  179. stock fm_set_weapon_ammo(entity, amount)

  180.  

  181. {

  182.  

  183. set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);

  184.  

  185. }

  186.  

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: örök lőszer
HozzászólásElküldve: 2012.07.10. 15:35 
Offline
Őstag
Avatar

Csatlakozott: 2010.04.16. 16:50
Hozzászólások: 1342
Megköszönt másnak: 42 alkalommal
Megköszönték neki: 58 alkalommal
nem jó valamiért...

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: örök lőszer
HozzászólásElküldve: 2012.07.10. 15:43 
Offline
Veterán
Avatar

Csatlakozott: 2011.06.07. 15:29
Hozzászólások: 1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
CeDee kódjából volt néhány hiba. Átírtam az eredetit, teszt nemvolt, de remélem, hogy jólesz.
Kód:
  1. #include <amxmodx>

  2. #include <fakemeta>

  3. #include <cstrike>

  4.  

  5. #if cellbits == 32

  6.         const OFFSET_CLIPAMMO = 51

  7. #else

  8.         const OFFSET_CLIPAMMO = 65

  9. #endif

  10.         const OFFSET_LINUX_WEAPONS = 4

  11.  

  12. new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,

  13.  

  14.                         10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

  15.  

  16.  

  17. new bool:g_has_unlimited_clip[33]

  18.  

  19. public plugin_init()

  20. {

  21.         register_plugin("Unlimited Clip", "1.0", "MeRcyLeZZ & oroszrulett")

  22.         register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

  23.         register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")

  24.         register_clcmd("say /orokloszer", "loszer")

  25. }

  26.  

  27. public loszer(id)

  28. {

  29.         if(cs_get_user_money(id) >= 1000)

  30.         {

  31.                 cs_set_user_money(id, cs_get_user_money(id)-1000)

  32.                 g_has_unlimited_clip[id] = true

  33.                 client_print(id, print_chat, "Vettel orok loszert!")

  34.         }else{

  35.                 client_print(id, print_chat, "Nincs eleg penzed!")

  36.         }

  37.  

  38. }

  39.  

  40. public event_round_start()

  41. {

  42.         for (new id; id <= 32; id++)

  43.                 g_has_unlimited_clip[id] = false;

  44. }

  45.  

  46. public message_cur_weapon(msg_id, msg_dest, msg_entity)

  47. {

  48.         if(!g_has_unlimited_clip[msg_entity])

  49.                 return;

  50.  

  51.         if(!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)

  52.                 return;

  53.  

  54.         static weapon, clip

  55.         weapon = get_msg_arg_int(2) // get weapon ID

  56.         clip = get_msg_arg_int(3) // get weapon clip

  57.  

  58.         if (MAXCLIP[weapon] > 2) // skip grenades

  59.         {

  60.                 set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time

  61.  

  62.                 if (clip < 2) // refill when clip is nearly empty

  63.                 {

  64.                         static wname[32], weapon_ent

  65.                         get_weaponname(weapon, wname, sizeof wname - 1)

  66.                         weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)

  67.  

  68.                         fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])

  69.                 }

  70.         }

  71. }

  72.  

  73. stock fm_find_ent_by_owner(entity, const classname[], owner)

  74. {

  75.         while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}

  76.  

  77.         return entity;

  78. }

  79.  

  80. stock fm_set_weapon_ammo(entity, amount)

  81. {

  82.         set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);

  83. }

  84.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: örök lőszer
HozzászólásElküldve: 2012.07.10. 16:03 
Offline
Őstag
Avatar

Csatlakozott: 2010.04.16. 16:50
Hozzászólások: 1342
Megköszönt másnak: 42 alkalommal
Megköszönték neki: 58 alkalommal
Köszönöm, jó lett :D

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 6 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 28 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole