Problem with view distance

hi guys I´ve this view distance code bellow it works fine but after some minutes the view distance goes back to default , does someone know what can be causing this problem ?
Code:
setviewdistance 2000;
bis_fog = 0;

setviewdistance 2000;
0 setovercast 0;
0 setrain 1;
0 setfog bis_fog
 
Just put it in a loop.

Code:
While {true} do {
setviewdistance 2000;
bis_fog = 0;

setviewdistance 2000;
0 setovercast 0;
0 setrain 1;
0 setfog bis_fog
Sleep 30;
};

You probably only need this though
Code:
While {true} do {
setviewdistance 2000;
Sleep 30;
};
 
Just put it in a loop.

Code:
While {true} do {
setviewdistance 2000;
bis_fog = 0;

setviewdistance 2000;
0 setovercast 0;
0 setrain 1;
0 setfog bis_fog
Sleep 30;
};

You probably only need this though
Code:
While {true} do {
setviewdistance 2000;
Sleep 30;
};
can I use this just like that or do I need set a varible first then give it the true value so use it in the loop ?
if so where can I find information about this language
 
It keeps changing because the view distance is supposed to be the same for all players so its hard coded into dayz.
setviewdistance page
https://community.bistudio.com/wiki/setViewDistance


All Scripting commands
https://community.bistudio.com/wiki/Category:Scripting_Commands

syntax page
https://community.bistudio.com/wiki/SQF_syntax

loops
https://community.bistudio.com/wiki/Control_Structures

Variables
https://community.bistudio.com/wiki/Variables

Assignment and Comparison operators.
https://community.bistudio.com/wiki/Operators
 
Just put it in a loop.

Code:
While {true} do {
setviewdistance 2000;
bis_fog = 0;

setviewdistance 2000;
0 setovercast 0;
0 setrain 1;
0 setfog bis_fog
Sleep 30;
};

You probably only need this though
Code:
While {true} do {
setviewdistance 2000;
Sleep 30;
};
I did it and worked for me but I can only use it in one option for example 2000 then if I choose 500 it will go back to 2000 and it start to change 500 then 2000 forever , how can I use this without it happen
 
Last edited:
yeah but how about telling us how?!
Maybe there are some more people with this problem :p

what I did was change the scope of my variable from local to global it worked but when I start the server it starts laging for everyone , but I don´t know if it has anything to do with this change that I did , then I put the old files back and let it as it was before do you know what can I do ? becase looks like if I use global variables it will lag the server after sometime
 
Back
Top