hlmod.hu
https://hlmod.hu/

HITplace
https://hlmod.hu/viewtopic.php?f=10&t=13699
Oldal: 1 / 1

Szerző:  HTML [ 2014.01.06. 05:07 ]
Hozzászólás témája:  HITplace

Hello,valaki átirná,mert mindig round végekor nullázódik,úgy kellene,hogy ha meghalsz,akkor megint nulláról induljon a számláló.
MERT:ha egy 4 perces round-ban kapsz pl:2 fejlövést és meghalsz DM-ben,újraéledsz,és kapsz pl:megint 3 fejlövést,akkor már 5-öt fog irni,HA VALAMI NEM VILÁGOS,kérdezz!

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <csx>
  3.  
  4. #define PLUGIN "Death HitPlace Details"
  5. #define VERSION "1.0"
  6. #define AUTHOR "Alka"
  7.  
  8. new
  9. head_hit[32],
  10. chest_hit[32],
  11. leftarm_hit[32],
  12. rightarm_hit[32],
  13. leftleg_hit[32],
  14. rightleg_hit[32],
  15. stomach_hit[32],
  16. total_hits[32];
  17.  
  18. new toggle_plugin;
  19.  
  20. public plugin_init() {
  21.  
  22. register_plugin(PLUGIN, VERSION, AUTHOR)
  23.  
  24. register_logevent("round_start", 2, "1=Round_Start")
  25.  
  26. toggle_plugin = register_cvar("amx_showhitplace","1")
  27. }
  28.  
  29. public client_damage(attacker,victim,damage,weapon,hitplace,ta)
  30. {
  31. if(!get_pcvar_num(toggle_plugin))
  32. return 1;
  33.  
  34. if(hitplace == HIT_HEAD || hitplace == HIT_CHEST || hitplace == HIT_STOMACH || hitplace == HIT_LEFTARM || hitplace == HIT_RIGHTARM || hitplace == HIT_LEFTLEG || hitplace == HIT_RIGHTLEG)
  35. total_hits[victim] ++
  36.  
  37. if(hitplace == HIT_HEAD)
  38. head_hit[victim] ++
  39.  
  40. else if(hitplace == HIT_CHEST)
  41. chest_hit[victim] ++
  42.  
  43. else if(hitplace == HIT_STOMACH)
  44. stomach_hit[victim] ++
  45.  
  46. else if(hitplace == HIT_LEFTARM)
  47. leftarm_hit[victim] ++
  48.  
  49. else if(hitplace == HIT_RIGHTARM)
  50. rightarm_hit[victim] ++
  51.  
  52. else if(hitplace == HIT_LEFTLEG)
  53. leftleg_hit[victim] ++
  54.  
  55. else if(hitplace == HIT_RIGHTLEG)
  56. rightleg_hit[victim] ++
  57.  
  58. return 0;
  59. }
  60.  
  61. public client_death(killer,victim,weapon,hitplace,tk)
  62. {
  63. if(!get_pcvar_num(toggle_plugin))
  64. return 1;
  65.  
  66. set_hudmessage(0, 255, 255, -1.0, -0.49, 0, 2.0, 5.0, 0.1, 0.1, -1)
  67. show_hudmessage(victim, "(%d)^n--%d--[%d]--%d--^n[%d]^n%d %d^n_/ \_",head_hit[victim],leftarm_hit[victim],chest_hit[victim],rightarm_hit[victim],stomach_hit[victim],leftleg_hit[victim],rightleg_hit[victim])
  68.  
  69. set_hudmessage(255, 25, 0, 0.45, 0.51, 0, 2.0, 5.0, 0.1, 0.1, -1)
  70. show_hudmessage(victim,"Total Hits: %d",total_hits[victim])
  71.  
  72. return 1;
  73. }
  74.  
  75. public round_start()
  76. {
  77. if(!get_pcvar_num(toggle_plugin))
  78. return 1;
  79.  
  80. new players[32], num
  81. get_players(players, num)
  82.  
  83. new player
  84. for(new i = 0; i < num; i++)
  85. {
  86. player = players[i]
  87.  
  88. head_hit[player] = 0
  89. chest_hit[player] = 0
  90. stomach_hit[player] = 0
  91. leftarm_hit[player] = 0
  92. rightarm_hit[player] = 0
  93. leftleg_hit[player] = 0
  94. rightleg_hit[player] = 0
  95.  
  96. total_hits[player] = 0
  97. }
  98. return 1;
  99. }
  100.  

Szerző:  HuBaBuBa [ 2014.01.06. 13:44 ]
Hozzászólás témája:  Re: HITplace

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <csx>
  3. #include <hamsandwich>
  4.  
  5. #define PLUGIN "Death HitPlace Details"
  6. #define VERSION "1.0"
  7. #define AUTHOR "Alka"
  8.  
  9. new
  10. head_hit[32],
  11. chest_hit[32],
  12. leftarm_hit[32],
  13. rightarm_hit[32],
  14. leftleg_hit[32],
  15. rightleg_hit[32],
  16. stomach_hit[32],
  17. total_hits[32];
  18.  
  19. new toggle_plugin;
  20.  
  21. public plugin_init() {
  22.  
  23. register_plugin(PLUGIN, VERSION, AUTHOR)
  24.  
  25. RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
  26.  
  27. toggle_plugin = register_cvar("amx_showhitplace","1")
  28. }
  29.  
  30. public client_damage(attacker,victim,damage,weapon,hitplace,ta)
  31. {
  32. if(!get_pcvar_num(toggle_plugin))
  33. return 1;
  34.  
  35. if(hitplace == HIT_HEAD || hitplace == HIT_CHEST || hitplace == HIT_STOMACH || hitplace == HIT_LEFTARM || hitplace == HIT_RIGHTARM || hitplace == HIT_LEFTLEG || hitplace == HIT_RIGHTLEG)
  36. total_hits[victim] ++
  37.  
  38. if(hitplace == HIT_HEAD)
  39. head_hit[victim] ++
  40.  
  41. else if(hitplace == HIT_CHEST)
  42. chest_hit[victim] ++
  43.  
  44. else if(hitplace == HIT_STOMACH)
  45. stomach_hit[victim] ++
  46.  
  47. else if(hitplace == HIT_LEFTARM)
  48. leftarm_hit[victim] ++
  49.  
  50. else if(hitplace == HIT_RIGHTARM)
  51. rightarm_hit[victim] ++
  52.  
  53. else if(hitplace == HIT_LEFTLEG)
  54. leftleg_hit[victim] ++
  55.  
  56. else if(hitplace == HIT_RIGHTLEG)
  57. rightleg_hit[victim] ++
  58.  
  59. return 0;
  60. }
  61.  
  62. public client_death(killer,victim,weapon,hitplace,tk)
  63. {
  64. if(!get_pcvar_num(toggle_plugin))
  65. return 1;
  66.  
  67. set_hudmessage(0, 255, 255, -1.0, -0.49, 0, 2.0, 5.0, 0.1, 0.1, -1)
  68. show_hudmessage(victim, "(%d)^n--%d--[%d]--%d--^n[%d]^n%d %d^n_/ \_",head_hit[victim],leftarm_hit[victim],chest_hit[victim],rightarm_hit[victim],stomach_hit[victim],leftleg_hit[victim],rightleg_hit[victim])
  69.  
  70. set_hudmessage(255, 25, 0, 0.45, 0.51, 0, 2.0, 5.0, 0.1, 0.1, -1)
  71. show_hudmessage(victim,"Total Hits: %d",total_hits[victim])
  72.  
  73. return 1;
  74. }
  75.  
  76. public Player_Spawn(id)
  77. {
  78. if(!get_pcvar_num(toggle_plugin))
  79. return 1;
  80.  
  81. head_hit[id] = 0
  82. chest_hit[id] = 0
  83. stomach_hit[id] = 0
  84. leftarm_hit[id] = 0
  85. rightarm_hit[id] = 0
  86. leftleg_hit[id] = 0
  87. rightleg_hit[id] = 0
  88.  
  89. total_hits[id] = 0
  90.  
  91. return 1;
  92. }
  93.  

Szerző:  kiki [ 2014.01.06. 14:11 ]
Hozzászólás témája:  Re: HITplace

Hubabuba, csalódtam benned ):

Ugye a szerveren folyamatos respawn van.

TFH: Van 10jatekos fent, 5ct, 5t. A ctk megolnek egy terrort, a terror ujra eled, es mindenkinek resetelodik a cuccja. Mi az értelme?:)

Megold: A hasznalt fuggveny alapbol rendelkezik id parameterrel, igy a ciklust kiszedheted, s idjet kell csak resetelni.

Szerző:  HuBaBuBa [ 2014.01.06. 14:35 ]
Hozzászólás témája:  Re: HITplace

[profil]kiki[/profil] :cry: :cry: :cry:

Javítva! (azt hiszem :o )

Szerző:  HTML [ 2014.01.06. 15:07 ]
Hozzászólás témája:  Re: HITplace

HuBaBuBa írta:
[profil]kiki[/profil] :cry: :cry: :cry:

Javítva! (azt hiszem :o )


A hit nekem itt nem elég :D De azért check-olom!

Szerző:  HTML [ 2014.01.06. 16:41 ]
Hozzászólás témája:  Re: HITplace

Nem jó!Nem ir ki egyáltalán semmit,a plugin fut,de nem irja ki HUDban a képernyőre,eddig ment és nincs sok HUD a képernyőn!Néha megjelenik,h total hit mennyi,de felette nem,hogy hova kapta

REPAIR!

Szerző:  kiki [ 2014.01.06. 17:04 ]
Hozzászólás témája:  Re: HITplace

Az ifbe a felső returnt töröld, mert igy nem fut le az alatta lévő rész. A spawn eventről beszélgetünk.

Szerző:  HuBaBuBa [ 2014.01.06. 17:35 ]
Hozzászólás témája:  Re: HITplace

Lefut az alatta lévő rész és nálam megjelenít mindent rendesen hud-ban.

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