HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <zombie_plague_advance>
  3.  
  4. #define PLUGIN "ZP Round Fog"
  5. #define VERSION "1.0.0"
  6. #define AUTHOR "yokomo"
  7.  
  8. public plugin_init()
  9. {
  10. register_plugin(PLUGIN, VERSION, AUTHOR)
  11.  
  12. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  13. }
  14.  
  15. public plugin_cfg()
  16. {
  17. set_task(0.6, "event_round_start")
  18. }
  19.  
  20. public event_round_start()
  21. {
  22. CreateFog(0, .clear = true);
  23. }
  24.  
  25. public client_putinserver(id)
  26. {
  27. CreateFog(id, .clear = true);
  28. }
  29.  
  30. public zp_round_started(gamemode)
  31. {
  32. switch(gamemode)
  33. {
  34. // Make sure density must between 0.0001 and 0.25
  35. // Max RGB color is 255
  36. case MODE_ASSASSIN: CreateFog(0, 255, 255, 255, 0.0005);
  37. }
  38. }
  39.  
  40. // Stock create fog by Arkshine
  41. stock CreateFog (const index = 0, const red = 127, const green = 127, const blue = 127, const Float:density_f = 0.001, bool:clear = false)
  42. {
  43. static msgFog;
  44.  
  45. if (msgFog || (msgFog = get_user_msgid("Fog")))
  46. {
  47. new density = _:floatclamp(density_f, 0.0001, 0.25) * _:!clear;
  48. message_begin(index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgFog, .player = index);
  49. write_byte(clamp(red, 0, 255));
  50. write_byte(clamp(green, 0, 255));
  51. write_byte(clamp(blue , 0, 255));
  52. write_byte((density & 0xFF));
  53. write_byte((density >> 8) & 0xFF);
  54. write_byte((density >> 16) & 0xFF);
  55. write_byte((density >> 24) & 0xFF);
  56. message_end();
  57. }
  58. }
  59. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  60. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
  61. */