Advertisement
Guest User

Untitled

a guest
Sep 26th, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #define AUTHOR "aSior - amxx.pl/user/60210-asior/"
  4.  
  5. new const happyHours[] = { 0, 24 }
  6.  
  7. new const vipFlag[] = "t";
  8. new const svipFlag[] = "s";
  9.  
  10. new currentTime[4], bool:happyHourEnabled, currentHour;
  11.  
  12. public plugin_init()
  13. {
  14. register_plugin("x", "v0.1", AUTHOR);
  15.  
  16. get_time("%H", currentTime, charsmax(currentTime));
  17.  
  18. currentHour = str_to_num(currentTime);
  19.  
  20. if(happyHours[0] <= currentHour <= happyHours[1])
  21. happyHourEnabled = true;
  22. }
  23.  
  24. public client_authorized(index)
  25. {
  26. if(!happyHourEnabled || get_user_flags(index) & read_flags(svipFlag))
  27. return;
  28.  
  29. new newFlags = get_user_flags(index) | read_flags(vipFlag);
  30.  
  31. set_user_flags(index, newFlags);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement