OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: popS on 25 Jan 2005, 17:32:27
-
Im having trouble getting access to public variable in a script.
The variable is declared in a different script.
In script A:
WestFlag = WestFlag + [_flag]
PublicVariable "WestFlag"
In script B:
?!(Flag1 in WestFlag) : JumpOnLeftLegScreemingImALuckyPotatoe^^^^^^^^^^^^
This part look like its not working. It looks like the array "WestFlag" is empty.
"WestFlag" should be an array of objects, since "_flag" should be a flag. "Flag1" should also be a flag.
Maybe I shouldnt use public variables at all?
-
JumpOnLeftLegScreemingImALuckyPotatoe
Oh if only... ;D
-
In your init.sqs before any reference to WestFlag try adding the following line :
WestFlag = []
to initialise the array. Then you can add elements to it. You only need to use PublicVariable when you want to update the WestFlag array on all clients and the server.
-
Thats it, Thx a mill.