mr_shadow 4 Posted July 4 Well hello everyone! I have a script at my server Spoiler MS_fnc_localMarkers = { private ["_target", "_marker", "_name"]; _target = _this; _name = name _target; player globalchat "Assassin must eliminate the witness before he will arrive to the court."; _marker = createMarker [_name, getposATL _target]; _marker setMarkerType "hd_dot"; _target setVariable["WIT",1,true]; _marker setMarkerColor "ColorRED"; _text = format ["Witness: %1",_name]; _marker setMarkerText _text; while {(_target getVariable ["WIT",0] == 1)} do { _marker setMarkerPos (getPosATL _target); if (!alive _target) exitWith { hint format ["%1 was eliminated", _name]; _target setVariable["WIT",0,true]; player setVariable["reward",1,true];player globalchat "Task was completed successfully"; deleteMarker _marker; }; if (_target in list court) then { _target setVariable["WIT",0,true]; hint format ["Cops have secured the witness."]; player globalchat "Cops have secured the witness."; deleteMarker _marker; if (_target in list court) exitWith { }; }; sleep 1; }; sleep 420; player setVariable["reward",0,true]; }; MS_fnc_actionMarkers = { _array = [civ_1,civ_2,civ_3,civ_4,civ_5,civ_6,attorney,deputy_attorney,police_commander,high_sheriff,civ_7,civ_8,civ_9,civ_10,civ_11,civ_12,civ_13,civ_14,civ_15,civ_16,civ_17,civ_18,civ_19,civ_20,civ_21,civ_22,civ_23,civ_24,civ_25,civ_26,civ_27,civ_28,civ_29,civ_30,civ_31,civ_32,civ_33,civ_34,civ_35,civ_36,civ_37,civ_38,civ_39,civ_40,civ_41,civ_42,civ_43,civ_44,civ_45,civ_46,civ_47,civ_48,civ_49,civ_50,civ_51,civ_52,civ_53,civ_54,civ_55]; { if ((!alive _x) || {_x == player}) then { _array set [_forEachIndex, -1]; }; } forEach playableUnits; _array = _array - [-1]; _target = _array select floor( random (count _array)); if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; if (!alive _target) then { _target = _array select floor( random (count _array));}; [_target, "MS_fnc_localMarkers", true, false] spawn BIS_fnc_MP; }; assassin addAction ["Choose a target", MS_fnc_actionMarkers]; The problem is that - its working if every player slot is busy. Otherwise you have to click on it unless - you will get an active player. How to make to choose from ALIVE player at that player array once time? And stop preventing others unless the active mission will be succeed or failed? ____________________ State Life Dev Share this post Link to post Share on other sites
Melody_Mike 130 Posted July 14 Sir you are not explaining your problem, except by saying, "there is a problem". On 7/4/2024 at 6:23 AM, mr_shadow said: I have a script at my server Please add comments to your script, explaining the function, what each variable is in the mission, and what you think is wrong with it. On 7/4/2024 at 6:23 AM, mr_shadow said: The problem is that - its working if every player slot is busy. Otherwise you have to click on it unless - you will get an active player. It's working from where (where do you run it? Server? Local? On all machines? Once? Repeating?)? Click on what? What exactly do you *want* the script to do, versus what it is doing now? You may get more answers if you submit a more exact question. Share this post Link to post Share on other sites