Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. #pragma semicolon 1
  5. #pragma newdecals required
  6.  
  7. KeyValues gK_ConnectSystem;
  8.  
  9. public Plugin:myinfo =
  10. {
  11. name = "|Staff Tools| AutoRR",
  12. description = "The Staff 2018",
  13. author = "The Staff",
  14. version = "2.0",
  15. url = "www.thestaff.net"
  16. };
  17.  
  18. public void OnMapStart()
  19. {
  20. gK_ConnectSystem = new KeyValues("connectsystem");
  21.  
  22. char[] sFile = new char[PLATFORM_MAX_PATH];
  23. BuildPath(Path_SM, sFile, PLATFORM_MAX_PATH, "configs/connectsystem.cfg");
  24. gK_ConnectSystem.ImportFromFile(sFile);
  25. }
  26.  
  27. public void OnMapEnd() {
  28. delete gK_ConnectSystem;
  29. }
  30.  
  31. public void OnClientPutInServer(int client)
  32. {
  33. if (!IsFakeClient(client))
  34. {
  35. char[] sSteamId = new char[MAX_NAME_LENGTH];
  36. GetClientAuthId(client, AuthId_Steam2, sSteamId, MAX_NAME_LENGTH);
  37.  
  38. if (gK_ConnectSystem.JumpToKey(sSteamId, false))
  39. {
  40. char[] sFormat = new char[PLATFORM_MAX_PATH];
  41. gK_ConnectSystem.GetString("sound", sFormat, PLATFORM_MAX_PATH);
  42.  
  43. if (sFormat[0] != '\0')
  44. {
  45. if (sFormat[0] != '*')
  46. Format(sFormat, PLATFORM_MAX_PATH, "*%s", sFormat);
  47. EmitSoundToAll(sFormat);
  48. }
  49.  
  50. gK_ConnectSystem.GetString("message", sFormat, PLATFORM_MAX_PATH);
  51.  
  52. if (sFormat[0] != '\0')
  53. {
  54. FilterColors(sFormat);
  55. PrintToChatAll(" %s", sFormat);
  56. }
  57. }
  58. gK_ConnectSystem.Rewind();
  59. }
  60. }
  61.  
  62. void FilterColors(char[] sString)
  63. {
  64. ReplaceString(sString, PLATFORM_MAX_PATH, "{red}", "\x02", false);
  65. ReplaceString(sString, PLATFORM_MAX_PATH, "{green}", "\x04", false);
  66. ReplaceString(sString, PLATFORM_MAX_PATH, "{olive}", "\x06", false);
  67. ReplaceString(sString, PLATFORM_MAX_PATH, "{purple}", "\x03", false);
  68. ReplaceString(sString, PLATFORM_MAX_PATH, "{yellow}", "\x09", false);
  69. ReplaceString(sString, PLATFORM_MAX_PATH, "{blue}", "\x0B", false);
  70. ReplaceString(sString, PLATFORM_MAX_PATH, "{pink}", "\x0E", false);
  71. ReplaceString(sString, PLATFORM_MAX_PATH, "{grey}", "\x08", false);
  72. ReplaceString(sString, PLATFORM_MAX_PATH, "{lightred}", "\x07", false);
  73. ReplaceString(sString, PLATFORM_MAX_PATH, "{white}", "\x01", false);
  74. ReplaceString(sString, PLATFORM_MAX_PATH, "{orange}", "\x10", false);
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement