02-11-2013, 18:30
|
!come command
|
|
02-11-2013, 19:22
(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 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 Code: using System;
using System.Text;
using Addon;
namespace ClassLibrary1
{
public class Class1 : CPlugin
{
public override void OnServerLoad()
{
ServerPrint("Teleport_Plugin by 8Q4S8 loaded");
}
public override ChatType OnSay(string Message, ServerClient Client)
{
if (Message.ToLower().StartsWith("!come"))
{
string[] split = Message.Split(' ');
foreach (ServerClient ci in GetClients())
{
if (ci.Name.ToLower().Contains(split[1].ToLower()))
{
ci.OriginX = Client.OriginX;
ci.OriginY = Client.OriginY;
ci.OriginZ = Client.OriginZ;
TellClient(Client.ClientNum, "[^1Teleporter^7]: " + ci.Name + " Teleported.", true);
}
}
return ChatType.ChatNone;
}
if (Message.ToLower().StartsWith("!ccome"))
{
string[] split = Message.Split(' ');
foreach (ServerClient ci in GetClients())
{
if (int.Parse(split[1]) == ci.ClientNum)
{
ci.OriginX = Client.OriginX;
ci.OriginY = Client.OriginY;
ci.OriginZ = Client.OriginZ;
TellClient(Client.ClientNum, "[^1Teleporter^7]: " + ci.Name + " Teleported.", true);
}
}
return ChatType.ChatNone;
}
return ChatType.ChatContinue;
}
}
}inb4 @SgtLegend is making a "better" code with a few lines less
Ask and you shall you receive
Code: using Addon;
namespace ComeToMe
{
public class ComeToMe : CPlugin
{
public override void OnServerLoad()
{
ServerPrint("\nTeleport_Plugin by 8Q4S8 loaded");
}
public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat)
{
string msg = Message.ToLower();
string[] split = msg.Split(' ');
if (split[0] == "!come" || split[0] == "!ccome")
{
foreach (ServerClient c in GetClients())
{
if (
(split[0] == "!ccome" && c.ClientNum == int.Parse(split[1])) ||
(split[0] == "!come" && c.Name.ToLower() == split[1] || c.Name.ToLower().Contains(split[1]))
) {
c.OriginX = Client.OriginX;
c.OriginY = Client.OriginY;
c.OriginZ = Client.OriginZ;
TellClient(Client.ClientNum, string.Format("[^1Teleporter^7]: {0} teleported", c.Name), true);
}
}
return ChatType.ChatNone;
}
return ChatType.ChatContinue;
}
}
}
I now host all my MW3 projects on my private GIT repo
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| Help auto command | Dynasty | 6 | 5,998 |
08-26-2013, 16:05 Last Post: hillbilly |
|
| whats the command to get string length | pedjas | 4 | 4,310 |
01-20-2013, 18:30 Last Post: pedjas |
|
| [Request] Team change by admin command. | Dumas | 10 | 11,394 |
11-29-2012, 21:38 Last Post: 99IRock |
|
|
|
Help kick command still need help | koro35 | 3 | 4,354 |
11-27-2012, 22:45 Last Post: koro35 |
| [Help] How to hide a command? | korsika | 4 | 5,581 |
10-27-2012, 23:30 Last Post: korsika |
|
| server command problem | anedaktos | 3 | 4,247 |
08-05-2012, 12:14 Last Post: hillbilly |
|
| [Tutorial] Making command-line application | Arteq | 9 | 7,601 |
04-17-2012, 13:35 Last Post: OrangePL |
|
| [Request] !killall or !respawn all command? | choppson | 4 | 4,063 |
03-10-2012, 20:51 Last Post: JariZ |
|
| [Request] Admin Chat command changing Map and Mod | DeMenTor | 6 | 5,455 |
03-03-2012, 06:52 Last Post: Yurio |
|
| [News] Command & Conquer Generals 2 on Frostbite 2!!! | ddaavvee | 6 | 4,532 |
01-06-2012, 15:41 Last Post: iAegle |
|
| Users browsing this thread: |
| 2 Guest(s) |


(((( and dont works with numbers