OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: illmatic on 31 Jan 2004, 22:00:18
-
#start
? (p1 == Player) : goto "ok"
? (p2 == Player) : goto "away"
? (p3 == Player) : goto "away"
? (p4 == Player) : goto "away"
? (p5 == Player) : goto "away"
#away
player setpos getpos cop1a
Player GroupChat "This is p1's garage, you cannot enter";
goto "end"
#ok
Player GroupChat "Welcome to your garage p1";
goto "end"
#end
exitok the problem is, when someone enters such as p2, it activates for the rest aswell.......... is there a way to stop this? ty to anyone who can help me ??? ;D ;D ;D
-
Is it activated through a trigger? if so you might want to change the triggers to "Anyone present" and "Repeadedly" and change the Activation line to {_x exec "script1.sqs"} foreach in thislist
and edit the script a little bit like so..
;script1.sqs
#start
? (p1 == _this) : goto "ok"
? (p2 == _this) : goto "away"
? (p3 == _this) : goto "away"
? (p4 == _this) : goto "away"
? (p5 == _this) : goto "away"
goto "end"
#away
_this setpos getpos cop1a
_this GroupChat "This is p1's garage, you cannot enter";
goto "end"
#ok
_this GroupChat "Welcome to your garage p1";
goto "end"
#end
exit
And hopefully it should work ;D
-
Thanks mate, i edited the script did all you said but {_x exec "script1.sqs"} foreach in thislist wont go into the activation field, unknown operator..... ??? ??? :'(
-
Try
{[_x] exec "script1.sqs"} forEach thisList
-
:beat: beaten by Mac... :P
However, what was causing the unknown operator was in before thisList... No need for in...
Macs syntax is right...
-
thx that works, and whoops another prob :(
#start
? (p1 == _this) : goto "ok";
? (p2 == _this) : goto "away";
? (p3 == _this) : goto "away";
? (p4 == _this) : goto "away";
? (p5 == _this) : goto "away";
goto "end"
#away
_this setpos getpos cop1a
_this GroupChat "This is p1's garage, you cannot enter";
goto "end"
#ok
_this GroupChat "Welcome to your garage p1";
goto "end"
#end
exit
I get an error
â€Ëœ(p5 == _this) |#||': Error ==: Type Array, expected number,string,object,sidegroup
umm......... this is probaly something really simple but im abit lost! ???
ty to all ppl who are helpin 8)
-
You need something like
_loon = _this select 0
#start
? (p1 == _loon) : goto "ok";
and so on. The problem is that _this is an array, which is no good with the ==.
-
thx all peeps who helped ive managed to get this workin perfectly ;D ;D ;D ;D
-
â€Ëœ(p5 == _this) |#||': Error ==: Type Array, expected number,string,object,sidegroup
I think this error was caused by executing the script with [_x]... It results in array AFAIK so if executed with _x it would not have given any errors...
But that doesn't matter if u got all sorted out :P