summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core/viewdistance.lua
blob: 2cf96d8bc72b21636d9ff5b41a3cbe8db9e24922 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
function HandleViewDistanceCommand( Split, Player )
	if( #Split ~= 2 ) then
		Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. "Usage: /viewdistance [".. cClientHandle.MIN_VIEW_DISTANCE .."-".. cClientHandle.MAX_VIEW_DISTANCE .."]" )
		return true
	end
	
	Player:GetClientHandle():SetViewDistance( Split[2] )
	Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. "Your view distance has been set to " .. Player:GetClientHandle():GetViewDistance() )
	return true
end