hlmod.hu

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



Jelenlévő felhasználók

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

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 6 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: ékezet+orpheu miatti fordítás
HozzászólásElküldve: 2015.06.02. 18:31 
Offline
Fanatikus
Avatar

Csatlakozott: 2014.10.31. 15:27
Hozzászólások: 185
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 7 alkalommal
Helló mindenki, van 2 gondom már a címben is benne van Az amxx studio nem fordítja le az #include <orpheu> miatt és hogy az egész pluginba beírni az ékezetet aki megcsinálja megy a gomb!
erre gondoltam:
SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. replace_all(msg, 190, "!g", "^4")
  3. replace_all(msg, 190, "!y", "^1")
  4. replace_all(msg, 190, "!t", "^3")
  5. replace_all(msg, 190, "á", "á")
  6. replace_all(msg, 190, "é", "Ă©")
  7.  

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

 

_________________
Soha ne mondd, hogy soha.

Tisztelettel: ΔƓҽƬƬ


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: ékezet+orpheu miatti fordítás
HozzászólásElküldve: 2015.06.02. 18:50 
Offline
Veterán
Avatar

Csatlakozott: 2011.06.07. 15:29
Hozzászólások: 1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
Letöltöd a ... telepíted, majd a .sma fájlt belehúzod a scripting mappába, és az inceket is beteszed. Csatolom a .inc fájlokat az orpheu -hoz.

Ékezetesítve van, UTF-8 ba elmentettem neked. Valami nem menne, írj.
Csatolmány:
ze.sma [46.2 KiB]
Letöltve 81 alkalommal.


INCLUDE(K):

Csatolmány:
include.rar [4.86 KiB]
Letöltve 73 alkalommal.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: ékezet+orpheu miatti fordítás
HozzászólásElküldve: 2015.06.02. 19:21 
Offline
Fanatikus
Avatar

Csatlakozott: 2014.10.31. 15:27
Hozzászólások: 185
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 7 alkalommal
Ezt írja
Kép

_________________
Soha ne mondd, hogy soha.

Tisztelettel: ΔƓҽƬƬ


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: ékezet+orpheu miatti fordítás
HozzászólásElküldve: 2015.06.02. 20:11 
Offline
Veterán
Avatar

Csatlakozott: 2011.06.07. 15:29
Hozzászólások: 1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
krisztian2 írta:
Ezt írja
Kép


Bent vannak az include mappában az orpheu .inc fájlok?

Ők köszönték meg oroszrulett nek ezt a hozzászólást: AsD# (2015.06.07. 19:53)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: ékezet+orpheu miatti fordítás
HozzászólásElküldve: 2015.06.02. 21:45 
Offline
Fanatikus
Avatar

Csatlakozott: 2014.10.31. 15:27
Hozzászólások: 185
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 7 alkalommal
Jah,Jah bent vannak

_________________
Soha ne mondd, hogy soha.

Tisztelettel: ΔƓҽƬƬ


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: ékezet+orpheu miatti fordítás
HozzászólásElküldve: 2015.06.03. 03:40 
Offline
Veterán
Avatar

Csatlakozott: 2011.06.07. 15:29
Hozzászólások: 1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
krisztian2 írta:
Jah,Jah bent vannak


Ma átnézem, csak hagy aludjak pls :D
Ezt a hszt fogom szerkeszteni, ne töröljétek offért :)

Ők köszönték meg oroszrulett nek ezt a hozzászólást: AsD# (2015.06.07. 19:53)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 6 hozzászólás ] 


Ki van itt

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