IPB


Welcome Guest ( Log In | Register )

 Forum Rules ArmedAssault.info Forum Rules
 
Reply to this topicStart new topic
> faulty SQF file
T4MP400
post Apr 28 2012, 19:05
Post #1


Member
***

Group: Members
Posts: 111
Joined: 23-July 08
From: Sweden
Member No.: 3,719



Hi!
Ive been trying to get this sqf file to work for the latest hour but cant figure out whats the problem. I want this sound to repeat during the whole mission.

CODE
while {true} do
   {
       #loop
   playsound "background";
   sleep 21;
    }
sleep 1;
~21
Goto "loop"
};


When I try to run the script it works fine and repeats like I want it to but I get a error message saying:
'|#|sleep 1;'
Error Generic error in expression

If anyone could find out whats wrong with it and correct it I would be very grateful.

This post has been edited by T4MP400: Apr 28 2012, 19:06


--------------------
Gunner: Sir! We are surrounded! Commander: Excellent! Then we can attack them from all directions!
 
Quote Post
NeMeSiS
post Apr 29 2012, 14:17
Post #2


Senior Member
****

Group: Members
Posts: 261
Joined: 16-October 06
From: Leiden, The Netherlands
Member No.: 7



You just mixed sqs and sqf.
Sqs is line based and uses goto's and labels, sqf allows you to use stuff like while/for/etcetc. ~ is for sqs, sleep is for sqf.
sqs is run with exec, and sqf (in this case) with execVM.


So either make it sqs:
CODE
#loop
~21
playsound "background"
goto "loop"


Or sqf:
CODE
while {true} do
{
playsound "background";
sleep 21;
};


--------------------
Homo sapiens non urinat in ventum.
[img]http://www.impossible-quiz.com/images/badges/95-3.gif[img]
Impossible Quiz
 
Quote Post

Reply to this topicStart new topic
6 User(s) are reading this topic (6 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 29th March 2024 - 09:11