Advertisement
Guest User

bans

a guest
Mar 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. void DisplayBanReasonMenu(int client)
  2. {
  3. Menu menu = new Menu(MenuHandler_BanReasonList);
  4.  
  5. char title[100];
  6. Format(title, sizeof(title), "%T: %N", "Ban reason", client, g_BanTarget[client]);
  7. menu.SetTitle(title);
  8. menu.ExitBackButton = true;
  9.  
  10. //Add custom chat reason entry first
  11. //menu.AddItem("", "Custom reason (type in chat)");
  12.  
  13. //Loading configurable entries from the kv-file
  14. char reasonName[100];
  15. char reasonFull[255];
  16.  
  17. //Iterate through the kv-file
  18. g_hKvBanReasons.GotoFirstSubKey(false);
  19. do
  20. {
  21. g_hKvBanReasons.GetSectionName(reasonName, sizeof(reasonName));
  22. g_hKvBanReasons.GetString(NULL_STRING, reasonFull, sizeof(reasonFull));
  23.  
  24. //Add entry
  25. menu.AddItem(reasonFull, reasonName);
  26.  
  27. } while (g_hKvBanReasons.GotoNextKey(false));
  28.  
  29. //Reset kvHandle
  30. g_hKvBanReasons.Rewind();
  31.  
  32. menu.Display(client, MENU_TIME_FOREVER);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement