Jump to content
  • 0

Call Variables From Mission File?


Pavillin

Question

Hello all, I'm wondering if it's possible to call on variables in the mission file to use in my server pbo. If you can could somone explain how I do this thanks :D

Edit:

Just to add more detail, I have a file which holds a function in my mission file. This function can be called on by using:

publicVariable "Magic";

I'm wondering if I use this in a file in my dayz_server.pbo will it work and run the function

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Variables are used for many things. What exactly are you trying to do ? 

This code (locally or serverside) would simply broadcast that variable as true to all clients and the server.

ThisValue = true;
publicVariable "ThisValue"; 

The code below is assuming you want to attach a value to an object, like a player or a vehicle .. i'm going to use player for the example..

//Mission Script , init.sqf for example
player setVariable ["VariableName",4321,true]; //True makes it Global

//Server script 
_getTheVariable = player getVariable "VariableName"; //Would return "4321" 

 

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...