freefiles

Untitled

Nov 25th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #pragma semicolon 1
  2.  
  3. #include <sourcemod>
  4. #include <sdktools>
  5. #include <sdkhooks>
  6.  
  7. new const String:g_sSteamID[][] =
  8. {
  9. "STEAM_0:1:91",
  10. "STEAM_2",
  11. "STEAM_3"
  12. };
  13.  
  14. new const String:g_sNickname[][] =
  15. {
  16. "777",
  17. "Ник для STEAM_2",
  18. "Ник для STEAM_3"
  19. };
  20.  
  21. public Plugin:myinfo =
  22. {
  23. name = "Enter/Change permanent nickname",
  24. author = "AlmazON, T@HK",
  25. version = "2.1",
  26. description = "Enter permanent nickname in server,change old nickname",
  27. url = "https://hlmod.ru/threads/plagin-zapreta-smeny-nika.12846/page-4"
  28. };
  29.  
  30. public OnClientAuthorized(client, const String:auth[])
  31. {
  32. new String:f_sAuthID[64];
  33. GetClientAuthId(client, AuthId_Steam2, f_sAuthID, sizeof(f_sAuthID), false);
  34. new String:f_sPlayer_Name[65];
  35. GetClientName(client, f_sPlayer_Name, sizeof(f_sPlayer_Name));
  36. for (new i; i < sizeof(g_sSteamID); ++i)
  37. {
  38. if (strcmp(g_sSteamID[i], auth) == 0)
  39. {
  40. decl String:Name[MAX_NAME_LENGTH];
  41. GetClientName(client, Name, sizeof(Name));
  42. if (strcmp(g_sNickname[i], Name)) SetClientInfo(client, "Name", g_sNickname[i]);
  43. return;
  44. }
  45. }
  46. PrintToServer("[ValidateNickSteam] %N %s %s", client, f_sPlayer_Name, f_sAuthID);
  47. LogMessage("OnClientAuthorized fired for %L with SteamID %s", client, auth);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment