summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core/viewdistance.lua
blob: 9b2066cbf35c0991f39dec7cb9a63baa74e32ec4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
function HandleViewDistanceCommand( Split, Player )

	if( #Split ~= 2 ) then
		SendMessage( Player, "Usage: /viewdistance [".. cClientHandle.MIN_VIEW_DISTANCE .."-".. cClientHandle.MAX_VIEW_DISTANCE .."]" )
		return true
	end

	Player:GetClientHandle():SetViewDistance( Split[2] )
	SendMessageSuccess( Player, "Your view distance has been set to " .. Player:GetClientHandle():GetViewDistance() )
	return true

end