hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.04.28. 01:49



Jelenlévő felhasználók

Jelenleg 512 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 511 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] 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: Wh blocker
HozzászólásElküldve: 2013.08.15. 14:00 
Offline
Félisten

Csatlakozott: 2012.06.19. 15:12
Hozzászólások: 926
Megköszönt másnak: 109 alkalommal
Megköszönték neki: 31 alkalommal
Felraktam ezt http://forums.alliedmods.net/showthread.php?t=100886 a wh blockert és az egyik amxx fájl hibás debugoltam és ezt dobta ki valaki javítaná.

L 08/15/2013 - 13:51:19: [CSTRIKE] Non-player entity 0 out of range
L 08/15/2013 - 13:51:19: [AMXX] Displaying debug trace (plugin "snblock.amxx")
L 08/15/2013 - 13:51:19: [AMXX] Run time error 10: native error (native "cs_get_weapon_silen")
L 08/15/2013 - 13:51:19: [AMXX] [0] snblock.sma::PlayShotSound (line 1303)
L 08/15/2013 - 13:51:19: [AMXX] [1] snblock.sma::fw_PlaybackEvent (line 707)

SMA Forráskód: [ Mindet kijelol ]
  1. /* Formatright © 2009, OT
  2.  
  3. Sound Block 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. GNU General Public License as published by the Free Software Foundation.
  7.  
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12.  
  13. You should have received a copy of the GNU General Public License
  14. along with Migraine; if not, write to the
  15. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. Boston, MA 02111-1307, USA.
  17. */
  18.  
  19. /* [Plugin Link]
  20. */
  21.  
  22. /* [Changelog]
  23. - 8.0 - fixed crash bug, fixed high cpu usage bug, added also support for ent sounds and reloadsound
  24. - 7.0 - made the plugin use spawnStaticSound, now this can fully block ESP
  25. - 6.3 - soundhackkey not compatible with older soundkeys, added more sounds to block the soundhacks, extended the block to entities that would give info about the player.
  26. - 6.2 - the plugin cannot be seen on game-monitor anymore (for surprize)
  27. - 6.1 - Remade the function that gets the coords of the ground, more efficient, and faster, not laggy
  28. - 6.0 - Well well, 100% CPU USAGE improvement, no more shot blockage
  29. - 5.6 - Fixed the amxx crash bug when soundkey has been used
  30. - 5.5 - Changed the way the command of creating soundkey works, added log to files, added more cvars for configuration, and miscelanous things
  31. - 5.4 - Anti-Soundhack shot, pick-up and spawn
  32. - 5.3 - Separated the channels from the shot mechanism (now we have the sound of the shot, the bullet particles and the weapon animation separated!)
  33. - 5.2 - Fixed double jump/land sound, made the soundkey use less resources if the sounds that are used are default, removed PVS cvar (useless), new cvar wallblocker_footsteps
  34. - 5.1 - PreHook fix, EmitAmbientSound function used, update key (more random and better when dealing with problems!)
  35. - 5.0 - Added anti-soundhack based with key, made the ents follow the players much closer
  36. - 4.8 - Less crash risk, new method of detecting transparent ents and making them transperent will not destroy ladded functionality anymore!!!
  37. - 4.5 - texture check now isn't made that often (less crash risk!), added texture check autodisable cfg, added a new method to ignore entities that are transparent (100% efficient), reupdated the weapon headpoint
  38. - 4.2 - added bitsum remember system, smooth check is made now by FRAME_CONSTANT (1/48), changed alive/dead recognision system (less resource use!)
  39. - 4.1 - fixed plugin_init problem!
  40. - 4.0 - all bugs fixed, added texture check , everything tweaked and tuned!
  41. - 3.0 - removed Engine module (another method), improved smooth engine, removed , fixed flashing bug, target check now works both ways (if you are seen the player will be shown!)
  42. - 2.5 - removed HamSandWich module (useless), improved smooth check, corpse remove bug fixed, optimized the code a little bit.
  43. - 2.4 - bug fix release (weapon index out of bounds fix, reconnect bug fix (with CSDM), made the ent check not so sensitive (not so many blind-spots)
  44. - 2.2 - bug fix release (index out of bounds & weapon confusion bug)
  45. - 2.1 - removed a bugged feature (block_dead cvar), added smooth cvar
  46. - 2.0 - more customizable, less cpu usage (50% TESTED!), weapons grenades check added, bug fixes
  47. - 1.5 - removed some checks, optimized it a bit, added weapon head-point check
  48. - 1.0 - initial release
  49. */
  50.  
  51. /* [Credits]
  52. - joropito - for compiling engineX on linux
  53. - hlstriker - for finding the way to detect semi-transparent textures!
  54. - h010c - for tests and benchmarks, anti-soundhack tests and code samples
  55. - joaquimandrade - for pointing out the plugin flaws, and for the Orpheu module
  56. - Connor - some stocks
  57. - Arkshine - for finding precise weapon head points, and for some sig files, spawnStaticSound
  58. - Mnx Community - for letting me test this plugin on linux!
  59. - turshija - for some small suggestions.
  60. - .Owyn. - bug reports
  61. - ShlumPF* - for small improvements (initial v1.0)
  62. - eD & Niculae - for some tests
  63. */
  64.  
  65. #include <amxmodx>
  66. #include <amxmisc>
  67. #include <cstrike>
  68. #include <fakemeta>
  69. #include <engine>
  70. #include <hamsandwich>
  71. #include <orpheu>
  72. #include <orpheu_advanced>
  73. #include <orpheu_memory>
  74. #include <orpheu_stocks>
  75.  
  76. #define MAX_PLAYERS 32
  77. #define BUFFERSIZE 256
  78.  
  79. #define m_pPlayer 41
  80. #define m_pNext 42
  81. #define m_iId 43
  82.  
  83. // texture types
  84. #define CHAR_TEX_CONCRETE 'C'
  85. #define CHAR_TEX_METAL 'M'
  86. #define CHAR_TEX_SNOW 'N'
  87. #define CHAR_TEX_DIRT 'D'
  88. #define CHAR_TEX_VENT 'V'
  89. #define CHAR_TEX_GRATE 'G'
  90. #define CHAR_TEX_TILE 'T'
  91. #define CHAR_TEX_SLOSH 'S'
  92. #define CHAR_TEX_WOOD 'W'
  93. #define CHAR_TEX_COMPUTER 'P'
  94. #define CHAR_TEX_GLASS 'Y'
  95. #define CHAR_TEX_FLESH 'F'
  96.  
  97. // Step Types
  98. #define STEP_CONCRETE 0 // default step sound
  99. #define STEP_METAL 1 // metal floor
  100. #define STEP_DIRT 2 // dirt, sand, rock
  101. #define STEP_VENT 3 // ventillation duct
  102. #define STEP_GRATE 4 // metal grating
  103. #define STEP_TILE 5 // floor tiles
  104. #define STEP_SLOSH 6 // shallow liquid puddle
  105. #define STEP_WADE 7 // wading in liquid
  106. #define STEP_LADDER 8 // climbing ladder
  107. #define STEP_SNOW 9 // snow
  108.  
  109. // Footsteps generator constants
  110. #define FOOTSTEP_DIST 14.0
  111. #define SND_ZVELOCITY 0.0
  112. #define SND_MOVEVELOCITY 136.0
  113. #define OFFSET_MINTRACE 70.0
  114. #define SND_MULCONST 0.1
  115.  
  116. #define SHOTGUNS_BITSUM ((1<<CSW_XM1014) | (1<<CSW_M3))
  117. #define SMGS_BITSUM ((1<<CSW_MAC10) | (1<<CSW_UMP45) | (1<<CSW_MP5NAVY) | (1<<CSW_TMP) | (1<<CSW_P90))
  118. #define RIFFLES_BITSUM ((1<<CSW_AUG) | (1<<CSW_GALIL) | (1<<CSW_FAMAS) | (1<<CSW_M249) | (1<<CSW_M4A1) | (1<<CSW_SG552) | (1<<CSW_AK47))
  119. #define SNIPERS_BITSUM ((1<<CSW_SCOUT) | (1<<CSW_SG550) | (1<<CSW_AWP) | (1<<CSW_G3SG1))
  120.  
  121. #define PRIMARIES_BITSUM (SHOTGUNS_BITSUM|SMGS_BITSUM|RIFFLES_BITSUM|SNIPERS_BITSUM)
  122. #define GUNS_BITSUM ((1<<CSW_P228) | (1<<CSW_ELITE) | (1<<CSW_FIVESEVEN) | (1<<CSW_USP) | (1<<CSW_GLOCK18) | (1<<CSW_DEAGLE))
  123. #define NADES_BITSUM ((1<<CSW_HEGRENADE) | (1<<CSW_SMOKEGRENADE) | (1<<CSW_FLASHBANG))
  124.  
  125. #define MAX_ITEM_TYPES 6
  126. new const m_rgpPlayerItems[MAX_ITEM_TYPES] = {367,368,369,370,371,372}
  127.  
  128. #define EXTRAOFFSET_WEAPONS 4
  129. #define EXTRAOFFSET 5
  130.  
  131.  
  132. enum FWrite
  133. {
  134. FW_NONE = 0,
  135. FW_DELETESOURCE = (1<<0),
  136. FW_CANOVERRIDE = (1<<1)
  137. }
  138.  
  139. new gBS_Alive, gBS_GunsEvents, gBS_SpectatesFirstPerson
  140.  
  141. #define add_alive_property(%1) gBS_Alive |= (1<<%1)
  142. #define del_alive_property(%1) gBS_Alive &= ~(1<<%1)
  143. #define has_alive_property(%1) (gBS_Alive & (1<<%1))
  144. #define add_spect_property(%1) gBS_SpectatesFirstPerson |= (1<<%1)
  145. #define del_spect_property(%1) gBS_SpectatesFirstPerson &= ~(1<<%1)
  146. #define has_spect_property(%1) (gBS_SpectatesFirstPerson & (1<<%1))
  147. #define clamp_byte(%1) (clamp(%1, 0, 255))
  148. #define clamp_short(%1) (clamp(%1, 0, 65535))
  149. #define write_coord_f(%1) (engfunc(EngFunc_WriteCoord, %1))
  150. #define null_vector (Float:{ 0.0, 0.0, 0.0 })
  151.  
  152. new gPCV_on_off, gPCV_footsteps, gPCV_shotover
  153. new gI_MaxPlayers,gI_SoundSize
  154.  
  155. new gCLI_oldwaterlevel[MAX_PLAYERS + 1], gCLI_iStepLeft[MAX_PLAYERS + 1], gCLI_oldflags[MAX_PLAYERS + 1]
  156.  
  157. new bool:gB_DefaultSounds = false, bool:gB_loaded = true
  158. new gDecal_shot1
  159.  
  160. new gSZ_SoundMod[128][60]
  161. new gF_sndkey[300]
  162.  
  163. new gPSND_Indexes[10]
  164.  
  165. new Trie:gTRIE_SoundList, Trie:gTRIE_TraceRegs
  166.  
  167. new const gSZ_SoundList[105][] =
  168. {
  169. "items/9mmclip1.wav",
  170. "items/ammopickup2.wav",
  171. "items/gunpickup2.wav",
  172. "items/kevlar.wav",
  173. "common/wpn_select.wav",
  174. "weapons/c4_plant.wav",
  175. "weapons/c4_disarm.wav",
  176. "weapons/reload1.wav",
  177. "weapons/reload2.wav",
  178. "weapons/reload3.wav",
  179. "weapons/ric_metal-1.wav",
  180. "weapons/ric_metal-2.wav",
  181. "player/pl_die1.wav",
  182. "player/pl_fallpain1.wav",
  183. "player/pl_fallpain2.wav",
  184. "player/pl_fallpain3.wav",
  185. "player/pl_pain2.wav",
  186. "player/pl_pain4.wav",
  187. "player/pl_pain5.wav",
  188. "player/pl_pain6.wav",
  189. "player/pl_pain7.wav",
  190. "player/pl_shell1.wav",
  191. "player/pl_shot1.wav",
  192. "player/sprayer.wav",
  193. "player/bhit_flesh-1.wav",
  194. "player/bhit_flesh-2.wav",
  195. "player/bhit_flesh-3.wav",
  196. "player/bhit_helmet-1.wav",
  197. "player/bhit_kevlar-1.wav",
  198. "player/headshot1.wav",
  199. "player/headshot2.wav",
  200. "player/headshot3.wav",
  201. "player/pl_dirt1.wav",
  202. "player/pl_dirt2.wav",
  203. "player/pl_dirt3.wav",
  204. "player/pl_dirt4.wav",
  205. "player/pl_duct1.wav",
  206. "player/pl_duct2.wav",
  207. "player/pl_duct3.wav",
  208. "player/pl_duct4.wav",
  209. "player/pl_jump1.wav",
  210. "player/pl_jump2.wav",
  211. "player/pl_ladder1.wav",
  212. "player/pl_ladder2.wav",
  213. "player/pl_ladder3.wav",
  214. "player/pl_ladder4.wav",
  215. "player/pl_grate1.wav",
  216. "player/pl_grate2.wav",
  217. "player/pl_grate3.wav",
  218. "player/pl_grate4.wav",
  219. "player/pl_metal1.wav",
  220. "player/pl_metal2.wav",
  221. "player/pl_metal3.wav",
  222. "player/pl_metal4.wav",
  223. "player/pl_slosh1.wav",
  224. "player/pl_slosh2.wav",
  225. "player/pl_slosh3.wav",
  226. "player/pl_slosh4.wav",
  227. "player/pl_snow1.wav",
  228. "player/pl_snow2.wav",
  229. "player/pl_snow3.wav",
  230. "player/pl_snow4.wav",
  231. "player/pl_snow5.wav",
  232. "player/pl_snow6.wav",
  233. "player/pl_step1.wav",
  234. "player/pl_step2.wav",
  235. "player/pl_step3.wav",
  236. "player/pl_step4.wav",
  237. "player/pl_swim1.wav",
  238. "player/pl_swim2.wav",
  239. "player/pl_swim3.wav",
  240. "player/pl_swim4.wav",
  241. "player/pl_tile1.wav",
  242. "player/pl_tile2.wav",
  243. "player/pl_tile3.wav",
  244. "player/pl_tile4.wav",
  245. "player/pl_tile5.wav",
  246. "player/pl_wade1.wav",
  247. "player/pl_wade2.wav",
  248. "player/pl_wade3.wav",
  249. "player/pl_wade4.wav",
  250. "weapons/boltdown.wav",
  251. "weapons/boltpull1.wav",
  252. "weapons/boltup.wav",
  253. "weapons/clipin1.wav",
  254. "weapons/clipout1.wav",
  255. "weapons/de_clipin.wav",
  256. "weapons/de_clipout.wav",
  257. "weapons/de_deploy.wav",
  258. "weapons/headshot2.wav",
  259. "weapons/pinpull.wav",
  260. "weapons/slideback1.wav",
  261. "weapons/sliderelease1.wav",
  262. "weapons/dryfire_pistol.wav",
  263. "weapons/dryfire_rifle.wav",
  264. "weapons/knife_deploy1.wav",
  265. "weapons/knife_hit1.wav",
  266. "weapons/knife_hit2.wav",
  267. "weapons/knife_hit3.wav",
  268. "weapons/knife_hit4.wav",
  269. "weapons/knife_hitwall1.wav",
  270. "weapons/knife_slash1.wav",
  271. "weapons/knife_slash2.wav",
  272. "weapons/knife_stab.wav",
  273. "weapons/zoom.wav"
  274. }
  275.  
  276. new const gSZ_GunsEvents[][] =
  277. {
  278. "events/awp.sc",
  279. "events/g3sg1.sc",
  280. "events/ak47.sc",
  281. "events/scout.sc",
  282. "events/m249.sc",
  283. "events/m4a1.sc",
  284. "events/sg552.sc",
  285. "events/aug.sc",
  286. "events/sg550.sc",
  287. "events/m3.sc",
  288. "events/xm1014.sc",
  289. "events/usp.sc",
  290. "events/mac10.sc",
  291. "events/ump45.sc",
  292. "events/fiveseven.sc",
  293. "events/p90.sc",
  294. "events/deagle.sc",
  295. "events/p228.sc",
  296. "events/glock18.sc",
  297. "events/mp5n.sc",
  298. "events/tmp.sc",
  299. "events/elite_left.sc",
  300. "events/elite_right.sc",
  301. "events/galil.sc",
  302. "events/famas.sc"
  303. }
  304.  
  305. public plugin_precache()
  306. {
  307. OrpheuRegisterHook(OrpheuGetEngineFunction("pfnPrecacheSound","PrecacheSound"), "pfw_PrecacheSound", OrpheuHookPost)
  308. gTRIE_SoundList = TrieCreate()
  309. gTRIE_TraceRegs = TrieCreate()
  310.  
  311. get_datadir(gF_sndkey, charsmax(gF_sndkey))
  312. format(gF_sndkey, charsmax(gF_sndkey),"%s/%s", gF_sndkey, "wb_sndkey.cfg")
  313.  
  314. new bool:versionver = false
  315.  
  316. // Use the normal sounds if we do not have a key!
  317. if (!file_exists(gF_sndkey))
  318. {
  319. server_print("[SND Block] Soundhack key not existent! Using default sounds!")
  320.  
  321. for (new i=0;i<sizeof gSZ_SoundList;i++)
  322. {
  323. copy(gSZ_SoundMod[i], 59, gSZ_SoundList[i])
  324. }
  325.  
  326. gI_SoundSize = sizeof gSZ_SoundList
  327.  
  328. versionver = true
  329. gB_loaded = false
  330. gB_DefaultSounds = true
  331. }
  332. else
  333. {
  334. new pf = fopen(gF_sndkey, "r"), line[60]
  335.  
  336. server_print("[SND Block] Soundhack key reading!")
  337.  
  338. // Read key.
  339. while (!feof(pf))
  340. {
  341. fgets(pf, line, charsmax(line))
  342.  
  343. if (line[0] == ';' || line[0] == '/')
  344. continue
  345.  
  346. if (line[0] == 'v' && !versionver)
  347. {
  348. versionver = true
  349. if ((line[1] == '6' && line[2] == '.' && line[3] == '3') || line[1] == '7' || line[1] == '8')
  350. {
  351. server_print("[SND Block] Soundhack key version correspondence, eveything ok!")
  352. }
  353. else
  354. {
  355. server_print("[SND Block] Soundhack key version load failure (Version does not correspond). Using default sounds!")
  356. log_error(AMX_ERR_NONE, "[SND Block] Soundhack key version load failure (Version does not correspond). Using default sounds!")
  357.  
  358. gB_DefaultSounds = true
  359.  
  360. for (new i=0;i<sizeof gSZ_SoundList;i++)
  361. {
  362. copy(gSZ_SoundMod[i], 59, gSZ_SoundList[i])
  363. }
  364.  
  365. gB_loaded = false
  366.  
  367. gI_SoundSize = sizeof gSZ_SoundList
  368.  
  369. break
  370. }
  371.  
  372. continue
  373. }
  374.  
  375. copy(gSZ_SoundMod[gI_SoundSize], 59, line)
  376.  
  377. // Get rid of the "newline" parts
  378. replace(gSZ_SoundMod[gI_SoundSize], 59, "^n", "^0")
  379. gI_SoundSize++;
  380. }
  381.  
  382. fclose(pf)
  383. }
  384.  
  385. if (gI_SoundSize != sizeof gSZ_SoundList)
  386. {
  387. gB_DefaultSounds = true
  388.  
  389. server_print("[SND Block] Soundhack key version load failure (Number of sounds does not correspond). Using default sounds!")
  390. log_error(AMX_ERR_NONE, "[SND Block] Soundhack key version load failure (Number of sounds does not correspond). Using default sounds!")
  391.  
  392. for (new i=0;i<sizeof gSZ_SoundList;i++)
  393. {
  394. copy(gSZ_SoundMod[i], 59, gSZ_SoundList[i])
  395. }
  396.  
  397. gB_loaded = false
  398. }
  399.  
  400. if (!versionver)
  401. {
  402. gB_DefaultSounds = true
  403.  
  404. server_print("[SND Block] Soundhack key version load failure (Version read failure). Using default sounds!")
  405. log_error(AMX_ERR_NONE, "[SND Block] Soundhack key version load failure (Version read failure). Using default sounds!")
  406.  
  407. for (new i=0;i<sizeof gSZ_SoundList;i++)
  408. {
  409. copy(gSZ_SoundMod[i], 59, gSZ_SoundList[i])
  410. }
  411.  
  412. gB_loaded = false
  413. }
  414.  
  415. if (gB_loaded)
  416. {
  417. new filepath[300], filepath2[300]
  418.  
  419. copy(filepath, charsmax(filepath), gSZ_SoundMod[0])
  420. replace(filepath, charsmax(filepath), "/", " ")
  421. parse(filepath, filepath, charsmax(filepath), filepath2, charsmax(filepath2))
  422.  
  423. format(filepath, charsmax(filepath), "sound/%s", filepath)
  424.  
  425. if (!dir_exists(filepath))
  426. {
  427. mkdir(filepath)
  428. }
  429.  
  430. new bool:bSizeOk = true
  431. new bool:bExists = true
  432.  
  433. for (new i=0;i<gI_SoundSize; i++)
  434. {
  435. format(filepath, charsmax(filepath), "sound/%s", gSZ_SoundList[i])
  436. format(filepath2, charsmax(filepath), "sound/%s", gSZ_SoundMod[i])
  437.  
  438. if (!file_exists(filepath2))
  439. {
  440. if (!fcopy(filepath, filepath2))
  441. {
  442. bExists = false
  443. break
  444. }
  445. }
  446. else
  447. {
  448. if (!fcompare(filepath, filepath2))
  449. {
  450. bSizeOk = false
  451. gB_loaded = false
  452. break
  453. }
  454. }
  455.  
  456. }
  457.  
  458. if (!bExists)
  459. {
  460. server_print("[SND Block] Soundhack key version load failure (Unknown read\write error). Using default sounds!")
  461. log_error(AMX_ERR_NONE, "[SND Block] Soundhack key version load failure (Unknown read\write error). Using default sounds!")
  462.  
  463. for (new i=0;i<sizeof gSZ_SoundList;i++)
  464. {
  465. copy(gSZ_SoundMod[i], 59, gSZ_SoundList[i])
  466. }
  467.  
  468. gB_loaded = false
  469. }
  470.  
  471. if (!bSizeOk)
  472. {
  473. server_print("[SND Block] Soundhack key version load failure (File size not maching). Using default sounds!")
  474. log_error(AMX_ERR_NONE, "[SND Block] Soundhack key version load failure (File size not maching). Using default sounds!")
  475.  
  476. for (new i=0;i<sizeof gSZ_SoundList;i++)
  477. {
  478. copy(gSZ_SoundMod[i], 59, gSZ_SoundList[i])
  479. }
  480.  
  481. gB_loaded = false
  482. }
  483.  
  484. for (new i=0;i<gI_SoundSize && bSizeOk; i++)
  485. {
  486. precache_sound(gSZ_SoundMod[i])
  487. }
  488.  
  489. if (bSizeOk)
  490. server_print("[SND Block] Soundhack key loaded!")
  491. }
  492.  
  493. register_forward(FM_Spawn, "pfw_Spawn", 1)
  494. register_forward(FM_PrecacheEvent, "pfw_PrecacheEvent", 1)
  495. gTRIE_TraceRegs = TrieCreate()
  496. }
  497.  
  498. public pfw_PrecacheEvent(type, const name[])
  499. {
  500. for (new i = 0; i < sizeof gSZ_GunsEvents; ++i)
  501. {
  502. if (equal(gSZ_GunsEvents[i], name))
  503. {
  504. gBS_GunsEvents |= (1<<get_orig_retval())
  505. return FMRES_HANDLED
  506. }
  507. }
  508.  
  509. return FMRES_IGNORED
  510. }
  511.  
  512. public pfw_PrecacheSound(filename[])
  513. {
  514. if (TrieKeyExists(gTRIE_SoundList, filename))
  515. return
  516.  
  517. TrieSetCell(gTRIE_SoundList, filename, OrpheuGetReturn())
  518. }
  519.  
  520. public pfw_Spawn(ent)
  521. {
  522. if (!pev_valid(ent))
  523. return
  524.  
  525. new classname[32]
  526. pev(ent, pev_classname, classname, charsmax(classname))
  527.  
  528. if(!TrieKeyExists(gTRIE_TraceRegs, classname))
  529. {
  530. RegisterHam(Ham_TraceAttack, classname, "pfw_GlobalTraceAttack", 1)
  531. TrieSetCell(gTRIE_TraceRegs, classname, true)
  532. }
  533. }
  534.  
  535. public plugin_init()
  536. {
  537. register_plugin("SND Block", "8.0", "OT")
  538.  
  539. gPCV_on_off = register_cvar("snb_enable", "1")
  540. gPCV_footsteps = register_cvar("snb_footsteps", "1")
  541. gPCV_shotover = register_cvar("snb_shotover", "1")
  542.  
  543. register_forward(FM_PlaybackEvent, "fw_PlaybackEvent")
  544.  
  545. register_forward(FM_PlayerPreThink, "fw_FreqThink" , 0)
  546. register_forward(FM_PlayerPreThink, "fw_FreqThink" , 1)
  547. register_forward(FM_PlayerPostThink, "fw_FreqThink" , 0)
  548. register_forward(FM_PlayerPostThink, "fw_FreqThink" , 1)
  549.  
  550. gPSND_Indexes[STEP_CONCRETE] = getStringPos("player/pl_step1.wav")
  551. gPSND_Indexes[STEP_METAL] = getStringPos("player/pl_metal1.wav")
  552. gPSND_Indexes[STEP_DIRT] = getStringPos("player/pl_dirt1.wav")
  553. gPSND_Indexes[STEP_VENT] = getStringPos("player/pl_duct1.wav")
  554. gPSND_Indexes[STEP_GRATE] = getStringPos("player/pl_grate1.wav")
  555. gPSND_Indexes[STEP_TILE] = getStringPos("player/pl_tile1.wav")
  556. gPSND_Indexes[STEP_SLOSH] = getStringPos("player/pl_slosh1.wav")
  557. gPSND_Indexes[STEP_WADE] = getStringPos("player/pl_wade1.wav")
  558. gPSND_Indexes[STEP_LADDER] = getStringPos("player/pl_ladder1.wav")
  559. gPSND_Indexes[STEP_SNOW] = getStringPos("player/pl_snow1.wav")
  560.  
  561. RegisterHam(Ham_Spawn, "player", "fw_alive_handle", 1)
  562. RegisterHam(Ham_Killed, "player", "fw_alive_handle", 1)
  563.  
  564. register_srvcmd("amx_sndkeycfg", "cmd_sndkeycfg", ADMIN_IMMUNITY, "<command> <target>")
  565.  
  566. gDecal_shot1 = engfunc(EngFunc_DecalIndex, "{shot1")
  567.  
  568. register_event("TextMsg","event_specMode","b","2&#Spec_Mode")
  569.  
  570. gI_MaxPlayers = get_maxplayers()
  571.  
  572. OrpheuRegisterHook(OrpheuGetEngineFunction("pfnEmitSound","EmitSound"), "fw_EmitSound")
  573. OrpheuRegisterHook(OrpheuGetEngineFunction("pfnEmitAmbientSound","EmitAmbientSound"), "fw_EmitAmbientSound")
  574. OrpheuRegisterHook(OrpheuGetFunction("ReloadSound","CBasePlayerWeapon"), "fw_RloadSound")
  575. }
  576.  
  577. public OrpheuHookReturn:fw_RloadSound(ent)
  578. {
  579. new owner = get_pdata_cbase(ent, m_pPlayer, 4)
  580.  
  581. if ((1<<get_pdata_int(ent, m_iId, 4)) & ((1<<CSW_M3) | (1<<CSW_XM1014)))
  582. EmitSpecialSound(false, owner, (1<<get_pdata_int(ent, m_iId, 4)) & ((1<<CSW_M3) | (1<<CSW_XM1014)) ? "weapons/generic_shot_reload.wav" : "weapons/generic_reload.wav", VOL_NORM, 3.12, 0, PITCH_NORM)
  583.  
  584. return OrpheuSupercede
  585. }
  586.  
  587. public event_specMode(id)
  588. {
  589. new specMode[12]
  590. read_data(2,specMode,11)
  591.  
  592. if(specMode[10] == '4')
  593. {
  594. add_spect_property(id)
  595. }
  596. else
  597. {
  598. del_spect_property(id)
  599. }
  600. }
  601.  
  602. public fw_FreqThink(id)
  603. {
  604. if (!get_pcvar_num(gPCV_footsteps) || !get_pcvar_num(gPCV_on_off))
  605. return FMRES_IGNORED
  606.  
  607. if (!has_alive_property(id))
  608. return FMRES_IGNORED
  609.  
  610. new waterLevel = entity_get_int(id, EV_INT_waterlevel)
  611. new iStepLeft = entity_get_int(id, EV_INT_iStepLeft)
  612. new flags = entity_get_int(id, EV_INT_flags)
  613.  
  614. if (waterLevel > 1)
  615. {
  616. gCLI_oldwaterlevel[id] = waterLevel
  617. gCLI_iStepLeft[id] = iStepLeft
  618. gCLI_oldflags[id] = flags
  619. return FMRES_IGNORED
  620. }
  621.  
  622. if (waterLevel == 1 && !!gCLI_iStepLeft[id] == !iStepLeft && get_velocity(id, true) > SND_MOVEVELOCITY)
  623. {
  624. PM_PlayStepSound(id, STEP_SLOSH, 0.60)
  625. gCLI_oldwaterlevel[id] = waterLevel
  626. gCLI_iStepLeft[id] = iStepLeft
  627. gCLI_oldflags[id] = flags
  628. return FMRES_IGNORED
  629. }
  630.  
  631. if (entity_get_int(id, EV_INT_movetype) == MOVETYPE_FLY && !!gCLI_iStepLeft[id] == !iStepLeft && get_velocity(id, false) > SND_MOVEVELOCITY)
  632. {
  633. PM_PlayStepSound(id, STEP_LADDER, 0.8)
  634. gCLI_oldwaterlevel[id] = waterLevel
  635. gCLI_iStepLeft[id] = iStepLeft
  636. gCLI_oldflags[id] = flags
  637. return FMRES_IGNORED
  638. }
  639.  
  640. if ((!!gCLI_iStepLeft[id] == !iStepLeft && (flags & FL_ONGROUND) && get_velocity(id, true) > SND_MOVEVELOCITY) || (!(flags & FL_ONGROUND) && (gCLI_oldflags[id] & FL_ONGROUND) && get_zveleocity(id) > SND_ZVELOCITY))
  641. {
  642. new Float:start[3], Float:end[3], ent
  643.  
  644. gCLI_iStepLeft[id] = iStepLeft
  645.  
  646. ent = getFootStepCoords(id, start, end)
  647.  
  648. new texture[64]
  649.  
  650. if (!trace_texture(ent, start, end, texture, charsmax(texture)))
  651. {
  652. PM_PlayStepSound(id, STEP_CONCRETE, 0.75)
  653. gCLI_oldwaterlevel[id] = waterLevel
  654. gCLI_oldflags[id] = flags
  655.  
  656. return FMRES_IGNORED
  657. }
  658.  
  659. PM_PlayStepSound(id, PM_MapTextureTypeStepType(dllfunc(DLLFunc_PM_FindTextureType, texture)), 0.75)
  660.  
  661. gCLI_oldwaterlevel[id] = waterLevel
  662. gCLI_oldflags[id] = flags
  663.  
  664. return FMRES_IGNORED
  665. }
  666. else
  667. {
  668. gCLI_iStepLeft[id] = iStepLeft
  669. gCLI_oldwaterlevel[id] = waterLevel
  670. gCLI_oldflags[id] = flags
  671. }
  672.  
  673. return FMRES_IGNORED
  674. }
  675.  
  676. public pfw_GlobalTraceAttack(ent, attacker, Float:damage, Float:direction[3], tracehdl, bits)
  677. {
  678. if (!get_pcvar_num(gPCV_on_off) || !get_pcvar_num(gPCV_shotover))
  679. return HAM_IGNORED
  680.  
  681. if (attacker > gI_MaxPlayers || gI_MaxPlayers < 1)
  682. return HAM_IGNORED
  683.  
  684. if (get_user_weapon(attacker) == CSW_KNIFE)
  685. return HAM_IGNORED
  686.  
  687. new Float:origin[3]
  688.  
  689. get_tr2(tracehdl, TR_vecEndPos, origin)
  690.  
  691. BulletHole(origin, attacker)
  692.  
  693. return HAM_IGNORED
  694. }
  695.  
  696. public fw_PlaybackEvent(flags, invoker, eventid)
  697. {
  698. if (!get_pcvar_num(gPCV_on_off) || !get_pcvar_num(gPCV_shotover))
  699. return FMRES_IGNORED
  700.  
  701. if (!(gBS_GunsEvents & (1<<eventid)) || !(1 <= invoker <= gI_MaxPlayers))
  702. return FMRES_IGNORED
  703.  
  704. new weapon = get_user_weapon(invoker)
  705.  
  706. PlayShotSound(invoker, weapon)
  707.  
  708. new players[32], num, id
  709.  
  710. get_players(players, num, "b")
  711.  
  712. for (new i=0;i<num;i++)
  713. {
  714. id = players[i]
  715.  
  716. if (!has_spect_property(id))
  717. continue
  718.  
  719. if (pev(id, pev_iuser2) != invoker)
  720. continue
  721.  
  722. SendShotAnnimation(id, ham_get_user_weaponent(invoker, weapon))
  723. }
  724.  
  725. return FMRES_SUPERCEDE
  726. }
  727.  
  728. public OrpheuHookReturn:fw_EmitSound(ent, Float:origin[3], sample[], Float:volume, Float:attenuation, fFlags, pitch)
  729. {
  730. if (!get_pcvar_num(gPCV_on_off))
  731. return OrpheuIgnored
  732.  
  733. if (!pev_valid(ent))
  734. return OrpheuIgnored
  735.  
  736. if (ent > gI_MaxPlayers)
  737. {
  738. new classname[10]
  739. pev(ent, pev_classname, classname, charsmax(classname))
  740.  
  741. if (contain(classname, "weapon_") != 0)
  742. return OrpheuIgnored
  743.  
  744. if (pev(ent, pev_aiment) == 0)
  745. return OrpheuIgnored
  746.  
  747. if (gB_DefaultSounds)
  748. {
  749. EmitSpecialSound(true, pev(ent, pev_aiment), sample, volume, attenuation, fFlags, pitch)
  750. }
  751. else
  752. {
  753. new position = getStringPos(sample)
  754. EmitSpecialSound(true, pev(ent, pev_aiment), (position == -1) ? sample : gSZ_SoundList[position], volume, attenuation, fFlags, pitch)
  755. }
  756.  
  757. return OrpheuSupercede
  758. }
  759.  
  760. if (gB_DefaultSounds)
  761. {
  762. EmitSpecialSound(true, ent, sample, volume, attenuation, fFlags, pitch)
  763. }
  764. else
  765. {
  766. new position = getStringPos(sample)
  767. EmitSpecialSound(true, ent, (position == -1) ? sample : gSZ_SoundList[position], volume, attenuation, fFlags, pitch)
  768. }
  769.  
  770. return OrpheuSupercede
  771. }
  772.  
  773. public OrpheuHookReturn:fw_EmitAmbientSound(ent, Float:origin[3], sample[], Float:volume, Float:attenuation, fFlags, pitch)
  774. {
  775. if (!get_pcvar_num(gPCV_on_off))
  776. return OrpheuIgnored
  777.  
  778. if (!pev_valid(ent))
  779. return OrpheuIgnored
  780.  
  781. if (ent > gI_MaxPlayers)
  782. return OrpheuIgnored
  783.  
  784. OrpheuSetParam(1, 0)
  785. return OrpheuIgnored
  786. }
  787.  
  788. public cmd_sndkeycfg(id, level, cid)
  789. {
  790. if (!cmd_access(id, level, cid, 2))
  791. {
  792. server_print("Usage: amx_sndkeycfg help - this will show you how to use the command")
  793. return PLUGIN_HANDLED
  794. }
  795.  
  796. new arg[300]
  797. read_argv(1, arg, charsmax(arg))
  798.  
  799. if (equali(arg, "help"))
  800. {
  801. server_print("Usage examples:")
  802. server_print("amx_sndkeycfg help - this will show you how to use the command")
  803. server_print("amx_sndkeycfg delete - this will delete the present soundkey (only if it was loaded)")
  804. server_print("amx_sndkeycfg create - this will delete the present soundkey (only if it was loaded) and create a new one")
  805. server_print("amx_sndkeycfg import <target> - this will import a soundkey from a file (will not override the present soundkey)")
  806. server_print("amx_sndkeycfg overimport <target> - this will import a soundkey from a file and delete the present one (only if it was loaded)")
  807.  
  808. return PLUGIN_HANDLED
  809. }
  810.  
  811. new filepath[300]
  812. new string1[128][21]
  813. new foldername[25] = "wb"
  814.  
  815.  
  816. if (equali(arg, "create"))
  817. {
  818. if (!file_exists(gF_sndkey))
  819. {
  820. for (new i=2;i < charsmax(foldername); i++)
  821. {
  822. foldername[i] = randomchar(random(3))
  823. }
  824.  
  825. for (new i=0;i< sizeof gSZ_SoundList;i++)
  826. {
  827. // Here we create a random name for the new sound file
  828. for (new j=0;j<20;j++)
  829. {
  830. string1[i][j] = randomchar(random(3))
  831. }
  832.  
  833. // Recheck for duplicates
  834. for (new j=0;j<i;j++)
  835. {
  836. if (equal(string1[i], string1[j]))
  837. {
  838. for (new j=0;j<20;j++)
  839. {
  840. string1[i][j] = randomchar(random(3))
  841. }
  842. }
  843. }
  844.  
  845. // Add all that we need
  846. format(gSZ_SoundMod[i], 59, "%s/%s.wav", foldername, string1[i])
  847. }
  848.  
  849. format(filepath, charsmax(filepath), "sound/%s",foldername)
  850.  
  851. new pf = fopen(gF_sndkey, "w")
  852. fprintf(pf, "; DO NOT DELETE THIS FILE! UNLESS YOU KNOW WHAT YOU ARE DOING!!!^n")
  853. fprintf(pf, "v8.0^n")
  854.  
  855. for (new i=0;i< sizeof gSZ_SoundList;i++)
  856. {
  857. if (i != sizeof gSZ_SoundList - 1)
  858. {
  859. fprintf(pf, "%s^n", gSZ_SoundMod[i])
  860. }
  861. else
  862. {
  863. fprintf(pf, "%s", gSZ_SoundMod[i])
  864. }
  865. }
  866.  
  867. fclose(pf)
  868.  
  869. server_print("[SND Block] Soundhack key created!")
  870. }
  871. else
  872. {
  873. if (!gB_loaded)
  874. {
  875. server_print("[SND Block] Soundhack key not loaded will not delete due to security measures!")
  876. return PLUGIN_HANDLED
  877. }
  878.  
  879. delete_file(gF_sndkey)
  880.  
  881. for (new i=0;i< sizeof gSZ_SoundList;i++)
  882. {
  883. format(filepath, charsmax(filepath), "sound/%s", gSZ_SoundMod[i])
  884. delete_file(filepath)
  885. }
  886.  
  887. new filepath[300], filepath2[300]
  888.  
  889. copy(filepath, charsmax(filepath), gSZ_SoundMod[0])
  890. replace(filepath, charsmax(filepath), "/", " ")
  891. parse(filepath, filepath, charsmax(filepath), filepath2, charsmax(filepath2))
  892.  
  893. format(filepath, charsmax(filepath), "sound/%s", filepath)
  894.  
  895. rmdir(filepath)
  896.  
  897. for (new i=2;i < charsmax(foldername); i++)
  898. {
  899. foldername[i] = randomchar(random(3))
  900. }
  901.  
  902. for (new i=0;i< sizeof gSZ_SoundList;i++)
  903. {
  904. // Here we create a random name for the new sound file
  905. for (new j=0;j<20;j++)
  906. {
  907. string1[i][j] = randomchar(random(3))
  908. }
  909.  
  910. // Recheck for duplicates
  911. for (new j=0;j<i;j++)
  912. {
  913. if (equal(string1[i], string1[j]))
  914. {
  915. for (new j=0;j<20;j++)
  916. {
  917. string1[i][j] = randomchar(random(3))
  918. }
  919. }
  920. }
  921.  
  922. // Add all that we need
  923. format(gSZ_SoundMod[i], 59, "%s/%s.wav", foldername, string1[i])
  924. }
  925.  
  926. format(filepath, charsmax(filepath), "sound/%s",foldername)
  927.  
  928. new pf = fopen(gF_sndkey, "w")
  929. fprintf(pf, "; DO NOT DELETE THIS FILE! UNLESS YOU KNOW WHAT YOU ARE DOING!!!^n")
  930. fprintf(pf, "v8.0^n")
  931.  
  932. for (new i=0;i< sizeof gSZ_SoundList;i++)
  933. {
  934. if (i != sizeof gSZ_SoundList - 1)
  935. {
  936. fprintf(pf, "%s^n", gSZ_SoundMod[i])
  937. }
  938. else
  939. {
  940. fprintf(pf, "%s", gSZ_SoundMod[i])
  941. }
  942. }
  943.  
  944. fclose(pf)
  945.  
  946. server_print("[SND Block] Soundhack key created!")
  947. }
  948. }
  949.  
  950.  
  951. if (equali(arg, "delete"))
  952. {
  953. if (!file_exists(gF_sndkey))
  954. {
  955. server_print("[SND Block] No existent key! Cannot delete!")
  956. return PLUGIN_HANDLED
  957. }
  958.  
  959. if (!gB_loaded)
  960. {
  961. server_print("[SND Block] Soundhack key not loaded will not delete due to security measures!")
  962. return PLUGIN_HANDLED
  963. }
  964.  
  965. delete_file(gF_sndkey)
  966. new filepath[300]
  967.  
  968. for (new i=0;i< sizeof gSZ_SoundList;i++)
  969. {
  970. format(filepath, charsmax(filepath), "sound/%s", gSZ_SoundMod[i])
  971. delete_file(filepath)
  972. }
  973.  
  974. new filepath2[300]
  975.  
  976. copy(filepath, charsmax(filepath), gSZ_SoundMod[0])
  977. replace(filepath, charsmax(filepath), "/", " ")
  978. parse(filepath, filepath, charsmax(filepath), filepath2, charsmax(filepath2))
  979.  
  980. format(filepath, charsmax(filepath), "sound/%s", filepath)
  981.  
  982. rmdir(filepath)
  983.  
  984. server_print("[SND Block] Key deleted!")
  985. // Restart the server so we can load the key!
  986. server_cmd("restart")
  987.  
  988. return PLUGIN_HANDLED
  989. }
  990.  
  991.  
  992. if (equali(arg, "import"))
  993. {
  994. if (file_exists(gF_sndkey))
  995. {
  996. server_print("[SND Block] Cannot override! Use")
  997. return PLUGIN_HANDLED
  998. }
  999. else
  1000. {
  1001. read_argv(2, arg, charsmax(arg))
  1002.  
  1003. if (!file_exists(arg))
  1004. {
  1005. server_print("[SND Block] Invaild path specified! %s", arg)
  1006. return PLUGIN_HANDLED
  1007. }
  1008.  
  1009. fcopy(arg, gF_sndkey)
  1010. }
  1011. }
  1012.  
  1013. if (equali(arg, "overimport"))
  1014. {
  1015. read_argv(2, arg, charsmax(arg))
  1016.  
  1017. if (!file_exists(arg))
  1018. {
  1019. server_print("[SND Block] Invaild path specified! %s", arg)
  1020. return PLUGIN_HANDLED
  1021. }
  1022.  
  1023. if (file_exists(gF_sndkey))
  1024. {
  1025. if (!gB_loaded)
  1026. {
  1027. server_print("[SND Block] Soundhack key not loaded will not delete due to security measures!")
  1028. return PLUGIN_HANDLED
  1029. }
  1030.  
  1031. delete_file(gF_sndkey)
  1032. new filepath[300]
  1033.  
  1034. for (new i=0;i< sizeof gSZ_SoundList;i++)
  1035. {
  1036. format(filepath, charsmax(filepath), "sound/%s", gSZ_SoundMod[i])
  1037. delete_file(filepath)
  1038. }
  1039.  
  1040. new filepath2[300]
  1041.  
  1042. copy(filepath, charsmax(filepath), gSZ_SoundMod[0])
  1043. replace(filepath, charsmax(filepath), "/", " ")
  1044. parse(filepath, filepath, charsmax(filepath), filepath2, charsmax(filepath2))
  1045.  
  1046. format(filepath, charsmax(filepath), "sound/%s", filepath)
  1047.  
  1048. rmdir(filepath)
  1049. }
  1050.  
  1051. fcopy(arg, gF_sndkey)
  1052. }
  1053.  
  1054. // Restart the server so we can load the key!
  1055. server_cmd("restart")
  1056.  
  1057. return PLUGIN_HANDLED
  1058. }
  1059.  
  1060. public client_connect(id)
  1061. {
  1062. del_alive_property(id)
  1063. }
  1064.  
  1065. public client_disconnect(id)
  1066. {
  1067. del_alive_property(id)
  1068. }
  1069.  
  1070. public fw_alive_handle(id)
  1071. {
  1072. if (!is_user_alive(id))
  1073. {
  1074. del_alive_property(id)
  1075. }
  1076. else
  1077. {
  1078. add_alive_property(id)
  1079. }
  1080. }
  1081.  
  1082. stock ham_get_user_weaponent(id, iCswId, iSlot = 0)
  1083. {
  1084. new iWeapon
  1085. if( !iSlot )
  1086. {
  1087. if( PRIMARIES_BITSUM & (1<<iCswId) )
  1088. {
  1089. iSlot = 1
  1090. }
  1091. else if( GUNS_BITSUM & (1<<iCswId) )
  1092. {
  1093. iSlot = 2
  1094. }
  1095. else if( iCswId == CSW_KNIFE )
  1096. {
  1097. iSlot = 3
  1098. }
  1099. else if( NADES_BITSUM & (1<<iCswId) )
  1100. {
  1101. iSlot = 4
  1102. }
  1103. else if( iCswId == CSW_C4 )
  1104. {
  1105. iSlot = 5
  1106. }
  1107. }
  1108.  
  1109. // get the last weapon that the player gained in this slot
  1110. iWeapon = get_pdata_cbase(id, m_rgpPlayerItems[iSlot], EXTRAOFFSET)
  1111. while( pev_valid(iWeapon) ) // >0 check should be enough, i let pev_valid for the tut
  1112. {
  1113. // Check if the weapon type (CSW_) is the one we are searching
  1114. if( get_pdata_int(iWeapon, m_iId, EXTRAOFFSET_WEAPONS) == iCswId )
  1115. {
  1116. // return the weapon entity index
  1117. return iWeapon
  1118. }
  1119. // if not, search if another weapon is linked to the previous one
  1120. iWeapon = get_pdata_cbase(iWeapon, m_pNext, EXTRAOFFSET_WEAPONS)
  1121. }
  1122. // return 0 on failure
  1123. return 0
  1124. }
  1125.  
  1126.  
  1127. stock fcompare(read_path[300], dest_path[300])
  1128. {
  1129. // Prepare for read
  1130. new fp_read = fopen(read_path, "rb")
  1131.  
  1132. // No file to read, errors!
  1133. if (!fp_read)
  1134. {
  1135. fclose(fp_read)
  1136. return -1
  1137. }
  1138.  
  1139. // Prepare for read
  1140. new fp_read2 = fopen(dest_path, "rb")
  1141.  
  1142. // No file to read, errors!
  1143. if (!fp_read2)
  1144. {
  1145. fclose(fp_read2)
  1146. return -1
  1147. }
  1148.  
  1149. // Set to the end!
  1150. fseek(fp_read, 0, SEEK_END);
  1151. fseek(fp_read2, 0, SEEK_END);
  1152. // Tell the file sizez, if equal that means that the size is the same!
  1153. if (ftell(fp_read) == ftell(fp_read2))
  1154. {
  1155. fclose(fp_read)
  1156. fclose(fp_read2)
  1157. return 1
  1158. }
  1159.  
  1160. fclose(fp_read)
  1161. fclose(fp_read2)
  1162.  
  1163. return 0
  1164. }
  1165.  
  1166. stock fcopy(read_path[300], dest_path[300], FWrite:flags = FW_NONE)
  1167. {
  1168. // Prepare for read
  1169. new fp_read = fopen(read_path, "rb")
  1170.  
  1171. // No file to read, errors!
  1172. if (!fp_read)
  1173. {
  1174. fclose(fp_read)
  1175. return 0
  1176. }
  1177.  
  1178. // If the native cannot override
  1179. if (file_exists(dest_path) && !(flags & FW_CANOVERRIDE))
  1180. {
  1181. return 0
  1182. }
  1183.  
  1184. // Prepare for write
  1185. new fp_write = fopen(dest_path, "wb")
  1186.  
  1187. // Used for copying
  1188. static buffer[BUFFERSIZE]
  1189. static readsize
  1190.  
  1191. // Find the size of the files
  1192. fseek(fp_read, 0, SEEK_END);
  1193. new fsize = ftell(fp_read);
  1194. fseek(fp_read, 0, SEEK_SET);
  1195.  
  1196. // Here we copy the info
  1197. for (new j = 0; j < fsize; j += BUFFERSIZE)
  1198. {
  1199. readsize = fread_blocks(fp_read, buffer, BUFFERSIZE, BLOCK_CHAR);
  1200. fwrite_blocks(fp_write, buffer, readsize, BLOCK_CHAR);
  1201. }
  1202.  
  1203. // Close the files
  1204. fclose(fp_read)
  1205. fclose(fp_write)
  1206.  
  1207. // Can delete source?
  1208. if (flags & FW_DELETESOURCE)
  1209. delete_file(read_path)
  1210.  
  1211. // Success
  1212. return 1
  1213. }
  1214.  
  1215. stock getStringPos(string[])
  1216. {
  1217. for (new i=0;i<94;i++)
  1218. {
  1219. if (equali(gSZ_SoundList[i],string))
  1220. return i
  1221. }
  1222. return -1
  1223. }
  1224.  
  1225. stock randomchar(i)
  1226. {
  1227. // 1 for big letters
  1228. // 2 for small ones
  1229. // The rest numbers
  1230. switch(i)
  1231. {
  1232. case 1:
  1233. {
  1234. return random_num('A', 'Z')
  1235. }
  1236. case 2:
  1237. {
  1238. return random_num('a', 'z')
  1239. }
  1240. default:
  1241. {
  1242. return random_num('0', '9')
  1243. }
  1244. }
  1245.  
  1246. return 'a'
  1247. }
  1248.  
  1249. stock PlayShotSound(id, weapon_id)
  1250. {
  1251. new weapon_ent = ham_get_user_weaponent(id,weapon_id)
  1252.  
  1253. switch(weapon_id)
  1254. {
  1255. case CSW_P228:
  1256. {
  1257. EmitSpecialSound(false, id, "weapons/p228-1.wav", VOL_NORM, 0.8, 0, 94 + random(15))
  1258. }
  1259. case CSW_SCOUT:
  1260. {
  1261. EmitSpecialSound(false, id, "weapons/scout_fire-1.wav", VOL_NORM, 1.6, 0, 94 + random(15))
  1262. }
  1263. case CSW_XM1014:
  1264. {
  1265. EmitSpecialSound(false, id, "weapons/xm1014-1.wav", VOL_NORM, 0.52, 0, 94 + random(15))
  1266. }
  1267. case CSW_MAC10:
  1268. {
  1269. EmitSpecialSound(false, id, "weapons/mac10-1.wav", VOL_NORM, 0.72, 0, 94 + random(15))
  1270. }
  1271. case CSW_AUG:
  1272. {
  1273. EmitSpecialSound(false, id, "weapons/aug-1.wav", VOL_NORM, 0.48, 0, 94 + random(15))
  1274. }
  1275. case CSW_ELITE:
  1276. {
  1277. EmitSpecialSound(false, id, "weapons/elite_fire.wav", VOL_NORM, 0.8, 0, 94 + random(15))
  1278. }
  1279. case CSW_FIVESEVEN:
  1280. {
  1281. EmitSpecialSound(false, id, "weapons/fiveseven-1.wav", VOL_NORM, 0.8, 0, 94 + random(15))
  1282. }
  1283. case CSW_UMP45:
  1284. {
  1285. EmitSpecialSound(false, id, "weapons/ump45-1.wav", VOL_NORM, 0.64, 0, 94 + random(15))
  1286. }
  1287. case CSW_SG550:
  1288. {
  1289. EmitSpecialSound(false, id, "weapons/sg550-1.wav", VOL_NORM, 0.4, 0, 94 + random(15))
  1290. }
  1291. case CSW_GALIL:
  1292. {
  1293. EmitSpecialSound(false, id, random(2) ? "weapons/galil-1.wav" : "weapons/galil-2.wav", VOL_NORM, 0.4, 0, 94 + random(15))
  1294. }
  1295. case CSW_FAMAS:
  1296. {
  1297. EmitSpecialSound(false, id, random(2) ? "weapons/famas-1.wav" : "weapons/famas-2.wav", VOL_NORM, 0.45, 0, 94 + random(15))
  1298. }
  1299. case CSW_USP:
  1300. {
  1301. if (cs_get_weapon_silen(weapon_ent))
  1302. {
  1303. EmitSpecialSound(false, id, random(2) ? "weapons/usp1.wav" : "weapons/usp2.wav", VOL_NORM, 2.0, 0, 94 + random(15))
  1304. }
  1305. else
  1306. {
  1307. EmitSpecialSound(false, id, "weapons/usp_unsil-1.wav", VOL_NORM, 0.8, 0, 87 + random(15))
  1308. }
  1309. }
  1310. case CSW_GLOCK18:
  1311. {
  1312. if (cs_get_weapon_burst(weapon_ent))
  1313. {
  1314. EmitSpecialSound(false, id, "weapons/glock18-1.wav", VOL_NORM, 0.8, 0, 94 + random(15))
  1315. }
  1316. else
  1317. {
  1318. EmitSpecialSound(false, id, "weapons/glock18-2.wav", VOL_NORM, 0.8, 0, 94 + random(15))
  1319. }
  1320. }
  1321. case CSW_AWP:
  1322. {
  1323. EmitSpecialSound(false, id, "weapons/awp1.wav", VOL_NORM, 0.28, 0, 94 + random(15))
  1324. }
  1325. case CSW_MP5NAVY:
  1326. {
  1327. EmitSpecialSound(false, id, random(2) ? "weapons/mp5-1.wav" : "weapons/mp5-2.wav", VOL_NORM, 0.64, 0, 94 + random(15))
  1328. }
  1329. case CSW_M249:
  1330. {
  1331. EmitSpecialSound(false, id, random(2) ? "weapons/m249-1.wav" : "weapons/m249-2.wav", VOL_NORM, 0.52, 0, 94 + random(15))
  1332. }
  1333. case CSW_M3:
  1334. {
  1335. EmitSpecialSound(false, id, "weapons/m3-1.wav", VOL_NORM, 0.48, 0, 94 + random(15))
  1336. }
  1337. case CSW_M4A1:
  1338. {
  1339. if (cs_get_weapon_silen(weapon_ent))
  1340. {
  1341. EmitSpecialSound(false, id, "weapons/m4a1-1.wav", VOL_NORM, 1.4, 0, 94 + random(15))
  1342. }
  1343. else
  1344. {
  1345. EmitSpecialSound(false, id, random(2) ? "weapons/m4a1_unsil-1.wav" : "weapons/m4a1_unsil-2.wav", VOL_NORM, 0.52, 0, 94 + random(15))
  1346. }
  1347. }
  1348. case CSW_TMP:
  1349. {
  1350. EmitSpecialSound(false, id, random(2) ? "weapons/tmp-1.wav" : "weapons/tmp-2.wav", VOL_NORM, 1.6, 0, 94 + random(15))
  1351. }
  1352. case CSW_G3SG1:
  1353. {
  1354. EmitSpecialSound(false, id, "weapons/g3sg1-1.wav", VOL_NORM, 0.4, 0, 94 + random(15))
  1355. }
  1356. case CSW_SG552:
  1357. {
  1358. EmitSpecialSound(false, id, random(2) ? "weapons/sg552-1.wav" : "weapons/sg552-2.wav", VOL_NORM, 0.4, 0, 94 + random(15))
  1359. }
  1360. case CSW_AK47:
  1361. {
  1362. EmitSpecialSound(false, id, random(2) ? "weapons/ak47-1.wav" : "weapons/ak47-2.wav", VOL_NORM, 0.4, 0, 94 + random(15))
  1363. }
  1364. case CSW_P90:
  1365. {
  1366. EmitSpecialSound(false, id, "weapons/p90-1.wav", VOL_NORM, 0.64, 0, 94 + random(15))
  1367. }
  1368. case CSW_DEAGLE:
  1369. {
  1370. EmitSpecialSound(false, id, random(2) ? "weapons/deagle-1.wav" : "weapons/deagle-2.wav", VOL_NORM, 0.6, 0, 94 + random(15))
  1371. }
  1372. }
  1373. }
  1374.  
  1375. stock EmitSpecialSound(bool:playonent, ent, sample[], Float:fvol, Float:attn, flags, pitch)
  1376. {
  1377. if (!TrieKeyExists(gTRIE_SoundList, sample))
  1378. {
  1379. log_amx("[WallBlocker] [EmitSpecialSound] Error: Sample unregistered")
  1380. return
  1381. }
  1382.  
  1383. new soundIndex
  1384.  
  1385. if (!TrieGetCell(gTRIE_SoundList, sample, soundIndex))
  1386. {
  1387. log_amx("[WallBlocker] [EmitSpecialSound] Error: TrieGetCell error")
  1388. return
  1389. }
  1390.  
  1391. new Float:origin[3]
  1392. pev(ent, pev_origin, origin)
  1393.  
  1394. new players[32], num
  1395. get_players(players, num)
  1396.  
  1397. new Float:distance_to_send = (attn == ATTN_NONE) ? 1000000.0 : (1600 / attn)
  1398.  
  1399. for (new i=0;i<num;i++)
  1400. {
  1401. if (entity_range(ent, players[i]) > distance_to_send)
  1402. continue
  1403.  
  1404. if (players[i] == ent)
  1405. {
  1406. if (playonent)
  1407. spawnStaticSound(ent, ent, null_vector, soundIndex, fvol, attn, pitch, flags)
  1408.  
  1409. continue
  1410. }
  1411.  
  1412. spawnStaticSound(players[i], 0, origin, soundIndex, fvol, attn, pitch, flags)
  1413. }
  1414. }
  1415.  
  1416.  
  1417. stock getFootStepCoords(id, Float:fstart[3], Float:fend[3])
  1418. {
  1419. new Float:start[5][3], Float:end[5][3], Float:diff[5][3], Float:angle[3], Float:fwd[3], Float:right[3], ent[5], grndent, bool:halftests = false
  1420.  
  1421. entity_get_vector(id, EV_VEC_v_angle, angle)
  1422.  
  1423. angle_vector(angle, ANGLEVECTOR_FORWARD, fwd)
  1424. fwd[2] = 0.0
  1425. angle_vector(angle, ANGLEVECTOR_RIGHT, right)
  1426.  
  1427. if (xs_vec_len(fwd) != 0.0)
  1428. xs_vec_mul_scalar(fwd, FOOTSTEP_DIST/xs_vec_len(fwd), fwd)
  1429. else
  1430. halftests = true
  1431.  
  1432. xs_vec_mul_scalar(right, FOOTSTEP_DIST/xs_vec_len(right), right)
  1433.  
  1434. // Get Normal start and end origins
  1435. entity_get_vector(id, EV_VEC_origin, start[0])
  1436. end[0] = start[0]
  1437. end[0][2] -= OFFSET_MINTRACE
  1438.  
  1439. if (halftests)
  1440. {
  1441. xs_vec_add(start[0], right, start[1])
  1442. xs_vec_sub(start[0], right, start[2])
  1443.  
  1444. grndent = entity_get_edict(id, EV_ENT_groundentity)
  1445.  
  1446. for (new i=0;i<3;i++)
  1447. {
  1448. ent[i] = trace_line(-1, start[i], end[i], diff[i])
  1449.  
  1450. if (ent[i] == grndent)
  1451. {
  1452. fstart = start[i]
  1453. fend = end[i]
  1454. return ent[i]
  1455. }
  1456.  
  1457. if (!grndent)
  1458. {
  1459. if (!xs_vec_equal(diff[i], end[i]))
  1460. {
  1461. fstart = start[i]
  1462. fend = end[i]
  1463. return 0
  1464. }
  1465. }
  1466. }
  1467.  
  1468. fstart = start[2]
  1469. fend = end[2]
  1470.  
  1471. return ent[2] <= 0 ? 0 : ent[2]
  1472. }
  1473.  
  1474. xs_vec_add(start[0], fwd, start[1])
  1475. xs_vec_add(start[1], right, start[1])
  1476.  
  1477. xs_vec_add(start[0], fwd, start[2])
  1478. xs_vec_sub(start[2], right, start[2])
  1479.  
  1480. xs_vec_sub(start[0], fwd, start[3])
  1481. xs_vec_add(start[3], right, start[3])
  1482.  
  1483. xs_vec_sub(start[0], fwd, start[4])
  1484. xs_vec_sub(start[4], right, start[4])
  1485.  
  1486. xs_vec_add(end[0], fwd, end[1])
  1487. xs_vec_add(end[1], right, end[1])
  1488.  
  1489. xs_vec_add(end[0], fwd, end[2])
  1490. xs_vec_sub(end[2], right, end[2])
  1491.  
  1492. xs_vec_sub(end[0], fwd, end[3])
  1493. xs_vec_add(end[3], right, end[3])
  1494.  
  1495. xs_vec_sub(end[0], fwd, end[4])
  1496. xs_vec_sub(end[4], right, end[4])
  1497.  
  1498. grndent = entity_get_edict(id, EV_ENT_groundentity)
  1499.  
  1500. for (new i=0;i<5;i++)
  1501. {
  1502. ent[i] = trace_line(-1, start[i], end[i], diff[i])
  1503.  
  1504. if (ent[i] == grndent)
  1505. {
  1506. fstart = start[i]
  1507. fend = end[i]
  1508. return ent[i]
  1509. }
  1510.  
  1511. if (!grndent)
  1512. {
  1513. if (!xs_vec_equal(diff[i], end[i]))
  1514. {
  1515. fstart = start[i]
  1516. fend = end[i]
  1517. return 0
  1518. }
  1519. }
  1520. }
  1521.  
  1522. fstart = start[4]
  1523. fend = end[4]
  1524.  
  1525. return ent[4] <= 0 ? 0 : ent[4]
  1526. }
  1527.  
  1528. stock spawnStaticSound(const sendto, const index, const Float:origin[3], const soundIndex, const Float:vol, const Float:atten, const pitch, const flags)
  1529. {
  1530. message_begin(sendto ? MSG_ONE : MSG_ALL, SVC_SPAWNSTATICSOUND, .player = sendto);
  1531. {
  1532. write_coord_f(origin[0]);
  1533. write_coord_f(origin[1]);
  1534. write_coord_f(origin[2]);
  1535. write_short(soundIndex);
  1536. write_byte(clamp_byte(floatround(vol * 255)))
  1537. write_byte(clamp_byte(floatround(atten * 64)))
  1538. write_short(index)
  1539. write_byte(pitch)
  1540. write_byte(flags)
  1541. }
  1542. message_end()
  1543. }
  1544.  
  1545. stock BulletHole(Float: origin[3], id)
  1546. {
  1547. new players[32], num, player
  1548. get_players(players, num)
  1549.  
  1550.  
  1551. for (new i=0;i<num;i++)
  1552. {
  1553. player = players[i]
  1554.  
  1555. if (id == player)
  1556. continue
  1557.  
  1558. engfunc(EngFunc_MessageBegin, MSG_ONE, SVC_TEMPENTITY, null_vector, player)
  1559. write_byte(TE_GUNSHOTDECAL)
  1560. engfunc(EngFunc_WriteCoord, origin[0])
  1561. engfunc(EngFunc_WriteCoord, origin[1])
  1562. engfunc(EngFunc_WriteCoord, origin[2])
  1563. write_short(0)
  1564. write_byte(gDecal_shot1 - random(5))
  1565. message_end()
  1566.  
  1567. if (random(100) < 10)
  1568. {
  1569. engfunc(EngFunc_MessageBegin, MSG_ONE, SVC_TEMPENTITY, null_vector, player)
  1570. write_byte(TE_SPARKS)
  1571. engfunc(EngFunc_WriteCoord, origin[0])
  1572. engfunc(EngFunc_WriteCoord, origin[1])
  1573. engfunc(EngFunc_WriteCoord, origin[2])
  1574. message_end()
  1575. }
  1576. }
  1577.  
  1578. return 1
  1579. }
  1580.  
  1581. stock Float:get_velocity(ent, bool:use2d)
  1582. {
  1583. new Float:vel[3]
  1584. entity_get_vector(ent, EV_VEC_velocity, vel)
  1585.  
  1586. if (use2d)
  1587. vel[2] = 0.0
  1588.  
  1589. return xs_vec_len(vel)
  1590. }
  1591.  
  1592. stock Float:get_zveleocity(ent)
  1593. {
  1594. new Float:vel[3]
  1595. entity_get_vector(ent, EV_VEC_velocity, vel)
  1596.  
  1597. return vel[2]
  1598. }
  1599.  
  1600. stock PM_PlayStepSound(id, step, Float:fvol)
  1601. {
  1602. new irand = random(2) + (entity_get_int(id, EV_INT_iStepLeft) * 2)
  1603.  
  1604. switch (step)
  1605. {
  1606. case STEP_METAL:
  1607. {
  1608. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_METAL] + getRemixedValues(irand)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1609. }
  1610. case STEP_DIRT:
  1611. {
  1612. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_DIRT] + getRemixedValues(irand)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1613. }
  1614. case STEP_VENT:
  1615. {
  1616. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_VENT] + getRemixedValues(irand)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1617. }
  1618. case STEP_GRATE:
  1619. {
  1620. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_GRATE] + getRemixedValues(irand)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1621. }
  1622. case STEP_TILE:
  1623. {
  1624. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_TILE] + ((random(101) < 90) ? getRemixedValues(irand) : 4)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1625. }
  1626. case STEP_SLOSH:
  1627. {
  1628. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_SLOSH] + getRemixedValues(irand)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1629. }
  1630. case STEP_WADE:
  1631. {
  1632. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_WADE] + irand], fvol, ATTN_NORM, 0, PITCH_NORM )
  1633. }
  1634. case STEP_LADDER:
  1635. {
  1636. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_LADDER] + getRemixedValues(irand)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1637. }
  1638. case STEP_SNOW:
  1639. {
  1640. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_SNOW] + random(6)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1641. }
  1642. default:
  1643. {
  1644. EmitSpecialSound( true, id, gSZ_SoundMod[gPSND_Indexes[STEP_CONCRETE] + getRemixedValues(irand)], fvol, ATTN_NORM, 0, PITCH_NORM )
  1645. }
  1646. }
  1647.  
  1648. return 1
  1649. }
  1650.  
  1651. stock getRemixedValues(value)
  1652. {
  1653. switch (value)
  1654. {
  1655. case 1: return 2
  1656. case 2: return 1
  1657. case 3: return 3
  1658. default: return 0
  1659. }
  1660.  
  1661. return 0
  1662. }
  1663.  
  1664. stock PM_MapTextureTypeStepType(TextureType)
  1665. {
  1666. switch (TextureType)
  1667. {
  1668. case CHAR_TEX_METAL: return STEP_METAL
  1669. case CHAR_TEX_DIRT: return STEP_DIRT
  1670. case CHAR_TEX_VENT: return STEP_VENT
  1671. case CHAR_TEX_GRATE: return STEP_GRATE
  1672. case CHAR_TEX_TILE: return STEP_TILE
  1673. case CHAR_TEX_SLOSH: return STEP_SLOSH
  1674. case CHAR_TEX_SNOW: return STEP_SNOW
  1675. default: return STEP_CONCRETE
  1676. }
  1677.  
  1678. return STEP_CONCRETE
  1679. }
  1680.  
  1681. stock SendShotAnnimation(id, weapon_ent)
  1682. {
  1683. new ammo = cs_get_weapon_ammo(weapon_ent)
  1684.  
  1685. switch (cs_get_weapon_id(weapon_ent))
  1686. {
  1687. case CSW_AWP:
  1688. {
  1689. SendWeaponAnim(id, random_num(1,3))
  1690. }
  1691. case CSW_SCOUT,CSW_XM1014,CSW_SG550,CSW_M3,CSW_M249,CSW_G3SG1:
  1692. {
  1693. SendWeaponAnim(id, random_num(1,2))
  1694. }
  1695. case CSW_MAC10,CSW_AUG,CSW_UMP45,CSW_GALIL,CSW_FAMAS,CSW_MP5NAVY,CSW_TMP,CSW_SG552,CSW_AK47,CSW_P90:
  1696. {
  1697. SendWeaponAnim(id, random_num(3,5))
  1698. }
  1699. case CSW_P228:
  1700. {
  1701. if (ammo != 0)
  1702. SendWeaponAnim(id, random_num(1,3))
  1703. else
  1704. SendWeaponAnim(id, 4)
  1705. }
  1706. case CSW_FIVESEVEN, CSW_DEAGLE:
  1707. {
  1708. if (ammo != 0)
  1709. SendWeaponAnim(id, random_num(1,2))
  1710. else
  1711. SendWeaponAnim(id, 3)
  1712. }
  1713. case CSW_GLOCK18:
  1714. {
  1715. if (ammo != 0)
  1716. SendWeaponAnim(id, random_num(3,5))
  1717. else
  1718. SendWeaponAnim(id, 6)
  1719. }
  1720. case CSW_M4A1:
  1721. {
  1722. if (cs_get_weapon_silen(weapon_ent))
  1723. SendWeaponAnim(id, random_num(1,3))
  1724. else
  1725. SendWeaponAnim(id, random_num(8,10))
  1726. }
  1727. case CSW_USP:
  1728. {
  1729. if (ammo == 0)
  1730. {
  1731. if (cs_get_weapon_silen(weapon_ent))
  1732. SendWeaponAnim(id, 4)
  1733. else
  1734. SendWeaponAnim(id, 12)
  1735. }
  1736. else
  1737. {
  1738. if (cs_get_weapon_silen(weapon_ent))
  1739. SendWeaponAnim(id, random_num(1,3))
  1740. else
  1741. SendWeaponAnim(id, random_num(9,11))
  1742. }
  1743. }
  1744. case CSW_ELITE:
  1745. {
  1746. if (ammo % 2 == 1)
  1747. {
  1748. if (ammo != 1)
  1749. SendWeaponAnim(id, random_num(2, 6))
  1750. else
  1751. SendWeaponAnim(id, 7)
  1752. }
  1753.  
  1754. if (ammo % 2 == 0)
  1755. {
  1756. if (ammo != 0)
  1757. SendWeaponAnim(id, random_num(8, 12))
  1758. else
  1759. SendWeaponAnim(id, 13)
  1760. }
  1761. }
  1762. }
  1763.  
  1764. return 0
  1765. }
  1766.  
  1767. stock SendWeaponAnim(id, iAnim)
  1768. {
  1769. set_pev(id, pev_weaponanim, iAnim)
  1770.  
  1771. message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, _, id)
  1772. write_byte(iAnim)
  1773. write_byte(pev(id,pev_body))
  1774. message_end()
  1775. }
  1776.  
  1777. stock xs_vec_add(const Float:in1[], const Float:in2[], Float:out[])
  1778. {
  1779. out[0] = in1[0] + in2[0];
  1780. out[1] = in1[1] + in2[1];
  1781. out[2] = in1[2] + in2[2];
  1782. }
  1783.  
  1784. stock xs_vec_sub(const Float:in1[], const Float:in2[], Float:out[])
  1785. {
  1786. out[0] = in1[0] - in2[0];
  1787. out[1] = in1[1] - in2[1];
  1788. out[2] = in1[2] - in2[2];
  1789. }
  1790.  
  1791. stock xs_vec_mul_scalar(const Float:vec[], Float:scalar, Float:out[])
  1792. {
  1793. out[0] = vec[0] * scalar;
  1794. out[1] = vec[1] * scalar;
  1795. out[2] = vec[2] * scalar;
  1796. }
  1797.  
  1798. stock Float:xs_vec_len(const Float:vec[3])
  1799. {
  1800. return floatsqroot(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]);
  1801. }
  1802.  
  1803. stock Float:xs_vec_dot(const Float:vec[], const Float:vec2[])
  1804. {
  1805. return (vec[0]*vec2[0] + vec[1]*vec2[1] + vec[2]*vec2[2])
  1806. }
  1807.  
  1808. stock bool:xs_vec_equal(const Float:vec1[], const Float:vec2[])
  1809. {
  1810. return (vec1[0] == vec2[0]) && (vec1[1] == vec2[1]) && (vec1[2] == vec2[2]);
  1811. }

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Wh blocker
HozzászólásElküldve: 2013.08.15. 14:03 
Offline
Beavatott

Csatlakozott: 2013.03.01. 14:37
Hozzászólások: 92
Megköszönt másnak: 10 alkalommal
Megköszönték neki: 4 alkalommal
ÉN EZT A WH BLOCKERT HASZNÁLOM A SZERÓMON ÉS EZ TÖKÉLETES NEKEM.....
Próbáld meg ezt: http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=BW

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Wh blocker
HozzászólásElküldve: 2013.08.15. 14:05 
Offline
Félisten

Csatlakozott: 2012.06.19. 15:12
Hozzászólások: 926
Megköszönt másnak: 109 alkalommal
Megköszönték neki: 31 alkalommal
xdadam írta:
ÉN EZT A WH BLOCKERT HASZNÁLOM A SZERÓMON ÉS EZ TÖKÉLETES NEKEM.....
Próbáld meg ezt: http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=BW


Ok megpróbálom amit linkeltem az is ez csak a legfrissebb verziója.

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Wh blocker
HozzászólásElküldve: 2013.08.15. 14:26 
Offline
Developer
Avatar

Csatlakozott: 2011.06.01. 21:11
Hozzászólások: 7962
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 535 alkalommal
Igazából ez csak steames szerveren fog menni. De én teszteltem anno, működött, nagyon jó :)

_________________
http://www.easyrankup.eu


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Wh blocker
HozzászólásElküldve: 2013.08.15. 14:56 
Offline
Félisten

Csatlakozott: 2012.06.19. 15:12
Hozzászólások: 926
Megköszönt másnak: 109 alkalommal
Megköszönték neki: 31 alkalommal
kiki írta:
Igazából ez csak steames szerveren fog menni. De én teszteltem anno, működött, nagyon jó :)


Jó tudni.

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Wh blocker
HozzászólásElküldve: 2013.08.15. 14:58 
Offline
Developer
Avatar

Csatlakozott: 2011.06.01. 21:11
Hozzászólások: 7962
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 535 alkalommal
Tomos írta:
kiki írta:
Igazából ez csak steames szerveren fog menni. De én teszteltem anno, működött, nagyon jó :)


Jó tudni.


Requirements:
Steam
AmxModX v1.80
EngineX
Orpheu

_________________
http://www.easyrankup.eu


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 48 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