hlmod.hu
https://hlmod.hu/

Vampire hud átírás
https://hlmod.hu/viewtopic.php?f=10&t=4496
Oldal: 1 / 1

Szerző:  tson_ [2012.05.23. 16:14 ]
Hozzászólás témája:  Vampire hud átírás

Valaki ezt át tudná írni, hogy a hud szöveget a HP fölé jelezze ha öltünk?

Kód:
/*
*   http://games.qwerty.ru
*
*   AmxModX
*   Vampire plugin
*    by Shalfey
*
*   CVars
*   amx_vampire_hp - hp add for kill
*   amx_vampire_hp_hs - hp add for kill in head
*   amx_vampire_max_hp - max player hp
*
*   Players gets HP for kills.
*/
#include <amxmodx>
#include <fun>
 
#define PLUGIN_VERSION "1.0c"
 
new health_add
new health_hs_add
new health_max
 
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
 
public plugin_init()
{
   register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")
 
   health_add = register_cvar("amx_vampire_hp", "15")
   health_hs_add = register_cvar("amx_vampire_hp_hs", "40")
   health_max = register_cvar("amx_vampire_max_hp", "100")
 
   register_event("DeathMsg", "hook_death", "a", "1>0")    
}
 
public hook_death()
{
   // Killer id
   nKiller = read_data(1)
 
   if ( (read_data(3) == 1) && (read_data(5) == 0) )
   {
      nHp_add = get_pcvar_num (health_hs_add)
   }
   else
      nHp_add = get_pcvar_num (health_add)
 
   nHp_max = get_pcvar_num (health_max)
 
   // Updating Killer HP
   nKiller_hp = get_user_health(nKiller)
   nKiller_hp += nHp_add
 
   // Maximum HP check
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
 
   set_user_health(nKiller, nKiller_hp)
 
   // Hud message " +15/+40 hp"
   set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
   show_hudmessage(nKiller, " +%d hp", nHp_add)
 
   // Screen fading
   message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
   write_short(1<<10)
   write_short(1<<10)
   write_short(0x0000)
   write_byte(0)
   write_byte(0)
   write_byte(200)
   write_byte(75)
   message_end()
 
}
 

Szerző:  oroszrulett [2012.05.23. 16:15 ]
Hozzászólás témája:  Re: Vampire hud átírás

Kód:
  1. /*


  2. *

  3. *   AmxModX

  4. *   Vampire plugin

  5. *    by Shalfey

  6. *

  7. *   CVars

  8. *   amx_vampire_hp - hp add for kill

  9. *   amx_vampire_hp_hs - hp add for kill in head

  10. *   amx_vampire_max_hp - max player hp

  11. *

  12. *   Players gets HP for kills.

  13. */

  14. #include <amxmodx>

  15. #include <fun>

  16.  

  17. #define PLUGIN_VERSION "1.0c"

  18.  

  19. new health_add

  20. new health_hs_add

  21. new health_max

  22.  

  23. new nKiller

  24. new nKiller_hp

  25. new nHp_add

  26. new nHp_max

  27.  

  28. public plugin_init()

  29. {

  30.    register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")

  31.  

  32.    health_add = register_cvar("amx_vampire_hp", "15")

  33.    health_hs_add = register_cvar("amx_vampire_hp_hs", "40")

  34.    health_max = register_cvar("amx_vampire_max_hp", "100")

  35.  

  36.    register_event("DeathMsg", "hook_death", "a", "1>0")    

  37. }

  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.  

  51.    nHp_max = get_pcvar_num (health_max)

  52.  

  53.    // Updating Killer HP

  54.    nKiller_hp = get_user_health(nKiller)

  55.    nKiller_hp += nHp_add

  56.  

  57.    // Maximum HP check

  58.    if (nKiller_hp > nHp_max) nKiller_hp = nHp_max

  59.  

  60.    set_user_health(nKiller, nKiller_hp)

  61.  

  62.    // Hud message " +15/+40 hp"

  63.    set_hudmessage(0, 255, 0, 0.0, 0.88, 0, 1.0, 1.0, 0.1, 0.1, -1)

  64.    show_hudmessage(nKiller, " +%d hp", nHp_add)

  65.  

  66.    // Screen fading

  67.    message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)

  68.    write_short(1<<10)

  69.    write_short(1<<10)

  70.    write_short(0x0000)

  71.    write_byte(0)

  72.    write_byte(0)

  73.    write_byte(200)

  74.    write_byte(75)

  75.    message_end()

  76.  

  77. }

  78.  

Szerző:  tson_ [2012.05.23. 16:17 ]
Hozzászólás témája:  Re: Vampire hud átírás

kösz ;)

Szerző:  oroszrulett [2012.05.23. 16:20 ]
Hozzászólás témája:  Re: Vampire hud átírás

Szívesen.

Amúgy AMXX Studio-ban:

Generators --> Hudmessage Generator : Ott beállítod a kis képen, hogy hova szeretnéd az üzenetet, lemented magadnak az X, és Y koordinátákat, és azokat behelyettesíted a 4-5 érték helyére a show_hudmessage funkcióban.

Szerző:  tson_ [2012.06.04. 18:49 ]
Hozzászólás témája:  Re: Vampire hud átírás

A hud (vagy dhud nemtom miben különbözik) szövegét hogy lehetne kicsit nagyítani ?

Szerző:  CeDee [2012.06.04. 21:04 ]
Hozzászólás témája:  Re: Vampire hud átírás

a dhud nagyobb felbontason ugyan akkara marad a sima hud hoz képest nagy lesz

Szerző:  oroszrulett [2012.06.06. 19:19 ]
Hozzászólás témája:  Re: Vampire hud átírás

Idézet:
A hud (vagy dhud nemtom miben különbözik) szövegét hogy lehetne kicsit nagyítani ?


Sehogy.
Különbség:
A HUD 800x600-as felbontásban hatalmas, a fél képernyőt elfoglalja, míg a DHUD ugyanakkora felbontásban kicsi. Nagyobban pedig nagyobb, mint az ugyanakkora felbontásban lévő sima HUD üzenet.

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