Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #include <sourcemod>
- #include <sdktools>
- new Handle hud_red = INVALID_HANDLE;
- new Handle hud_green = INVALID_HANDLE;
- new Handle hud_blue = INVALID_HANDLE;
- new int chosenColorRed = 255;
- new int chosenColorGreen = 0;
- new int chosenColorBlue = 0;
- public Plugin:myinfo =
- {
- name = "Map Hud Hints",
- author = "theSaint",
- description = "Says everything what map said in center hud text",
- version = "1",
- url = "http://ggeasy.pl/"
- }
- public OnPluginStart()
- {
- AddCommandListener(FilterChat, "say");
- hud_red = CreateConVar("sm_hud_color_red", "255", "RGB RED Color" );
- hud_green = CreateConVar("sm_hud_color_green","0", "RGB BLUE Color" );
- hud_blue = CreateConVar("sm_hud_color_blue", "0", "RGB GREEN Color" );
- HookConVarChange(hud_red, OnColorChanged);
- HookConVarChange(hud_green, OnColorChanged);
- HookConVarChange(hud_blue, OnColorChanged);
- chosenColorRed = GetConVarInt(sm_hud_color_red);
- chosenColorGreen = GetConVarInt(sm_hud_color_green);
- chosenColorBlue = GetConVarInt(sm_hud_color_blue);
- }
- public OnColorChanged(Handle:cvar, const String:oldVal[], const String:newVal[])
- {
- chosenColorRed = GetConVarInt(sm_hud_color_red);
- chosenColorGreen = GetConVarInt(sm_hud_color_green);
- chosenColorBlue = GetConVarInt(sm_hud_color_blue);
- }
- public Action:FilterChat(client, const String:command[], args)
- {
- if (!client)
- {
- decl String:text[192];
- GetCmdArgString(text, sizeof(text));
- for(int i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i) && !IsFakeClient(i))
- {
- SetHudTextParams(0.45, 0.350, 3.0, GetConVarInt(hud_red), GetConVarInt(hud_blue), GetConVarInt(hud_green), 255, 0, 0.25, 0.5, 0.3);
- ShowHudText(i, 1, text);
- }
- }
- return Plugin_Handled;
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement