Jump to content

Crazy_Man

Member
  • Content Count

    33
  • Joined

  • Last visited

  • Medals

Community Reputation

12 Good

1 Follower

About Crazy_Man

  • Rank
    Private First Class

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Put this in the init field of your heli : nul = this spawn { _heli = _this; _spotDistance = 2500; // change it as you wish while {alive _heli} do { {if ([side _x, side _heli] call BIS_fnc_sideIsEnemy) then {_heli reveal [_x,4]}} forEach (_heli nearEntities [["Man", "Air", "Car", "Motorcycle", "Tank"], _spotDistance]); sleep 1; }; };
  2. Use Larrow's code, it corrects 2 errors that I had not seen.
  3. Ho sorry I made a mistake, my bad. I fortgot the "" for params ["_target","_caller","_actionId","_myPassedVariables"]; myPassedVariables params ["_activate","_show","_hide","_player","_slingloadgroup","_trashloc","_slingloadhelortb","_vehiclesupplyloc","_supplyloc","_cargonetloc","_technicalloc","_truckloc","_repairloc"]; So your code should look like : //variable define for schedule task _myVariables = [_activate,_show,_hide,_player,_slingloadgroup,_trashloc,_slingloadhelortb,_vehiclesupplyloc,_supplyloc,_cargonetloc,_technicalloc,_truckloc,_repairloc]; //start action menu _activate = false; slingloadmain = _player addAction [ "SUPPORTS", { params ["_target","_caller","_actionId","_myPassedVariables"]; myPassedVariables params ["_activate","_show","_hide","_player","_slingloadgroup","_trashloc","_slingloadhelortb","_vehiclesupplyloc","_supplyloc","_cargonetloc","_technicalloc","_truckloc","_repairloc"]; _player removeaction slingloadmain; _activate = false; //Loads of other addactions that I'll work on after I get the main menu working properly... }, [ _myVariables,_activate,_show,_hide,_player,_slingloadgroup,_trashloc,_slingloadhelortb,_vehiclesupplyloc,_supplyloc,_cargonetloc,_technicalloc,_truckloc,_repairloc ], 10, false, true, "", "true", // _target, _this, _originalTarget 3, false, "", "" ];
  4. Yes you passed well your variables but your array still wrong, you should write : //variable define for schedule task _myVariables = [_activate,_show,_hide,_player,_slingloadgroup,_trashloc,_slingloadhelortb,_vehiclesupplyloc,_supplyloc,_cargonetloc,_technicalloc,_truckloc,_repairloc]; I think you are confused about the third argument of addAction but for example your first variable passed by the third argument is _activate so to access it it's : _activate = (_this select 3) select 0 Or params ["_target","_caller","_actionId","_myPassedVariables"]; _activate = _mypassedVariables select 0; And for more ease you can write what Grumpy Old Man says at the beginning : params ["_target","_caller","_actionId","_myPassedVariables"]; _myPassedVariables params [_activate]; And finally it give that : params ["_target","_caller","_actionId","_myPassedVariables"]; myPassedVariables params [_activate,_show,_hide,_player,_slingloadgroup,_trashloc,_slingloadhelortb,_vehiclesupplyloc,_supplyloc,_cargonetloc,_technicalloc,_truckloc,_repairloc]; Another thing is that the code executed in an addAction is local to the machine who activate the addAction. If that machine (player) disconnect while his support is called it will end the script brutaly and maybe missed the end of the script. And why do you broadcast those local variables to the server? : publicVariableServer "_activate"; publicVariableServer "_show"; publicVariableServer "_hide"; publicVariableServer "_player"; publicVariableServer "_slingloadgroup"; publicVariableServer "_trashloc"; publicVariableServer "_slingloadhelortb"; publicVariableServer "_vehiclesupplyloc"; publicVariableServer "_supplyloc"; publicVariableServer "_cargonetloc"; publicVariableServer "_technicalloc"; publicVariableServer "_truckloc"; publicVariableServer "_repairloc"; It will not works because they are local variables, you need to broadcast global variables witout underscore at the start of the variable name.
  5. Try waitUntil command. _HVTs = _this select 0; waitUntil {!alive _HVTs}; _marker = createMarker [format["%1_area",vehicleVarName _HVTs], position _HVTs]; // Don't forget to name all your HVTs _marker setMarkerShape "ELLIPSE"; _marker setMarkerSize [10,10]; _marker setMarkerColor "ColorOrange"; sleep 300; deleteMarker _marker;
  6. The caller is the player who activate the action. Since you add your action to a player, the player is both the target and the caller. So, the _caller variable you defined with params command point on the player that activate the action. Grumpy Old Man is right again, you did not put your variables in the third argument of the addAction command.
  7. Grumpy Old Man is right and to broadcast a variable with publicVariable or publicVariableServer you need to use a global variable name without underscore. Since you add the action to a player, the caller is that player so you can (if you want) use the _caller variable to remove or add action after the first assigment of the action but it's not necessary so you can use the _player variable too.
  8. Use the params _caller instead _player passed argument
  9. Crazy_Man

    Make enemy know where player is

    Execute this script in your initServer.sqf : while {true} do { _allPlayers = allPlayers; { if ((side _x) == east) then // put the right ennemy side { for "_i" from 0 to count _allplayers -1 do { _x reveal [(_allplayers) select _i, 4]; }; }; } forEach allUnits; sleep 30; // every 30 seconds };
  10. Crazy_Man

    Weapon On Back - Action Menu

    Put in the init.sqf if (hasInterface) then { player addAction ["Weapon on back", { player action ["SWITCHWEAPON",player,player,-1]; }, nil, 0, false, true, "", "vehicle _originalTarget == _originalTarget"]; };
  11. Oh ok it works in this case, thanks killzone_kid!
  12. Hello, I want to sort an array of array with strings and numbers but only on the number. With the highest number at the start of the array. _array = [["Player 1",1], ["Player 2",3], ["Player 3", 2]]; // The result I want is : _array = [["Player 2",3], ["Player 3",2], ["Player 1", 1]];
  13. First get the class name of the building you want. Get closer to the building and execute this code in the debug console: _nBuilding = nearestBuilding player; copyToClipBoard str typeOf _nBuilding; This will copy in the clip board the class name you need. Then in the init.sqf put this code: if (isServer) then { _pos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"); _blds = nearestobjects [_pos,["your_Building_class_name"], 20000]; // Put your building class name. { _doorH = "VR_3DSelector_01_complete_F" createVehicle (_x getRelPos [0,0]); // Replace [0,0] by the relative position you want for the door compared to the building. _doorH addaction ["your action name", "yourScript.sqf"]; // Configure your addaction as you wish } forEach _blds; }; But i think you can't add an action to an invisible object so i've put an VR object ("VR_3DSelector_01_complete_F") instead. The only problem is that you will see the VR object at the door. See getRelPos command for the relative position of the door.
  14. Yeah that works great pierremgi thanks a lot 👍
  15. Ok, I used the owner command and it works great! It finally exit the loop when the player disconnect. Thank you a lot for putting me on the right path 😀 params ["_player"]; _playerID = owner _player; while {_playerID == owner _player} do { waitUntil { diag_log "!!!!In waitUntil loop!!!!"; sleep 1; _playerID != owner _player or {a} }; if (_playerID != owner _player) exitWith {}; //code... // // };
×