Advertisement
nomy

Untitled

Mar 5th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #pragma semicolon 1
  2. #include <sourcemod>
  3. #include <morecolors>
  4.  
  5. #define PLUGIN_VERSION "1.1"
  6.  
  7.  
  8. new Handle:g_hCV_Enabled;
  9.  
  10. public Plugin:myinfo =
  11. {
  12.     name = "Favorite Connections",
  13.     author = "RIP?",
  14.     description = "Detect when a player connects to the server via favorites."
  15. };
  16.  
  17.  
  18. public OnPluginStart()
  19. {
  20.     LoadTranslations("favoriteconnections.phrases");
  21.     g_hCV_Enabled = CreateConVar("favoriteconnections_enable", "1", "Enable the plugin? 1 = Enable, 0 = Disable");
  22. }
  23.  
  24. public OnClientPostAdminCheck(client)
  25. {
  26.     if (!GetConVarBool(g_hCV_Enabled))
  27.     {
  28.         return;
  29.     }
  30.    
  31.     doCheck(client);
  32. }
  33.  
  34. doCheck(client)
  35. {
  36.     new String:sMethod[32];
  37.     if (GetClientInfo(client, "cl_connectmethod", sMethod, sizeof(sMethod)))
  38.     {
  39.         if (StrEqual(sMethod, "serverbrowser_favorites"))
  40.         {
  41.             for(new i = 1; i <= MaxClients; i++)
  42.             {
  43.                 CPrintToChat(i, "%T", "fav connection", i, client);
  44.             }
  45.            
  46.             AddUserFlags(client, Admin_Custom1);
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement