Jump to content
Sign in to follow this  
ANSWER

my JIP ONLY excute script doesnt work what is problem?

Recommended Posts

JIPonly.sqf

/*

Script by Sickboy (sb _at_ 6thSense.eu)

Version: v0.1

*/

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;

};

};

waitUntil {T_INIT};

/* script by me */

// NPC ACTION

if (T_JIP) then {

if (Mission_State_On) then {removeAllActions missiongiver_1;};

if (not Mission_State_On) then {removeAllActions missiongiver_1;missiongiver_1 addaction ["Mission Dialog","mDialog.sqf"];};

};

sleep 1;

// TASK

if (T_JIP) then { if (Mission_State_On) then {

switch (Mission_Switch) do

{

case "EXPLOSION" : { /*...code...*/ };

case "HVT" : { /*...code...*/ };

case "SOTANG" : {

//task part

task_sotang = player createSimpleTask ["kill operation"];

task_sotang setSimpleTaskDestination (getPos task_area);

task_sotang setSimpleTaskDescription ["kill all enemy","kill operation","operation area"];

task_sotang setTaskState "Assigned";

player setCurrentTask task_sotang;

//marker part

sotang_marker = createMarkerLocal ["SotangMarker",getPos task_area];

"SotangMarker" setMarkerShapeLocal "ELLIPSE";

"SotangMarker" setMarkerBrushLocal "Solid";

"SotangMarker" setMarkerColorLocal "ColorRed";

"SotangMarker" setMarkerSizeLocal [200,200];

["TaskAssigned",["","task created"]] spawn BIS_fnc_showNotification;

};

};

} else {

switch (Mission_Switch) do

{

case "EXPLOSION" : { /*...code...*/ };

case "HVT" : { /*...code...*/ };

case "SOTANG" : {

// task part

player removeSimpleTask task_sotang;

task_sotang = nil;

publicVariable "task_sotang";

//marker part

deleteMarkerLocal "SotangMarker";

sotang_marker = nil;

publicVariable "sotang_marker"

["TaskAssigned",["","task deleted"]] spawn BIS_fnc_showNotification;

};

};

};

};

purpose of this script is only JIP excution of creation of task which same as in-game player

i think T_JIP didnt work

and this script excute on every computer when JIP joins game using << ["M_Sqf\JIPonly.sqf","BIS_fnc_execVM",true,true] call BIS_fnc_MP; >>

i used this wiki : https://community.bistudio.com/wiki/6thSense.eu:EG

Edited by ANSWER

Share this post


Link to post
Share on other sites
I suggest you simply use the initPlayerLocal.sqf event script. To make the code run only on JIP you can check if (_this select 1) is true.

yeah!!!! it worked thank you SS :yay:

Share this post


Link to post
Share on other sites

You could also just use BIS_fnc_setTask, as it has a global parameter, so there would be no need to create it local to each player, and it shouldn't have any issues with JIP (at least from my usage).

Edited by JShock

Share this post


Link to post
Share on other sites

It's just a recomendation... Ident your code, it'll be easy for you and for others to understand, and to see syntax errors at first glance.

Share this post


Link to post
Share on other sites
It's just a recomendation... Ident your code, it'll be easy for you and for others to understand, and to see syntax errors at first glance.

It probably was, but since he used a spoiler tag instead of PHP or CODE tags, as Dreaded recommended, he lost any possible formating for the code.

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  

×