hlmod.hu
https://hlmod.hu/

HP
https://hlmod.hu/viewtopic.php?f=9&t=21344
Oldal: 1 / 1

Szerző:  apple [ 2015.07.03. 21:48 ]
Hozzászólás témája:  HP

#include <amxmodx>
#include <amxmisc>
#include <fun>

public plugin_init()
{
register_plugin("Kill Bonus", "1.0", "Kensai")
register_cvar("amx_kill_bonus", "5")
register_cvar("amx_kb_limit", "130")
register_event("DeathMsg", "hp_up", "be")
}

public hp_up(id)
{
new attacker = read_data(1)
new health = get_user_health(attacker)
new nhealth = get_cvar_num("amx_kill_bonus")
new limit = get_cvar_num("amx_kb_limit")

if(health < limit)
{
set_user_health(attacker, health + nhealth)
}
if(health > limit)
{
set_user_health(attacker, limit)
}
}

Sziasztok valaki bele írná mikor meg ölöm az adott embert és kapot +5 életet akkor ki írja hudba hogy kaptál +5 életet?

Szerző:  Charlie224 [ 2015.07.04. 11:38 ]
Hozzászólás témája:  Re: HP

A forráskódot máskor tedd bele 'SMA Forráskód'-ba . Megkönyítenéd a munkát :)

Szerző:  NuD[!]e [ 2015.07.04. 11:41 ]
Hozzászólás témája:  Re: HP

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fun>
  4.  
  5. public plugin_init()
  6. {
  7. register_plugin("Kill Bonus", "1.0", "Kensai")
  8. register_cvar("amx_kill_bonus", "5")
  9. register_cvar("amx_kb_limit", "130")
  10. register_event("DeathMsg", "hp_up", "be")
  11. }
  12.  
  13. public hp_up(id)
  14. {
  15. new attacker = read_data(1)
  16. new health = get_user_health(attacker)
  17. new nhealth = get_cvar_num("amx_kill_bonus")
  18. new limit = get_cvar_num("amx_kb_limit")
  19.  
  20. if(health < limit)
  21. {
  22. set_user_health(attacker, health + nhealth)
  23. set_hudmessage(255, 255, 255, 0.35, 0.05, 0, 6.0, 12.0)
  24. show_hudmessage(attacker, "Kaptál +%d HPt!", nhealth)
  25.  
  26. }
  27. if(health > limit)
  28. {
  29. set_user_health(attacker, limit)
  30. set_hudmessage(255, 255, 255, 0.35, 0.05, 0, 6.0, 12.0)
  31. show_hudmessage(attacker, "HP: %d", health)
  32. }
  33. }

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