Jump to content
Sign in to follow this  
KC Grimes

Having trouble with detecting JIP

Recommended Posts

Howdy folks! I'm still working on my revive script, though am almost done. However I have hit a little snag. I'm having trouble detecting JIP. Here's my story.

What I first had setup:

init.sqf
waitUntil {player == player};
waitUntil {!isNull player};

//This leads to execVM full of one line defines, which leads to execVM, which in the first lines has:
execvmnum2.sqf
if (time > 0) then {
G_JIP = true;
}
else
{
G_JIP = false;

However, this was always returning false, even for JIP (testing as an MP host).

So, I tried sickboy's code and connected it to mine to maintain my links:

T_INIT = false;
T_Server = false; T_Client = false; T_JIP = false;

if (playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian > 0) then { T_MP = true } else { T_MP = false };

if (isServer) then
{
 T_Server = true;
 if (!(isNull player)) then { T_Client = true };
 T_INIT = true;
} else {
 T_Client = true;
 if (isNull player) then
 {
     T_JIP = true;
     [] spawn { waitUntil { !(isNull player) }; T_INIT = true };
 } else {
     T_INIT = true;
 };
};

if (T_JIP) then {
G_JIP = true;
player setVariable ["G_Test",true,true];
player sideChat "You're JIP!";
}
else
{
G_JIP = false;
player setVariable ["G_Test",false,true];
player sideChat "You're NOT JIP!";
};

However, it once again always returned false. As well, for whatever reason the side chat never showed up on the JIP's screen as expected. That's why I used the variable, so I could check it from my end.

So... I'm stuck. I need to differentiate JIP/init, but can't seem to get it done with these methods. Any suggestions? Anybody seeing errors?

Thanks as always!

Edit:

Well. Problem solved. :P Not sure why, but this worked:

G_Server = false;
G_Client = false;
G_JIP = false;

if (isServer) then { G_Server = true };
if (!isDedicated) then { G_Client = true };
if (isNull player) then { G_JIP = true };

if (G_JIP) then {
titleText ["You're JIP!", "BLACK", 0];}
else
{
titleText ["You're NOT JIP!", "BLACK", 0];
};

Edited by Grimes [3rd ID]

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  

×