Synide – User talk

From Bohemia Interactive Community
Revision as of 00:15, 15 June 2007 by Synide (talk | contribs)
Jump to navigation Jump to search

The following is temporary...


This is my init.sqf file I use in all my missions. It correctly identifies in what context the init.sqf file is being run.

/* Synide 11/6/2007 v1.0 Things to note... If you are there at mission launch from that point on your 'Context' will always be 'MP_CLIENT' and will stay as such even when you respawn. If you are an 'MP_CLIENT' then you 'disconnect' from a continuing mission and select a new playable character or the same playable character you will become a 'JIP_CLIENT'. If you join an inprogress mission you will be a 'JIP_CLIENT' from that point till the mission ends. */ //init.sqf debug=false; common = compile preprocessfile "scripts\common\init.sqf"; mp_server = compile preprocessfile "scripts\mp_server\init.sqf"; sp_server = compile preprocessfile "scripts\sp_server\init.sqf"; mp_client = compile preprocessfile "scripts\mp_client\init.sqf"; jip_client = compile preprocessfile "scripts\jip_client\init.sqf"; if (isServer) then { Context = "SP_SERVER"; if (isnull player) then {Context = "MP_SERVER";}; } else { Context = "MP_CLIENT"; if (isnull player) then {Context = "JIP_CLIENT";}; }; call common; switch (Context) do { case "MP_SERVER": {call mp_server;}; case "SP_SERVER": {call sp_server;}; case "MP_CLIENT": {call mp_client;}; case "JIP_CLIENT": {call jip_client;}; }; processInitCommands; finishMissionInit;

Things to note about the above for MP only.

  • If you are there at mission launch from that point on your 'Context' will always be 'MP_CLIENT' and will stay as such even when you respawn.
  • If you are an 'MP_CLIENT' then you 'disconnect' from the continuing mission and select a new playable character you will become a 'JIP_CLIENT'.
  • If you join an inprogress mission you will be a 'JIP_CLIENT' from that point till the mission ends.