-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed type errors found with the CuberitePluginChecher.
- Loading branch information
Showing
3 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
function HandleViewDistanceCommand( Split, Player ) | ||
function HandleViewDistanceCommand(a_Split, a_Player) | ||
-- Check the number of params, show usage if not enough: | ||
if (#a_Split ~= 2) then | ||
SendMessage(a_Player, "Usage: /viewdistance <".. cClientHandle.MIN_VIEW_DISTANCE .." - ".. cClientHandle.MAX_VIEW_DISTANCE ..">") | ||
return true | ||
end | ||
|
||
if( #Split ~= 2 ) then | ||
SendMessage( Player, "Usage: /viewdistance <".. cClientHandle.MIN_VIEW_DISTANCE .."-".. cClientHandle.MAX_VIEW_DISTANCE ..">" ) | ||
-- Check if the param is a number: | ||
local viewDistance = tonumber(a_Split[2]) | ||
if not(viewDistance) then | ||
SendMessageFailure(a_Player, "Expected a number parameter") | ||
return true | ||
end | ||
|
||
Player:GetClientHandle():SetViewDistance( Split[2] ) | ||
SendMessageSuccess( Player, "Your view distance has been set to " .. Player:GetClientHandle():GetViewDistance() ) | ||
a_Player:GetClientHandle():SetViewDistance(viewDistance) | ||
SendMessageSuccess(a_Player, "Your view distance is now " .. a_Player:GetClientHandle():GetViewDistance()) | ||
return true | ||
|
||
end |