Jump to content
Sign in to follow this  
alexharvey52

Whats the opposite of "isNil" ?

Recommended Posts

what is the oposite for isNil in an sqf arma file?

Lets say just for my explaining purpopes the oposite of 'isNil' is 'isTrue' this is what im trying to do:

	if (isNil "acre_sys_io_pipeHandle") then
{  
	if (!isDedicated) then {titleText [ACREWARNING_MESSAGE, "PLAIN", 3];};
};

if (isTrue "acre_sys_io_pipeHandle") then
{  
	[5663, acre] call acre_api_fnc_joinChannel;
};

Thanks is advance!

Share this post


Link to post
Share on other sites

!(isnil "acre_sys_io_pipeHandle") [using your example above - not sure in what context]

try that

! means Not or you can just use not instead they both work

Share this post


Link to post
Share on other sites

...or you could try:

if (isNil "acre_sys_io_pipeHandle") then
{  
	if (!isDedicated) then {titleText [ACREWARNING_MESSAGE, "PLAIN", 3];};
}
       else
{  
	[5663, acre] call acre_api_fnc_joinChannel;
};

Share this post


Link to post
Share on other sites
!(isnil "acre_sys_io_pipeHandle") [using your example above - not sure in what context]

try that

! means Not or you can just use not instead they both work

Will give this a go thanks.

---------- Post added at 08:40 ---------- Previous post was at 08:39 ----------

...or you could try:

if (isNil "acre_sys_io_pipeHandle") then
{  
	if (!isDedicated) then {titleText [ACREWARNING_MESSAGE, "PLAIN", 3];};
}
       else
{  
	[5663, acre] call acre_api_fnc_joinChannel;
};

I tried using the else statement before you posted it and I was getting an error on the "[5663, acre] call acre_api_fnc_joinChannel;" line but when its not in there it works fine.

Also I need to do this loop throughout the time the player is on the server. Where should I put it?

Edited by alexharvey52

Share this post


Link to post
Share on other sites

Generally in programming a ! symbol means the negation of the expression that is after it.

Share this post


Link to post
Share on other sites

I thought it would be better to carry on this thread instead of making a new topic.

I have something else I need help with must alike my previous questions but more advance.

while {(isServer)} do
{

if (!isNil "acre_sys_io_pipeHandle") then
{  
	[5663, acre] call acre_api_fnc_joinChannel;
	sleep 5;
};

if (isNil "acre_sys_io_pipeHandle") then
{  
	titleText [ACREWARNING_MESSAGE, "PLAIN", 3];
	sleep 5;
};

};

I want the mission to constantly check the if statements. This works with the code above however it then carrys on looping the commands, this is ofcourse expected. What I need is for it to loop forever and if the text is already on the screen then it doesnt display it again.

Ive written an example in shudo code below:

while {(isServer)} do
{

if (!isNil "acre_sys_io_pipeHandle") then
{  
		[5663, acre] call acre_api_fnc_joinChannel;
	sleep 5;
};

if (isNil "acre_sys_io_pipeHandle") then
{  
	titleText [ACREWARNING_MESSAGE, "PLAIN", 3];
	sleep 5;
               if acre warning message is already on screen then skip step
};

};

Once I have got it working on the warning message I will try and apply it to the acre join channel command.

Share this post


Link to post
Share on other sites

IF U WANT HELP YOU HAVE TO EXPLAIN WHAT RE U TRYING TO ACHIVE

while {(isServer)} do
{

if (!isNil "acre_sys_io_pipeHandle") then
{  
	[5663, acre] call acre_api_fnc_joinChannel;
	sleep 5;
};

if (isNil "acre_sys_io_pipeHandle") then
{  
	titleText [ACREWARNING_MESSAGE, "PLAIN", 3];
	sleep 5;
};

};

from my point of view the idea of this code is simply wrong...

I tried using the else statement before you posted it and I was getting an error on the "[5663, acre] call acre_api_fnc_joinChannel;" line but when its not in there it works fine.

this:

if isServer then
{
 while { true } do
 {
   if (!isNil "acre_sys_io_pipeHandle") then
   {  
     [5663, acre] call acre_api_fnc_joinChannel;
   }
   else
   {  
     titleText [ACREWARNING_MESSAGE, "PLAIN", 3];
   };

   sleep 5;
 };
};

dont have to be same as this:

if isServer then
{
 while { true } do
 {
   if (isNil "acre_sys_io_pipeHandle") then
   {  
     titleText [ACREWARNING_MESSAGE, "PLAIN", 3];
   }
   else
   {  
     [5663, acre] call acre_api_fnc_joinChannel;
   };

   sleep 5;
 };
};

since u didnt explain much... i can just guess that this can be the solution...

if isServer then
{
 _null = [] spawn
 {
   waitUntil { !isNil "acre_sys_io_pipeHandle" };
   [5663, acre] call acre_api_fnc_joinChannel;
 };
};

....and another question is... if its really good idea to call, not spawn, that function...

---------- Post added at 13:40 ---------- Previous post was at 13:25 ----------

btw... if that should be work around public variables u should probably stop and look at https://community.bistudio.com/wiki/BIS_fnc_MP

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  

×