
--Chat commands lol

local function Help( ply, args, call )

	umsg.Start( "ShowHelpMenu", ply ); umsg.End();

	return "";
	
end
TS.AddChatCommand( "/help", Help );

local function cMeow( ply, args, call )

	local r1 = math.random( 1, 4 );
	
	if( r1 == 1 ) then
		ply:PrintMessage( 3, "Meow!" );
	end
	
	if( r1 == 2 ) then
		ply:PrintMessage( 3, "Mew!" );
	end
	
	if( r1 == 3 ) then
		ply:PrintMessage( 3, "Maow!" );
	end
	
	if( r1 == 4 ) then
		ply:PrintMessage( 3, "Mrow!" );
	end

	return "";

end
--TS.AddChatCommand( "/meow", cMeow );
--TS.AddChatCommand( "/mew", cMeow );
--TS.AddChatCommand( "/maow", cMeow );
--TS.AddChatCommand( "/mrow", cMeow );

local function cPM( ply, args, call )

	if( string.find( args, " " ) ) then
	
		local targetname = string.sub( args, 1, string.find( args, " " ) - 1 );
		local target = TS.RunPlayerSearch( ply, targetname, true );
	
		if( target ) then
	
			ply:PrivateMessage( "[PM to " .. target:Nick() .. "] " .. string.sub( args, string.find( args, " " ) + 1 ) );
			ply:PrintMessage( 2, "[PM to " .. target:Nick() .. "] " .. string.sub( args, string.find( args, " " ) + 1 ) );
			target:PrivateMessage( "[PM from " .. ply:Nick() .. "] " .. string.sub( args, string.find( args, " " ) + 1 ) );
			target:PrintMessage( 2, "[PM from " .. ply:Nick() .. "] " .. string.sub( args, string.find( args, " " ) + 1 ) );
			
			TS.DayLog( "chatlog.txt", ply:LogInfo() .. "[PM to " .. target:Nick() .. "] " .. string.sub( args, string.find( args, " " ) + 1 ) );

		end
		
	else
		
		ply:PrintMessage( 3, "Specify a target" );
		
	end
	
	return "";

end
TS.AddChatCommand( "/pm ", cPM );

local function SpeakOOC( ply, args, call )

	if( not ply:IsAdmin() and CurTime() - ply:GetField( "lastooc" ) <= TS.ServerVars["oocdelay"] ) then
	
		TS.Notify( ply, "Wait " .. math.ceil( TS.ServerVars["oocdelay"] - ( CurTime() - ply:GetField( "lastooc" ) ) ), 3 );
		return "";
	
	end

	if( string.lower( call ) == "[ooc]" ) then
	
		AddHelpTip( ply, .05, .5, 285, 68, "You silly little man.  You can just type\n// or /a before your text to speak in OOC\n(Out-Of-Character)" );
		
	end
	
	if( ply:IsAdmin() and TS.ServerVars["oocdelay"] > 0 ) then
	
		TS.Notify( ply, "OOC delay is " .. TS.ServerVars["oocdelay"], 3 );
	
	end
	
	TS.DayLog( "chatlog.txt", "[GLOBAL]" .. ply:LogInfo() .. ": " .. args );
	
	ply:SetField( "lastooc", CurTime() );
	
	return "[OOC] " .. args;

end
TS.AddChatCommand( "//", SpeakOOC );
TS.AddChatCommand( "/a ", SpeakOOC );
TS.AddChatCommand( "((", SpeakOOC );
TS.AddChatCommand( "/ooc", SpeakOOC );
TS.AddChatCommand( "[OOC]", SpeakOOC );

local function SpeakLocalOOC( ply, args, call )

	TS.DayLog( "chatlog.txt", "[LOCAL-OOC]" .. ply:LogInfo() .. ": " .. args );
	
	TS.TalkToRange( ply:Nick() .. ": [LOCAL-OOC] " .. args, ply:EyePos(), TS.ServerVars["talkrange"] );
			
	return "";

end
TS.AddChatCommand( ".//", SpeakLocalOOC );
TS.AddChatCommand( "[[", SpeakLocalOOC );

local function RadioTalk( ply, args, call )

	if( not ply:HasItem( "radio" ) ) then
	
		ply:PrintMessage( 3, "You need a radio" );
		return "";
	
	end
	
	if( math.floor( ply:GetField( "radiofreq" ) ) == 0 ) then
	
		ply:PrintMessage( 3, "0.0 is not a valid radio frequency" );
		return "";
	
	end
	
	if( ply:GetField( "radiofreq" ) > 999.9 ) then
	
		ply:PrintMessage( 3, "Cannot speak in this radio frequency (have to be registered to do so)" );
		return "";
	
	end
	
	if( ply:GetField( "radiofreq" ) < 0 or ply:GetField( "radiofreq" ) > 9999.9 ) then
	
		ply:PrintMessage( 3, "Invalid radio frequency" );
		return "";
	
	end

	TS.TalkToFreq( ply:GetField( "radiofreq" ), ply:Nick() .. ": " .. args );
	TS.TalkToRange( ply:Nick() .. ": " .. args, ply:EyePos(), TS.ServerVars["talkrange"] );
	TS.DayLog( "chatlog.txt", "[RADIO]" .. ply:LogInfo() .. ": " .. args );
				
	return "";

end
TS.AddChatCommand( "/r ", RadioTalk );

local function RadioAliasTalk( ply, args, call )

	if( not ply:IsAdmin() ) then ply:PrintMessage( 3, "Need to be admin" ) return end
	
	if( math.floor( ply:GetField( "radiofreq" ) ) == 0 ) then
	
		ply:PrintMessage( 3, "0.0 is not a valid radio frequency" );
		return "";
	
	end
	
	if( ply:GetField( "radiofreq" ) > 999.9 ) then
	
		ply:PrintMessage( 3, "Cannot speak in this radio frequency (have to be registered to do so)" );
		return "";
	
	end
	
	if( ply:GetField( "radiofreq" ) < 0 or ply:GetField( "radiofreq" ) > 9999.9 ) then
	
		ply:PrintMessage( 3, "Invalid radio frequency" );
		return "";
	
	end
	
	local args_split = string.Explode( " ", args );
	local name = args_split[1];
	local text = "";
	
	for i = 2, #args_split do
		
		text = text .. args_split[i];
		
	end

	TS.TalkToFreq( ply:GetField( "radiofreq" ), name .. ": " .. text );
	TS.DayLog( "chatlog.txt", "[RADIO]" .. ply:LogInfo() .. " (Alias: " .. name .. "): " .. text );
	
	return "";

end
TS.AddChatCommand( "/ra ", RadioAliasTalk );

local function AddPropertyOwner( ply, args, call )

	local trace = { }
	trace.start = ply:EyePos();
	trace.endpos = trace.start + ply:GetAimVector() * 200;
	trace.filter = ply;
	local tr = util.TraceLine( trace );
	
	if( ValidEntity( tr.Entity ) and tr.Entity:IsDoor() ) then
	
		if( tr.Entity:OwnsDoor( ply ) ) then

			if( string.find( args, " " ) ) then

				local targetname = string.sub( args, string.find( args, " " ) + 1 );
				
				local target = TS.RunPlayerSearch( ply, targetname, true );
	
				if( target ) then
				
					if( tr.Entity:OwnsProperty( target ) ) then
					
						ply:PrintMessage( 3, target:Nick() .. " already co owns this property" );
					
					else
				
						tr.Entity:OwnProperty( target );
						ply:PrintMessage( 3, target:Nick() .. " has been made co owner of this property" );
					
					end
					
				end
				
			else
			
				ply:PrintMessage( 3, "Specify a target" );
			
			end
		
		else
		
			ply:PrintMessage( 3, "You don't own this door" );
		
		end
	
	end
	
	return "";

end
TS.AddChatCommand( "/addpropertyowner" , AddPropertyOwner );

local function RemoveDoorOwner( ply, args, call )

	local trace = { }
	trace.start = ply:EyePos();
	trace.endpos = trace.start + ply:GetAimVector() * 200;
	trace.filter = ply;
	local tr = util.TraceLine( trace );
	
	if( ValidEntity( tr.Entity ) and tr.Entity:IsDoor() ) then
	
		if( tr.Entity:OwnsDoor( ply ) ) then

			if( string.find( args, " " ) ) then

				local targetname = string.sub( args, string.find( args, " " ) + 1 );
				
				local target = TS.RunPlayerSearch( ply, targetname, true );
	
				if( target ) then
				
					if( target == tr.Entity:GetTable().MainOwner ) then
					
						ply:PrintMessage( 3, "Cannot remove main owner" );
						return "";
					
					end
				
					if( tr.Entity:OwnsDoor( target ) ) then
					
						ply:PrintMessage( 3, target:Nick() .. " has been removed from co ownership of this door" );
						tr.Entity:UnownDoor( target );
					
					else
				
						ply:PrintMessage( 3, target:Nick() .. " doesnt co own this door" );
						
					end
					
				end
				
			else
			
				ply:PrintMessage( 3, "Specify a target" );
			
			end
		
		else
		
			ply:PrintMessage( 3, "You don't own this door" );
		
		end
	
	end
	
	return "";

end
TS.AddChatCommand( "/removedoorowner" , RemoveDoorOwner );


local function RemovePropertyOwner( ply, args, call )

	local trace = { }
	trace.start = ply:EyePos();
	trace.endpos = trace.start + ply:GetAimVector() * 200;
	trace.filter = ply;
	local tr = util.TraceLine( trace );
	
	if( ValidEntity( tr.Entity ) and tr.Entity:IsDoor() ) then
	
		if( tr.Entity:OwnsDoor( ply ) ) then

			if( string.find( args, " " ) ) then

				local targetname = string.sub( args, string.find( args, " " ) + 1 );
				
				local target = TS.RunPlayerSearch( ply, targetname, true );
	
				if( target ) then
				
					if( target == tr.Entity:GetTable().MainOwner ) then
					
						ply:PrintMessage( 3, "Cannot remove main owner" );
						return "";
					
					end
				
					if( tr.Entity:OwnsAnyOfProperty( target ) ) then
					
						ply:PrintMessage( 3, target:Nick() .. " has been removed from co ownership of this property" );
						tr.Entity:UnownProperty( target );
					
					else
				
						ply:PrintMessage( 3, target:Nick() .. " doesnt co own any of this property" );
						
					end
					
				end
				
			else
			
				ply:PrintMessage( 3, "Specify a target" );
			
			end
		
		else
		
			ply:PrintMessage( 3, "You don't own this door" );
		
		end
	
	end
	
	return "";

end
TS.AddChatCommand( "/removepropertyowner" , RemovePropertyOwner );


local function GetDoorOwners( ply, args, call )

	local trace = { }
	trace.start = ply:EyePos();
	trace.endpos = trace.start + ply:GetAimVector() * 200;
	trace.filter = ply;
	local tr = util.TraceLine( trace );
	
	if( ValidEntity( tr.Entity ) and tr.Entity:IsDoor() ) then
	
		if( tr.Entity:OwnsDoor( ply ) ) then

			local tbl = tr.Entity:GetDoorOwnersList();
		
			ply:PrintMessage( 3, "A list has been printed in your console" );
			ply:PrintMessage( 2, "OWNERS: " );
		
			for k, v in pairs( tbl ) do
			
				ply:PrintMessage( 2, v:Nick() );
			
			end
		
		else
		
			ply:PrintMessage( 3, "You don't own this door" );
		
		end
	
	end
	
	return "";

end
TS.AddChatCommand( "/getdoorowners" , GetDoorOwners );


local AntiCyberTab = {
	{ " sex ", " hugs " },
	{ " cock ", " rooster " },
	{ " vagina ", " cat " },
	{ " penis ", " iPod " },
	{ "grabs his penis", "grabs his iPod" },
	{ " vaginal ", " pertaining to cats " },
	{ " anal ", " green " },
	{ " anus ", " paint " },
	{ " fuck my ", " hug my " },
	{ "rubs her pussy", "eats an apple" },
	{ " pussy ", " cat " },
	{ "sucks his cock", "gives him a new computer" },
	{ " clit ", " guitar " },
	{ "holds her breasts", "grabs a drink" },
	{ "cups her breasts", "grabs a drink" },
	{ "feels her breasts", "grabs a drink" },
	{ "fucks his", "watches Twilight" },
	{ "fucks her", "watches Twilight" }
}

function AntiCyber( args ) -- olo
	
	local args2 = args;
	for k, v in pairs( AntiCyberTab ) do
		
		args2 = string.gsub( args2, v[1], v[2] );
		
	end
	
	return args2;
	
end


local function AddDoorOwner( ply, args, call )

	local trace = { }
	trace.start = ply:EyePos();
	trace.endpos = trace.start + ply:GetAimVector() * 200;
	trace.filter = ply;
	local tr = util.TraceLine( trace );
	
	if( ValidEntity( tr.Entity ) and tr.Entity:IsDoor() ) then
	
		if( tr.Entity:OwnsDoor( ply ) ) then

			if( string.find( args, " " ) ) then

				local targetname = string.sub( args, string.find( args, " " ) + 1 );
				
				local target = TS.RunPlayerSearch( ply, targetname, true );
	
				if( target ) then
				
					if( tr.Entity:OwnsDoor( target ) ) then
					
						ply:PrintMessage( 3, target:Nick() .. " already co owns this door" );
					
					else
				
						tr.Entity:OwnDoor( target );
						ply:PrintMessage( 3, target:Nick() .. " has been made co owner of this door" );
					
					end
					
				end
				
			else
			
				ply:PrintMessage( 3, "Specify a target" );
			
			end
		
		else
		
			ply:PrintMessage( 3, "You don't own this door" );
		
		end
	
	end
	
	return "";

end
TS.AddChatCommand( "/adddoorowner" , AddDoorOwner );

local function DoMe( ply, args, call )

	TS.DayLog( "chatlog.txt", "[ACTION]" .. ply:LogInfo() .. " " .. args );
	
	TS.TalkToRange( "**" .. ply:Nick() .. AntiCyber( args ), ply:EyePos(), TS.ServerVars["talkrange"] );
			
	return "";

end
TS.AddChatCommand( "/me", DoMe );

local function WriteLetter( ply, args )

	if( ply:HasItem( "paper" ) ) then

		umsg.Start( "msgCreateLetterEditor", ply ); 
			umsg.String( string.sub( string.gsub( args, "//", "\n" ), 2 ) or "" );
		umsg.End();
	
	end
	
	return "";

end
TS.AddChatCommand( "/write", WriteLetter );

local function DropMoney( ply, args )
	
    if( args == "" ) then return ""; end
	
	local amount = tonumber( args );
	
	if( not ply:CanAfford( n ) ) then return ""; end
	
	if( amount < 1 ) then
	
		Notify( ply, 1, 4, "You must drop at least 1 credit." );
		return "";
	
	end
	
	ply:AddMoney( amount * -1 );
	
	local trace = { }
	
	trace.start = ply:EyePos();
	trace.endpos = trace.start + ply:GetAimVector() * 85;
	trace.filter = ply;
	
	local tr = util.TraceLine( trace );
	
	TS.PrintMessageAll( 2, "** [ITEM]" .. ply:Nick() .. " dropped $" .. amount );
	table.insert( TS.ItemLogs, TS.GetLogFormatDate() .. ply:Nick() .. "(" .. ply:SteamID() .. ") dropped $" .. amount );
	
	local moneybag = ents.Create( "prop_physics" );
	moneybag:SetModel( "models/props/cs_assault/money.mdl" );
	moneybag:SetPos( tr.HitPos );
	moneybag:Spawn();
	
	return "";
end
TS.AddChatCommand( "/dropmoney", DropMoney );
TS.AddChatCommand( "/moneydrop", DropMoney );
TS.AddChatCommand( "/droptokens", DropMoney );
TS.AddChatCommand( "/tokensdrop", DropMoney );

local function GiveMoney( ply, args )

	local n = tonumber( args );

	if( not n ) then return ""; end

	if( n <= 0 ) then
	
		return "";
	
	end

	if( not ply:CanAfford( n ) ) then return ""; end

	local trace = { }
	trace.start = ply:EyePos();
	trace.endpos = trace.start + 120 * ply:GetAimVector();
	trace.filter = ply;
	
	local tr = util.TraceLine( trace );
	
	if( ValidEntity( tr.Entity ) and tr.Entity:IsPlayer() ) then
	
		n = math.floor( n );
	
		ply:TakeMoney( n );
		tr.Entity:SetNWFloat( "money", n + tr.Entity:GetNWFloat( "money" ) );
		tr.Entity:PrintMessage( 3, ply:Nick() .. " has given you " .. n .. " credits" );
		ply:PrintMessage( 3, "Gave " .. tr.Entity:Nick() .. " " .. n .. " credits" );

		ply:SaveField( "charTokens", ply:GetNWFloat( "money" ) );
		tr.Entity:SaveField( "charTokens", tr.Entity:GetNWFloat( "money" ) );
		
	end


	return "";

end
TS.AddChatCommand( "/givemoney", GiveMoney );
TS.AddChatCommand( "/givecash", GiveMoney );
TS.AddChatCommand( "/givecredits", GiveMoney );

local function SetDoorTitle( ply, args )

	local trace = { }
	trace.start = ply:EyePos();
	trace.endpos = trace.start + 120 * ply:GetAimVector();
	trace.filter = ply;
	
	local tr = util.TraceLine( trace );
	
	if( ValidEntity( tr.Entity ) and tr.Entity:IsOwnable() ) then
	
		if( tr.Entity:OwnsDoor( ply ) ) then
		
			tr.Entity:SetNWString( "doorname", args );
		
		end
	
	end
	
	return "";

end
TS.AddChatCommand( "/doortitle", SetDoorTitle );

local function GiveWeapon( ply, args )

	if( not ply:GetActiveWeapon():IsValid() ) then
	
		ply:PrintMessage( 3, "Must have a weapon out" );
		return "";
	
	end

	local trace = { }
	trace.start = ply:EyePos();
	trace.endpos = trace.start + ply:GetAimVector() * 200;
	trace.filter = ply;
	local tr = util.TraceLine( trace );
	
	if( ValidEntity( tr.Entity ) and tr.Entity:IsPlayer() ) then
	
		if( tr.Entity:EyePos():Distance( ply:EyePos() ) <= 50 ) then
		
			local activeweap = ply:GetActiveWeapon();
			
			ply:StripWeapon( activeweap:GetClass() );
			ply:RemoveTSAmmo( activeweap:GetClass() );
			--Remove weapon
			
			local ammotype = activeweap:GetPrimaryAmmoType();
			local count = ply:GetAmmoCount( ammotype );
			
			ply:RemoveAmmo( count, ammotype );
			
			ply:RemoveInventoryWeapon( activeweap:GetClass() );
			
			tr.Entity:ForceGive( activeweap:GetClass() );
		
			ply:SaveItems();
			tr.Entity:SaveItems();
		
		else
		
			ply:PrintMessage( 3, "Not close enough to player" );
		
		end
		
	else
	
		ply:PrintMessage( 3, "Must be looking at a player" );
	
	end
	
	return "";

end
TS.AddChatCommand( "/givegun", GiveWeapon );
TS.AddChatCommand( "/giveweapon", GiveWeapon );

local function DropWeapon( ply, args )
--[[
	if( true ) then
	
		ply:PrintMessage( 3, "Disabled due to abuse" );
		return "";
	
	end
]]--
	if( not ply:GetActiveWeapon():IsValid() ) then
	
		ply:PrintMessage( 3, "Must have a weapon out" );
		return "";
	
	end	

	ply:DropWeapon();

	ply:SaveItems();

	return "";

end
TS.AddChatCommand( "/dropgun", DropWeapon );
TS.AddChatCommand( "/dropweapon", DropWeapon );

local function Whisper( ply, args )

	TS.TalkToRange( ply:Nick() .. ": [WHISPER] " .. args, ply:EyePos(), TS.ServerVars["whisperrange"] );
	
	TS.DayLog( "chatlog.txt", "[WHISPER]" .. ply:LogInfo() .. ": " .. args );
	
	return "";
		
end
TS.AddChatCommand( "/w ", Whisper );

local function Yell( ply, args )

	TS.TalkToRange( ply:Nick() .. ": [YELL] " .. args, ply:EyePos(), TS.ServerVars["yellrange"] );
	
	TS.DayLog( "chatlog.txt", "[YELL]" .. ply:LogInfo() .. ": " .. args );
	
	return "";
		
end
TS.AddChatCommand( "/y ", Yell );
TS.AddChatCommand( "/yell ", Yell );

local function Anon( ply, args )

	TS.PrintMessageAll( 2, ply:Nick() .. " used anon talk" );
	TS.TalkToRange( "???: " .. args, ply:EyePos(), TS.ServerVars["talkrange"] );
	
	TS.DayLog( "chatlog.txt", "[ANON]" .. ply:LogInfo() .. ": " .. args );
	
	return "";	

end
TS.AddChatCommand( "/an ", Anon );

local function SetTitle( ply, args, call )

	if( string.len( args ) > 54 ) then
	
		ply:PrintMessage( 3, "Title too long" );
		return "";
	
	end

	if( call == "/job " and ply:GetField( "jobnotify" ) == 0 ) then
		AddHelpTip( ply, .05, .5, 285, 68, "/job!?  You're not setting your job, you're\nsetting your character's title.  Sorry, but\nthere are no magical pay days for setting\nyour job anymore!" );
		ply:SetField( "jobnotify", 1 );
	end
	
	ply:SetNWString( "title", args );
	
	return "";

end
TS.AddChatCommand( "/title ", SetTitle );
TS.AddChatCommand( "/job ", SetTitle );

local function SetTitle2( ply, args, call )

	if( string.len( args ) > 54 ) then
	
		ply:PrintMessage( 3, "Title too long" );
		return "";
	
	end

	if( call == "/job " and ply:GetField( "jobnotify" ) == 0 ) then
		AddHelpTip( ply, .05, .5, 285, 68, "/job!?  You're not setting your job, you're\nsetting your character's title.  Sorry, but\nthere are no magical pay days for setting\nyour job anymore!" );
		ply:SetField( "jobnotify", 1 );
	end
	
	ply:SetNWString( "title", args );
	
	return "";

end
TS.AddChatCommand( "/title2 ", SetTitle2 );
TS.AddChatCommand( "/job2 ", SetTitle2 );

local function Advertise( ply, args, call )

	if( not ply:CanAfford( 25 ) ) then 
		ply:PrintMessage( 2, "Need 25 credits to advertise" );
		return ""; 
	end
	
	ply:TakeMoney( 25 );
	
	ply:SaveField( "charTokens", ply:GetNWFloat( "money" ) );
	
	TS.PrintMessageAll( 2, ply:Nick() .. " created an advertisement: " );
	TS.PrintMessageAll( 3, "[ADVERTISEMENT] " .. args, true );
	return "";

end
TS.AddChatCommand( "/adv ", Advertise );

local function Liedown( ply, args, call )

	if( ply:GetNWInt( "lyingdown" ) == 0 ) then

		ply:LieDown();
		
	end
	
	return "";

end
TS.AddChatCommand( "/liedown", Liedown );

local function GetUp( ply, args, call )

	if( ply:GetNWInt( "lyingdown" ) == 1 ) then
		
		ply:GetUp();
		
	end
	
	return "";	

end
TS.AddChatCommand( "/getup", GetUp );

local function Broadcast( ply, args, call )

	if( not ply:IsTrooper() ) then
		return "";
	end
	
	if( BROADCAST or ply:IsAdmin() ) then
		
		TS.DayLog( "chatlog.txt", "[BROADCAST]" .. ply:LogInfo() .. " " .. args );
	
		TS.PrintMessageAll( 2, ply:Nick() .. " used /bc" );
		
		TS.PrintMessageAll( 3, "[BROADCAST] " .. ply:Nick() .. ": " .. args, true );
		
	else
		
		TS.Notify( ply, "Broadcast is disabled.", 3 );
		
	end
	return "";

end
TS.AddChatCommand( "/bc", Broadcast );


local function cBecomeMI( ply, args, call )

	if( ply:CanBecomeMI() ) then
		ply:BecomeCP();
	end
	
	return "";

end
TS.AddChatCommand( "/mi", cBecomeMI );

local function cBecomeFleet( ply, args, call )

	if( ply:CanBecomeFleet() ) then
		ply:BecomeOW();
	end
	
	return "";

end
TS.AddChatCommand( "/fleet", cBecomeFleet );

local function cBecomeCitizen( ply, args, call )

	ply:BecomeCitizen();
	
	return "";

end
TS.AddChatCommand( "/citizen", cBecomeCitizen );

local function cKick( ply, args, call )

	ply:ConCommand( "rp_kick " .. args .. "\n" );
	
	return "";

end
TS.AddChatCommand( "!kick", cKick );

local function cBan( ply, args, call )

	ply:ConCommand( "rp_ban " .. args .. "\n" );
	
	return "";

end
TS.AddChatCommand( "!ban", cBan );

local function cSlay( ply, args, call )

	ply:ConCommand( "rp_slay " .. args .. "\n" );
	
	return "";

end
TS.AddChatCommand( "!slay", cSlay );

local function cSlap( ply, args, call )

	ply:ConCommand( "rp_slap " .. args .. "\n" );
	
	return "";

end
TS.AddChatCommand( "!slap", cSlap );

local function cExplode( ply, args, call )

	ply:ConCommand( "rp_explode " .. args .. "\n" );
	
	return "";

end
TS.AddChatCommand( "!explode", cExplode );

local function cASay( ply, args, call )

	ply:ConCommand( "rp_asay " .. args .. "\n" );
	
	return "";

end
TS.AddChatCommand( "!a", cASay );

local function cGoto( ply, args, call )

	ply:ConCommand( "rp_goto " .. args .. "\n" );
	
	return "";

end
TS.AddChatCommand( "!goto", cGoto );

local function cBring( ply, args, call )

	ply:ConCommand( "rp_bring " .. args .. "\n" );
	
	return "";

end
TS.AddChatCommand( "!bring", cBring );

local function cNoclip( ply, args, call )

	ply:ConCommand( "rp_noclip\n" );
	
	return "";

end
TS.AddChatCommand( "!noclip", cNoclip );

local function DoIt( ply, args, call )

	TS.DayLog( "chatlog.txt", "[IT]" .. ply:LogInfo() .. " " .. args );
	
	TS.PrintMessageAll( 2, ply:Nick() .. " used /it" );
	TS.TalkToRange( "**" .. AntiCyber( args ) .. "**", ply:EyePos(), TS.ServerVars["talkrange"] );
			
	return "";

end
TS.AddChatCommand( "/it", DoIt );


local function Event( ply, args, call )

	if( not ply:IsAdmin() ) then
		return "";
	end
	
	TS.DayLog( "chatlog.txt", "[EVENT]" .. ply:LogInfo() .. " " .. args );
	TS.PrintMessageAll( 2, ply:Nick() .. " used /ev" );

	TS.PrintMessageAll( 3, "[EVENT]**" .. args .. "**" );
	return "";

end
TS.AddChatCommand( "/ev", Event );
