hlmod.hu
https://hlmod.hu/

Életadás
https://hlmod.hu/viewtopic.php?f=29&t=21378
Oldal: 1 / 1

Szerző:  johnny [ 2015.07.06. 15:53 ]
Hozzászólás témája:  Életadás

Hali, ezt a plugin nekem valaki át írná úgy h ne csak az adminok részesüljenek, köszi!
Ja, és szerintem ez az eggyetlen plugin (ÉLETADÓ) ami működik, a fórum listái között! (TEST MEGVOLT)
És, ha találtok benne hibát, javítsátok mát.. :) KÖSZI!

SMA Forráskód: [ Mindet kijelol ]
  1. #define DAMAGE_RECIEVED
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7. static const COLOR[] = "^x04" //green
  8. static const CONTACT[] = ""
  9. new maxplayers
  10. new gmsgSayText
  11. new mpd, mkb, mhb
  12. new g_MsgSync
  13. new health_add
  14. new health_hs_add
  15. new health_max
  16. new nKiller
  17. new nKiller_hp
  18. new nHp_add
  19. new nHp_max
  20. new g_menu_active
  21. new bool:HasC4[33]
  22. #define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
  23. #if defined DAMAGE_RECIEVED
  24. new g_MsgSync2
  25. #endif
  26.  
  27. public plugin_init()
  28. {
  29. register_plugin("kill_healed", "1.0", "Dev!l")
  30. health_add = register_cvar("hp", "10")
  31. health_hs_add = register_cvar("hp_hs", "10")
  32. health_max = register_cvar("max_hp", "100")
  33. register_event("DeathMsg","death_msg","a")
  34. maxplayers = get_maxplayers()
  35. gmsgSayText = get_user_msgid("SayText")
  36. register_event("DeathMsg", "hook_death", "a", "1>0")
  37. g_MsgSync = CreateHudSyncObj()
  38. #if defined DAMAGE_RECIEVED
  39. g_MsgSync2 = CreateHudSyncObj()
  40. #endif
  41. }
  42. public death_msg()
  43. {
  44. if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
  45. }
  46. public hook_death()
  47. {
  48. // Killer id
  49. nKiller = read_data(1)
  50.  
  51. if ( (read_data(3) == 1) && (read_data(5) == 0) )
  52. {
  53. nHp_add = get_pcvar_num (health_hs_add)
  54. }
  55. else
  56. nHp_add = get_pcvar_num (health_add)
  57. nHp_max = get_pcvar_num (health_max)
  58. // Updating Killer HP
  59. if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
  60. return;
  61.  
  62. nKiller_hp = get_user_health(nKiller)
  63. nKiller_hp += nHp_add
  64. // Maximum HP check
  65. if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
  66. set_user_health(nKiller, nKiller_hp)
  67. // Hud message "Healed +15/+30 hp"
  68. set_hudmessage(255, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  69. show_hudmessage(nKiller, "Elet +%d hp", nHp_add)
  70. // Screen fading
  71. message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
  72. write_short(1<<10)
  73. write_short(1<<10)
  74. write_short(0x0000)
  75. write_byte(0)
  76. write_byte(0)
  77. write_byte(200)
  78. write_byte(75)
  79. message_end()
  80.  
  81. }
  82.  
  83.  
  84.  

 
 

Szerző:  SmaCk [ 2015.07.06. 16:24 ]
Hozzászólás témája:  Re: Életadás

Done.
SMA Forráskód: [ Mindet kijelol ]
  1. #define DAMAGE_RECIEVED
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7. static const COLOR[] = "^x04" //green
  8. static const CONTACT[] = ""
  9. new maxplayers
  10. new gmsgSayText
  11. new mpd, mkb, mhb
  12. new g_MsgSync
  13. new health_add
  14. new health_hs_add
  15. new health_max
  16. new nKiller
  17. new nKiller_hp
  18. new nHp_add
  19. new nHp_max
  20. new g_menu_active
  21. new bool:HasC4[33]
  22. #define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
  23. #if defined DAMAGE_RECIEVED
  24. new g_MsgSync2
  25. #endif
  26.  
  27. public plugin_init()
  28. {
  29. register_plugin("kill_healed", "1.0", "Dev!l")
  30. health_add = register_cvar("hp", "10")
  31. health_hs_add = register_cvar("hp_hs", "10")
  32. health_max = register_cvar("max_hp", "100")
  33. register_event("DeathMsg","death_msg","a")
  34. maxplayers = get_maxplayers()
  35. gmsgSayText = get_user_msgid("SayText")
  36. register_event("DeathMsg", "hook_death", "a", "1>0")
  37. g_MsgSync = CreateHudSyncObj()
  38. #if defined DAMAGE_RECIEVED
  39. g_MsgSync2 = CreateHudSyncObj()
  40. #endif
  41. }
  42. public death_msg()
  43. {
  44. if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
  45. }
  46. public hook_death()
  47. {
  48. // Killer id
  49. nKiller = read_data(1)
  50.  
  51. if ( (read_data(3) == 1) && (read_data(5) == 0) )
  52. {
  53. nHp_add = get_pcvar_num (health_hs_add)
  54. }
  55. else
  56. nHp_add = get_pcvar_num (health_add)
  57. nHp_max = get_pcvar_num (health_max)
  58. // Updating Killer HP
  59. return;
  60.  
  61. nKiller_hp = get_user_health(nKiller)
  62. nKiller_hp += nHp_add
  63. // Maximum HP check
  64. if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
  65. set_user_health(nKiller, nKiller_hp)
  66. // Hud message "Healed +15/+30 hp"
  67. set_hudmessage(255, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  68. show_hudmessage(nKiller, "Elet +%d hp", nHp_add)
  69. // Screen fading
  70. message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
  71. write_short(1<<10)
  72. write_short(1<<10)
  73. write_short(0x0000)
  74. write_byte(0)
  75. write_byte(0)
  76. write_byte(200)
  77. write_byte(75)
  78. message_end()
  79.  
  80. }
  81.  
  82.  
  83.  

Szerző:  DecToR [ 2015.07.06. 16:50 ]
Hozzászólás témája:  Re: Életadás

Hibák javítva, és így mindenki számára elérhető az életadó!

SMA Forráskód: [ Mindet kijelol ]
  1. #define DAMAGE_RECIEVED
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7.  
  8. new maxplayers
  9. new mkb
  10. new health_add
  11. new health_hs_add
  12. new health_max
  13. new nKiller
  14. new nKiller_hp
  15. new nHp_add
  16. new nHp_max
  17. #define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
  18. #if defined DAMAGE_RECIEVED
  19.  
  20. #endif
  21.  
  22. public plugin_init()
  23. {
  24. register_plugin("kill_healed", "1.0", "Dev!l")
  25. health_add = register_cvar("hp", "15")
  26. health_hs_add = register_cvar("hp_hs", "20")
  27. health_max = register_cvar("max_hp", "100")
  28. register_event("DeathMsg","death_msg","a")
  29. maxplayers = get_maxplayers()
  30. register_event("DeathMsg", "hook_death", "a", "1>0")
  31.  
  32.  
  33.  
  34. }
  35. public death_msg()
  36. {
  37. if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
  38. }
  39. public hook_death()
  40. {
  41. // Killer id
  42. nKiller = read_data(1)
  43.  
  44. if ( (read_data(3) == 1) && (read_data(5) == 0) )
  45. {
  46. nHp_add = get_pcvar_num (health_hs_add)
  47. }
  48. else
  49. nHp_add = get_pcvar_num (health_add)
  50. nHp_max = get_pcvar_num (health_max)
  51. // Updating Killer HP
  52. return;
  53.  
  54. nKiller_hp = get_user_health(nKiller)
  55. nKiller_hp += nHp_add
  56. // Maximum HP check
  57. if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
  58. set_user_health(nKiller, nKiller_hp)
  59. // Hud message "Healed +15/+30 hp"
  60. set_hudmessage(255, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  61. show_hudmessage(nKiller, "Elet +%d hp", nHp_add)
  62. // Screen fading
  63. message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
  64. write_short(1<<10)
  65. write_short(1<<10)
  66. write_short(0x0000)
  67. write_byte(0)
  68. write_byte(0)
  69. write_byte(200)
  70. write_byte(75)
  71. message_end()
  72.  
  73. }
  74.  

Szerző:  SmaCk [ 2015.07.06. 20:33 ]
Hozzászólás témája:  Re: Életadás

Dector ugyanazt csináltam ;)

Szerző:  DecToR [ 2015.07.06. 20:41 ]
Hozzászólás témája:  Re: Életadás

SmaCk írta:
Dector ugyanazt csináltam ;)


majdnem csak hogy a tied tiszta hibás ;)


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Unreachable code on line 61
Warning: Symbol is never used: "COLOR" on line 83
Warning: Symbol is never used: "CONTACT" on line 83
Warning: Symbol is never used: "HasC4" on line 83
Warning: Symbol is assigned a value that is never used: "g_MsgSync" on line 83
Warning: Symbol is assigned a value that is never used: "g_MsgSync2" on line 83
Warning: Symbol is never used: "g_menu_active" on line 83
Warning: Symbol is assigned a value that is never used: "gmsgSayText" on line 83
Warning: Symbol is never used: "mhb" on line 83
Warning: Symbol is never used: "mpd" on line 83
Header size: 608 bytes
Code size: 2024 bytes
Data size: 568 bytes
Stack/heap size: 16384 bytes; estimated max. usage=778 cells (3112 bytes)
Total requirements: 19584 bytes

10 Warnings.
Done.

Szerző:  SmaCk [ 2015.07.06. 21:11 ]
Hozzászólás témája:  Re: Életadás

Nálam lefordult, és tökéletesen ment..:)

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