Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #include <PugConst>
  4. #include <PugForwards>
  5. #include <PugStocks>
  6.  
  7. #pragma semicolon 1
  8.  
  9. new g_pPugMod
  10. new g_pWarmup;
  11. new g_pStart;
  12. new g_pLive;
  13. new g_pHalfTime;
  14. new g_pOvertime;
  15. new g_pFinished;
  16.  
  17. public plugin_init()
  18. {
  19. register_plugin("Pug Mod (Configs)",PUG_MOD_VERSION,PUG_MOD_AUTHOR);
  20.  
  21. g_pPugMod = create_cvar("pug_config_pugmod","pugmod.rc",FCVAR_NONE,"Config executed for pugmod cvars");
  22. g_pWarmup = create_cvar("pug_config_warmup","warmup.rc",FCVAR_NONE,"Used at warmup session in pug mod");
  23. g_pStart = create_cvar("pug_config_start","start.rc",FCVAR_NONE,"Executed when vote session starts");
  24. g_pLive = create_cvar("pug_config_live","esl.rc",FCVAR_NONE,"Used when the match begin (Live config)");
  25. g_pHalfTime = create_cvar("pug_config_halftime","halftime.rc",FCVAR_NONE,"Used at half-time session");
  26. g_pOvertime = create_cvar("pug_config_overtime","esl-ot.rc",FCVAR_NONE,"Used at Overtime session");
  27. g_pFinished = create_cvar("pug_config_end","end.rc",FCVAR_NONE,"Executed when the match ends");
  28. }
  29.  
  30. public plugin_cfg()
  31. {
  32. fnExec(g_pPugMod);
  33. }
  34.  
  35. public PugEventWarmup()
  36. {
  37. fnExec(g_pWarmup);
  38. }
  39.  
  40. public PugEventStart()
  41. {
  42. fnExec(g_pStart);
  43. }
  44.  
  45. public PugEventFirstHalf()
  46. {
  47. fnExec(g_pLive);
  48. }
  49.  
  50. public PugEventHalfTime()
  51. {
  52. fnExec(g_pHalfTime);
  53. }
  54.  
  55. public PugEventSecondHalf()
  56. {
  57. fnExec(g_pLive);
  58. }
  59.  
  60. public PugEventOvertime()
  61. {
  62. fnExec(g_pOvertime);
  63. }
  64.  
  65. public PugEventEnd()
  66. {
  67. fnExec(g_pFinished);
  68. }
  69.  
  70. fnExec(hConvar)
  71. {
  72. new sFile[32];
  73. get_pcvar_string(hConvar,sFile,charsmax(sFile));
  74.  
  75. if(sFile[0] != '^0')
  76. {
  77. new sDir[128];
  78. PugGetConfigsDir(sDir,charsmax(sDir));
  79.  
  80. format(sDir,charsmax(sDir),"%s/%s",sDir,sFile);
  81.  
  82. server_cmd("exec %s",sDir);
  83. server_exec();
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement