ItsMods

Full Version: Rules plugin v2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
blablabla say !rules to see the rules blabla

Updates/features
- C#
- It PMs users the rules now, don't want this?
Add this to sv_config.ini and change it
Code:
[RULES]
pm=yes
- Change rules in addon\rules.txt
- Comes with free bananas

[Image: 834vg.png]

CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Addon;
  6. using System.IO;
  7.  
  8. namespace Rules
  9. {
  10. public class Rules : CPlugin
  11. {
  12. string[] rules = { "" };
  13. public override void OnServerLoad()
  14. {
  15. pm = GetServerCFG("RULES", "pm", "yes");
  16. rules = File.ReadAllLines("addon\\rules.txt");
  17. ServerPrint("ohai. Rules v2 loaded");
  18. }
  19. string pm = string.Empty;
  20. public override ChatType OnSay(string Message, ServerClient Client)
  21. {
  22. if (Message.StartsWith("!rules"))
  23. {
  24. foreach (string rule in rules)
  25. if (pm == "yes")
  26. {
  27. foreach (ServerClient pl in GetClients())
  28. {
  29. TellClient(pl.ClientNum, rule, true);
  30. }
  31. }
  32. else
  33. ServerSay(rule, true);
  34. return ChatType.ChatNone;
  35. }
  36. return ChatType.ChatAll;
  37. }
  38. }
  39. }


Download
[attachment=1415]
@ jariz, has forgotten to add?
cg_chatHeight "8"
cg_chatTime "30000"
Hi
Rules shows only the last 3 lines
@makavel It should display at least 4 lines
Only shows 2 lines for me and anyone else that uses it
Not possible
Yes displays the 4 last lines of the rules but only if nothing is displayed in the say.
You can do so rules shown a without limit line.
There's a setting in your cfg for this.
Updated plugin to work with nukem's update which fucked up all plugins again
is it possible to make so that each line is pm'd is time delayed?
Pages: 1 2 3 4