Thread Rating:
  • 3 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Rules plugin v2
#11
Yes, new Thread + Thread.Sleep
Reply

#12
(01-12-2012, 22:42)Yurio Wrote: Yes, new Thread + Thread.Sleep

do you know if this will be implemented?

Reply

#13
My mod of the jariz's original plugin (for .NET 3 is not checked):

CSHARP Code
  1. using System.IO;
  2. using System.Threading;
  3. using Addon;
  4.  
  5. namespace Rules
  6. {
  7. public class Rules : CPlugin
  8. {
  9. string[] rules = { "" };
  10. public override void OnServerLoad()
  11. {
  12. rules = File.ReadAllLines("addon\\rules.txt");
  13. ServerPrint("Rules plugin");
  14. }
  15.  
  16. public override ChatType OnSay(string Message, ServerClient Client)
  17. {
  18. ServerPrint(Client.Name + ": " + Message);
  19. if (Message.StartsWith("!cmd"))
  20. {
  21. Thread shru = new Thread(ShowRules);
  22. shru.Start(Client);
  23. return ChatType.ChatNone;
  24. }
  25. return ChatType.ChatGame;
  26. }
  27.  
  28. private void ShowRules(object cli)
  29. {
  30. ServerClient sc = (ServerClient)cli;
  31. foreach (string rule in rules)
  32. {
  33. Thread.Sleep(1000);
  34. TellClient(sc.ClientNum, "[^1PM^7]: " + rule, true);
  35. ServerPrint("console to " + sc.Name + ": " + "[^1PM^7]: " + rule);
  36. }
  37. }
  38. }
  39. }
Reply

#14
(01-15-2012, 07:34)Yurio Wrote: My mod of the jariz's original plugin (for .NET 3 is not checked):

CSHARP Code
  1. using System.IO;
  2. using System.Threading;
  3. using Addon;
  4.  
  5. namespace Rules
  6. {
  7. public class Rules : CPlugin
  8. {
  9. string[] rules = { "" };
  10. public override void OnServerLoad()
  11. {
  12. rules = File.ReadAllLines("addon\\rules.txt");
  13. ServerPrint("Rules plugin");
  14. }
  15.  
  16. public override ChatType OnSay(string Message, ServerClient Client)
  17. {
  18. ServerPrint(Client.Name + ": " + Message);
  19. if (Message.StartsWith("!cmd"))
  20. {
  21. Thread shru = new Thread(ShowRules);
  22. shru.Start(Client);
  23. return ChatType.ChatNone;
  24. }
  25. return ChatType.ChatGame;
  26. }
  27.  
  28. private void ShowRules(object cli)
  29. {
  30. ServerClient sc = (ServerClient)cli;
  31. foreach (string rule in rules)
  32. {
  33. Thread.Sleep(1000);
  34. TellClient(sc.ClientNum, "[^1PM^7]: " + rule, true);
  35. ServerPrint("console to " + sc.Name + ": " + "[^1PM^7]: " + rule);
  36. }
  37. }
  38. }
  39. }
how do i get this on my server
Reply

#15
@Cprl.Rst someone has to complie the code to dll file
@Yurio Good job but messages pop up too fast,hard to read it
Reply

#16
You can write rules in Russian???
Reply

#17
@camelot if you had actually read the thread you could see that rules can be edited and added yourself. So yes, in Russian as well
Reply

#18
When I wrote the rules of the game, I have question marks in game!
Reply

#19
In that case IDK. Something with the encoding of the file I guess
Reply

#20
What do?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,161 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,744 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,510 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,667 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,176 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 62,206 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,621 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,711 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,263 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 3,063 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.