Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Everything posted by sarogahtyp

  1. If u want to get help then u need to show ur code and also how/where u execute it.
  2. Yeah, I missed this and did not cover it in my code... Hard to trace this server side only. Maybe there is a smarter client side only solution by storing the chosen side in profile namespace but idk how client can detect if server actually runs the same mission session or if it was restarted. Maybe one could just use the mission time for this.
  3. That is why I used spawn in my original code...
  4. I guess this is because of the .bikey files which he put on the server
  5. Also they are not part of the -mod parameter....
  6. I would not try to copy those values but to give the AI the same target or target position. But it depends on how the player is selecting the target..
  7. Above code is ready to get tested and debugged. Im not able to do this because Ive no arma 3 pc for another week and also i think i dont like to set up a dedicated server just to test this. Therefore I can help with debugging but I ll not test the code myself. Possible problems I see: BIS_fnc_getUnitByUID - may not return objNull when player is not spawned yet "end1" call BIS_fnc_endMission; - idk if this is the corret end for sending player back to lobby. If you test the code and get any error or not intended behavior just post it here and I ll try to help.
  8. You could just test what is returned for a laser and then remove that classname from the array before u check if the array is empty.
  9. Forget bout exec. This is not for sqf scripts. call is executing immediatly when used in unscheduled environment. Everytging bout it is described here: https://community.bistudio.com/wiki/Scheduler
  10. I did not have tested anything but this is the way I would try it. initServer.sqf SARO_playerSideArray = []; addMissionEventHandler ["PlayerConnected", { _this spawn { //time the player is forbidden to chose another side - in minutes private _restrictedChangeTime = 10; // all players with these sides chosen will get checked for side change private _restrictedSidesArray = [west, east, independent]; params ["", "_uid", "_name"]; private [ "_dummy", "_playerUnit", "_playerIndex", "_playerNotFound" ]; // wait until the connected client is spawned as player object waitUntil { sleep 1; _playerUnit = _uid call BIS_fnc_getUnitByUID; not isNull _playerUnit }; _playerSide = side _playerUnit; // exit if player did not choose a restricted side if !( _playerSide in _restrictedSidesArray ) exitWith {}; _playerIndex = SARO_playerSideArray findIf { _x select 0 isEqualTo _uid }; _playerNotFound = _playerIndex < 0; if (_playerNotFound) then { _dummy = SARO_playerSideArray pushBack [ _uid, _playerSide, diag_tickTime ]; } else { private _priorSide = SARO_playerSideArray select 1; private _timeUntilChange = (diag_tickTime - SARO_playerSideArray select 2) / 60 - _restrictedChangeTime; if ( _playerSide isNotEqualTo _priorSide and _timeUntilChange > 0 ) then { private _string = format [ "%1, before choosing another side you have to play on side %2 for another %3 minutes!", _name, _priorSide, _timeUntilChange ]; _string remoteExec ["hint", _playerUnit]; sleep 3; ["end1", BIS_fnc_endMission] remoteExec ["call", _playerUnit]; }; }; }; }];
  11. Yeah hard to answer without the knowledge bout what u exactly want to do. But a whole array can be shown like this: _array = [1, 8, "nine", true, "something"]; hint str _array; Or just the 2nd element: hint str _array select 1; Or every element with a delay: { hint str _x; sleep 3; } forEach _array;
  12. sarogahtyp


    Idk if u mean this but if i remember correct then u can toggle collision with camera in the camera settings menu where u also can set camera speed and such things. Should be reachable through a button above the view port.
  13. This should get done server side. You could just store the IDs of players together with their chosen side in an array or a hashmap. Every time a player reconnects you just look for the ID and can get its prior chosen side. https://community.bistudio.com/wiki/Array https://community.bistudio.com/wiki/getPlayerUID https://community.bistudio.com/wiki/onPlayerConnected https://community.bistudio.com/wiki/Event_Scripts#initServer.sqf
  14. It just sets a flag on the group. You are able to TRY to prevent auto deletion with it and later you can mark it for auto deletion again. Its the same flag as you can set with createGroup command. Read both wiki entries to get a clue of it.
  15. What you are asking for is not specific enough to help effectively. Just describe your actual mission editing situation, what you want to achieve, what did u try and what problems do u have with it. Also open a new topic for it!
  16. Its all about wiki reading: https://community.bistudio.com/wiki/allUnits https://community.bistudio.com/wiki/createGroup
  17. I totally agree. Its not neccessary to do this server side. Also to break the loop on death and to restart it on respawn is a smart solution which avoids a dirty infinite loop.
  18. Until the player object gets deleted. when this happens depends on garbage collection. Mostly those variables get useless when player dies and have to get reassigned to the new player object after respawning.
  19. I had a similar thing some years ago. My vehicle was a tiny short time inside of water and therefore the engine was disabled. I did spawn the vehicle at 0,0,0 and moved it elsewhere then. After I changed spawning to another location the issue was solved.
  20. sarogahtyp


  21. Why not just doing what I requested?
  22. Idk such script but creating one is possible for sure. One could create a random key for the current mission session, store it together with the first side chosen in players profile and send player to lobby if he chooses another side during the same session...
  23. sarogahtyp

    random road position

    This can be done more effective by combining select command with inArea as I told above. now Ive the time to show it: _all_roads = ( nearestTerrainObjects [[4092.9,4596.33,0], ["Road"], 3500] ) select { not (_x inArea "arfldmrkr") }; _all_roads append ( [4092.9,4596.33,0] nearRoads 3500 ) select { not (_x inArea "arfldmrkr") }; _all_roads = _all_roads arrayIntersect _all_roads;
  24. sarogahtyp

    random road position

    you don't need the exitWith you can just use the condition of the while. But the bigger problem with that loop is that it can get an endless loop if no suitable position can be found. Therefore I would recommend a second part for the condition which breaks the loop after 5 seconds or something. @Rok Stuhne never show these messages in the forum because it is always the last error message occuring. Show errror messages copied out of .rpt file! In this case the error comes from the while syntax... just use the wiki. EDIT: private _isFlat = false; private _startTime = diag_tickTime; private _runTime = 5; while { !_isFlat && diag_tickTime - _startTime < _runTime } do { _random_road = selectRandom _all_roads; _isFlat = !(position _random_road isFlatEmpty [100, -1, 0.05, 100, 0, false, player] isEqualTo []); }; or just breaking when all road segments are not suitable: private _isFlat = false; while { not _isFlat and _all_roads isNotEqualTo [] } do { _random_road = selectRandom _all_roads; _isFlat = !(position _random_road isFlatEmpty [100, -1, 0.05, 100, 0, false, player] isEqualTo []); _all_roads = _all_roads - _random_road; };