Jump to content
Sign in to follow this  
Tom_48_97

SQF Syntaxe

Recommended Posts

Hello all,

I've just a little problem, so, what's wrong ?!

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Num = _This Select 0;

switch (_Num) do

{

   case 0:

   {

HintC "Test 1\nReturn 0"

Player SideChat "0"

   };

   case 1:

   {

HintC "Test 1\nReturn 1"

Player SideChat "1"

   };

   default

   {

HintC "Test 1\nReturn None"

Player SideChat "No value"

   };

};

Exit;

And it doesn't work, it execute all "SideChat" and all "HintC"...

Look by yourself :

http://www.shark-bambi.fr/deposite/Divers%7F/Prob_sqf.gif

When I do like this, that's okay   banghead.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Num = _This Select 0;

switch (_Num) do{case 0:{HintC "Test 1\nReturn 0";Player SideChat "0"; }; case 1:{HintC "Test 1\nReturn 1";Player SideChat "1";    };};

Exit;

Edit : How to call it ?

[] exec "something.sqf" take the syntax like an SQS file :/ So How to call this script in order to have an SQF syntaxe ?

Thanks to all help.gif

Share this post


Link to post
Share on other sites

You also need semicolons after every line in sqf, since whitespace is meaningless in that regards.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Num = _This Select 0;

switch (_Num) do

{

case 0:

{

HintC "Test 1\nReturn 0";

Player SideChat "0";

};

case 1:

{

HintC "Test 1\nReturn 1";

Player SideChat "1";

};

default

{

HintC "Test 1\nReturn None";

Player SideChat "No value";

};

};

Exit;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×