![]() |
|
[SOURCE] Ingame Rcon - Printable Version +- ItsMods (https://www.itsmods.com) +-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html) +--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html) +--- Thread: [SOURCE] Ingame Rcon (/Thread-SOURCE-Ingame-Rcon.html) |
[SOURCE] Ingame Rcon - iAegle - 01-06-2012 Ingame rcon tool, any admin can execute any command admins need to be added to the sv_config.ini: Code: [RCON]
xuids=admin_1_xuid,admin_2_xuid,admin_3_xuidCode: using System;
using System.Collections.Generic;
using Addon;
namespace plugin_test
{
public class plugin_test : CPlugin
{
List<string> admins = new List<string>();
bool disable = false;
public override ChatType OnSay( string Message, ServerClient Client )
{
if( disable )
return ChatType.ChatAll;
if( Message.StartsWith( "!rcon" ) && admins.Contains( Client.XUID ) )
{
if( Message.Length <= 6 )
TellClient( Client.ClientNum, "^2RCON: ^3Usage: !rcon [COMMAND]", true );
else
{
string cmd = Message.Substring( 6 );
ServerPrint( Client.Name + " used the rcon! command: \"" + cmd + "\"" );
ServerCommand( cmd );
}
return ChatType.ChatNone;
}
return ChatType.ChatAll;
}
public override void OnServerLoad()
{
string l = GetServerCFG( "RCON", "xuids", "" );
if( l == "" )
foreach( string xuid in l.Split( ',' ) )
admins.Add( xuid );
if( admins.Count == 0 )
disable = true;
ServerPrint( "Ingame RCON loaded. Author: iAegle. Version: 1.0" );
}
}
}Its not compiled or tested .. but I don't have access to my pc Download
IngameRCON.zip (Size: 2.28 KB / Downloads: 278)
RE: [SOURCE] Ingame Rcon - Nukem - 01-06-2012 I'd advise you to use ChatType.ChatContinue for the return, otherwise plugins like PM Manager will not work correctly. (it would show the !pm in the chat with this enabled) Looks good and useful because IW's ingame rcon doesn't work ![]() Suggestion: use passwords for players to login or use a combination of XUIDs and passwords. RE: [SOURCE] Ingame Rcon - JariZ - 01-06-2012 Very nice! Happy to see more and more people using this will compile now for ya Compiled + syntax errors fixed (4) var declaration goes inside the class, not outside the class, you did it to the pluginpack plugins as well
RE: [SOURCE] Ingame Rcon - zxz0O0 - 01-06-2012 Shouldn't it be Code: if( l != "" )
foreach( string xuid in l.Split( ',' ) )
admins.Add( xuid );RE: [SOURCE] Ingame Rcon - Pozzuh - 01-06-2012 (01-06-2012, 12:44)zxz0O0 Wrote: Shouldn't it be I thought that too RE: [SOURCE] Ingame Rcon - opsvjace - 01-06-2012 Nice one But a few things im not clear on.. Where do i find players xuids and where in the code do i place it [RCON] xuids=admin_1_xuid,admin_2_xuid,admin_3_xuid What commands can be used in game, i'm asuming its things like !status, !kick !ban and so on, a full list would be good. Thanks this is going to be a great plugin for our clan. RE: [SOURCE] Ingame Rcon - zxz0O0 - 01-06-2012 (01-06-2012, 12:47)opsvjace Wrote: Nice oneType status in server console or rcon and you will see the xuid of every player. If your xuid is ex. 11000013AC09D20 you do it like Code: [RCON]
xuids=11000013AC09D20, ...http://www.mapmodnews.com/article.php/MW3-Dedicated-Server-Rcon-Setup RE: [SOURCE] Ingame Rcon - opsvjace - 01-06-2012 Ok so am i right in thinking this works just like the stock ingame rcon. RE: [SOURCE] Ingame Rcon - iAegle - 01-06-2012 @zxz yeah thats right my mistake Just type: !rcon (any command) So if i want to change the timelimit: !rcon scr_dm_timelimit 10 RE: [SOURCE] Ingame Rcon - opsvjace - 01-06-2012 (01-06-2012, 13:38)iAegle Wrote: @zxz yeah thats right my mistake Thanks but im still unclear on how to add admins to the sv_config.ini. where it says "admin" in the code do i add the xuid for the player. xuids=admin_1_xuid,admin_2_xuid,admin_3_xuid So xuids=000000001111222AAD_1_xuid,01010101ADC_2_xuid,000000111222DGS_3_xuid.... and so on. Thanks |