jts_2009 96 Posted June 10, 2017 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
Grumpy Old Man 3545 Posted June 10, 2017 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 1 Share this post Link to post Share on other sites
Muzzleflash 111 Posted June 10, 2017 Have you tried adding the following to your init.sqf file: if (didJIP) exitWith {}; 1 Share this post Link to post Share on other sites
jts_2009 96 Posted June 10, 2017 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
Muzzleflash 111 Posted June 10, 2017 Unless they changed something recently, init.sqf is always run. Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted June 10, 2017 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
jts_2009 96 Posted June 10, 2017 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
Grumpy Old Man 3545 Posted June 11, 2017 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
jts_2009 96 Posted June 11, 2017 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
Muzzleflash 111 Posted June 11, 2017 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 }; 1 Share this post Link to post Share on other sites
jts_2009 96 Posted June 11, 2017 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
Grumpy Old Man 3545 Posted June 11, 2017 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 1 Share this post Link to post Share on other sites
jts_2009 96 Posted June 11, 2017 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... 1 Share this post Link to post Share on other sites
GrizzlyDK 20 Posted June 13, 2017 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
jts_2009 96 Posted June 15, 2017 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
GrizzlyDK 20 Posted June 20, 2017 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