hlmod.hu

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



Jelenlévő felhasználók

Jelenleg 426 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 425 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  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Zombi Escape
HozzászólásElküldve: 2013.12.22. 13:39 
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
Valaki megnézné mi a hiba át akarom konvertálni http://aghl.ru/webcompiler/webcompiler.php és ezt írja:

zombie_escape_v13sma.sma(97) : error 001: expected token: "#endif", but found "-end of file-"

1 Error.
Could not locate output file zombie_escape_v13sma.amx (compile failed).

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <fakemeta>
  5. #include <fakemeta_util>
  6. #include <hamsandwich>
  7. #include <cstrike>
  8. #include <fun>
  9.  
  10. #if defined _orpheu_included
  11. #endinput
  12. #endif
  13. #define _orpheu_included
  14.  
  15.  
  16. #if defined _orpheu_const_included
  17. #endinput
  18. #endif
  19. #define _orpheu_const_included
  20.  
  21. #if AMXX_VERSION_NUM >= 175
  22. #pragma reqlib orpheu
  23. #if !defined AMXMODX_NOAUTOLOAD
  24. #pragma loadlib orpheu
  25. #endif
  26. #else
  27. #pragma library orpheu
  28. #endif
  29.  
  30. const OrpheuFunction:OrpheuInvalidFunction = OrpheuFunction:0
  31.  
  32. enum OrpheuHookReturn
  33. {
  34. OrpheuIgnored,
  35. OrpheuOverride,
  36. OrpheuSupercede
  37. }
  38.  
  39. enum OrpheuHookPhase
  40. {
  41. OrpheuHookPre,
  42. OrpheuHookPost
  43. }
  44.  
  45. enum OrpheuStructType
  46. {
  47. OrpheuStructMovevars,
  48. OrpheuStructUsercmd,
  49. OrpheuStructMonsterEvent,
  50. OrpheuStructDLL_FUNCTIONS,
  51. OrpheuStructPlayerMove,
  52. OrpheuStructEngineFuncs,
  53. OrpheuStructTraceResult,
  54. OrpheuStructPhysent,
  55. OrpheuStructPmplane,
  56. OrpheuStructPmtrace,
  57. OrpheuStructWeaponData,
  58. OrpheuStructAmmoInfo,
  59. OrpheuStructItemInfo,
  60. OrpheuStructTask,
  61. OrpheuStructSchedule,
  62. OrpheuStructKeyValueData
  63. }
  64.  
  65.  
  66.  
  67. native OrpheuFunction:OrpheuGetFunction(const libFunctionName[],const className[]="")
  68. native OrpheuHook:OrpheuRegisterHook(OrpheuFunction:function,const hookFunctionName[],OrpheuHookPhase:phase = OrpheuHookPre)
  69. native OrpheuUnregisterHook(OrpheuHook:hook)
  70. native OrpheuCall(OrpheuFunction:function,any:...)
  71. native OrpheuCallSuper(OrpheuFunction:function,any:...)
  72. native any:OrpheuGetReturn(any:...)
  73. native OrpheuSetReturn(any:...)
  74. native OrpheuSetParam(num,any:...)
  75. native OrpheuStruct:OrpheuCreateStruct(OrpheuStructType:structType)
  76. native OrpheuGetParamStructMember(num,const memberName[],any:...)
  77. native OrpheuSetParamStructMember(num,const memberName[],any:...)
  78. native OrpheuStruct:OrpheuGetStructFromParam(num)
  79. native OrpheuStruct:OrpheuCloneStructFromParam(num)
  80. native OrpheuSetStructMember(OrpheuStruct:struct,const memberName[],any:...)
  81. native OrpheuGetStructMember(OrpheuStruct:struct,const memberName[],any:...)
  82. native OrpheuStruct:OrpheuGetEngineFunctionsStruct()
  83. native OrpheuStruct:OrpheuGetDLLFunctionsStruct()
  84. native OrpheuFunction:OrpheuGetFunctionFromClass(const entityClassName[],const libFunctionName[],const libClassName[])
  85. native OrpheuFunction:OrpheuGetFunctionFromEntity(id,const libFunctionName[],const libClassName[])
  86. native OrpheuFunction:OrpheuGetFunctionFromObject(object,const libFunctionName[],const libClassName[])
  87. native OrpheuFunction:OrpheuGetFunctionFromMonster(id, const libFunctionName[], const libClassName[])
  88.  
  89.  
  90. #if defined _orpheu_stocks_included
  91. #endinput
  92. #endif
  93. #define _orpheu_stocks_included
  94.  
  95.  
  96. #if defined _orpheu_const_included
  97. #endinput
  98. #endif
  99. #define _orpheu_const_included
  100.  
  101. #if AMXX_VERSION_NUM >= 175
  102. #pragma reqlib orpheu
  103. #if !defined AMXMODX_NOAUTOLOAD
  104. #pragma loadlib orpheu
  105. #endif
  106. #else
  107. #pragma library orpheu
  108. #endif
  109.  
  110. const OrpheuFunction:OrpheuInvalidFunction = OrpheuFunction:0
  111.  
  112. enum OrpheuHookReturn
  113. {
  114. OrpheuIgnored,
  115. OrpheuOverride,
  116. OrpheuSupercede
  117. }
  118.  
  119. enum OrpheuHookPhase
  120. {
  121. OrpheuHookPre,
  122. OrpheuHookPost
  123. }
  124.  
  125. enum OrpheuStructType
  126. {
  127. OrpheuStructMovevars,
  128. OrpheuStructUsercmd,
  129. OrpheuStructMonsterEvent,
  130. OrpheuStructDLL_FUNCTIONS,
  131. OrpheuStructPlayerMove,
  132. OrpheuStructEngineFuncs,
  133. OrpheuStructTraceResult,
  134. OrpheuStructPhysent,
  135. OrpheuStructPmplane,
  136. OrpheuStructPmtrace,
  137. OrpheuStructWeaponData,
  138. OrpheuStructAmmoInfo,
  139. OrpheuStructItemInfo,
  140. OrpheuStructTask,
  141. OrpheuStructSchedule,
  142. OrpheuStructKeyValueData
  143. }
  144.  
  145.  
  146. #if defined _orpheu_included
  147. #endinput
  148. #endif
  149. #define _orpheu_included
  150.  
  151.  
  152. #if defined _orpheu_const_included
  153. #endinput
  154. #endif
  155. #define _orpheu_const_included
  156.  
  157. #if AMXX_VERSION_NUM >= 175
  158. #pragma reqlib orpheu
  159. #if !defined AMXMODX_NOAUTOLOAD
  160. #pragma loadlib orpheu
  161. #endif
  162. #else
  163. #pragma library orpheu
  164. #endif
  165.  
  166. const OrpheuFunction:OrpheuInvalidFunction = OrpheuFunction:0
  167.  
  168. enum OrpheuHookReturn
  169. {
  170. OrpheuIgnored,
  171. OrpheuOverride,
  172. OrpheuSupercede
  173. }
  174.  
  175. enum OrpheuHookPhase
  176. {
  177. OrpheuHookPre,
  178. OrpheuHookPost
  179. }
  180.  
  181. enum OrpheuStructType
  182. {
  183. OrpheuStructMovevars,
  184. OrpheuStructUsercmd,
  185. OrpheuStructMonsterEvent,
  186. OrpheuStructDLL_FUNCTIONS,
  187. OrpheuStructPlayerMove,
  188. OrpheuStructEngineFuncs,
  189. OrpheuStructTraceResult,
  190. OrpheuStructPhysent,
  191. OrpheuStructPmplane,
  192. OrpheuStructPmtrace,
  193. OrpheuStructWeaponData,
  194. OrpheuStructAmmoInfo,
  195. OrpheuStructItemInfo,
  196. OrpheuStructTask,
  197. OrpheuStructSchedule,
  198. OrpheuStructKeyValueData
  199. }
  200.  
  201.  
  202.  
  203. native OrpheuFunction:OrpheuGetFunction(const libFunctionName[],const className[]="")
  204. native OrpheuHook:OrpheuRegisterHook(OrpheuFunction:function,const hookFunctionName[],OrpheuHookPhase:phase = OrpheuHookPre)
  205. native OrpheuUnregisterHook(OrpheuHook:hook)
  206. native OrpheuCall(OrpheuFunction:function,any:...)
  207. native OrpheuCallSuper(OrpheuFunction:function,any:...)
  208. native any:OrpheuGetReturn(any:...)
  209. native OrpheuSetReturn(any:...)
  210. native OrpheuSetParam(num,any:...)
  211. native OrpheuStruct:OrpheuCreateStruct(OrpheuStructType:structType)
  212. native OrpheuGetParamStructMember(num,const memberName[],any:...)
  213. native OrpheuSetParamStructMember(num,const memberName[],any:...)
  214. native OrpheuStruct:OrpheuGetStructFromParam(num)
  215. native OrpheuStruct:OrpheuCloneStructFromParam(num)
  216. native OrpheuSetStructMember(OrpheuStruct:struct,const memberName[],any:...)
  217. native OrpheuGetStructMember(OrpheuStruct:struct,const memberName[],any:...)
  218. native OrpheuStruct:OrpheuGetEngineFunctionsStruct()
  219. native OrpheuStruct:OrpheuGetDLLFunctionsStruct()
  220. native OrpheuFunction:OrpheuGetFunctionFromClass(const entityClassName[],const libFunctionName[],const libClassName[])
  221. native OrpheuFunction:OrpheuGetFunctionFromEntity(id,const libFunctionName[],const libClassName[])
  222. native OrpheuFunction:OrpheuGetFunctionFromObject(object,const libFunctionName[],const libClassName[])
  223. native OrpheuFunction:OrpheuGetFunctionFromMonster(id, const libFunctionName[], const libClassName[])
  224.  
  225.  
  226. #if defined _orpheu_advanced_included
  227. #endinput
  228. #endif
  229. #define _orpheu_advanced_included
  230.  
  231.  
  232. #if defined _orpheu_const_included
  233. #endinput
  234. #endif
  235. #define _orpheu_const_included
  236.  
  237. #if AMXX_VERSION_NUM >= 175
  238. #pragma reqlib orpheu
  239. #if !defined AMXMODX_NOAUTOLOAD
  240. #pragma loadlib orpheu
  241. #endif
  242. #else
  243. #pragma library orpheu
  244. #endif
  245.  
  246. const OrpheuFunction:OrpheuInvalidFunction = OrpheuFunction:0
  247.  
  248. enum OrpheuHookReturn
  249. {
  250. OrpheuIgnored,
  251. OrpheuOverride,
  252. OrpheuSupercede
  253. }
  254.  
  255. enum OrpheuHookPhase
  256. {
  257. OrpheuHookPre,
  258. OrpheuHookPost
  259. }
  260.  
  261. enum OrpheuStructType
  262. {
  263. OrpheuStructMovevars,
  264. OrpheuStructUsercmd,
  265. OrpheuStructMonsterEvent,
  266. OrpheuStructDLL_FUNCTIONS,
  267. OrpheuStructPlayerMove,
  268. OrpheuStructEngineFuncs,
  269. OrpheuStructTraceResult,
  270. OrpheuStructPhysent,
  271. OrpheuStructPmplane,
  272. OrpheuStructPmtrace,
  273. OrpheuStructWeaponData,
  274. OrpheuStructAmmoInfo,
  275. OrpheuStructItemInfo,
  276. OrpheuStructTask,
  277. OrpheuStructSchedule,
  278. OrpheuStructKeyValueData
  279. }
  280.  
  281.  
  282. native OrpheuGetBytesAtAddress(address,bytes[],count)
  283. native OrpheuGetFunctionAddress(OrpheuFunction:function)
  284. native OrpheuStruct:OrpheuGetStructFromAddress(OrpheuStructType:structType,address)
  285. native OrpheuFunction:OrpheuCreateFunction(address,const libFunctionName[],const classname[]="")
  286. native OrpheuGetFunctionOffset(OrpheuFunction:function)
  287. native OrpheuGetLibraryAddress(const libraryName[])
  288. native OrpheuGetNextCallAtAddress(address,number)
  289.  
  290.  
  291. stock OrpheuFunction:OrpheuGetEngineFunction(const memberName[],const libFunctionName[])
  292. {
  293. static OrpheuStruct:engineFunctions
  294.  
  295. if(!engineFunctions)
  296. {
  297. engineFunctions = OrpheuGetEngineFunctionsStruct()
  298. }
  299.  
  300. return OrpheuCreateFunction( OrpheuGetStructMember(engineFunctions,memberName),libFunctionName )
  301. }
  302.  
  303. stock OrpheuFunction:OrpheuGetDLLFunction(const memberName[],const libFunctionName[])
  304. {
  305. static OrpheuStruct:OrpheuDLLFunctions
  306.  
  307. if(!OrpheuDLLFunctions)
  308. {
  309. OrpheuDLLFunctions = OrpheuGetDLLFunctionsStruct()
  310. }
  311.  
  312. return OrpheuCreateFunction( OrpheuGetStructMember(OrpheuDLLFunctions,memberName),libFunctionName )
  313. }
  314.  
  315. stock OrpheuHook:OrpheuRegisterHookFromClass(const entityClassName[],const libFunctionName[],const libClassName[],const hookFunctionName[],OrpheuHookPhase:phase = OrpheuHookPre)
  316. {
  317. return OrpheuRegisterHook(OrpheuGetFunctionFromClass(entityClassName,libFunctionName,libClassName),hookFunctionName,phase)
  318. }
  319.  
  320. stock OrpheuHook:OrpheuRegisterHookFromEntity(id,const libFunctionName[],const libClassName[],const hookFunctionName[],OrpheuHookPhase:phase = OrpheuHookPre)
  321. {
  322. return OrpheuRegisterHook(OrpheuGetFunctionFromEntity(id,libFunctionName,libClassName),hookFunctionName,phase)
  323. }
  324.  
  325. stock OrpheuHook:OrpheuRegisterHookFromObject(object,const libFunctionName[],const libClassName[],const hookFunctionName[],OrpheuHookPhase:phase = OrpheuHookPre)
  326. {
  327. return OrpheuRegisterHook(OrpheuGetFunctionFromObject(object,libFunctionName,libClassName),hookFunctionName,phase)
  328. }
  329.  
  330.  
  331. #if defined _orpheu_memory_included
  332. #endinput
  333. #endif
  334. #define _orpheu_memory_included
  335.  
  336.  
  337. #if defined _orpheu_const_included
  338. #endinput
  339. #endif
  340. #define _orpheu_const_included
  341.  
  342. #if AMXX_VERSION_NUM >= 175
  343. #pragma reqlib orpheu
  344. #if !defined AMXMODX_NOAUTOLOAD
  345. #pragma loadlib orpheu
  346. #endif
  347. #else
  348. #pragma library orpheu
  349. #endif
  350.  
  351. const OrpheuFunction:OrpheuInvalidFunction = OrpheuFunction:0
  352.  
  353. enum OrpheuHookReturn
  354. {
  355. OrpheuIgnored,
  356. OrpheuOverride,
  357. OrpheuSupercede
  358. }
  359.  
  360. enum OrpheuHookPhase
  361. {
  362. OrpheuHookPre,
  363. OrpheuHookPost
  364. }
  365.  
  366. enum OrpheuStructType
  367. {
  368. OrpheuStructMovevars,
  369. OrpheuStructUsercmd,
  370. OrpheuStructMonsterEvent,
  371. OrpheuStructDLL_FUNCTIONS,
  372. OrpheuStructPlayerMove,
  373. OrpheuStructEngineFuncs,
  374. OrpheuStructTraceResult,
  375. OrpheuStructPhysent,
  376. OrpheuStructPmplane,
  377. OrpheuStructPmtrace,
  378. OrpheuStructWeaponData,
  379. OrpheuStructAmmoInfo,
  380. OrpheuStructItemInfo,
  381. OrpheuStructTask,
  382. OrpheuStructSchedule,
  383. OrpheuStructKeyValueData
  384. }
  385.  
  386.  
  387. native OrpheuMemoryReplace(const memoryDataName[],count,any:...)
  388. native OrpheuMemoryReplaceAtAddress(address,const memoryDataNameName[],count,any:...)
  389. native OrpheuMemoryGet(const memoryDataName[],any:...)
  390. native OrpheuMemoryGetAtAddress(address,const memoryDataName[],any:...)
  391. native OrpheuMemorySet(const memoryDataName[],count,any:...)
  392. native OrpheuMemorySetAtAddress(address,const memoryDataName[],count,any:...)
  393.  
  394. #define PLUGIN "Zombie Escape"
  395. #define VERSION "1.3"
  396. #define AUTHOR "Dias"
  397.  
  398. #define MIN_PLAYER 2
  399. #define DEFAULT_LIGHT "d"
  400. new USE_FOG = 1
  401. #define FOG_DENSITY "0.0010"
  402. #define FOG_COLOR "100 100 100"
  403.  
  404. // Human Config
  405. #define HUMAN_HEALTH 1000.0
  406. #define HUMAN_ARMOR 100.0
  407. #define HUMAN_GRAVITY 1.0
  408. #define HUMAN_SPEED 250.0
  409.  
  410. // Zombie Config
  411. #define ZOMBIE_HEALTH 14000.0
  412. #define ZOMBIE_ARMOR 100.0
  413. #define ZOMBIE_GRAVITY 0.875
  414. #define ZOMBIE_SPEED 350.0
  415. #define ZOMBIE_KNOCKBACK_POWER 500.0
  416.  
  417. #define SKY_NAME "hk"
  418.  
  419. // primary weapons (menu|game)
  420. new g_primaryweapons[][][] =
  421. {
  422. { "M4A1", "weapon_m4a1" },
  423. { "AK47", "weapon_ak47" },
  424. { "AUG", "weapon_aug" },
  425. { "SG552", "weapon_sg552" },
  426. { "Galil", "weapon_galil" },
  427. { "Famas", "weapon_famas" },
  428. { "MP5 Navy", "weapon_mp5navy" },
  429. { "XM1014", "weapon_xm1014" },
  430. { "M3", "weapon_m3" },
  431. { "P90", "weapon_p90" },
  432. { "M249", "weapon_m249" },
  433. { "SG550", "weapon_sg550" },
  434. { "G3SG1", "weapon_g3sg1" }
  435. }
  436.  
  437. // secondary weapons (menu|game)
  438. new g_secondaryweapons[][][] =
  439. {
  440. { "USP", "weapon_usp" },
  441. { "Deagle", "weapon_deagle" },
  442. { "Elite", "weapon_elite" }
  443. }
  444.  
  445. // grenade loadout (game)
  446. new g_grenades[][] =
  447. {
  448. "weapon_hegrenade",
  449. "weapon_smokegrenade"
  450. }
  451.  
  452. new const Game_Desc[] =
  453. "Zombie Escape. Version: 1.0. Coded: Dias"
  454.  
  455. new const ready_sound[1][] =
  456. {
  457. "zombie_escape/ZE_Ready.mp3"
  458. }
  459.  
  460. new const ambience_sound[1][] =
  461. {
  462. "zombie_escape/ZE_Ambience.mp3"
  463. }
  464.  
  465. new const zombieappear_sound[2][] =
  466. {
  467. "zombie_escape/zombi_coming_1.wav",
  468. "zombie_escape/zombi_coming_2.wav"
  469. }
  470.  
  471. new const zombieinfect_sound[2][] =
  472. {
  473. "zombie_escape/zombie/human_death_01.wav",
  474. "zombie_escape/zombie/human_death_02.wav"
  475. }
  476.  
  477. new const zombiehurt_sound[2][] =
  478. {
  479. "zombie_escape/zombie/zombi_hurt_01.wav",
  480. "zombie_escape/zombie/zombi_hurt_02.wav"
  481. }
  482.  
  483. new const zombieattack_sound[3][] =
  484. {
  485. "zombie_escape/zombie/zombi_attack_1.wav",
  486. "zombie_escape/zombie/zombi_attack_2.wav",
  487. "zombie_escape/zombie/zombi_attack_3.wav"
  488. }
  489.  
  490. new const zombieswing_sound[3][] =
  491. {
  492. "zombie_escape/zombie/zombi_swing_1.wav",
  493. "zombie_escape/zombie/zombi_swing_2.wav",
  494. "zombie_escape/zombie/zombi_swing_3.wav"
  495. }
  496.  
  497. new const zombiehitwall_sound[3][] =
  498. {
  499. "zombie_escape/zombie/zombi_wall_1.wav",
  500. "zombie_escape/zombie/zombi_wall_2.wav",
  501. "zombie_escape/zombie/zombi_wall_3.wav"
  502. }
  503.  
  504. new const count_sound[] = "zombie_escape/count/%i.wav"
  505. new const escape_suc_sound[] = "zombie_escape/zombi_escape_success.wav"
  506. new const escape_fail_sound[] = "zombie_escape/zombi_escape_fail.wav"
  507.  
  508. new const host_zombie_model[] = "tank_zombi_host"
  509. new const origin_zombie_model[] = "tank_zombi_origin"
  510. new const claws_model[] = "models/zombie_escape/v_knife_tank_zombi.mdl"
  511. new const sound_nvg[2][] = {"items/nvg_off.wav", "items/nvg_on.wav"}
  512.  
  513. new g_szObjectiveClassNames[][] =
  514. {
  515. "func_bomb_target",
  516. "info_bomb_target",
  517. "info_vip_start",
  518. "func_vip_safetyzone",
  519. "func_escapezone",
  520. "hostage_entity",
  521. "monster_scientist",
  522. "func_hostage_rescue",
  523. "info_hostage_rescue",
  524. "item_longjump"
  525. };
  526.  
  527.  
  528. enum
  529. {
  530. TASK_COUNTDOWN = 52000,
  531. TASK_COUNTDOWN2,
  532. TASK_AMBIENCE,
  533. TASK_ROUNDTIME
  534. }
  535.  
  536. enum
  537. {
  538. TEAM_T = 1,
  539. TEAM_CT = 2,
  540. TEAM_ALL = 5,
  541. TEAM_START = 6
  542. }
  543. enum
  544. {
  545. AL_NOT = 0,
  546. AL_ALIVE = 1,
  547. AL_BOTH = 2
  548. }
  549. enum
  550. {
  551. ZOMBIE_TYPE_HOST = 0,
  552. ZOMBIE_TYPE_ORIGIN
  553. }
  554.  
  555. new g_endround, g_count, bot_register, g_gamestart, g_default_model[33][64], score_hud, Float:delay_hud[33]
  556. new notice_hud, g_started, g_zombie[33], g_zombie_type[33], g_nvg[33], g_isalive[33], g_team_score[6]
  557.  
  558. new OrpheuHook:handleHookCheckMapConditions;
  559. new OrpheuHook:handleHookCheckWinConditions;
  560. new OrpheuHook:handleHookHasRoundTimeExpired;
  561.  
  562. new g_WinText[7][64], g_pGameRules
  563. #define set_mp_pdata(%1,%2) (OrpheuMemorySetAtAddress( g_pGameRules, %1, 1, %2 ) )
  564. #define get_mp_pdata(%1) (OrpheuMemoryGetAtAddress( g_pGameRules, %1 ) )
  565.  
  566. new bool:g_showmenu[33], bool:g_menufailsafe[33], g_player_weapons[33][2], g_menuposition[33]
  567. #define TASKID_WEAPONSMENU 564
  568. #define EQUIP_PRI (1<<0)
  569. #define EQUIP_SEC (1<<1)
  570. #define EQUIP_GREN (1<<2)
  571. #define EQUIP_ALL (1<<0 | 1<<1 | 1<<2)
  572.  
  573. #define OFFSET_LASTPRIM 368
  574. #define OFFSET_LASTSEC 369
  575. #define OFFSET_LASTKNI 370
  576.  
  577. #define OFFSET_DEATH 444
  578. #define OFFSET_TEAM 114
  579. #define OFFSET_ARMOR 112
  580. #define OFFSET_NVG 129
  581. #define OFFSET_CSMONEY 115
  582. #define OFFSET_PRIMARYWEAPON 116
  583. #define OFFSET_WEAPONTYPE 43
  584. #define OFFSET_CLIPAMMO 51
  585. #define EXTRAOFFSET_WEAPONS 4
  586.  
  587. #define OFFSET_AMMO_338MAGNUM 377
  588. #define OFFSET_AMMO_762NATO 378
  589. #define OFFSET_AMMO_556NATOBOX 379
  590. #define OFFSET_AMMO_556NATO 380
  591. #define OFFSET_AMMO_BUCKSHOT 381
  592. #define OFFSET_AMMO_45ACP 382
  593. #define OFFSET_AMMO_57MM 383
  594. #define OFFSET_AMMO_50AE 384
  595. #define OFFSET_AMMO_357SIG 385
  596. #define OFFSET_AMMO_9MM 386
  597.  
  598. #define fm_lastprimary(%1) get_pdata_cbase(id, OFFSET_LASTPRIM)
  599. #define fm_lastsecondry(%1) get_pdata_cbase(id, OFFSET_LASTSEC)
  600. #define fm_lastknife(%1) get_pdata_cbase(id, OFFSET_LASTKNI)
  601. #define fm_get_weapon_id(%1) get_pdata_int(%1, OFFSET_WEAPONTYPE, EXTRAOFFSET_WEAPONS)
  602.  
  603. new const g_weapon_ammo[][] =
  604. {
  605. { -1, -1 },
  606. { 13, 200 },
  607. { -1, -1 },
  608. { 10, 200 },
  609. { -1, -1 },
  610. { 7, 200 },
  611. { -1, -1 },
  612. { 30, 200 },
  613. { 30, 200 },
  614. { -1, -1 },
  615. { 30, 200 },
  616. { 20, 200 },
  617. { 25, 000 },
  618. { 30, 200 },
  619. { 35, 200 },
  620. { 25, 200 },
  621. { 12, 200 },
  622. { 20, 200 },
  623. { 10, 200 },
  624. { 30, 200 },
  625. { 100, 200 },
  626. { 8, 200 },
  627. { 30, 200 },
  628. { 30, 200 },
  629. { 20, 200 },
  630. { -1, -1 },
  631. { 7, 200 },
  632. { 30, 200 },
  633. { 30, 200 },
  634. { -1, -1 },
  635. { 50, 200 }
  636. }
  637.  
  638. // Plugin & Precache & Config Zone
  639. public plugin_init()
  640. {
  641. static map_name[32]
  642. get_mapname(map_name, sizeof(map_name))
  643.  
  644. if(containi(map_name, "ze_") == -1)
  645. {
  646. set_fail_state("[ZE] Hibas Map")
  647. return
  648. }
  649.  
  650. register_plugin(PLUGIN, VERSION, AUTHOR)
  651.  
  652. format(g_WinText[TEAM_T], 63, "Escape Fail")
  653. format(g_WinText[TEAM_CT], 63, "Escape Success")
  654. format(g_WinText[TEAM_ALL], 63, "#Round_Draw")
  655. format(g_WinText[TEAM_START], 63, "#Game_Commencing")
  656.  
  657. register_menu("Equipment", 1023, "action_equip")
  658. register_menu("Primary", 1023, "action_prim")
  659. register_menu("Secondary", 1023, "action_sec")
  660.  
  661. // Event
  662. register_event("HLTV", "event_newround", "a", "1=0", "2=0")
  663. register_logevent("event_roundend", 2, "1=Round_End")
  664. register_event("TextMsg","event_roundend","a","2=#Game_Commencing","2=#Game_will_restart_in")
  665. register_event("CurWeapon", "event_CurWeapon", "be", "1=1")
  666.  
  667. // Message
  668. register_message(get_user_msgid("Health"), "message_health")
  669. register_message(get_user_msgid("StatusIcon"), "message_StatusIcon")
  670.  
  671. // Forward & Ham
  672. register_forward(FM_EmitSound, "fw_EmitSound")
  673. register_forward(FM_GetGameDescription, "fw_GetGameDesc")
  674. RegisterHam(Ham_Spawn, "player", "fw_Spawn_Post", 1)
  675. RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
  676. RegisterHam(Ham_Killed, "player", "fw_Killed_Post", 1)
  677. RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon")
  678. RegisterHam(Ham_Touch, "armoury_entity", "fw_TouchWeapon")
  679. RegisterHam(Ham_Touch, "weapon_shield", "fw_TouchWeapon")
  680.  
  681. PatchRoundInfinity()
  682.  
  683. set_cvar_string("sv_skyname", SKY_NAME)
  684.  
  685. notice_hud = CreateHudSyncObj(1)
  686. score_hud = CreateHudSyncObj(2)
  687.  
  688. register_clcmd("nightvision", "cmd_nightvision")
  689.  
  690. register_clcmd("jointeam", "cmd_jointeam")
  691. register_clcmd("chooseteam", "cmd_jointeam")
  692. }
  693.  
  694. public plugin_cfg()
  695. {
  696. static map_name[32]
  697. get_mapname(map_name, sizeof(map_name))
  698.  
  699. if(containi(map_name, "ze_") == -1)
  700. return
  701.  
  702. server_cmd("mp_freezetime 22.0")
  703. server_cmd("mp_roundtime 9.0")
  704. server_cmd("mp_friendlyfire 0")
  705. server_cmd("mp_startmoney 16000")
  706. }
  707.  
  708. public plugin_precache()
  709. {
  710. static map_name[32]
  711. get_mapname(map_name, sizeof(map_name))
  712.  
  713. if(containi(map_name, "ze_") == -1)
  714. return
  715.  
  716. OrpheuRegisterHook(OrpheuGetFunction("InstallGameRules"),"OnInstallGameRules",OrpheuHookPost)
  717.  
  718. new i, buffer[128]
  719. for(i = 0; i < sizeof(ready_sound); i++)
  720. {
  721. if(equal(ready_sound[i][strlen(ready_sound[i]) - 4], ".mp3"))
  722. {
  723. format(buffer, charsmax(buffer), "sound/%s", ready_sound[i])
  724. precache_generic(buffer)
  725. } else {
  726. precache_sound(ready_sound[i])
  727. }
  728. }
  729. for(i = 0; i < sizeof(ambience_sound); i++)
  730. {
  731. if(equal(ambience_sound[i][strlen(ambience_sound[i]) - 4], ".mp3"))
  732. {
  733. format(buffer, charsmax(buffer), "sound/%s", ambience_sound[i])
  734. precache_generic(buffer)
  735. } else {
  736. precache_sound(ambience_sound[i])
  737. }
  738. }
  739. for(i = 0; i < sizeof(zombieappear_sound); i++)
  740. precache_sound(zombieappear_sound[i])
  741. for(i = 0; i < sizeof(zombieinfect_sound); i++)
  742. precache_sound(zombieinfect_sound[i])
  743. for(i = 0; i < sizeof(zombiehurt_sound); i++)
  744. precache_sound(zombiehurt_sound[i])
  745. for(i = 0; i < sizeof(zombieattack_sound); i++)
  746. precache_sound(zombieattack_sound[i])
  747. for(i = 0; i < sizeof(zombieswing_sound); i++)
  748. precache_sound(zombieswing_sound[i])
  749. for(i = 0; i < sizeof(zombiehitwall_sound); i++)
  750. precache_sound(zombiehitwall_sound[i])
  751. for (i = 1; i <= 10; i++)
  752. {
  753. new sound_count[64]
  754. format(sound_count, sizeof sound_count - 1, count_sound, i)
  755.  
  756. precache_sound(sound_count)
  757. }
  758.  
  759. formatex(buffer, sizeof(buffer), "gfx/env/%sbk.tga", SKY_NAME)
  760. precache_generic(buffer)
  761. formatex(buffer, sizeof(buffer), "gfx/env/%sdn.tga", SKY_NAME)
  762. precache_generic(buffer)
  763. formatex(buffer, sizeof(buffer), "gfx/env/%sft.tga", SKY_NAME)
  764. precache_generic(buffer)
  765. formatex(buffer, sizeof(buffer), "gfx/env/%slf.tga", SKY_NAME)
  766. precache_generic(buffer)
  767. formatex(buffer, sizeof(buffer), "gfx/env/%srt.tga", SKY_NAME)
  768. precache_generic(buffer)
  769. formatex(buffer, sizeof(buffer), "gfx/env/%sup.tga", SKY_NAME)
  770. precache_generic(buffer)
  771.  
  772. precache_sound(escape_suc_sound)
  773. precache_sound(escape_fail_sound)
  774.  
  775. formatex(buffer, sizeof(buffer), "models/player/%s/%s.mdl", host_zombie_model, host_zombie_model)
  776. precache_model(buffer)
  777. formatex(buffer, sizeof(buffer), "models/player/%s/%s.mdl", origin_zombie_model, origin_zombie_model)
  778. precache_model(buffer)
  779.  
  780. engfunc(EngFunc_PrecacheModel, claws_model)
  781.  
  782. if(USE_FOG == 1)
  783. {
  784. static ent
  785. ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_fog"))
  786. if (pev_valid(ent))
  787. {
  788. fm_set_kvd(ent, "density", FOG_DENSITY, "env_fog")
  789. fm_set_kvd(ent, "rendercolor", FOG_COLOR, "env_fog")
  790. }
  791. }
  792.  
  793. register_forward(FM_Spawn, "fw_Spawn")
  794.  
  795. }
  796.  
  797. public plugin_end()
  798. {
  799. UnPatchRoundInfinity()
  800. }
  801.  
  802. public fw_Spawn(iEnt)
  803. {
  804. if (!pev_valid(iEnt))
  805. return FMRES_IGNORED;
  806.  
  807. static s_szClassName[32], s_iNum;
  808. pev(iEnt, pev_classname, s_szClassName, 31);
  809.  
  810. for (s_iNum = 0; s_iNum < sizeof g_szObjectiveClassNames; s_iNum++)
  811. {
  812. if (equal(s_szClassName, g_szObjectiveClassNames[s_iNum]))
  813. {
  814. engfunc(EngFunc_RemoveEntity, iEnt);
  815. return FMRES_SUPERCEDE;
  816. }
  817. }
  818.  
  819. return FMRES_IGNORED;
  820. }
  821.  
  822. public client_putinserver(id)
  823. {
  824. if(!bot_register && is_user_bot(id))
  825. {
  826. bot_register = 1
  827. set_task(1.0, "do_register", id)
  828. }
  829.  
  830. g_showmenu[id] = true
  831. g_isalive[id] = 0
  832. }
  833.  
  834. public client_disconnect(id)
  835. {
  836. g_isalive[id] = 0
  837. check_win_con()
  838. }
  839.  
  840. public do_register(id)
  841. {
  842. RegisterHamFromEntity(Ham_Spawn, id, "fw_Spawn_Post", 1)
  843. RegisterHamFromEntity(Ham_TakeDamage, id, "fw_TakeDamage")
  844. RegisterHamFromEntity(Ham_Killed, id, "fw_Killed_Post", 1)
  845. }
  846.  
  847. public PatchRoundInfinity()
  848. {
  849. handleHookCheckMapConditions = OrpheuRegisterHook( OrpheuGetFunction( "CheckMapConditions" , "CHalfLifeMultiplay" ), "CheckConditions" );
  850. handleHookCheckWinConditions = OrpheuRegisterHook( OrpheuGetFunction( "CheckWinConditions" , "CHalfLifeMultiplay" ), "CheckConditions" );
  851.  
  852. if (is_linux_server())
  853. {
  854. handleHookHasRoundTimeExpired = OrpheuRegisterHook( OrpheuGetFunction( "HasRoundTimeExpired" , "CHalfLifeMultiplay" ), "CheckConditions" );
  855. }
  856. else
  857. {
  858. BytesToReplace("roundTimeCheck", { 0x90, 0x90, 0x90 } );
  859. }
  860. }
  861.  
  862. public UnPatchRoundInfinity()
  863. {
  864. OrpheuUnregisterHook( handleHookCheckMapConditions );
  865. OrpheuUnregisterHook( handleHookCheckWinConditions );
  866.  
  867. if (is_linux_server())
  868. {
  869. OrpheuUnregisterHook( handleHookHasRoundTimeExpired );
  870. }
  871. else
  872. {
  873. BytesToReplace("roundTimeCheck", { 0xF6, 0xC4, 0x41 } );
  874. }
  875. }
  876.  
  877. public OrpheuHookReturn:CheckConditions ()
  878. {
  879. OrpheuSetReturn( false );
  880. return OrpheuSupercede;
  881. }
  882.  
  883. public OnInstallGameRules()
  884. {
  885. g_pGameRules = OrpheuGetReturn()
  886. }
  887.  
  888. // End of Plugin & Precache & Config Zone
  889.  
  890. // Event: New Round
  891. public event_newround()
  892. {
  893. // Reset Vars
  894. g_endround = 0
  895. g_gamestart = 0
  896. g_count = 20
  897.  
  898. // Remove Task
  899. remove_task(TASK_COUNTDOWN)
  900. remove_task(TASK_COUNTDOWN2)
  901. remove_task(TASK_AMBIENCE)
  902. remove_task(TASK_ROUNDTIME)
  903.  
  904. if(get_player_num(TEAM_ALL, AL_ALIVE) < MIN_PLAYER)
  905. {
  906. client_printc(0, "!g[Zombie Escape]!n Nincs eleg jatekos a modhoz! Jatekosok : !t%i!n", MIN_PLAYER)
  907. g_started = 0
  908.  
  909. return
  910. }
  911.  
  912. client_printc(0, "!g[Zombie Escape]!n Keszen allsz? Sok szerencset!")
  913. PlaySound(0, ready_sound[random_num(0, charsmax(ready_sound))])
  914.  
  915. set_task(1.0, "do_countdown", TASK_COUNTDOWN, _, _, "b")
  916. set_task(get_cvar_float("mp_roundtime") * 60.0 + 43.0, "do_zombie_win", TASK_ROUNDTIME)
  917. }
  918.  
  919. public do_countdown(taskid)
  920. {
  921. if(g_endround)
  922. {
  923. remove_task(taskid)
  924. return
  925. }
  926.  
  927. if (!g_count)
  928. {
  929. start_game_now()
  930. remove_task(taskid)
  931. return
  932. }
  933.  
  934. if (g_count <= 10)
  935. {
  936. new sound[64]
  937. format(sound, charsmax(sound), count_sound, g_count)
  938. PlaySound(0, sound)
  939. }
  940.  
  941. new message[64]
  942. format(message, charsmax(message), "K�szen allsz? Megnyitas %i masodperc mulva!", g_count)
  943.  
  944. client_print(0, print_center, message)
  945. //set_hudmessage(255, 255, 0, -1.0, 0.21, 1, 2.0, 2.0)
  946. //ShowSyncHudMsg(0, notice_hud, message)
  947.  
  948. g_count--
  949. }
  950. // End of Event: New Round
  951.  
  952. // Event: Round End
  953. public event_roundend()
  954. {
  955. g_endround = 1
  956.  
  957. remove_task(TASK_COUNTDOWN)
  958. remove_task(TASK_COUNTDOWN2)
  959. remove_task(TASK_AMBIENCE)
  960. }
  961.  
  962. // End of Event: Round End
  963.  
  964. public cmd_jointeam(id)
  965. {
  966. if(!is_user_connected(id))
  967. return 1
  968.  
  969. if(cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T)
  970. {
  971. open_game_menu(id)
  972. return 1
  973. }
  974.  
  975. return PLUGIN_CONTINUE
  976. }
  977.  
  978. public open_game_menu(id)
  979. {
  980. static menu
  981. menu = menu_create("Game Menu", "gamem_handle")
  982.  
  983. menu_additem(menu, "Equipment", "1", 0)
  984. menu_additem(menu, "Game Information", "2", 0)
  985.  
  986. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
  987.  
  988. menu_display(id, menu, 0)
  989. }
  990.  
  991. public gamem_handle(id, menu, item)
  992. {
  993. if(item == MENU_EXIT)
  994. {
  995. menu_destroy(menu)
  996. return PLUGIN_HANDLED;
  997. }
  998.  
  999. new data[6], szName[64];
  1000. new access, callback;
  1001.  
  1002. menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
  1003.  
  1004. new key = str_to_num(data);
  1005.  
  1006. switch(key)
  1007. {
  1008. case 1: // Equipment
  1009. {
  1010. g_showmenu[id] = true
  1011. client_printc(id, "!g[Zombie Escape]!n Engedelyezve van az Equipment menu!")
  1012. }
  1013. case 2: // Game Info
  1014. {
  1015. show_motd(id, Game_Desc, "Jatek informacio")
  1016. }
  1017. }
  1018.  
  1019. return 0
  1020. }
  1021.  
  1022. // NightVision
  1023. public cmd_nightvision(id)
  1024. {
  1025. if (!is_user_alive(id) || !g_zombie[id]) return PLUGIN_HANDLED;
  1026.  
  1027. if (!g_nvg[id])
  1028. {
  1029. SwitchNvg(id, 1)
  1030. PlaySound(id, sound_nvg[1])
  1031. }
  1032. else
  1033. {
  1034. SwitchNvg(id, 0)
  1035. PlaySound(id, sound_nvg[0])
  1036. }
  1037.  
  1038. return PLUGIN_CONTINUE
  1039. }
  1040.  
  1041. stock SwitchNvg(id, mode)
  1042. {
  1043. if (!is_user_connected(id)) return;
  1044.  
  1045. g_nvg[id] = mode
  1046. set_user_nvision(id)
  1047. }
  1048.  
  1049. stock set_user_nvision(id)
  1050. {
  1051. if (!is_user_connected(id)) return;
  1052.  
  1053. new alpha
  1054. if (g_nvg[id]) alpha = 70
  1055. else alpha = 0
  1056.  
  1057. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, id)
  1058. write_short(0) // duration
  1059. write_short(0) // hold time
  1060. write_short(0x0004) // fade type
  1061. write_byte(253) // r
  1062. write_byte(110) // g
  1063. write_byte(110) // b
  1064. write_byte(alpha) // alpha
  1065. message_end()
  1066.  
  1067. if(g_nvg[id])
  1068. {
  1069. set_player_light(id, "z")
  1070. } else {
  1071. set_player_light(id, DEFAULT_LIGHT)
  1072. }
  1073. }
  1074.  
  1075. stock set_player_light(id, const LightStyle[])
  1076. {
  1077. message_begin(MSG_ONE, SVC_LIGHTSTYLE, .player = id)
  1078. write_byte(0)
  1079. write_string(LightStyle)
  1080. message_end()
  1081. }
  1082. // End of NightVision
  1083.  
  1084. // Start Game
  1085. public start_game_now()
  1086. {
  1087. g_gamestart = 1
  1088.  
  1089. PlaySound(0, ambience_sound[random_num(0, charsmax(ambience_sound))])
  1090. set_task(105.0, "check_ambience_sound", TASK_AMBIENCE, _, _, "b")
  1091.  
  1092. // Make Zombies
  1093. for(new i = 0; i < require_zombie(); i++)
  1094. {
  1095. set_user_zombie(get_random_player(TEAM_CT, AL_ALIVE), ZOMBIE_TYPE_ORIGIN)
  1096. }
  1097.  
  1098. g_count = 7
  1099. set_task(1.0, "do_count_rezombie", TASK_COUNTDOWN2, _, _, "b")
  1100.  
  1101. for(new i = 0; i < get_maxplayers(); i++)
  1102. {
  1103. if(is_user_connected(i) && is_user_alive(i) && !g_zombie[i])
  1104. {
  1105. set_user_maxspeed(i, HUMAN_SPEED)
  1106. set_user_gravity(i, HUMAN_GRAVITY)
  1107. }
  1108. }
  1109. }
  1110.  
  1111. public check_ambience_sound(taskid)
  1112. {
  1113. if(g_endround)
  1114. {
  1115. remove_task(taskid)
  1116. return
  1117. }
  1118.  
  1119. PlaySound(0, ambience_sound[random_num(0, charsmax(ambience_sound))])
  1120. }
  1121.  
  1122. public do_count_rezombie(taskid)
  1123. {
  1124. if(g_endround)
  1125. {
  1126. remove_task(taskid)
  1127. return
  1128. }
  1129.  
  1130. if (!g_count)
  1131. {
  1132. release_zombie()
  1133. remove_task(taskid)
  1134. return
  1135. }
  1136.  
  1137. set_hudmessage(255, 255, 0, -1.0, 0.21, 1, 2.0, 2.0)
  1138. ShowSyncHudMsg(0, notice_hud, "Zombik ki szabadulnak %i masodperc mulva!", g_count)
  1139.  
  1140. g_count--
  1141. }
  1142. // End of Start Game
  1143.  
  1144. // Game Main
  1145. public release_zombie()
  1146. {
  1147. g_gamestart = 2
  1148.  
  1149. for(new i = 0; i < get_maxplayers(); i++)
  1150. {
  1151. if(!is_user_connected(i) || !is_user_alive(i))
  1152. continue
  1153. if(!g_zombie[i])
  1154. continue
  1155.  
  1156. set_user_maxspeed(i, ZOMBIE_SPEED)
  1157. set_user_gravity(i, ZOMBIE_GRAVITY)
  1158. }
  1159. }
  1160.  
  1161. public client_PostThink(id)
  1162. {
  1163. if(!is_user_alive(id))
  1164. return
  1165. if(get_gametime() - 1.0 > delay_hud[id])
  1166. {
  1167. set_hudmessage(255, 255, 255, -1.0, 0.0, 0, 2.0, 2.0)
  1168. ShowSyncHudMsg(id, score_hud, "Zombik vs Emberek^n %i --------- %i", g_team_score[TEAM_T], g_team_score[TEAM_CT])
  1169.  
  1170. delay_hud[id] = get_gametime()
  1171. }
  1172.  
  1173. if(!g_gamestart)
  1174. {
  1175. if(!is_user_connected(id) || !is_user_alive(id))
  1176. return
  1177.  
  1178. if(cs_get_user_team(id) != CS_TEAM_CT) cs_set_user_team(id, CS_TEAM_T)
  1179. }
  1180. if(g_gamestart != 1)
  1181. return
  1182. if(!g_zombie[id])
  1183. return
  1184.  
  1185. if(get_user_maxspeed(id) != 0.1) set_user_maxspeed(id, 0.1)
  1186. }
  1187.  
  1188. public set_user_zombie(id, zombie_type)
  1189. {
  1190. cs_set_user_team(id, TEAM_T)
  1191.  
  1192. g_zombie[id] = 1
  1193. g_zombie_type[id] = zombie_type
  1194.  
  1195. set_user_health(id, zombie_type == 0 ? floatround(ZOMBIE_HEALTH / 2.0) : floatround(ZOMBIE_HEALTH))
  1196. set_user_armor(id, floatround(ZOMBIE_ARMOR))
  1197.  
  1198. if(zombie_type == ZOMBIE_TYPE_HOST)
  1199. {
  1200. set_user_maxspeed(id, ZOMBIE_SPEED)
  1201. set_user_gravity(id, ZOMBIE_GRAVITY)
  1202. } else {
  1203. set_user_maxspeed(id, 0.1)
  1204. set_user_gravity(id, ZOMBIE_GRAVITY)
  1205. }
  1206.  
  1207. cs_get_user_model(id, g_default_model[id], 63)
  1208. cs_set_user_model(id, zombie_type == 0 ? host_zombie_model : origin_zombie_model)
  1209. set_default_zombie(id, zombie_type)
  1210.  
  1211. emit_sound(id, CHAN_BODY, zombieinfect_sound[random_num(0, charsmax(zombieinfect_sound))], 1.0, ATTN_NORM, 0, PITCH_NORM)
  1212. PlaySound(0, zombieappear_sound[random_num(0, charsmax(zombieappear_sound))])
  1213.  
  1214. SwitchNvg(id, 1)
  1215. PlaySound(id, sound_nvg[1])
  1216.  
  1217. check_win_con()
  1218. }
  1219.  
  1220. stock set_default_zombie(id, zombie_type)
  1221. {
  1222. if(!is_user_alive(id))
  1223. return
  1224. if(!g_zombie[id])
  1225. return
  1226.  
  1227. if(zombie_type == ZOMBIE_TYPE_ORIGIN)
  1228. {
  1229. new player = -1, entity_num, entity_list[40]
  1230. if(cs_get_user_team(id) == CS_TEAM_T)
  1231. {
  1232. while((player = find_ent_by_class(player, "info_player_deathmatch")))
  1233. {
  1234. entity_list[entity_num] = player
  1235. entity_num++
  1236. }
  1237. } else if(cs_get_user_team(id) == CS_TEAM_CT) {
  1238. while((player = find_ent_by_class(player, "info_player_start")))
  1239. {
  1240. entity_list[entity_num] = player
  1241. entity_num++
  1242. }
  1243. }
  1244.  
  1245. new random_player1
  1246. random_player1 = entity_list[random(entity_num)]
  1247.  
  1248. if(random_player1 != 0)
  1249. {
  1250. new Float:Origin[3]
  1251. pev(random_player1, pev_origin, Origin)
  1252.  
  1253. if(check_spawn(Origin))
  1254. {
  1255. set_pev(id, pev_origin, Origin)
  1256. } else {
  1257. set_default_zombie(id, zombie_type)
  1258. }
  1259. } else {
  1260. set_default_zombie(id, zombie_type)
  1261. }
  1262. }
  1263.  
  1264. // Remove any zoom (bugfix)
  1265. cs_set_user_zoom(id, CS_RESET_ZOOM, 1)
  1266.  
  1267. // Remove armor
  1268. cs_set_user_armor(id, 0, CS_ARMOR_NONE)
  1269.  
  1270. // Drop weapons when infected
  1271. drop_weapons(id, 1)
  1272. drop_weapons(id, 2)
  1273.  
  1274. // Strip zombies from guns and give them a knife
  1275. fm_strip_user_weapons(id)
  1276. fm_give_item(id, "weapon_knife")
  1277. }
  1278.  
  1279. public event_CurWeapon(id)
  1280. {
  1281. if(!is_user_alive(id))
  1282. return 1
  1283. if(!g_zombie[id])
  1284. return 1
  1285. if(get_user_weapon(id) != CSW_KNIFE)
  1286. {
  1287. drop_weapons(id, 1)
  1288. drop_weapons(id, 2)
  1289.  
  1290. engclient_cmd(id, "weapon_knife")
  1291. } else {
  1292. set_pev(id, pev_viewmodel2, claws_model)
  1293. set_pev(id, pev_weaponmodel2, "")
  1294. }
  1295.  
  1296. return 0
  1297. }
  1298.  
  1299. public test(id)
  1300. {
  1301. }
  1302.  
  1303. // End of Game Main
  1304.  
  1305. public check_win_con()
  1306. {
  1307. if(g_endround)
  1308. return
  1309. if(!g_gamestart)
  1310. return
  1311.  
  1312. if(get_player_num(TEAM_T, AL_ALIVE) == 0)
  1313. {
  1314. TerminateRound(TEAM_CT)
  1315. } else if(get_player_num(TEAM_CT, AL_ALIVE) == 0) {
  1316. TerminateRound(TEAM_T)
  1317. }
  1318. }
  1319.  
  1320. public do_zombie_win()
  1321. {
  1322. TerminateRound(TEAM_T)
  1323. }
  1324.  
  1325. // Message
  1326. public message_StatusIcon(msg_id, msg_dest, msg_entity)
  1327. {
  1328. static szMsg[8];
  1329. get_msg_arg_string(2, szMsg ,7);
  1330.  
  1331. if(equal(szMsg, "buyzone") && get_msg_arg_int(1))
  1332. {
  1333. set_pdata_int(msg_entity, 235, get_pdata_int(msg_entity, 235) & ~(1<<0));
  1334. return PLUGIN_HANDLED;
  1335. }
  1336.  
  1337. return PLUGIN_CONTINUE;
  1338. }
  1339.  
  1340. public message_health(msg_id, msg_dest, msg_entity)
  1341. {
  1342. static health
  1343. health = get_msg_arg_int(1)
  1344.  
  1345. if(health > 255)
  1346. set_msg_arg_int(1, get_msg_argtype(1), 255)
  1347. }
  1348. // End of Message
  1349.  
  1350. // Ham
  1351. public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
  1352. {
  1353. // Block all those unneeeded hostage sounds
  1354. if (sample[0] == 'h' && sample[1] == 'o' && sample[2] == 's' && sample[3] == 't' && sample[4] == 'a' && sample[5] == 'g' && sample[6] == 'e')
  1355. return FMRES_SUPERCEDE;
  1356.  
  1357. // Replace these next sounds for zombies only
  1358. if (!is_user_connected(id) || !g_zombie[id])
  1359. return FMRES_IGNORED;
  1360.  
  1361. // Zombie being hit
  1362. if (sample[7] == 'b' && sample[8] == 'h' && sample[9] == 'i' && sample[10] == 't' ||
  1363. sample[7] == 'h' && sample[8] == 'e' && sample[9] == 'a' && sample[10] == 'd')
  1364. {
  1365. emit_sound(id, channel, zombiehurt_sound[random_num(0, charsmax(zombiehurt_sound))], volume, attn, flags, pitch)
  1366. return FMRES_SUPERCEDE;
  1367. }
  1368.  
  1369. // Zombie Attack
  1370. new attack_type
  1371. if (equal(sample,"weapons/knife_hitwall1.wav")) attack_type = 1
  1372. else if (equal(sample,"weapons/knife_hit1.wav") ||
  1373. equal(sample,"weapons/knife_hit3.wav") ||
  1374. equal(sample,"weapons/knife_hit2.wav") ||
  1375. equal(sample,"weapons/knife_hit4.wav") ||
  1376. equal(sample,"weapons/knife_stab.wav")) attack_type = 2
  1377. else if(equal(sample,"weapons/knife_slash1.wav") ||
  1378. equal(sample,"weapons/knife_slash2.wav")) attack_type = 3
  1379. if (attack_type)
  1380. {
  1381. if (attack_type == 1) emit_sound(id, channel, zombiehitwall_sound[random_num(0, charsmax(zombiehitwall_sound))], volume, attn, flags, pitch)
  1382. else if (attack_type == 2) emit_sound(id, channel, zombieattack_sound[random_num(0, charsmax(zombieattack_sound))], volume, attn, flags, pitch)
  1383. else if (attack_type == 3) emit_sound(id, channel, zombieswing_sound[random_num(0, charsmax(zombieswing_sound))], volume, attn, flags, pitch)
  1384.  
  1385. return FMRES_SUPERCEDE;
  1386. }
  1387.  
  1388. return FMRES_IGNORED;
  1389. }
  1390.  
  1391. public fw_GetGameDesc()
  1392. {
  1393. forward_return(FMV_STRING, "Zombie Escape")
  1394. return FMRES_SUPERCEDE
  1395. }
  1396.  
  1397. public fw_Spawn_Post(id)
  1398. {
  1399. if (get_player_num(TEAM_ALL, AL_ALIVE) > 1 && !g_started)
  1400. {
  1401. g_started = 1
  1402. TerminateRound(TEAM_START)
  1403. }
  1404. if(!is_user_connected(id))
  1405. return HAM_IGNORED
  1406. if(g_gamestart)
  1407. return HAM_IGNORED
  1408.  
  1409. cs_set_user_team(id, TEAM_CT)
  1410. cs_set_user_money(id, 16000, 1)
  1411.  
  1412. g_isalive[id] = 1
  1413. g_zombie[id] = 0
  1414. g_zombie_type[id] = 0
  1415. g_nvg[id] = 0
  1416. g_menufailsafe[id] = false
  1417. if(TASKID_WEAPONSMENU + id) remove_task(TASKID_WEAPONSMENU + id)
  1418.  
  1419. set_user_nvision(id)
  1420.  
  1421. set_human_stuff(id)
  1422.  
  1423. if(g_showmenu[id])
  1424. display_equipmenu(id)
  1425. else
  1426. {
  1427. equipweapon(id, EQUIP_ALL)
  1428. }
  1429.  
  1430. return HAM_HANDLED
  1431. }
  1432.  
  1433. public display_equipmenu(id)
  1434. {
  1435. static menubody[512], len
  1436. len = formatex(menubody, 511, "\yFegyver Menu^n^n")
  1437.  
  1438. static bool:hasweap
  1439. hasweap = ((g_player_weapons[id][0]) != -1 && (g_player_weapons[id][1] != -1)) ? true : false
  1440.  
  1441. len += formatex(menubody[len], 511 - len,"\w1. Uj fegyver^n")
  1442. len += formatex(menubody[len], 511 - len,"\w2. Elozo fegyver^n^n")
  1443. len += formatex(menubody[len], 511 - len,"\w3. Pre-Weapon & Don't Show^n^n")
  1444. len += formatex(menubody[len], 511 - len,"\w5. Kilepes^n", id, "MENU_EXIT")
  1445.  
  1446. static keys
  1447. keys = (MENU_KEY_1|MENU_KEY_5)
  1448.  
  1449. if(hasweap)
  1450. keys |= (MENU_KEY_2|MENU_KEY_3)
  1451.  
  1452. show_menu(id, keys, menubody, -1, "Equipment")
  1453. }
  1454.  
  1455. public action_equip(id, key)
  1456. {
  1457. if(!is_user_alive(id) || g_zombie[id])
  1458. return PLUGIN_HANDLED
  1459.  
  1460. switch(key)
  1461. {
  1462. case 0: display_weaponmenu(id, 1, g_menuposition[id] = 0)
  1463. case 1: equipweapon(id, EQUIP_ALL)
  1464. case 2:
  1465. {
  1466. g_showmenu[id] = false
  1467. equipweapon(id, EQUIP_ALL)
  1468. client_printc(id, "!g[Zombie Escape]!n Nyomd meg az M betut a jatekmenujehez!")
  1469. }
  1470. }
  1471.  
  1472. if(key > 0)
  1473. {
  1474. g_menufailsafe[id] = false
  1475. remove_task(TASKID_WEAPONSMENU + id)
  1476. }
  1477. return PLUGIN_HANDLED
  1478. }
  1479.  
  1480.  
  1481. public display_weaponmenu(id, menuid, pos)
  1482. {
  1483. if(pos < 0 || menuid < 0)
  1484. return
  1485.  
  1486. static start
  1487. start = pos * 8
  1488.  
  1489. static maxitem
  1490. maxitem = menuid == 1 ? sizeof g_primaryweapons : sizeof g_secondaryweapons
  1491.  
  1492. if(start >= maxitem)
  1493. start = pos = g_menuposition[id]
  1494.  
  1495. static menubody[512], len
  1496. len = formatex(menubody, 511, "\y%s\w^n^n", menuid == 1 ? "Primary" : "Secondary")
  1497.  
  1498. static end
  1499. end = start + 8
  1500. if(end > maxitem)
  1501. end = maxitem
  1502.  
  1503. static keys
  1504. keys = MENU_KEY_0
  1505.  
  1506. static a, b
  1507. b = 0
  1508.  
  1509. for(a = start; a < end; ++a)
  1510. {
  1511. keys |= (1<<b)
  1512. len += formatex(menubody[len], 511 - len,"%d. %s^n", ++b, menuid == 1 ? g_primaryweapons[a][0]: g_secondaryweapons[a][0])
  1513. }
  1514.  
  1515. if(end != maxitem)
  1516. {
  1517. formatex(menubody[len], 511 - len, "^n9. %s^n0. %s", "More", pos ? "Back" : "Exit")
  1518. keys |= MENU_KEY_9
  1519. }
  1520. else
  1521. formatex(menubody[len], 511 - len, "^n0. %s", pos ? "Back" : "Exit")
  1522.  
  1523. show_menu(id, keys, menubody, -1, menuid == 1 ? "Primary" : "Secondary")
  1524. }
  1525.  
  1526. public action_prim(id, key)
  1527. {
  1528. if(!is_user_alive(id) || g_zombie[id])
  1529. return PLUGIN_HANDLED
  1530.  
  1531. switch(key)
  1532. {
  1533. case 8: display_weaponmenu(id, 1, ++g_menuposition[id])
  1534. case 9: display_weaponmenu(id, 1, --g_menuposition[id])
  1535. default:
  1536. {
  1537. g_player_weapons[id][0] = g_menuposition[id] * 8 + key
  1538. equipweapon(id, EQUIP_PRI)
  1539.  
  1540. display_weaponmenu(id, 2, g_menuposition[id] = 0)
  1541. }
  1542. }
  1543. return PLUGIN_HANDLED
  1544. }
  1545.  
  1546. public action_sec(id, key)
  1547. {
  1548. if(!is_user_alive(id) || g_zombie[id])
  1549. return PLUGIN_HANDLED
  1550.  
  1551. switch(key)
  1552. {
  1553. case 8: display_weaponmenu(id, 2, ++g_menuposition[id])
  1554. case 9: display_weaponmenu(id, 2, --g_menuposition[id])
  1555. default:
  1556. {
  1557. g_menufailsafe[id] = false
  1558. remove_task(TASKID_WEAPONSMENU + id)
  1559.  
  1560. g_player_weapons[id][1] = g_menuposition[id] * 8 + key
  1561. equipweapon(id, EQUIP_SEC)
  1562. equipweapon(id, EQUIP_GREN)
  1563. }
  1564. }
  1565. return PLUGIN_HANDLED
  1566. }
  1567.  
  1568.  
  1569. public set_human_stuff(id)
  1570. {
  1571. g_zombie[id] = 0
  1572. g_zombie_type[id] = 0
  1573.  
  1574. set_user_health(id, floatround(HUMAN_HEALTH))
  1575. set_user_armor(id, floatround(HUMAN_ARMOR))
  1576.  
  1577. if(equal(g_default_model[id], "NonModel")) // Don't Have Model
  1578. {
  1579. cs_get_user_model(id, g_default_model[id], 63)
  1580. } else {
  1581. cs_set_user_model(id, g_default_model[id])
  1582. }
  1583. }
  1584.  
  1585. public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
  1586. {
  1587. if(g_gamestart < 2)
  1588. return HAM_SUPERCEDE
  1589. if(!is_user_connected(victim) || !is_user_connected(attacker))
  1590. return HAM_IGNORED
  1591. if(cs_get_user_team(attacker) == cs_get_user_team(victim))
  1592. return HAM_SUPERCEDE
  1593. if(g_zombie[attacker] && get_user_weapon(attacker) == CSW_KNIFE)
  1594. {
  1595. SendDeathMsg(attacker, victim)
  1596. FixDeadAttrib(victim)
  1597.  
  1598. update_frags(attacker, 1)
  1599. update_deaths(victim, 1)
  1600.  
  1601. set_user_zombie(victim, ZOMBIE_TYPE_HOST)
  1602. } else if(g_zombie[victim] && !g_zombie[attacker]) {
  1603. set_pdata_float(victim, 108, 1.0, 50)
  1604.  
  1605. static Float:MyOrigin[3]
  1606. pev(attacker, pev_origin, MyOrigin)
  1607.  
  1608. hook_ent2(victim, MyOrigin, ZOMBIE_KNOCKBACK_POWER, 2)
  1609. }
  1610.  
  1611. return HAM_HANDLED
  1612. }
  1613.  
  1614. public update_frags(id, frag)
  1615. {
  1616. if(!is_user_connected(id))
  1617. return
  1618.  
  1619. set_pev(id, pev_frags, float(pev(id, pev_frags) + frag))
  1620.  
  1621. message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"))
  1622. write_byte(id) // id
  1623. write_short(pev(id, pev_frags)) // frags
  1624. write_short(cs_get_user_deaths(id)) // deaths
  1625. write_short(0) // class?
  1626. write_short(get_pdata_int(id, 114, 5)) // team
  1627. message_end()
  1628. }
  1629.  
  1630. public update_deaths(id, death)
  1631. {
  1632. if(!is_user_connected(id))
  1633. return
  1634.  
  1635. cs_set_user_deaths(id, cs_get_user_deaths(id) + death)
  1636.  
  1637. message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"))
  1638. write_byte(id) // id
  1639. write_short(pev(id, pev_frags)) // frags
  1640. write_short(cs_get_user_deaths(id)) // deaths
  1641. write_short(0) // class?
  1642. write_short(get_pdata_int(id, 114, 5)) // team
  1643. message_end()
  1644. }
  1645.  
  1646. public fw_Killed_Post(id)
  1647. {
  1648. g_isalive[id] = 0
  1649. check_win_con()
  1650. }
  1651.  
  1652. public fw_TouchWeapon(weapon, id)
  1653. {
  1654. // Not a player
  1655. if (!is_user_connected(id))
  1656. return HAM_IGNORED
  1657. if (g_zombie[id])
  1658. return HAM_SUPERCEDE
  1659.  
  1660. return HAM_IGNORED
  1661. }
  1662. // End of Ham
  1663.  
  1664. // ============================ STOCK =================================
  1665. stock get_player_num(team, alive)
  1666. {
  1667. static player_num
  1668. player_num = 0
  1669.  
  1670. for(new i = 0; i < get_maxplayers(); i++)
  1671. {
  1672. if(!is_user_connected(i))
  1673. continue
  1674. if(alive == AL_NOT)
  1675. {
  1676. if(is_user_alive(i))
  1677. continue
  1678. } else if(alive == AL_ALIVE) {
  1679. if(!is_user_alive(i))
  1680. continue
  1681. }
  1682.  
  1683. if(team == TEAM_ALL)
  1684. {
  1685. if(cs_get_user_team(i) == CS_TEAM_UNASSIGNED || cs_get_user_team(i) == CS_TEAM_SPECTATOR)
  1686. continue
  1687. } else if(team == TEAM_T) {
  1688. if(cs_get_user_team(i) != CS_TEAM_T)
  1689. continue
  1690. } else if(team == TEAM_CT) {
  1691. if(cs_get_user_team(i) != CS_TEAM_CT)
  1692. continue
  1693. }
  1694.  
  1695. player_num++
  1696. }
  1697.  
  1698. return player_num
  1699. }
  1700.  
  1701. stock get_random_player(team, alive)
  1702. {
  1703. static list_player[33], list_player_num
  1704. static total_player
  1705. total_player = get_player_num(team, alive)
  1706.  
  1707. for(new i = 0; i < total_player; i++)
  1708. list_player[i] = 0
  1709.  
  1710. list_player_num = 0
  1711.  
  1712. for(new i = 0; i < get_maxplayers(); i++)
  1713. {
  1714. if(!is_user_connected(i))
  1715. continue
  1716.  
  1717. if(alive == AL_NOT)
  1718. {
  1719. if(is_user_alive(i))
  1720. continue
  1721. } else if(alive == AL_ALIVE) {
  1722. if(!is_user_alive(i))
  1723. continue
  1724. }
  1725.  
  1726. if(team == TEAM_ALL)
  1727. {
  1728. if(cs_get_user_team(i) == CS_TEAM_UNASSIGNED || cs_get_user_team(i) == CS_TEAM_SPECTATOR)
  1729. continue
  1730. } else if(team == TEAM_T) {
  1731. if(cs_get_user_team(i) != CS_TEAM_T)
  1732. continue
  1733. } else if(team == TEAM_CT) {
  1734. if(cs_get_user_team(i) != CS_TEAM_CT)
  1735. continue
  1736. }
  1737.  
  1738. list_player[list_player_num] = i
  1739. list_player_num++
  1740. }
  1741.  
  1742. static random_player; random_player = 0
  1743. random_player = list_player[random_num(0, list_player_num - 1)]
  1744.  
  1745. return random_player
  1746. }
  1747.  
  1748. stock PlaySound(id, const sound[])
  1749. {
  1750. if(id == 0)
  1751. {
  1752. if (equal(sound[strlen(sound)-4], ".mp3"))
  1753. client_cmd(0, "mp3 play ^"sound/%s^"", sound)
  1754. else
  1755. client_cmd(0, "spk ^"%s^"", sound)
  1756. } else {
  1757. if(is_user_connected(id)&& g_isalive[id])
  1758. {
  1759. if (equal(sound[strlen(sound)-4], ".mp3"))
  1760. client_cmd(id, "mp3 play ^"sound/%s^"", sound)
  1761. else
  1762. client_cmd(id, "spk ^"%s^"", sound)
  1763. }
  1764. }
  1765. }
  1766.  
  1767. stock client_printc(index, const text[], any:...)
  1768. {
  1769. new szMsg[128];
  1770. vformat(szMsg, sizeof(szMsg) - 1, text, 3);
  1771.  
  1772. replace_all(szMsg, sizeof(szMsg) - 1, "!g", "^x04");
  1773. replace_all(szMsg, sizeof(szMsg) - 1, "!n", "^x01");
  1774. replace_all(szMsg, sizeof(szMsg) - 1, "!t", "^x03");
  1775.  
  1776. if(index == 0)
  1777. {
  1778. for(new i = 0; i < get_maxplayers(); i++)
  1779. {
  1780. if(g_isalive[i] && is_user_connected(i))
  1781. {
  1782. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, i);
  1783. write_byte(i);
  1784. write_string(szMsg);
  1785. message_end();
  1786. }
  1787. }
  1788. } else {
  1789. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, index);
  1790. write_byte(index);
  1791. write_string(szMsg);
  1792. message_end();
  1793. }
  1794. }
  1795.  
  1796. stock require_zombie()
  1797. {
  1798. switch(get_player_num(TEAM_CT, 1))
  1799. {
  1800. case 2..5: return 1
  1801. case 6..15: return 2
  1802. case 16..25: return 3
  1803. case 26..32: return 4
  1804. }
  1805.  
  1806. return 0
  1807. }
  1808.  
  1809. stock check_spawn(Float:Origin[3])
  1810. {
  1811. new Float:originE[3], Float:origin1[3], Float:origin2[3]
  1812. new ent = -1
  1813. while ((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "player")) != 0)
  1814. {
  1815. pev(ent, pev_origin, originE)
  1816.  
  1817. // xoy
  1818. origin1 = Origin
  1819. origin2 = originE
  1820. origin1[2] = origin2[2] = 0.0
  1821. if (vector_distance(origin1, origin2) <= 2 * 16.0)
  1822. {
  1823. // oz
  1824. origin1 = Origin
  1825. origin2 = originE
  1826. origin1[0] = origin2[0] = origin1[1] = origin2[1] = 0.0
  1827. if (vector_distance(origin1, origin2) <= 72.0) return 0;
  1828. }
  1829. }
  1830.  
  1831. return 1
  1832. }
  1833.  
  1834. // Drop primary/secondary weapons
  1835. stock drop_weapons(id, dropwhat)
  1836. {
  1837. // Get user weapons
  1838. static weapons[32], num, i, weaponid
  1839. num = 0 // reset passed weapons count (bugfix)
  1840. get_user_weapons(id, weapons, num)
  1841.  
  1842. // Weapon bitsums
  1843. 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)
  1844. const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
  1845.  
  1846. // Loop through them and drop primaries or secondaries
  1847. for (i = 0; i < num; i++)
  1848. {
  1849. // Prevent re-indexing the array
  1850. weaponid = weapons[i]
  1851.  
  1852. if ((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
  1853. {
  1854. // Get weapon entity
  1855. static wname[32], weapon_ent
  1856. get_weaponname(weaponid, wname, charsmax(wname))
  1857. weapon_ent = fm_find_ent_by_owner(-1, wname, id)
  1858.  
  1859. // Hack: store weapon bpammo on PEV_ADDITIONAL_AMMO
  1860. set_pev(weapon_ent, pev_iuser1, cs_get_user_bpammo(id, weaponid))
  1861.  
  1862. // Player drops the weapon and looses his bpammo
  1863. engclient_cmd(id, "drop", wname)
  1864. cs_set_user_bpammo(id, weaponid, 0)
  1865. }
  1866. }
  1867. }
  1868.  
  1869. stock BytesToReplace ( identifier[], const bytes[], const bytesLength = sizeof bytes )
  1870. {
  1871. new address;
  1872. OrpheuMemoryGet( identifier, address );
  1873.  
  1874. for ( new i; i < bytesLength; i++)
  1875. {
  1876. OrpheuMemorySetAtAddress( address, "roundTimeCheck|dummy", 1, bytes[ i ], address );
  1877. address++;
  1878. }
  1879.  
  1880. server_cmd( "sv_restart 1" );
  1881. }
  1882.  
  1883. stock bool:TerminateRound(team)
  1884. {
  1885. new winStatus;
  1886. new event;
  1887. new sound[64];
  1888.  
  1889. switch(team)
  1890. {
  1891. case TEAM_T:
  1892. {
  1893. winStatus = 2;
  1894. event = 9;
  1895. sound = escape_fail_sound
  1896. g_team_score[TEAM_T]++
  1897.  
  1898. client_print(0, print_center, "Sikertelen menekules")
  1899. }
  1900. case TEAM_CT:
  1901. {
  1902. winStatus = 1;
  1903. event = 8;
  1904. sound = escape_suc_sound
  1905. g_team_score[TEAM_CT]++
  1906.  
  1907. client_print(0, print_center, "Sikeres menekules")
  1908. }
  1909. case TEAM_ALL:
  1910. {
  1911. winStatus = 3;
  1912. event = 10;
  1913. sound = "radio/rounddraw.wav";
  1914.  
  1915. client_print(0, print_center, "Kor Draw")
  1916. }
  1917. case TEAM_START:
  1918. {
  1919. winStatus = 3;
  1920. event = 10;
  1921.  
  1922. client_print(0, print_center, "Kor Draw")
  1923. }
  1924. default:
  1925. {
  1926. return false;
  1927. }
  1928. }
  1929.  
  1930. g_endround = 1
  1931. EndRoundMessage(g_WinText[team], event)
  1932. RoundTerminating(winStatus, team == TEAM_START ? 3.0 : 5.0)
  1933. PlaySound(0, sound)
  1934.  
  1935. for(new i = 0; i < get_maxplayers(); i++)
  1936. {
  1937. if(!is_user_connected(i) || !is_user_alive(i))
  1938. continue
  1939. if(g_zombie[i])
  1940. {
  1941. update_deaths(i, 1)
  1942. } else {
  1943. update_frags(i, 3)
  1944. }
  1945. }
  1946.  
  1947. return true;
  1948. }
  1949.  
  1950. stock RoundTerminating( const winStatus, const Float:delay )
  1951. {
  1952. set_mp_pdata("m_iRoundWinStatus" , winStatus );
  1953. set_mp_pdata("m_fTeamCount" , get_gametime() + delay );
  1954. set_mp_pdata("m_bRoundTerminating", true );
  1955. }
  1956.  
  1957. stock EndRoundMessage( const message[], const event, const bool:notifyAllPlugins = false )
  1958. {
  1959. static OrpheuFunction:handleFuncEndRoundMessage;
  1960.  
  1961. if ( !handleFuncEndRoundMessage )
  1962. {
  1963. handleFuncEndRoundMessage = OrpheuGetFunction( "EndRoundMessage" );
  1964. }
  1965.  
  1966. ( notifyAllPlugins ) ?
  1967. OrpheuCallSuper( handleFuncEndRoundMessage, message, event ) :
  1968. OrpheuCall( handleFuncEndRoundMessage, message, event );
  1969. }
  1970.  
  1971. stock hook_ent2(ent, Float:VicOrigin[3], Float:speed, type)
  1972. {
  1973. static Float:fl_Velocity[3]
  1974. static Float:EntOrigin[3]
  1975.  
  1976. pev(ent, pev_origin, EntOrigin)
  1977. static Float:distance_f
  1978. distance_f = get_distance_f(EntOrigin, VicOrigin)
  1979.  
  1980. new Float:fl_Time = distance_f / speed
  1981.  
  1982. if(type == 1)
  1983. {
  1984. fl_Velocity[0] = ((VicOrigin[0] - EntOrigin[0]) / fl_Time) * 1.5
  1985. fl_Velocity[1] = ((VicOrigin[1] - EntOrigin[1]) / fl_Time) * 1.5
  1986. fl_Velocity[2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
  1987. } else if(type == 2) {
  1988. fl_Velocity[0] = ((EntOrigin[0] - VicOrigin[0]) / fl_Time) * 1.5
  1989. fl_Velocity[1] = ((EntOrigin[1] - VicOrigin[1]) / fl_Time) * 1.5
  1990. fl_Velocity[2] = (EntOrigin[2] - VicOrigin[2]) / fl_Time
  1991. }
  1992.  
  1993. entity_set_vector(ent, EV_VEC_velocity, fl_Velocity)
  1994. }
  1995.  
  1996. stock equipweapon(id, weapon)
  1997. {
  1998. if(!is_user_alive(id) || !is_user_connected(id))
  1999. return
  2000.  
  2001. static weaponid[2], weaponent
  2002.  
  2003. if(weapon & EQUIP_PRI)
  2004. {
  2005. weaponent = fm_lastprimary(id)
  2006. weaponid[1] = get_weaponid(g_primaryweapons[g_player_weapons[id][0]][1])
  2007.  
  2008. if(pev_valid(weaponent))
  2009. {
  2010. weaponid[0] = fm_get_weapon_id(weaponent)
  2011. if(weaponid[0] != weaponid[1])
  2012. fm_strip_user_gun(id, weaponid[0])
  2013. }
  2014. else
  2015. weaponid[0] = -1
  2016.  
  2017. if(weaponid[0] != weaponid[1])
  2018. fm_give_item(id, g_primaryweapons[g_player_weapons[id][0]][1])
  2019.  
  2020. cs_set_user_bpammo(id, weaponid[1], g_weapon_ammo[weaponid[1]][1])
  2021. }
  2022.  
  2023. if(weapon & EQUIP_SEC)
  2024. {
  2025. weaponent = fm_lastsecondry(id)
  2026. weaponid[1] = get_weaponid(g_secondaryweapons[g_player_weapons[id][1]][1])
  2027.  
  2028. if(pev_valid(weaponent))
  2029. {
  2030. weaponid[0] = fm_get_weapon_id(weaponent)
  2031. if(weaponid[0] != weaponid[1])
  2032. fm_strip_user_gun(id, weaponid[0])
  2033. }
  2034. else
  2035. weaponid[0] = -1
  2036.  
  2037. if(weaponid[0] != weaponid[1])
  2038. fm_give_item(id, g_secondaryweapons[g_player_weapons[id][1]][1])
  2039.  
  2040. cs_set_user_bpammo(id, weaponid[1], g_weapon_ammo[weaponid[1]][1])
  2041. }
  2042.  
  2043. if(weapon & EQUIP_GREN)
  2044. {
  2045. static i
  2046. for(i = 0; i < sizeof g_grenades; i++) if(!user_has_weapon(id, get_weaponid(g_grenades[i])))
  2047. fm_give_item(id, g_grenades[i])
  2048. }
  2049. }
  2050.  
  2051. // Fix Dead Attrib on scoreboard
  2052. FixDeadAttrib(id)
  2053. {
  2054. message_begin(MSG_BROADCAST, get_user_msgid("ScoreAttrib"))
  2055. write_byte(id) // id
  2056. write_byte(0) // attrib
  2057. message_end()
  2058. }
  2059.  
  2060. // Send Death Message for infections
  2061. SendDeathMsg(attacker, victim)
  2062. {
  2063. message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"))
  2064. write_byte(attacker) // killer
  2065. write_byte(victim) // victim
  2066. write_byte(1) // headshot flag
  2067. write_string("infection") // killer's weapon
  2068. message_end()
  2069. }
  2070.  

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Zombi Escape
HozzászólásElküldve: 2013.12.26. 17:34 
Offline
Tud valamit

Csatlakozott: 2011.07.05. 17:25
Hozzászólások: 135
Megköszönt másnak: 5 alkalommal
Megköszönték neki: 5 alkalommal
Ahogy rá nézek ez nem amxmodx plugin, inkább metamod, vagy tévednék?


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Zombi Escape
HozzászólásElküldve: 2013.12.26. 18:02 
Offline
Tiszteletbeli
Avatar

Csatlakozott: 2012.10.09. 13:48
Hozzászólások: 1439
Megköszönték neki: 174 alkalommal
norbexx_13 írta:
Ahogy rá nézek ez nem amxmodx plugin, inkább metamod, vagy tévednék?

Tévedsz...

_________________
Minden jót! :)


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