hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.28. 11:28



Jelenlévő felhasználók

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

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-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  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Lövés csík
HozzászólásElküldve: 2015.02.28. 23:57 
Offline
Tag

Csatlakozott: 2015.02.21. 20:52
Hozzászólások: 30
Megköszönt másnak: 7 alkalommal
Megköszönték neki: 3 alkalommal
hali! valaki írna/linkelne olyan plugint ami:
ha lövök,akkor húzzon utána egy csíkot


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lövés csík
HozzászólásElküldve: 2015.03.01. 10:56 
Offline
Jómunkásember

Csatlakozott: 2012.01.29. 12:48
Hozzászólások: 408
Megköszönt másnak: 15 alkalommal
Megköszönték neki: 126 alkalommal
Szín beállítása( Piros(255), Zöld(255), Kék(255) színek keverésével állíthatod ):
amx_trace_laser_color "255225100" ( másold be ezt a sort az amxx.cfg legaljára )

SMA Forráskód: [ Mindet kijelol ]
  1. /* Formatright © 2009, ConnorMcLeod
  2.  
  3. TraceAttack is free software;
  4. you can redistribute it and/or modify it under the terms of the
  5. GNU General Public License as published by the Free Software Foundation.
  6.  
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11.  
  12. You should have received a copy of the GNU General Public License
  13. along with TraceAttack; if not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17.  
  18. /************** CUSTOMIZATION AREA ***************/
  19.  
  20. //#define TMP_IS_A_SILENCED_WEAPON
  21. //#define PER_PLAYER_SETTINGS
  22.  
  23. /*********** END OF CUSTOMIZATION AREA ***********/
  24.  
  25. #include <amxmodx>
  26. #include <cstrike>
  27. #include <fakemeta>
  28. #include <hamsandwich>
  29.  
  30. #define VERSION "LASER"
  31.  
  32. #define MAX_PLAYERS 32
  33. #define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
  34. #define write_coord_f(%1) engfunc(EngFunc_WriteCoord,%1)
  35.  
  36. #define m_pActiveItem 373
  37.  
  38. const GUNS_BITSUM = ((1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE))
  39. const SHOTGUNS_BITSUM = ((1<<CSW_XM1014)|(1<<CSW_M3))
  40. const SMGS_BITSUM = ((1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_MP5NAVY)|(1<<CSW_TMP)|(1<<CSW_P90))
  41. const RIFFLES_BITSUM = ((1<<CSW_AUG)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_M249)|(1<<CSW_M4A1)|(1<<CSW_SG552)|(1<<CSW_AK47))
  42. const SNIPERS_BITSUM = ((1<<CSW_SCOUT)|(1<<CSW_SG550)|(1<<CSW_AWP)|(1<<CSW_G3SG1))
  43.  
  44. const SILEN_BITSUM = ((1<<CSW_USP)|(1<<CSW_M4A1))
  45.  
  46. enum _:PcvarsNum {
  47. HandGuns = 0,
  48. ShotGuns,
  49. SmgGuns,
  50. RiffleGuns,
  51. SnipeGuns
  52. }
  53.  
  54. new const g_iWeaponBitSumList[] = { GUNS_BITSUM , SHOTGUNS_BITSUM , SMGS_BITSUM , RIFFLES_BITSUM , SNIPERS_BITSUM }
  55.  
  56. new g_iMaxPlayers
  57. new Trie:g_tClassNames
  58.  
  59. new g_pCvar[PcvarsNum], g_pCvarTraceEnabled, g_pCvarTraceHideSilen
  60. new g_pCvarColor
  61.  
  62. #if defined PER_PLAYER_SETTINGS
  63. new g_bHltv[MAX_PLAYERS+1], g_bSeeTracers[MAX_PLAYERS+1]
  64. new g_pCvarTraceHltv
  65. #endif
  66.  
  67. new m_spriteTexture
  68.  
  69. public plugin_precache()
  70. {
  71. m_spriteTexture = precache_model( "sprites/lgtning.spr" )
  72.  
  73. g_tClassNames = TrieCreate()
  74.  
  75. RegisterHam(Ham_TraceAttack, "worldspawn", "TraceAttack", 1)
  76. TrieSetCell(g_tClassNames, "worldspawn", 1)
  77. RegisterHam(Ham_TraceAttack, "player", "TraceAttack", 1)
  78. TrieSetCell(g_tClassNames, "player", 1)
  79.  
  80. register_forward(FM_Spawn, "Spawn", 1)
  81. }
  82.  
  83. public Spawn( iEnt )
  84. {
  85. if( pev_valid(iEnt) )
  86. {
  87. static szClassName[32]
  88. pev(iEnt, pev_classname, szClassName, charsmax(szClassName))
  89. if( !TrieKeyExists(g_tClassNames, szClassName) )
  90. {
  91. RegisterHam(Ham_TraceAttack, szClassName, "TraceAttack", 1)
  92. TrieSetCell(g_tClassNames, szClassName, 1)
  93. }
  94. }
  95. }
  96.  
  97. public plugin_end()
  98. {
  99. TrieDestroy(g_tClassNames)
  100. }
  101.  
  102. public plugin_init()
  103. {
  104. register_plugin("Advanced Weapon Tracers", VERSION, "ConnorMcLeod")
  105. register_cvar("awt_version", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
  106.  
  107. g_pCvarTraceEnabled = register_cvar("amx_tracers", "1")
  108.  
  109. g_pCvar[HandGuns] = register_cvar("amx_trace_handguns", "1")
  110. g_pCvar[ShotGuns] = register_cvar("amx_trace_shotguns", "1")
  111. g_pCvar[SmgGuns] = register_cvar("amx_trace_smgguns", "1")
  112. g_pCvar[RiffleGuns] = register_cvar("amx_trace_riffleguns", "1")
  113. g_pCvar[SnipeGuns] = register_cvar("amx_trace_snipeguns", "1")
  114.  
  115. g_pCvarTraceHideSilen = register_cvar("amx_trace_hide_silen", "0")
  116.  
  117. g_pCvarColor = register_cvar("amx_trace_laser_color", "255000000")
  118.  
  119. #if defined PER_PLAYER_SETTINGS
  120. g_pCvarTraceHltv = register_cvar("amx_trace_hltv", "1")
  121. register_clcmd("say /tracers", "ClientCommand_Tracers")
  122. #endif
  123.  
  124. g_iMaxPlayers = get_maxplayers()
  125. }
  126.  
  127. #if defined PER_PLAYER_SETTINGS
  128. public client_putinserver(id)
  129. {
  130. g_bSeeTracers[id] = !is_user_bot(id)
  131. g_bHltv[id] = is_user_hltv(id)
  132. set_task(35.0, "TaskAnnouncement", id)
  133. }
  134.  
  135. public ClientCommand_Tracers(id)
  136. {
  137. client_print(id, print_chat, "** [Advanced Weapon Tracers] Tracers are now %s",
  138. (g_bSeeTracers[id] = !g_bSeeTracers[id]) ? "ON" : "OFF")
  139. return PLUGIN_HANDLED
  140. }
  141.  
  142. public TaskAnnouncement(id)
  143. {
  144. client_print(id, print_chat, "** [Advanced Weapon Tracers] You can [en/dis]able tracers by typing /tracers in chat")
  145. }
  146. #endif
  147.  
  148. public TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
  149. {
  150. if( !IsPlayer(iAttacker) || get_pcvar_num(g_pCvarTraceEnabled) == 0 )
  151. {
  152. return
  153. }
  154.  
  155. new iWeapon = get_user_weapon(iAttacker)
  156. if( iWeapon == CSW_KNIFE )
  157. {
  158. return
  159. }
  160.  
  161. new bWeapon = (1<<iWeapon)
  162. for(new a; a<sizeof(g_iWeaponBitSumList); a++)
  163. {
  164. if( bWeapon & g_iWeaponBitSumList[a] )
  165. {
  166. if( get_pcvar_num(g_pCvar[a]) )
  167. {
  168. break
  169. }
  170. else
  171. {
  172. return
  173. }
  174. }
  175. }
  176.  
  177. if( SILEN_BITSUM & bWeapon )
  178. {
  179. if( get_pcvar_num(g_pCvarTraceHideSilen) )
  180. {
  181. if( cs_get_weapon_silen(get_pdata_cbase(iAttacker, m_pActiveItem)) )
  182. {
  183. return
  184. }
  185. }
  186. }
  187. #if defined TMP_IS_A_SILENCED_WEAPON
  188. else if( iWeapon == CSW_TMP && get_pcvar_num(g_pCvarTraceHideSilen) )
  189. {
  190. return
  191. }
  192. #endif
  193.  
  194. new Float:flEnd[3]
  195. get_tr2(ptr, TR_vecEndPos, flEnd)
  196.  
  197. new iColor = get_pcvar_num( g_pCvarColor )
  198. new iRed, iGreen, iBlue
  199.  
  200. iRed = iColor / 1000000
  201. iColor %= 1000000
  202. iGreen = iColor / 1000
  203. iBlue = iColor % 1000
  204.  
  205. #if defined PER_PLAYER_SETTINGS
  206. new iPlayers[MAX_PLAYERS], iNum, iPlayer, bHltv
  207. new Float:fX = flEnd[0], Float:fY = flEnd[1], Float:fZ = flEnd[2]
  208. get_players(iPlayers, iNum)
  209. for(new i; i<iNum; i++)
  210. {
  211. iPlayer = iPlayers[i]
  212. if( g_bHltv[iPlayer] )
  213. {
  214. if( !bHltv && get_pcvar_num(g_pCvarTraceHltv) == 1 )
  215. {
  216. bHltv = true
  217. message_begin(MSG_SPEC, SVC_TEMPENTITY)
  218. write_byte(TE_BEAMENTPOINT)
  219. write_short(iAttacker | 0x1000)
  220. write_coord_f(fX)
  221. write_coord_f(fY)
  222. write_coord_f(fZ)
  223. write_short(m_spriteTexture)
  224. write_byte(0) // framerate
  225. write_byte(0) // framerate
  226. write_byte(1) // life
  227. write_byte(5) // width
  228. write_byte(0) // noise
  229. write_byte(iRed) // r, g, b
  230. write_byte(iGreen) // r, g, b
  231. write_byte(iBlue) // r, g, b
  232. write_byte(128) // brightness
  233. write_byte(0) // speed
  234. message_end()
  235. }
  236. }
  237. else if( g_bSeeTracers[iPlayer] )
  238. {
  239. message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, iPlayer)
  240. write_byte(TE_BEAMENTPOINT)
  241. write_short(iAttacker | 0x1000)
  242. write_coord_f(fX)
  243. write_coord_f(fY)
  244. write_coord_f(fZ)
  245. write_short(m_spriteTexture)
  246. write_byte(0) // framerate
  247. write_byte(0) // framerate
  248. write_byte(1) // life
  249. write_byte(5) // width
  250. write_byte(0) // noise
  251. write_byte(iRed) // r, g, b
  252. write_byte(iGreen) // r, g, b
  253. write_byte(iBlue) // r, g, b
  254. write_byte(128) // brightness
  255. write_byte(0) // speed
  256. message_end()
  257. }
  258. }
  259. #else
  260. message_begin(MSG_BROADCAST, SVC_TEMPENTITY )
  261. write_byte(TE_BEAMENTPOINT)
  262. write_short(iAttacker | 0x1000)
  263. write_coord_f(flEnd[0])
  264. write_coord_f(flEnd[1])
  265. write_coord_f(flEnd[2])
  266. write_short(m_spriteTexture)
  267. write_byte(0) // framerate
  268. write_byte(0) // framerate
  269. write_byte(1) // life
  270. write_byte(5) // width
  271. write_byte(0) // noise
  272. write_byte(iRed) // r, g, b
  273. write_byte(iGreen) // r, g, b
  274. write_byte(iBlue) // r, g, b
  275. write_byte(128) // brightness
  276. write_byte(10) // speed
  277. message_end()
  278. #endif
  279. }
  280.  

Ők köszönték meg HuBaBuBa nek ezt a hozzászólást: danone (2015.03.01. 11:00)
  Népszerűség: 2.27%


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  [ 2 hozzászólás ] 


Ki van itt

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