hlmod.hu
https://hlmod.hu/

Csak halott lássa
https://hlmod.hu/viewtopic.php?f=10&t=18952
Oldal: 1 / 2

Szerző:  Fantom [2015.01.14. 13:58 ]
Hozzászólás témája:  Csak halott lássa

Valaki ezt nekem átírná hogy csak halott lássa?
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <cstrike>
  3.  
  4. #define PLUGIN "Frags CT of TE"
  5. #define VERSION "1.0"
  6. #define AUTHOR "pixxa112"
  7.  
  8. new ctfrags = 0
  9. new tfrags = 0
  10.  
  11. public plugin_init() {
  12.  
  13. register_plugin(PLUGIN, VERSION, AUTHOR)
  14. register_event("DeathMsg", "halal", "a");
  15. register_logevent("round_first", 2, "0=World triggered", "1&Restart_Round_")
  16. register_logevent("round_first", 2, "0=World triggered", "1=Game_Commencing")
  17.  
  18. set_task(5.0, "hud")
  19. }
  20.  
  21. public round_first()
  22.  
  23. ctfrags = 0, tfrags = 0
  24.  
  25. public halal()
  26. {
  27. static killer
  28. killer = read_data(1);
  29. if(get_user_team(killer) == 2)
  30. ctfrags++
  31. if(get_user_team(killer) == 1)
  32. tfrags++
  33.  
  34. return PLUGIN_CONTINUE
  35.  
  36. }
  37.  
  38. public hud()
  39. {
  40.  
  41. set_hudmessage(random(255),random(255), random(255), 0.0, 0.6, 0, 0.6, 5.0)
  42. show_hudmessage(0,"Frags of CT: %d^nFrags of TE: %d",ctfrags, tfrags)
  43.  
  44. set_task(5.0, "hud")
  45. }

Szerző:  NuD[!]e [2015.01.14. 14:16 ]
Hozzászólás témája:  Re: Csak halott lássa

a függvény alá (hud) oda írod hogy: if(!is_user_alive(id)){

Szerző:  Fantom [2015.01.14. 14:23 ]
Hozzászólás témája:  Re: Csak halott lássa

NuD[!]e írta:
a függvény alá (hud) oda írod hogy: if(!is_user_alive(id)){


Már próbáltam azzal több féle képen!

Szerző:  NuD[!]e [2015.01.14. 14:34 ]
Hozzászólás témája:  Re: Csak halott lássa

Mármint?:)

SMA Forráskód: [ Mindet kijelol ]
  1. public hud()
  2. {
  3. if(!is_user_alive(id)) return PLUGIN_HANDLED
  4.  
  5. set_hudmessage(random(255),random(255), random(255), 0.0, 0.6, 0, 0.6, 5.0)
  6. show_hudmessage(0,"Frags of CT: %d^nFrags of TE: %d",ctfrags, tfrags)
  7.  
  8. set_task(5.0, "hud")
  9. }

Szerző:  Fantom [2015.01.14. 14:45 ]
Hozzászólás témája:  Re: Csak halott lássa

NuD[!]e írta:
Mármint?:)

SMA Forráskód: [ Mindet kijelol ]public hud()
{
if(!is_user_alive(id)) return PLUGIN_HANDLED
 
set_hudmessage(random(255),random(255), random(255), 0.0, 0.6, 0, 0.6, 5.0)
show_hudmessage(0,"Frags of CT: %d^nFrags of TE: %d",ctfrags, tfrags)
 
set_task(5.0, "hud")
}


Nem jó!

Szerző:  NuD[!]e [2015.01.14. 15:00 ]
Hozzászólás témája:  Re: Csak halott lássa

Élők is látják? vagy semmi sincs ott?

Szerző:  NuD[!]e [2015.01.14. 16:15 ]
Hozzászólás témája:  Re: Csak halott lássa

SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. public hud(id) {
  3.  
  4. if(is_user_alive(id)) {
  5.  
  6. set_hudmessage(random(255),random(255), random(255), 0.0, 0.6, 0, 0.6, 5.0)
  7. show_hudmessage(0,"Frags of CT: %d^nFrags of TE: %d",ctfrags, tfrags)
  8. }

Szerző:  xXlederXxHUN [2015.01.14. 17:44 ]
Hozzászólás témája:  Re: Csak halott lássa

deathmsg-be tedd bele és id helyett read_data(2)

Szerző:  Fantom [2015.01.14. 18:37 ]
Hozzászólás témája:  Re: Csak halott lássa

xXlederXxHUN írta:
deathmsg-be tedd bele és id helyett read_data(2)


A második részét nem értem :(

Szerző:  xXlederXxHUN [2015.01.14. 18:45 ]
Hozzászólás témája:  Re: Csak halott lássa

plugin_init-be:
SMA Forráskód: [ Mindet kijelol ]
  1. register_event("DeathMsg", "death", "a")


valahova a pluginba:
SMA Forráskód: [ Mindet kijelol ]
  1. public death()
  2. {
  3. new aldozat = read_data(2)
  4. if(is_user_connected(aldozat))
  5. {
  6. set_hudmessage(random(255),random(255), random(255), 0.0, 0.6, 0, 0.6, 5.0)
  7. show_hudmessage(aldozat,"Frags of CT: %d^nFrags of TE: %d",ctfrags, tfrags)
  8. }
  9. }

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