hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.04.19. 10:25



Jelenlévő felhasználók

Jelenleg 220 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 218 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] 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  [ 3 hozzászólás ] 
Szerző Üzenet
HozzászólásElküldve: 2013.06.30. 10:23 
Offline
Nagyúr
Avatar

Csatlakozott: 2011.09.07. 18:41
Hozzászólások: 642
Megköszönt másnak: 15 alkalommal
Megköszönték neki: 6 alkalommal
Üdv! Valaki ki tudná nekem ezt javítani? :D

Kód:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <zombieplague>

#define PLUGIN "[ZP] Choose the weapons survivor"
#define VERSION "1.6.1"
#define AUTHOR "alan_el_more"

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))

new const PRIMARY_NAMES[][] =
{
   "M249",
   "MP5",
   "M3"

}

new const SECONDARY_NAMES[][] =
{
   "Elite",
   "Deagle",
   " Mac-10"
}
new const SECONDARY_ID[][] =
{   
        "weapon_elite",
   "weapon_deagle",
   "weapon_mac10"   
}

new const PRIMARY_ID[][] =
{
   "weapon_m249",
   "weapon_mp5navy",
   "weapon_m3"
}

new pcvar, pcvar_secondary
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
const PEV_ADDITIONAL_AMMO = pev_iuser1

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_dictionary("zp_choose_weapons_survivor.txt")
   pcvar = register_cvar("zp_cws_enable", "1", FCVAR_SERVER)
   pcvar_secondary = register_cvar("zp_cws_secondary", "1")
}

public mostrarmenu(id)
{   
   new menu = menu_create("\rTulelo Menu:", "mostrar_cliente")
   
   menu_additem(menu, "\yM249", "0", 0)
   menu_additem(menu, "\yMP5", "1", 0)
   menu_additem(menu, "\yM3", "2", 0)

   menu_display(id, menu, 0)
}

public mostrar_cliente(id, menu, item)
{
   new data[6], iName[64]
   new access, callback
   menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
   new key = str_to_num(data)
   
   if(key == 4)
      key = random_num(0, 3)
   
   drop_weapons(id, 1)
   fm_give_item(id, PRIMARY_ID[key])
   client_print(id, print_chat, "[Zombie-Zone] %L ^"%s^"", id, "CHOOSE_WEAPON", PRIMARY_NAMES[key])
   
   if(get_pcvar_num(pcvar_secondary))
      mostrarmenu2(id)
   
   menu_destroy(menu)
   return PLUGIN_HANDLED
}

public mostrarmenu2(id)
{   
   new menu = menu_create("\rTulelo Menu:", "mostrar_cliente2")
   
   menu_additem(menu, "\yElite", "0", 0)
   menu_additem(menu, "\yDeagle", "1", 0)
                   menu_additem(menu, "\yMac-10", "2", 0)

   menu_display(id, menu, 0)
}

public mostrar_cliente2(id, menu, item)
{
   new data[6], iName[64]
   new access, callback
   menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
   new key = str_to_num(data)
   
   if(key == 4)
      key = random_num(0, 3)
   
   drop_weapons(id, 2)
   fm_give_item(id, SECONDARY_ID[key])
   client_print(id, print_chat, "[Zombie-Zone] %L ^"%s^"", id, "CHOOSE_WEAPON", SECONDARY_NAMES[key])
   
   menu_destroy(menu)
   return PLUGIN_HANDLED
}

public zp_user_humanized_post(id)
{
   if (zp_get_user_survivor(id) && get_pcvar_num(pcvar))
      set_task(1.0, "mostrarmenu", id)
}

stock drop_weapons(id, dropwhat)
{
   static weapons[32], num, i, weaponid
   num = 0
   get_user_weapons(id, weapons, num)
   
   for (i = 0; i < num; i++)
   {
      weaponid = weapons[i]
      
      if ((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
      {
         static wname[32], weapon_ent
         get_weaponname(weaponid, wname, sizeof wname - 1)
         weapon_ent = fm_find_ent_by_owner(-1, wname, id);
         
         set_pev(weapon_ent, PEV_ADDITIONAL_AMMO, cs_get_user_bpammo(id, weaponid))
         
         engclient_cmd(id, "drop", wname)
         cs_set_user_bpammo(id, weaponid, 0)
      }
   }
}

stock fm_give_item(index, const item[]) {
   if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
      return 0

   new ent = fm_create_entity(item)
   if (!pev_valid(ent))
      return 0

   new Float:origin[3]
   pev(index, pev_origin, origin)
   set_pev(ent, pev_origin, origin)
   set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
   dllfunc(DLLFunc_Spawn, ent)

   new save = pev(ent, pev_solid)
   dllfunc(DLLFunc_Touch, ent, index)
   if (pev(ent, pev_solid) != save)
      return ent

   engfunc(EngFunc_RemoveEntity, ent)

   return -1
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
   while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
   
   return entity;
}


Hibák:
Kód:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

51cfeacf4b42b.sma(1) : error 010: invalid function or declaration
/var/www/dave/amxxcompiler/include/fakemeta.inc(15) : error 017: undefined symbol "AMXX_VERSION_NUM"
/var/www/dave/amxxcompiler/include/fakemeta.inc(247) : error 070: rational number support was not enabled
/var/www/dave/amxxcompiler/include/cstrike.inc(13) : error 017: undefined symbol "AMXX_VERSION_NUM"
51cfeacf4b42b.sma(41) : error 017: undefined symbol "CSW_SCOUT"
51cfeacf4b42b.sma(41 -- 42) : error 008: must be a constant expression; assumed zero
51cfeacf4b42b.sma(42 -- 43) : error 008: must be a constant expression; assumed zero
51cfeacf4b42b.sma(42 -- 43) : fatal error 107: too many error messages on one line

Compilation aborted.
8 Errors.

_________________
Kép
Kép
Kép


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2013.06.30. 14:05 
Offline
Félisten
Avatar

Csatlakozott: 2010.09.16. 20:57
Hozzászólások: 950
Megköszönt másnak: 9 alkalommal
Megköszönték neki: 101 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <cstrike>
  4. #include <zombieplague>
  5.  
  6. #define PLUGIN "[ZP] Choose the weapons survivor"
  7. #define VERSION "1.6.1"
  8. #define AUTHOR "alan_el_more"
  9.  
  10. #define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
  11.  
  12. new const PRIMARY_NAMES[][] =
  13. {
  14. "M249",
  15. "MP5",
  16. "M3"
  17.  
  18. }
  19.  
  20. new const SECONDARY_NAMES[][] =
  21. {
  22. "Elite",
  23. "Deagle",
  24. " Mac-10"
  25. }
  26. new const SECONDARY_ID[][] =
  27. {
  28. "weapon_elite",
  29. "weapon_deagle",
  30. "weapon_mac10"
  31. }
  32.  
  33. new const PRIMARY_ID[][] =
  34. {
  35. "weapon_m249",
  36. "weapon_mp5navy",
  37. "weapon_m3"
  38. }
  39.  
  40. new pcvar, pcvar_secondary
  41. const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
  42. const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
  43. const PEV_ADDITIONAL_AMMO = pev_iuser1
  44.  
  45. public plugin_init()
  46. {
  47. register_plugin(PLUGIN, VERSION, AUTHOR)
  48. register_dictionary("zp_choose_weapons_survivor.txt")
  49. pcvar = register_cvar("zp_cws_enable", "1", FCVAR_SERVER)
  50. pcvar_secondary = register_cvar("zp_cws_secondary", "1")
  51. }
  52.  
  53. public mostrarmenu(id)
  54. {
  55. new menu = menu_create("\rTulelo Menu:", "mostrar_cliente")
  56.  
  57. menu_additem(menu, "\yM249", "0", 0)
  58. menu_additem(menu, "\yMP5", "1", 0)
  59. menu_additem(menu, "\yM3", "2", 0)
  60.  
  61. menu_display(id, menu, 0)
  62. }
  63.  
  64. public mostrar_cliente(id, menu, item)
  65. {
  66. new data[6], iName[64]
  67. new access, callback
  68. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
  69. new key = str_to_num(data)
  70.  
  71. if(key == 4)
  72. key = random_num(0, 3)
  73.  
  74. drop_weapons(id, 1)
  75. fm_give_item(id, PRIMARY_ID[key])
  76. client_print(id, print_chat, "[Zombie-Zone] %L ^"%s^"", id, "CHOOSE_WEAPON", PRIMARY_NAMES[key])
  77.  
  78. if(get_pcvar_num(pcvar_secondary))
  79. mostrarmenu2(id)
  80.  
  81. menu_destroy(menu)
  82. return PLUGIN_HANDLED
  83. }
  84.  
  85. public mostrarmenu2(id)
  86. {
  87. new menu = menu_create("\rTulelo Menu:", "mostrar_cliente2")
  88.  
  89. menu_additem(menu, "\yElite", "0", 0)
  90. menu_additem(menu, "\yDeagle", "1", 0)
  91. menu_additem(menu, "\yMac-10", "2", 0)
  92.  
  93. menu_display(id, menu, 0)
  94. }
  95.  
  96. public mostrar_cliente2(id, menu, item)
  97. {
  98. new data[6], iName[64]
  99. new access, callback
  100. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
  101. new key = str_to_num(data)
  102.  
  103. if(key == 4)
  104. key = random_num(0, 3)
  105.  
  106. drop_weapons(id, 2)
  107. fm_give_item(id, SECONDARY_ID[key])
  108. client_print(id, print_chat, "[Zombie-Zone] %L ^"%s^"", id, "CHOOSE_WEAPON", SECONDARY_NAMES[key])
  109.  
  110. menu_destroy(menu)
  111. return PLUGIN_HANDLED
  112. }
  113.  
  114. public zp_user_humanized_post(id)
  115. {
  116. if (zp_get_user_survivor(id) && get_pcvar_num(pcvar))
  117. set_task(1.0, "mostrarmenu", id)
  118. }
  119.  
  120. stock drop_weapons(id, dropwhat)
  121. {
  122. static weapons[32], num, i, weaponid
  123. num = 0
  124. get_user_weapons(id, weapons, num)
  125.  
  126. for (i = 0; i < num; i++)
  127. {
  128. weaponid = weapons[i]
  129.  
  130. if ((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
  131. {
  132. static wname[32], weapon_ent
  133. get_weaponname(weaponid, wname, sizeof wname - 1)
  134. weapon_ent = fm_find_ent_by_owner(-1, wname, id);
  135.  
  136. set_pev(weapon_ent, PEV_ADDITIONAL_AMMO, cs_get_user_bpammo(id, weaponid))
  137.  
  138. engclient_cmd(id, "drop", wname)
  139. cs_set_user_bpammo(id, weaponid, 0)
  140. }
  141. }
  142. }
  143.  
  144. stock fm_give_item(index, const item[]) {
  145. if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
  146. return 0
  147.  
  148. new ent = fm_create_entity(item)
  149. if (!pev_valid(ent))
  150. return 0
  151.  
  152. new Float:origin[3]
  153. pev(index, pev_origin, origin)
  154. set_pev(ent, pev_origin, origin)
  155. set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
  156. dllfunc(DLLFunc_Spawn, ent)
  157.  
  158. new save = pev(ent, pev_solid)
  159. dllfunc(DLLFunc_Touch, ent, index)
  160. if (pev(ent, pev_solid) != save)
  161. return ent
  162.  
  163. engfunc(EngFunc_RemoveEntity, ent)
  164.  
  165. return -1
  166. }
  167.  
  168. stock fm_find_ent_by_owner(entity, const classname[], owner)
  169. {
  170. while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
  171.  
  172. return entity;
  173. }


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Header size: 820 bytes
Code size: 4396 bytes
Data size: 2248 bytes
Stack/heap size: 16384 bytes; estimated max. usage=99 cells (396 bytes)
Total requirements: 23848 bytes
Done.

_________________
Weboldalam: nandee.smmg.hu
Kép

Ők köszönték meg Nandee nek ezt a hozzászólást: Vath (2013.06.30. 17:03)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2013.06.30. 17:04 
Offline
Nagyúr
Avatar

Csatlakozott: 2011.09.07. 18:41
Hozzászólások: 642
Megköszönt másnak: 15 alkalommal
Megköszönték neki: 6 alkalommal
Köszönöm szépen nandee! :)

_________________
Kép
Kép
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  [ 3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 4 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