• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
!come command
#11
(02-10-2013, 20:58)8q4s8 Wrote:
(02-10-2013, 20:19)hillbilly Wrote: also it seems even using aaapermissions etc this cmd is open to all.

I changed the code a bit, download is updated.
No idea why this happened

users can still use it Sad(((( and dont works with numbers
  Reply
#12
(02-11-2013, 18:30)Dr3am95 Wrote:
(02-10-2013, 20:58)8q4s8 Wrote:
(02-10-2013, 20:19)hillbilly Wrote: also it seems even using aaapermissions etc this cmd is open to all.

I changed the code a bit, download is updated.
No idea why this happened

users can still use it Sad(((( and dont works with numbers

I just tested it and everything is working fine for me, maybe you got a command for users that starts with !come or something like that and !ccome is working too.

here's the code if you want to change the command
CSHARP Code
  1. using System;
  2. using System.Text;
  3. using Addon;
  4.  
  5. namespace ClassLibrary1
  6. {
  7. public class Class1 : CPlugin
  8. {
  9. public override void OnServerLoad()
  10. {
  11. ServerPrint("Teleport_Plugin by 8Q4S8 loaded");
  12. }
  13. public override ChatType OnSay(string Message, ServerClient Client)
  14. {
  15. if (Message.ToLower().StartsWith("!come"))
  16. {
  17. string[] split = Message.Split(' ');
  18. foreach (ServerClient ci in GetClients())
  19. {
  20. if (ci.Name.ToLower().Contains(split[1].ToLower()))
  21. {
  22. ci.OriginX = Client.OriginX;
  23. ci.OriginY = Client.OriginY;
  24. ci.OriginZ = Client.OriginZ;
  25.  
  26. TellClient(Client.ClientNum, "[^1Teleporter^7]: " + ci.Name + " Teleported.", true);
  27. }
  28. }
  29. return ChatType.ChatNone;
  30. }
  31. if (Message.ToLower().StartsWith("!ccome"))
  32. {
  33. string[] split = Message.Split(' ');
  34. foreach (ServerClient ci in GetClients())
  35. {
  36. if (int.Parse(split[1]) == ci.ClientNum)
  37. {
  38. ci.OriginX = Client.OriginX;
  39. ci.OriginY = Client.OriginY;
  40. ci.OriginZ = Client.OriginZ;
  41. TellClient(Client.ClientNum, "[^1Teleporter^7]: " + ci.Name + " Teleported.", true);
  42. }
  43.  
  44. }
  45. return ChatType.ChatNone;
  46. }
  47. return ChatType.ChatContinue;
  48. }
  49.  
  50. }
  51.  
  52. }


inb4 @SgtLegend is making a "better" code with a few lines less
  Reply
#13
Ask and you shall you receive

CSHARP Code
  1. using Addon;
  2.  
  3. namespace ComeToMe
  4. {
  5. public class ComeToMe : CPlugin
  6. {
  7. public override void OnServerLoad()
  8. {
  9. ServerPrint("\nTeleport_Plugin by 8Q4S8 loaded");
  10. }
  11.  
  12. public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat)
  13. {
  14. string msg = Message.ToLower();
  15. string[] split = msg.Split(' ');
  16.  
  17. if (split[0] == "!come" || split[0] == "!ccome")
  18. {
  19. foreach (ServerClient c in GetClients())
  20. {
  21. if (
  22. (split[0] == "!ccome" && c.ClientNum == int.Parse(split[1])) ||
  23. (split[0] == "!come" && c.Name.ToLower() == split[1] || c.Name.ToLower().Contains(split[1]))
  24. ) {
  25. c.OriginX = Client.OriginX;
  26. c.OriginY = Client.OriginY;
  27. c.OriginZ = Client.OriginZ;
  28.  
  29. TellClient(Client.ClientNum, string.Format("[^1Teleporter^7]: {0} teleported", c.Name), true);
  30. }
  31. }
  32.  
  33. return ChatType.ChatNone;
  34. }
  35.  
  36. return ChatType.ChatContinue;
  37. }
  38. }
  39. }
I now host all my MW3 projects on my private GIT repo
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help auto command Dynasty 6 1,487 08-26-2013, 16:05
Last Post: hillbilly
  whats the command to get string length pedjas 4 1,032 01-20-2013, 18:30
Last Post: pedjas
  [Request] Team change by admin command. Dumas 10 4,116 11-29-2012, 21:38
Last Post: 99IRock
Question Help kick command still need help koro35 3 1,090 11-27-2012, 22:45
Last Post: koro35
  [Help] How to hide a command? korsika 4 1,547 10-27-2012, 23:30
Last Post: korsika
  server command problem anedaktos 3 1,121 08-05-2012, 12:14
Last Post: hillbilly
  [Tutorial] Making command-line application Arteq 9 2,111 04-17-2012, 13:35
Last Post: OrangePL
  [Request] !killall or !respawn all command? choppson 4 1,084 03-10-2012, 20:51
Last Post: JariZ
  [Request] Admin Chat command changing Map and Mod DeMenTor 6 1,626 03-03-2012, 06:52
Last Post: Yurio
  [Release] Read command output JariZ 1 857 01-08-2012, 17:29
Last Post: iAegle

Forum Jump:


Users browsing this thread: 1 Guest(s)