Home   Help Search Login Register  

Author Topic: solved : changing golobal varies usin scripts  (Read 1048 times)

0 Members and 1 Guest are viewing this topic.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
solved : changing golobal varies usin scripts
« on: 24 Aug 2007, 09:26:50 »
is dere anyway 2 change a global variable using script ?

like i wanna set da vari true so i use

[variname] execVM "true.sqf"

da text in true.sqf

Code: [Select]
private ["vari"];

_vari = _this select 0;
_vari = true;

now i know dis wont work... also dis is not my script :P but its quick example 2 show wat i mean :D

LCD OUT
« Last Edit: 24 Aug 2007, 10:35:37 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Cheetah

  • Former Staff
  • ****
Re: changing golobal varies usin scripts
« Reply #1 on: 24 Aug 2007, 09:56:20 »
Hmm, as far as I know, you can always change variables, even without using a script?

Just do:

variable = true;

Or do I miss something specific you need for the script?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: changing golobal varies usin scripts
« Reply #2 on: 24 Aug 2007, 09:58:27 »
acualy... i wanna change (usin da same script) difrent variables... like evertime i send it avarible it does some calculations nd change da variable itself....

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Cheetah

  • Former Staff
  • ****
Re: changing golobal varies usin scripts
« Reply #3 on: 24 Aug 2007, 10:25:34 »
Code: [Select]
//Syntax: call { ["variableName"] execVM "true.sqf"; };

_var = _this select 0;
call compile format ["%1 = true;",_var];
hint format ["%1 = %2",_var,variable];

Example mission attached.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: changing golobal varies usin scripts
« Reply #4 on: 24 Aug 2007, 10:35:25 »
it works...  :good:

thanks

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta