HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2. #include <cssclantags>
  3. #include <cstrike>
  4.  
  5.  
  6. #define DATA "v1.0"
  7. new Handle:Tag = INVALID_HANDLE;
  8. new Handle:Color1 = INVALID_HANDLE;
  9. new Handle:Color2 = INVALID_HANDLE;
  10. new Handle:Color3 = INVALID_HANDLE;
  11.  
  12.  
  13. public Plugin:myinfo =
  14. {
  15. name = "Admin Chat",
  16. author = "Jose Alberto steam: tudo98",
  17. description = "Külön chat szín a adminnak /prefix.",
  18. version = DATA,
  19. url = "<- servers-cfg.foroactivo.com ->"
  20. }
  21.  
  22. public OnPluginStart()
  23. {
  24. RegConsoleCmd("say", SayHook);
  25. CreateConVar("sm_chat_admin", "", "");
  26. Tag = CreateConVar("sm_tag", "ADMIN |", "Prefix");
  27. Color1 = CreateConVar("sm_color1", "#01DF0", "");
  28. Color2 = CreateConVar("sm_color2", "#FA58A", "");
  29. Color3 = CreateConVar("sm_color3", "#FA58A", "");
  30. AutoExecConfig(true, "Admin Chat by jose alberto");
  31.  
  32. }
  33.  
  34. public OnClientPostAdminCheck(client)
  35. {
  36. new AdminId:AdminID = GetUserAdmin(client);
  37. if(AdminID != INVALID_ADMIN_ID)
  38. {
  39. new String:tag_str[32];
  40. Format(tag_str, sizeof(tag_str), "%s", Tag);
  41. CS_SetClientClanTag(client, tag_str);
  42. }
  43. }
  44. public Action:SayHook(client, args)
  45. {
  46. new AdminId:AdminID = GetUserAdmin(client);
  47. if(AdminID == INVALID_ADMIN_ID)
  48. return Plugin_Continue;
  49.  
  50. decl String:text[128];
  51. decl String:color2[128];
  52. decl String:color3[128];
  53. GetConVarString(Color1, text, sizeof(text));
  54. GetConVarString(Color2, color2, sizeof(color2));
  55. GetConVarString(Color3, color3, sizeof(color3));
  56.  
  57. new String:Msg[256];
  58. new String:Name[MAX_NAME_LENGTH];
  59. GetClientName(client, Name, sizeof(Name));
  60. GetCmdArgString(Msg, sizeof(Msg));
  61. Msg[strlen(Msg)-1] = '\0';
  62. PrintToChatAll("\x07%s(ADMIN) \x07%s%s: \x07%s%s", text, color2, Name, color3, Msg[1]);
  63.  
  64. return Plugin_Handled;
  65. }