Jump to content
Sign in to follow this  
alleycat

hardcoding viewdistance

Recommended Posts

If I wanted to hardcore the viewdistance server-side to a max value, where should I do that? Is putting setviewdistance in init.sqf safe?

Share this post


Link to post
Share on other sites
If I wanted to hardcore the viewdistance server-side to a max value, where should I do that? Is putting setviewdistance in init.sqf safe?

Yes. You could do something like this:

if (isServer) then {
   setViewDistance 1337;
};

Or if you allow players to change their viewdistance, this might be more suitable:

if (isDedicated) then {
  setViewDistance 1337;
};

Beware, some scripts change viewdistance on their own, like certain AI scripts serverside.

Share this post


Link to post
Share on other sites

I dont get what is the difference between the snippets. Both target the server? Why would the second allow clients to set the viewdistance and the first would not?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×