Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #pragma semicolon 1
  2. #include <sourcemod>
  3. #include <sdktools>
  4.  
  5. new Handle hud_red = INVALID_HANDLE;
  6. new Handle hud_green = INVALID_HANDLE;
  7. new Handle hud_blue = INVALID_HANDLE;
  8. new int chosenColorRed = 255;
  9. new int chosenColorGreen = 0;
  10. new int chosenColorBlue = 0;
  11.  
  12.  
  13.  
  14. public Plugin:myinfo =
  15. {
  16. name = "Map Hud Hints",
  17. author = "theSaint",
  18. description = "Says everything what map said in center hud text",
  19. version = "1",
  20. url = "http://ggeasy.pl/"
  21. }
  22.  
  23. public OnPluginStart()
  24. {
  25. AddCommandListener(FilterChat, "say");
  26.  
  27. hud_red = CreateConVar("sm_hud_color_red", "255", "RGB RED Color" );
  28. hud_green = CreateConVar("sm_hud_color_green","0", "RGB BLUE Color" );
  29. hud_blue = CreateConVar("sm_hud_color_blue", "0", "RGB GREEN Color" );
  30.  
  31. HookConVarChange(hud_red, OnColorChanged);
  32. HookConVarChange(hud_green, OnColorChanged);
  33. HookConVarChange(hud_blue, OnColorChanged);
  34.  
  35. chosenColorRed = GetConVarInt(sm_hud_color_red);
  36. chosenColorGreen = GetConVarInt(sm_hud_color_green);
  37. chosenColorBlue = GetConVarInt(sm_hud_color_blue);
  38. }
  39.  
  40. public OnColorChanged(Handle:cvar, const String:oldVal[], const String:newVal[])
  41. {
  42. chosenColorRed = GetConVarInt(sm_hud_color_red);
  43. chosenColorGreen = GetConVarInt(sm_hud_color_green);
  44. chosenColorBlue = GetConVarInt(sm_hud_color_blue);
  45. }
  46.  
  47. public Action:FilterChat(client, const String:command[], args)
  48. {
  49. if (!client)
  50. {
  51. decl String:text[192];
  52. GetCmdArgString(text, sizeof(text));
  53.  
  54. for(int i = 1; i <= MaxClients; i++)
  55. {
  56. if(IsClientInGame(i) && !IsFakeClient(i))
  57. {
  58. SetHudTextParams(0.45, 0.350, 3.0, GetConVarInt(hud_red), GetConVarInt(hud_blue), GetConVarInt(hud_green), 255, 0, 0.25, 0.5, 0.3);
  59. ShowHudText(i, 1, text);
  60. }
  61. }
  62. return Plugin_Handled;
  63. }
  64. return Plugin_Continue;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement