Jump to content

Recommended Posts

Hello. I have following problem: I made mission. It should be without respawn. In Description.ext I tried respawn = 0 and even to not define respawn. The problem is that I don't want that Init.sqf executes if someone joins in progress. He should be a seagull if he joins in progress (respawn = "BIRD" not worked, init.sqf executes anyway) and Init.sqf should not be executed on his machine. Is there some way to prevent this?

Share this post


Link to post
Share on other sites
26 minutes ago, jts_2009 said:

Hello. I have following problem: I made mission. It should be without respawn. In Description.ext I tried respawn = 0 and even to not define respawn. The problem is that I don't want that Init.sqf executes if someone joins in progress. He should be a seagull if he joins in progress (respawn = "BIRD" not worked, init.sqf executes anyway) and Init.sqf should not be executed on his machine. Is there some way to prevent this?

 

This is not the .sqf you're looking for.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Have you tried adding the following to your init.sqf file:

if (didJIP) exitWith {};

 

  • Like 1

Share this post


Link to post
Share on other sites
9 minutes ago, Grumpy Old Man said:

 

This is not the .sqf you're looking for.

 

Cheers

 

Hm. So if player joins in progress and there is initJIPcompatible.sqf, only initJIPcompatible.sqf will be executed and not Init.sqf?

Share this post


Link to post
Share on other sites
11 minutes ago, jts_2009 said:

 

Hm. So if player joins in progress and there is initJIPcompatible.sqf, only initJIPcompatible.sqf will be executed and not Init.sqf?

Thought about initPlayerLocal.sqf.

Passes the player as first parameter, and the second parameter as true if JIP, false if not.

Put the stuff you want to do in there and check for the second parameter.

 

Cheers

Share this post


Link to post
Share on other sites
2 hours ago, Grumpy Old Man said:

Thought about initPlayerLocal.sqf.

Passes the player as first parameter, and the second parameter as true if JIP, false if not.

Put the stuff you want to do in there and check for the second parameter.

 

You mean like this? (InitPlayerLocal.sqf):

 

sleep 1;
player groupchat format ["%1 %2", _this select 0, _this select 1];
 

the %2 is false. So you mean it will be true if player joins in progress..?

 

Like:

if (_this select 1) then
{
 //code1
}

else
{
 //code2
}

 

+ It is also not executed on (dedicated) server..?

Share this post


Link to post
Share on other sites
11 hours ago, jts_2009 said:

 

You mean like this? (InitPlayerLocal.sqf):

 

sleep 1;
player groupchat format ["%1 %2", _this select 0, _this select 1];
 

the %2 is false. So you mean it will be true if player joins in progress..?

 

Like:


if (_this select 1) then
{
 //code1
}

else
{
 //code2
}

 

 

Why the sleep?

Other than that, that's basically how it works.

 

11 hours ago, jts_2009 said:

+ It is also not executed on (dedicated) server..?

 

That's what initPlayerServer.sqf is for.

 

Cheers

Share this post


Link to post
Share on other sites
1 hour ago, Grumpy Old Man said:

Why the sleep?

 

The chat won't show up if you don't do it with delay in Init.sqf

 

1 hour ago, Grumpy Old Man said:

That's what initPlayerServer.sqf is for.

 

Well I think I have to split the things. For players InitPlayerLocal.sqf and for server: InitServer.sqf. The problem that I will test today is that if you create a game (Host), you will be actually the player and the server so to speak... And if by the host it executes InitPlayerLocal.sqf and InitServer.sqf - thats not so good...

Share this post


Link to post
Share on other sites

You can use these new event scripts if you want to. But it is not clear (to me), whether initPlayerServer.sqf, and initPlayerLocal.sqf both runs for the host on a hosted server (haven't bothered testing). Even then, if only one runs, initServer.sqf still also runs. And if you look at the initialization order it is not even guaranteed what order they run in. In addition they are run the scheduled environment, so one might be paused halfway through, and then the other runs. So you can't be sure anything defined by the "previous"  script is ready. I find that it is easier to just use one script (init.sqf) we always had, and then manually control the execution. That way you can be sure things don't conflict. Something like:

// You can't prevent this file from being run for JIPs
// But you can make them abort processing it immediately
if (didJIP) exitWith {
    //Bird is the word  
};

if (isServer) then {
    [] call compile preProcessFile "jts_serverInit.sqf";    
};

if (hasInterface) then {
    [] call compile preProcessFile "jts_playerInit.sqf";    
};

if (!isServer && !hasInterface) then {
  // If you want to handle headless clients
};

 

  • Like 1

Share this post


Link to post
Share on other sites
18 minutes ago, Muzzleflash said:

I find that it is easier to just use one script (init.sqf) we always had, and then manually control the execution

 

But like I see on this page, Init.sqf doesn't support these 2 arguments...

Share this post


Link to post
Share on other sites
11 minutes ago, jts_2009 said:

 

But like I see on this page, Init.sqf doesn't support these 2 arguments...

How so?

didJIP is a script command able to be executed anywhere in the scripting environment.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, Grumpy Old Man said:

How so?

didJIP is a script command able to be executed anywhere in the scripting environment.

 

Ah, ok. I thought this is just some variable. I'll test it today and will say if it worked. thanks...

  • Like 1

Share this post


Link to post
Share on other sites

Not sure if this is what you want, but if you are logged in as admin you can type #lock and no one can join.

Share this post


Link to post
Share on other sites
On 13.06.2017 at 0:33 PM, GrizzlyDK said:

 

Not sure if this is what you want, but if you are logged in as admin you can type #lock and no one can join.

 

 

That was definitely not the sense of my question... :S

Share this post


Link to post
Share on other sites
On 15/6/2017 at 8:01 PM, jts_2009 said:

 

That was definitely not the sense of my question... :S


Well i cant sense your questions.

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

×