Jump to content
Guest

Is the only way to detect a JIP player that was not present at mission start with IsNull Player in Init.sqf?

Recommended Posts

Guest

I've been digging around both here on the forums and with google trying to find a way to detect when a player has JIP'd which was not there at mission start so I can teleport them to "waiting area" for the mission to be finished by those already playing because the Coop mission is not technically Jip compatible.

 

All I've found is a few posts indicating to use IsNull Player in the Init.sqf. Problem here, is that I have also been told that it is possible that even for players that are there *at* mission start - there is a chance that a player may not yet be fully initialized in the Init.sqf and therefore "Player" can actually be temporarily Null even for someone that was there at mission start - and that would be very Bad, as then the JIP code would run on the wrong players.

 

If this is all we have, I can't help but wonder why Bis has not provided a simple command that could either provide a list of players that were there at mission start (to compare to any Jip'ers so we know the difference) or a way to identify Jip'ers directly.

 

This is the bit of code I picked up, pretty basic, but again, kind of questionable to at least me as to the safety of it for players that were there at mission start:

 

Init.Sqf:

if (!isServer && isNull player) then //JIP player { waitUntil {!isNull player}; [] execVM "scripts\initTeleportToSL.sqf"; };

Share this post


Link to post
Share on other sites
Guest
// initPlayerLocal.sqf
if (didJIP) then {
     [] execVM "scripts\initTeleportToSL.sqf";
};

https://community.bistudio.com/wiki/didJIP

 

 

 

Thanks!

 

Wow, didn't even know such a command existed, nor never saw a reference to such a thing amongst the topics I searched through. That is way to easy lol.

 

 

initPlayerLocal.sqf

if(_this select 1) then
{
    // Do stuff
};

 

Thanks for the reply.

 

What does _this Select 1 refer to from the initPlayerLocal.sqf ?

 

Also, why would this method be more desirable than the DidJip command when it seems that DidJip should safely cover all Jip's after mission start?

Share this post


Link to post
Share on other sites

 

What does _this Select 1 refer to from the initPlayerLocal.sqf ?

 

Also, why would this method be more desirable than the DidJip command when it seems that DidJip should safely cover all Jip's after mission start?

https://community.bistudio.com/wiki/Event_Scripts

 

It's a boolean passed into the initPlayerLocal.sqf.

Share this post


Link to post
Share on other sites
Guest

Thanks for the link there. Good to know.

 

Being able to detect Jip players via either method is definitely good to have, I was really not looking forward to finding a workaround in a couple of scripts, now solved with a very quick query.

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

×