astruyk / Ares

An arma3 mod that adds some extra functionality to Zeus
51 stars 11 forks source link

Add Changing respawn marker location #220

Open PHI-AM opened 8 years ago

PHI-AM commented 8 years ago

It would be cool to have a module to change the location of the respawn marker so you can change where people respawn during the mission. It works if you just change the location of the existing respawn marker and if the marker does not exist just creat a new one.

JakubNei commented 8 years ago

We are currently using this:

private _toPos = TARGET POSITION
private _markerNamePart = PART OF MARKER NAME, e.g.: respawn_west also moves respawn_west_1 and respawn_west_2

private _foundMarkersCount = 0;
{
    if([_markerNamePart, _x, false] call BIS_fnc_inString) then {
        _x setMarkerPos _toPos;
        _foundMarkersCount = _foundMarkersCount + 1;
    };
} forEach allMapMarkers;
if(_foundMarkersCount > 0) then {
    hint format["Moved %1 marker(s) with name pattern *%2* to your position.", _foundMarkersCount, _markerNamePart];
} else {
    createMarker [_markerNamePart, _toPos];
    hint format["No marker named %1 found, created new one at your position.", _markerNamePart]; 
};

Will probably need 5 modules or setting for sides: all, west, east, guerrila, civilian