Forum Jump :

Author Message


Posts: 44
Rank:


Level: Member

Country: nz
Location:
Occupation:
Age: 46
In-game name:

 
#1 Posted at 2009-08-09 03:16        
     
I have read some guides and tutorials on use of variables.

But alas my script doesn't want to work..

In my init.sqs file i have set vipp2=false.
The script below is called when a player uses a addaction via a trigger.
I want the script below to set vipp2 to true when it executes for the first time. And then if another player
uses the addaction/trigger later or again they will be told VIP2 has already been taken into custody.

But when this script runs i get the knocking door sfx and then nothing else happens.
The script was working earlier before i added the if true/exitwith bits. As far as i can tell im am using the correct syntax.

playSound "knocking_door";
if vipp2=true then exitwith {
Hint "VIP2 Has already been taken into custody."
}else{

player removeaction knock2;
_group1 = group player;
vpciv2= _group1 createUnit ["damsel1", getpos player, [], 0, "form"];

hint "Second VIP found.";
vipp2=true;
};


Author Message


Posts: 44
Rank:


Level: Member

Country: nz
Location:
Occupation:
Age: 46
In-game name:

 
#2 Posted at 2009-08-09 04:46        
     
I managed to find a work around for my problem! Still using name=true in trigger doesnt seem to work. So if someone in the know reading this, how would you get this to work using true/false in the triggers condition line?


This is my alternative.

player removeaction knock2;
playSound "knocking_door";
if (alive vpciv2) exitwith
{hint "VIP2 Has already been taken into custody."};

_group = group player;
vpciv2 = _group createUnit ["damsel1", getpos player, [], 0, "form"];
dostop vpciv2;
vpciv2 dowatch player;
hint "First VIP found.";

//in trigger knock = player addaction ["text", "scriptname.sqf"];
//note: Addaction cannot have the same "text" other wise the will intergrate.;