Home   Help Search Login Register  

Author Topic: Script error but works fine in trigger  (Read 1310 times)

0 Members and 1 Guest are viewing this topic.

Offline Lollypop

  • Members
  • *
  • Noob Alert
Script error but works fine in trigger
« on: 21 May 2009, 18:45:35 »
Hello

I copied some code from a trigger that opens gates when someone gets into trigger area.
But its not working properly: it opens and closes the gate 1st time with an error message "Invalid number in expression" in line 8"

If i try again to open them it stays open..doesnt close again.

can anyone help pls?

i attached the sqf file.

Offline i0n0s

  • Former Staff
  • ****
Re: Script error but works fine in trigger
« Reply #1 on: 21 May 2009, 18:55:24 »
~ doesn't work in SQF, use sleep instead.

Offline Lollypop

  • Members
  • *
  • Noob Alert
Re: Script error but works fine in trigger
« Reply #2 on: 21 May 2009, 19:17:21 »
hai..tnx for the reply..

im such a noob...the gates already have a built in open/close you just have to get near them  ::)

however for future use..the solution you gave me produced another error a missing ; in line 9  any ideas? :dunno:

Offline i0n0s

  • Former Staff
  • ****
Re: Script error but works fine in trigger
« Reply #3 on: 21 May 2009, 20:17:59 »
Each command in SQF has to be determinated with an ;
So you need to add ; to the end of each command.
I can recommend to read the Basic SQF Tutorial

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Script error but works fine in trigger
« Reply #4 on: 22 May 2009, 22:27:05 »
The error is like on the line above the ~5  in sqf has to be replaced with sleep 5;

Xbox Rocks