OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: illmatic on 31 Jan 2004, 22:00:18

Title: not sure how i would subject this!
Post 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


Title: Re:not sure how i would subject this!
Post by: Korax on 01 Feb 2004, 04:04:44
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..
Code: [Select]
;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
Title: Re:not sure how i would subject this!
Post by: illmatic on 01 Feb 2004, 13:07:20
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.....  ??? ???  :'(

Title: Re:not sure how i would subject this!
Post by: macguba on 01 Feb 2004, 13:24:58
Try

{[_x] exec "script1.sqs"} forEach thisList
Title: Re:not sure how i would subject this!
Post by: h- on 01 Feb 2004, 13:25:56
:beat: beaten by Mac...  :P

However, what was causing the unknown operator was in before thisList... No need for in...
Macs syntax is right...
Title: Re:not sure how i would subject this!
Post by: illmatic on 01 Feb 2004, 14:44:30
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)
Title: Re:not sure how i would subject this!
Post by: macguba on 01 Feb 2004, 16:25:21
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 ==.
Title: Re:not sure how i would subject this!
Post by: illmatic on 01 Feb 2004, 17:26:16
thx all peeps who helped ive managed to get this workin perfectly  ;D ;D ;D ;D
Title: Re:not sure how i would subject this!
Post by: h- on 01 Feb 2004, 21:25:06

â€Ëœ(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