Results 1 to 2 of 2

Thread: Scalar (dedi problem)

  1. #1

    Scalar (dedi problem)

    I have variable initialised in the init.sqf (guns = 0;) and two scripts with the following:

    Code:
    guns = guns +1;
    publicVariable "guns";
    
    hint format ["%1/2 gun", guns];
    
    if (guns == 2) then {
    _handler = [player,nil,rSIDECHAT, "Hint Message2."] call RE;
    };
    In preview, things work as expected, calling the script once will give "1/2 guns" hint and the second time 2/2 and the message. When I put it on a dedi however, all I get is the hint "scalar/2 guns". I assume 'scalar' in this context means undefined variable, but I can't figure out why.


    Ed: Putting the hint at the start of the trigger turns 'scalar' into 'any'. The init seems fine, though - other variables are being initialized, other commands further down in the init are working...
    Last edited by Reimann; May 9 2010 at 10:26.

  2. #2
    in init.sqf initialize the guns variable only on the server and publicVariable it (aka guns=0; publicVariable "guns";), and then at the start of this script add the line waitUntil {!isNil "guns"}; so that this script doesn't run before the variable is initialized by the server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •