Announcement

Collapse
No announcement yet.

Teleport To SL - by Megagoth1702

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Teleport To SL - by Megagoth1702

    Grabbed this from Pandora - TheInsurgency. This is the Teleport To Squad Leader script that gives you 3 minutes to kit up and then teleport to your squad leader. The admin team would like to see this implemented more often in our missions to reduce JIP problems where a player joins the game to wait a 1/2 hour before getting with the team.

    It may not be appropriate for every mission so it is not mandatory for mission makers to add it.

    THE LINK TO THE ZIP

    The script is two files.

    I can not post their contents due to site security.
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member
    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
    "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

  • #2
    Re: Teleport To SL - by Megagoth1702

    Also, if you can find a better way to implement this script or one of your own creating that can handle the same JIP problem please post it up!

    [unit][squadl][command2]

    KnyghtMare ~You could always tell the person holding the gun to your head you would like to play on a different server...

    Comment


    • #3
      Re: Teleport To SL - by Megagoth1702

      challenge accepted.
      Yink | Vanilla Pilot | Killer of Stirling | CS GOD | Projects Team

      Comment


      • #4
        JIP script improvement based on the original script. The script adds SPACE hold add action to the player who comes in after the mission has started (handled in initPlayerLocal.sqf) and gives him an option to teleport to the group leader. Script warns if the players is trying to teleport to himself and a bit more informative.

        Code:
        //place in initPlayerLocal.sqf
        _isJIP = if (time > 0) then { true } else { false };
        
        if (_isJIP) then
        {
            [] spawn TG_fnc_teleportToSL;
        };
        Code:
        //function entry inside the cfgfunctions.hpp
             //...
             class teleportToSL {};
             //...
        Code:
        //fn_teleportToSL.sqf inside the functions/client folder (for B's mission template) or TG folder (Unk's mission template)
        
        sleep 10;
        hint "JIP! SCROLL WHEEL and hold SPACE to teleport to your group leader! Press U for group management. 5 min limit.";
        cutText ["","BLACK OUT"];
        cutText ["JIP! SCROLL WHEEL and hold SPACE to teleport to your group leader! Press U for group management. 5 min limit.","PLAIN",2];
        
        teleportActionID = [
            player,
            "Teleport to your group Leader",
            "",
            "",
            "true",
            "true",
            {
                private ["_leader"];
                _leader = leader player;
                if (_leader == player) then
                {
                    hint "You are trying to teleport to yourself! Press U for group management.";
                    cutText ["","BLACK OUT"];
                    cutText ["You are trying to teleport to yourself! Press U for group management.","PLAIN",2];
                };
            },
            {},
            {
                private ["_leader","_LX","_LY","_LZ"];        
                _leader = leader player;
        
                //If leader's vehicle is the leader himself, move player 3m behind him
                if (vehicle _leader == _leader) then
                {   
                    //Getting the coords
                    _LX = (getpos _leader select 0) + (3*sin ((getDir _leader) -180));
                    _LY = (getpos _leader select 1) + (3*cos ((getDir _leader) -180));
                    _LZ = (getpos _leader select 2);
                    player setpos [_LX,_LY,_LZ];
                    [player, teleportActionID] call BIS_fnc_holdActionRemove;
        
                    hint "Teleported nearby the leader.";
                    cutText ["","BLACK OUT"];
                    cutText ["Teleported nearby the leader.","PLAIN",2];            
                }
                //If leader is inside vehicle, move player into vehicle cargo
                else
                {
                    /*Checking if there is room in the vehicle, gives hint if there is none
                    if there is room, player is moved into cargo of leader's vehicle*/
                    if ((vehicle _leader) emptyPositions "cargo"==0) then
                    {
                        hint "No room in squad leader's vehicle.";
                        cutText ["","BLACK OUT"];
                        cutText ["No room in squad leader's vehicle.","PLAIN",2];                
                    }
                    else
                    {
                        player moveincargo vehicle _leader;
                        [player, teleportActionID] call BIS_fnc_holdActionRemove;
        
                        hint "Teleported into the leader's vehicle.";
                        cutText ["","BLACK OUT"];
                        cutText ["Teleported into the leader's vehicle.","PLAIN",2];
                    };
                };
            },
            {        
                hint "Teleport aborted.";
                cutText ["","BLACK OUT"];
                cutText ["Teleport aborted.","PLAIN",2];
            },
            [],
            10,
            nil,
            true,
            false
        ] call BIS_fnc_holdActionAdd;
        
        sleep 300;//5min
        [player, teleportActionID] call BIS_fnc_holdActionRemove;

        Comment


        • #5
          Originally posted by |TG| B View Post
          Code:
          //place in initPlayerLocal.sqf
          _isJIP = if (time > 0) then { true } else { false };
          
          if (_isJIP) then
          {
          [] spawn TG_fnc_teleportToSL;
          };
          Time checking isn't needed as initPlayerLocal will run on JIP & mission start clients, you only have to spawn your function in initPlayerLocal and nowhere else to prevent duplication.

          Alternatively, you can use the following

          Code:
          //place in initPlayerLocal.sqf
          _didJIP = _this select 1;
          
          if(_didJIP) then 
          {
              [] spawn TG_fnc_teleportToSL;
          };

          Comment


          • #6
            The time checking I think was added to try and not run this code until you are actually controlling your avataar or "boots on ground" in game. I have begun using isPlayer and had better success.

            B, thanks for updating this!
            |TG-189th| Unkl
            ArmA 3 Game Officer
            Dean of Tactical Gamer University
            189th Infantry Brigade Member
            SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
            "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

            Comment

            Connect

            Collapse

            TeamSpeak 3 Server

            Collapse

            Advertisement

            Collapse

            Twitter Feed

            Collapse

            Working...
            X