Jump to content
  • 0

How if/then statements work.


Alexander Hamilton

Question

Ok I have a scripting question for you i want to make a config in my init an example would be i want to make Snapping = 1; then later down do if (Snapping == 1) then { run scripts }; then in the desc.ext call that config in the init how would i do this would i do if (Snapping in init.sqf == 1) then..... ? or how would one do this?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Does not work that way with include/config files.

 

What you can do instead is do a check in your custom compiles.

Snapping = false; //this is global variable that can be toggled any time

if (!isDedicated) then {

if (Snapping) then {
player_build = compile preprocessFileLineNumbers "Snapping\player_build.sqf"; //will load snap building
} else {
player_build = compile preprocessFileLineNumbers "dayz_code\compile\player_build.sqf";  //if false, will load defaults
};

};
Link to comment
Share on other sites

  • 0

 

Does not work that way with include/config files.

 

What you can do instead is do a check in your custom compiles.

Snapping = false; //this is global variable that can be toggled any time

if (!isDedicated) then {

if (Snapping) then {
player_build = compile preprocessFileLineNumbers "Snapping\player_build.sqf"; //will load snap building
} else {
player_build = compile preprocessFileLineNumbers "dayz_code\compile\player_build.sqf";  //if false, will load defaults
};

};

O ok thank you alot  :P silly me 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...