hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.17. 13:00



Jelenlévő felhasználók

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

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó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ás témája: Fegyver ikon
HozzászólásElküldve:2014.11.12. 16:22 
Offline
Jómunkásember
Avatar

Csatlakozott:2013.12.18. 17:35
Hozzászólások:365
Megköszönt másnak: 152 alkalommal
Megköszönték neki: 31 alkalommal
Üdv!
Azt a plugint keresem, amelyik a fegyver ikonját kiírja oldalt ahol a bomba,defuse stb. van.
Itt fent nem találtam, de lehet, hogy fent van.
Köszi előre is!

_________________
Ha segítettem használd a gombot!

Kép
KépKép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fegyver ikon
HozzászólásElküldve:2014.11.12. 16:31 
ezt egy angol oldalon találtam remélem meg felel

SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2. ********************************************************************************
  3. * AMX Mod X script.
  4. *
  5. * Weapon Icon Display (weapon_icon.sma)
  6. * Copyright (C) 2008-2009 by zenix and fixed by hoboman313
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * when you downloaded AMX Mod X; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. *
  22. * In addition, as a special exception, the author gives permission to
  23. * link the code of this program with the Half-Life Game Engine ("HL
  24. * Engine") and Modified Game Libraries ("MODs") developed by Valve,
  25. * L.L.C ("Valve"). You must obey the GNU General Public License in all
  26. * respects for all of the code used other than the HL Engine and MODs
  27. * from Valve. If you modify this file, you may extend this exception
  28. * to your version of the file, but you are not obligated to do so. If
  29. * you do not wish to do so, delete this exception statement from your
  30. * version.
  31. *
  32. *********************************************************************************
  33. */
  34.  
  35. /*
  36. * For a full plugin description read: http://forums.alliedmods.net/showthread.php?t=69664
  37. */
  38.  
  39. #include <amxmodx>
  40.  
  41. #define PLUGIN "Weapon Icon"
  42. #define VERSION "1.2"
  43. #define AUTHOR "hoboman313/Zenix"
  44.  
  45. #define MAX_PLAYERS 32
  46.  
  47. new iconstatus, pcv_iloc
  48. new user_icons[MAX_PLAYERS+1][16]
  49.  
  50.  
  51. public plugin_init()
  52. {
  53. register_plugin(PLUGIN, VERSION, AUTHOR)
  54.  
  55. register_event("CurWeapon", "update_icon", "be", "1=1")
  56. register_event("AmmoX", "draw_icon", "be")
  57. register_event("DeathMsg", "event_death", "a")
  58.  
  59. pcv_iloc = register_cvar("amx_weapon_location", "1")
  60.  
  61. check_icon_loc()
  62. }
  63.  
  64. public update_icon(id)
  65. {
  66. remove_weapon_icon(id)
  67.  
  68. check_icon_loc()
  69.  
  70. if( get_pcvar_num(pcv_iloc) == 0 || is_user_bot(id) )
  71. return
  72.  
  73. static sprite[16], iwpn, clip, ammo
  74.  
  75. iwpn = get_user_weapon(id, clip, ammo)
  76.  
  77. switch(iwpn)
  78. {
  79. case CSW_P228:
  80. sprite = "d_p228"
  81. case CSW_SCOUT:
  82. sprite = "d_scout"
  83. case CSW_HEGRENADE:
  84. sprite = "d_grenade"
  85. case CSW_XM1014:
  86. sprite = "d_xm1014"
  87. case CSW_MAC10:
  88. sprite = "d_mac10"
  89. case CSW_AUG:
  90. sprite = "d_aug"
  91. case CSW_SMOKEGRENADE:
  92. sprite = "d_flashbang"
  93. case CSW_ELITE:
  94. sprite = "d_elite"
  95. case CSW_FIVESEVEN:
  96. sprite = "d_fiveseven"
  97. case CSW_UMP45:
  98. sprite = "d_ump45"
  99. case CSW_SG550:
  100. sprite = "d_sg550"
  101. case CSW_GALIL:
  102. sprite = "d_galil"
  103. case CSW_FAMAS:
  104. sprite = "d_famas"
  105. case CSW_USP:
  106. sprite = "d_usp"
  107. case CSW_MP5NAVY:
  108. sprite = "d_mp5navy"
  109. case CSW_M249:
  110. sprite = "d_m249"
  111. case CSW_M3:
  112. sprite = "d_m3"
  113. case CSW_M4A1:
  114. sprite = "d_m4a1"
  115. case CSW_TMP:
  116. sprite = "d_tmp"
  117. case CSW_G3SG1:
  118. sprite = "d_g3sg1"
  119. case CSW_FLASHBANG:
  120. sprite = "d_flashbang"
  121. case CSW_DEAGLE:
  122. sprite = "d_deagle"
  123. case CSW_SG552:
  124. sprite = "d_sg552"
  125. case CSW_AK47:
  126. sprite = "d_ak47"
  127. case CSW_KNIFE:
  128. sprite = "d_knife"
  129. case CSW_P90:
  130. sprite = "d_p90"
  131. case CSW_GLOCK18:
  132. sprite = "d_glock18"
  133. case CSW_AWP:
  134. sprite = "d_awp"
  135. default:
  136. return
  137. }
  138. user_icons[id] = sprite
  139.  
  140. draw_icon(id)
  141.  
  142. return
  143. }
  144.  
  145.  
  146. public draw_icon(id)
  147. {
  148. static iwpn, clip, ammo, icon_color[3]
  149.  
  150. iwpn = get_user_weapon(id, clip, ammo)
  151.  
  152. // ammo check, this is for the color of the icon
  153. if ((ammo == 0 && clip == 0))
  154. icon_color = {255, 0, 0} // outta ammo!
  155. else if ( ammo==0 && iwpn!=CSW_KNIFE)
  156. icon_color = {255, 160, 0} // last clip!
  157. else
  158. icon_color = {0, 160, 0}//green icon...decent ammo
  159.  
  160.  
  161. // draw the sprite itself
  162. message_begin(MSG_ONE,iconstatus,{0,0,0},id)
  163. write_byte(1) // status (0=hide, 1=show, 2=flash)
  164. write_string(user_icons[id]) // sprite name
  165. write_byte(icon_color[0]) // red
  166. write_byte(icon_color[1]) // green
  167. write_byte(icon_color[2]) // blue
  168. message_end()
  169. }
  170.  
  171.  
  172. public remove_weapon_icon(id)
  173. {
  174. message_begin(MSG_ONE,iconstatus,{0,0,0},id)
  175. write_byte(0)
  176. write_string(user_icons[id])
  177. message_end()
  178. }
  179.  
  180.  
  181. public event_death()
  182. {
  183. new id = read_data(2) // the dead player's ID (1-32)
  184.  
  185. if (!is_user_bot(id))
  186. remove_weapon_icon(id)
  187. }
  188.  
  189.  
  190. public check_icon_loc()
  191. {
  192. new value = get_pcvar_num(pcv_iloc)
  193.  
  194. if (value == 1)
  195. iconstatus = get_user_msgid("StatusIcon")
  196. else if (value == 2)
  197. iconstatus = get_user_msgid("Scenario")
  198. else
  199. iconstatus = 0
  200.  
  201. return PLUGIN_CONTINUE
  202. }
  203.  
  204.  
  205.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fegyver ikon
HozzászólásElküldve:2014.11.12. 16:42 
Offline
Jómunkásember
Avatar

Csatlakozott:2013.12.18. 17:35
Hozzászólások:365
Megköszönt másnak: 152 alkalommal
Megköszönték neki: 31 alkalommal
Köszi, teljesen megfelel!

_________________
Ha segítettem használd a gombot!

Kép
KépKé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 5 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