hlmod.hu
https://hlmod.hu/

Hang hozzá rendelés modelhez.
https://hlmod.hu/viewtopic.php?f=10&t=13224
Oldal: 1 / 1

Szerző:  NiGGeR-BorZ [2013.12.14. 02:44 ]
Hozzászólás témája:  Hang hozzá rendelés modelhez.

Azt szeretném megkérdezni , hogy ha már pl: új kés model van benn , és ahhoz jártak soundok is , akkor soundokat hogy tudom hozzárendelni?
Itt egy példa sma:
[ KB így nézz ki , nem akartam részletezni , mert nem ezt akarom, ]
SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <engine>
  6.  
  7.  
  8. new bool:g_kes[33] = false
  9.  
  10. public plugin_init() {
  11. register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  12.  
  13. }
  14. public plugin_precache()
  15. {
  16. precache_model("models/knife/v_kesnew.mdl")
  17. precache_model("models/knife/p_kesnew.mdl")
  18. }
  19.  
  20. public Event_CurWeapon(id)
  21. {
  22. new weapon = get_user_weapon(id)
  23. new vModel[56],pModel[56]
  24. if(weapon == CSW_KNIFE && g_kes[id])
  25. {
  26. format(vModel,55,"models/knife/v_kesnew.mdl")
  27. format(pModel,55,"models/knife/p_kesnew.mdl")
  28. }
  29. entity_set_string(id, EV_SZ_viewmodel, vModel)
  30. entity_set_string(id, EV_SZ_weaponmodel, pModel)
  31. }


Na és nekem ehez a sound hangok is kellenek , hogy rendelhetem hozzá?
példa: Hozzájárt 7 hang.Hogy tudom beleírni? (ütés,stb).

Szerző:  kiki [2013.12.14. 10:47 ]
Hozzászólás témája:  Re: Hang hozzá rendelés modelhez.

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fakemeta>
  3.  
  4. #define MAX_KNIFE_SNDS 9
  5.  
  6. public plugin_init()
  7. {
  8. register_plugin("Custom knife sounds" , "0.1" , "v3x");
  9. register_forward(FM_EmitSound , "EmitSound");
  10. }
  11.  
  12. // Original knife sounds
  13. new knife_sounds_o[MAX_KNIFE_SNDS][] =
  14. {
  15. "weapons/knife_deploy1.wav",
  16. "weapons/knife_hit1.wav",
  17. "weapons/knife_hit2.wav",
  18. "weapons/knife_hit3.wav",
  19. "weapons/knife_hit4.wav",
  20. "weapons/knife_hitwall1.wav",
  21. "weapons/knife_slash1.wav",
  22. "weapons/knife_slash2.wav",
  23. "weapons/knife_stab.wav"
  24. }
  25.  
  26. // Replacement knife sounds ( edit these!! )
  27. new knife_sounds_r[MAX_KNIFE_SNDS][] =
  28. {
  29. "GHW/weapons/knife_deploy1.wav",
  30. "GHW/weapons/knife_hit1.wav",
  31. "GHW/weapons/knife_hit2.wav",
  32. "GHW/weapons/knife_hit3.wav",
  33. "GHW/weapons/knife_hit4.wav",
  34. "GHW/weapons/knife_hitwall1.wav",
  35. "GHW/weapons/knife_slash1.wav",
  36. "GHW/weapons/knife_slash2.wav",
  37. "GHW/weapons/knife_stab.wav"
  38. }
  39.  
  40. public plugin_precache()
  41. {
  42. for(new i = 0; i < MAX_KNIFE_SNDS; i++)
  43. precache_sound(knife_sounds_r[i]);
  44. }
  45.  
  46. public EmitSound(entity, channel, const sound[])
  47. {
  48. if(pev_valid(entity) && is_user_alive(entity))
  49. {
  50. for(new i = 0; i < MAX_KNIFE_SNDS; i++)
  51. {
  52. if(equal(sound , knife_sounds_o[i]))
  53. {
  54. emit_sound(entity, channel, knife_sounds_r[i], 1.0, ATTN_NORM, 0, PITCH_NORM);
  55. return FMRES_SUPERCEDE;
  56. }
  57. }
  58. }
  59. return FMRES_IGNORED;
  60. }

Szerző:  NiGGeR-BorZ [2013.12.14. 13:42 ]
Hozzászólás témája:  Re: Hang hozzá rendelés modelhez.

Ki próbálom csak szerzek egy kést :)

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/