FragZ Posted October 27, 2014 Report Share Posted October 27, 2014 I would like to know if it is possible to call a list of defined variables over the server.pbo, but in the mission file. *ANSWERED* I am totally lost right now! Link to comment Share on other sites More sharing options...
0 MPG Posted October 27, 2014 Report Share Posted October 27, 2014 I have the admin stuff all put server side so i dont have to update all the time. Yes there is a way of doing it. Link to comment Share on other sites More sharing options...
0 CordIAsis Posted October 27, 2014 Report Share Posted October 27, 2014 In your explanation it states that both server_whitelist.sqf and admintools_main.sqf are both serverside, but your one line question at the top states one is serverside one is clientside. That's confused me somewhat. I'm gonna assume that you made an error in your explanation and just go from your one line at the top. Yes, you can. Once you have initialised your variables serverside you can use publicVariable "my_variable"; to broadcast that to all clients. Clientside you can just put them in a hold, waitUntil {!isNil "my_variable"}; then a quick if statement to work out if the player UID is inside the 'my_variable' array. I hope that answered your question properly. MPG and FragZ 2 Link to comment Share on other sites More sharing options...
0 FragZ Posted October 27, 2014 Author Report Share Posted October 27, 2014 In your explanation it states that both server_whitelist.sqf and admintools_main.sqf are both serverside, but your one line question at the top states one is serverside one is clientside. That's confused me somewhat. I'm gonna assume that you made an error in your explanation and just go from your one line at the top. Yes, you can. Once you have initialised your variables serverside you can use publicVariable "my_variable"; to broadcast that to all clients. Clientside you can just put them in a hold, waitUntil {!isNil "my_variable"}; then a quick if statement to work out if the player UID is inside the 'my_variable' array. I hope that answered your question properly. Updated post, my bad. So once I define my variables over the server side, I would then need to put publicVariable "thevariablethatisinServerpbo"; somewhere in the client file? Or in the actual file needing the variable check? And I don't get your part about the waitUntil Link to comment Share on other sites More sharing options...
0 FragZ Posted October 27, 2014 Author Report Share Posted October 27, 2014 This is a part of my variable file I am talking about: /****************************************************************************************************************/ //Super admin and Dev testing whitelisting FZ_SuperLovers = ["xxxUIDsxxx"]; Mod_list = ["000"]; FZ_Admins = ["0"]; Would I just execVM that file from the server_functions.sqf ? And then, what to do next? (Sorry a bit hangover) Edit: So the server side file would have this:publicVariable "FZ_SuperLovers"; publicVariable "Mod_List"; publicVariable "FZ_Admins"; At the end so it broadcasts the variable globally? Link to comment Share on other sites More sharing options...
0 CordIAsis Posted October 27, 2014 Report Share Posted October 27, 2014 You would use the publicVariable command serverside, as you're wanting to send it from the server to the clients. The waitUntil{!isNil "my_var"}; command in the clientside files will stop the script proceeding until the client has received your variable from the server. This command will halt progress of the file it is in until the code inside the braces returns true. In this case it checks that the variable you send from your server using publicVariable command has been received by the client. Using this is important to prevent errors relating to your variable being undefined. Yes! Just like that. /****************************************************************************************************************/ //Super admin and Dev testing whitelisting FZ_SuperLovers = ["xxxUIDsxxx"]; Mod_list = ["000"]; FZ_Admins = ["0"]; publicVariable "FZ_SuperLovers"; publicVariable "Mod_List"; publicVariable "FZ_Admins"; That would do the trick just fine. ExecVm that from anywhere serverside and those variable will go to all clients. FragZ 1 Link to comment Share on other sites More sharing options...
0 FragZ Posted October 27, 2014 Author Report Share Posted October 27, 2014 You would use the publicVariable command serverside, as you're wanting to send it from the server to the clients. The waitUntil{!isNil "my_var"}; command in the clientside files will stop the script proceeding until the client has received your variable from the server. This command will halt progress of the file it is in until the code inside the braces returns true. In this case it checks that the variable you send from your server using publicVariable command has been received by the client. Using this is important to prevent errors relating to your variable being undefined. Oh I get you. So I would need to use publicvariable in the server file just like I posted above, and then use *waitUntil {!isNil "FZ_SuperLovers"}; at the top of my admintools file, so it prevents the file from continuing execution if the said variable is returning an empty array. I get it. But if I have multiple public variables in the same file, would I need to make like... 3 waitUntil commands if I have 3 variables from server side? Thank you very much for your help btw! Link to comment Share on other sites More sharing options...
0 CordIAsis Posted October 27, 2014 Report Share Posted October 27, 2014 You can check for all variables in 1 waitUntil command. waitUntil {(!isNil "myvar1") && (!isNil "myvar2") && (!isNil "myvar3")}; FragZ 1 Link to comment Share on other sites More sharing options...
0 FragZ Posted October 27, 2014 Author Report Share Posted October 27, 2014 You can check for all variables in 1 waitUntil command. waitUntil {(!isNil "myvar1") && (!isNil "myvar2") && (!isNil "myvar3")}; I see. Thank you very much for your time! Link to comment Share on other sites More sharing options...
0 CordIAsis Posted October 27, 2014 Report Share Posted October 27, 2014 You're welcome, if you need any further help/advice I'm happy to answer. Link to comment Share on other sites More sharing options...
0 FragZ Posted October 27, 2014 Author Report Share Posted October 27, 2014 You're welcome, if you need any further help/advice I'm happy to answer. Well since you ask... if you have time check this out: Link to comment Share on other sites More sharing options...
Question
FragZ
I would like to know if it is possible to call a list of defined variables over the server.pbo, but in the mission file.
*ANSWERED*
I am totally lost right now!
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now