Jump to content
  • 0

Teleport


godmode8

Question

 

Hello. I want to make a teleport from a certain object at the entrance to specific coordinates with a certain radius. 

For example, the player enters the item "Veins", we tilt it to the coordinates [22491.3,20059.3,0.001] with a radius of 150. Tried to do through server_PlayerLogin
Spoiler

if (!_isNew) then {
    //RETURNING CHARACTER
    _inventory = _primary select 4;
    _backpack = _primary select 5;
    _survival = _primary select 6;
    _model = _primary select 7;
    _hiveVer = _primary select 8;
    if !(_model in AllPlayers) then {_model = "Survivor2_DZ";};
    if ((count nearestObjects [_playerObj, ["%ClassnameItem%"], 60]) > 0) then {
        _newPos = [(getPosATL _playerObj), 80, 100, 10, 0, 20, 0] call BIS_fnc_findSafePos;
        _playerObj setPosATL _newPos;
    }

} else {
    _model = _primary select 3;
    _hiveVer = _primary select 4;
    if (isNil "_model") then {
        _model = "Survivor2_DZ";
    } else {
        if (_model == "") then {_model = "Survivor2_DZ";};
    };

    //Record initial inventory
    _config = configFile >> "CfgSurvival" >> "Inventory" >> "Default";
    _mags = getArray (_config >> "magazines");
    _wpns = getArray (_config >> "weapons");
    _bcpk = getText (_config >> "backpack");

    //Wait for HIVE to be free
    _key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
    _key call server_hiveWrite;

};

but failed. I ask for help.
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
17 minutes ago, godmode8 said:

 

when a player enters the server near a certain object, he must be teleported to certain coordinates. I am writing through a translator, sorry

I think It should go into server_playerSetup.sqf not server_playerLogin. Under line:

if (_lastInstance != dayZ_instance) then {_randomSpot = true;};

I am not sure what : "%ClassnameItem%"  is but i guess its a generic class object.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...