ACE3/addons/viewdistance/functions/fnc_changeViewDistance.sqf

41 lines
969 B
Plaintext
Raw Normal View History

2015-05-08 07:28:48 +00:00
/*
* Author: Winter
* Sets the player's current view distance according to allowed values.
*
*
* Arguments:
2015-05-08 12:14:15 +00:00
* None
2015-05-08 07:28:48 +00:00
*
* Return Value:
* None
*
* Example:
2015-05-08 12:14:15 +00:00
* [] call ace_viewdistance_fnc_changeViewDistance;
2015-05-08 07:28:48 +00:00
*
* Public: No
*/
#include "script_component.hpp"
2015-05-08 12:14:15 +00:00
private ["_new_view_distance_index","_new_view_distance"];
_new_view_distance_index = GVAR(newViewDistance);
_new_view_distance = [_new_view_distance_index] call FUNC(returnViewDistanceValue);
/*
hint format ["DEBUG: Player: %1 new view distance index: %2 new view distance value: %3",(name player),_new_view_distance_index,_new_view_distance];
diag_log format ["DEBUG: Player: %1 new view distance index: %2 new view distance value: %3",(name player),_new_view_distance_index,_new_view_distance];
*/
2015-05-08 07:28:48 +00:00
2015-05-08 12:14:15 +00:00
// To do: add a check against a sever or module top limit here.
2015-05-08 07:28:48 +00:00
2015-05-08 12:14:15 +00:00
if !GVAR(changeAllowed) then
{
hint "You cannot change the view distance!"
}
else
{
setViewDistance _new_view_distance;
};