hlmod.hu
https://hlmod.hu/

Dupla Frag
https://hlmod.hu/viewtopic.php?f=9&t=25741
Oldal: 1 / 1

Szerző:  Troy [2016.08.02. 15:35 ]
Hozzászólás témája:  Dupla Frag

Hali ez igy mukodhet? es szeretnek olyat kerni pl 15:30-16:00 mukodjon
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fun>
  4. #include <colorchat>
  5.  
  6. #define PLUGIN "New Plug-In"
  7. #define VERSION "1.0"
  8. #define AUTHOR "HunGamer"
  9.  
  10. new bool:aktiv = false;
  11. new bool:aktiv2 = false;
  12.  
  13. public plugin_init()
  14. {
  15.     register_plugin(PLUGIN, VERSION, AUTHOR);
  16.     register_event("DeathMsg","hook_death","a");
  17.     set_task(60.0, "check", 0, _, _, "b");
  18. }
  19. public check()
  20. {
  21.     new hour, minute, second;
  22.     time(hour, minute, second);
  23.  
  24.     if(23 <= hour && 7 > hour)
  25.     {
  26.         aktiv = true;
  27.         set_task(1.0,"event")
  28.     }
  29.     else
  30.     {      
  31.         aktiv = false;
  32.         aktiv2 = false;
  33.     }
  34.     return PLUGIN_CONTINUE
  35.  
  36.  
  37. }
  38.  
  39. public event()
  40. {
  41. if(aktiv2 == false)
  42. {
  43. ColorChat(0, GREEN, "[EVENT]^x01 Most mapváltás következik !!!")
  44. aktiv2 = true;
  45. server_cmd("changelevel ^"de_dust2^"")
  46. }
  47. }
  48.  
  49. public hook_death()
  50. {
  51.     if(!aktiv)
  52.         return PLUGIN_CONTINUE;
  53.  
  54.     new killer = read_data(1);
  55.     set_user_frags(killer, get_user_frags(killer) + 1);
  56.  
  57.     new frags = get_user_frags(killer)
  58.     new death = get_user_deaths(killer)
  59.     new team = get_user_team(killer)
  60.  
  61.     message_begin(MSG_ALL, get_user_msgid("ScoreInfo"), {0,0,0}, 0)
  62.     write_byte(killer)
  63.     write_short(frags)
  64.     write_short(death)
  65.     write_short(0)
  66.     write_short(team)
  67.     message_end()
  68.  
  69.     return PLUGIN_CONTINUE;
  70. }
  71.  
  72. public hirdet()
  73. {
  74.     if(!aktiv)
  75.     {
  76.     ColorChat(0, GREEN, "[EVENT]^x01 Most minden kill duplán számit!!!")
  77.     }
  78.     return PLUGIN_CONTINUE;
  79. }

Szerző:  Maxi [2016.08.03. 10:19 ]
Hozzászólás témája:  Re: Dupla Frag

24. sor
  1. if(23 <= hour && 7 > hour)

itt allitsd be, teszteld.

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