Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. //only run on jips joining after safestart disabled
  2. waitUntil {!isNull player};
  3. private _time = time;
  4. waitUntil {(player getVariable ["f_var_assignGear_done",false]) || ((time + 30) > _time)};
  5. _lead = [player, side player] call F_fnc_getCurLeader;
  6. if (typeName _lead == "BOOL") then {
  7. hint "Sorry, there is no available leadership unit for auto-teleportation. Contact an administrator.";
  8. systemChat "Sorry, there is no available leadership unit for auto-teleportation. Contact an administrator.";
  9. } else {
  10.  
  11. if (vehicle _lead != _lead) then {
  12. //in car
  13. player allowDamage false; [] spawn {sleep 5; player allowDamage true}; //protect them in the case of fall damage or whatnot
  14. player moveInCargo (vehicle _lead);
  15. sleep 2;
  16. if !(player in (crew vehicle _lead)) then {
  17. //the cargo was full
  18. hint "Current mission leader is inside of a full vehicle. Please wait for them to dismount.";
  19. systemChat "Current mission leader is inside of a full vehicle. Please wait for them to dismount.";
  20. [] spawn {sleep 10; [] execVM "f\JIP\f_JIP_autoTeleport.sqf";}; //rerun script and try again
  21. } else {
  22. //they are there in the car
  23. hint ((name player) + ", you have joined the current commander (" + (name _lead) + ") inside the AO. Please ask them for assignment to a team.");
  24. systemChat ((name player) + ", you have joined the current commander (" + (name _lead) + ") inside the AO. Please ask them for assignment to a team.");
  25. [
  26. [
  27. [_lead,player],
  28. {
  29. params ["_leader","_joiner"];
  30. hint ((name _joiner) + " is a JIP (" + getText(configFile >> "CfgVehicles" >> (typeOf _joiner) >> "displayName") + ") and has been teleported into your vehicle. Assign them to a team, " + (name _leader) + "!");
  31. systemChat ((name _joiner) + " is a JIP (" + getText(configFile >> "CfgVehicles" >> (typeOf _joiner) >> "displayName") + ") and has been teleported into your vehicle. Assign them to a team, " + (name _leader) + "!");
  32. }
  33. ],
  34. "BIS_fnc_spawn",
  35. _lead
  36. ] call BIS_fnc_MP;
  37. [player] join (group _lead);
  38. };
  39. } else {
  40. //on foot
  41. _posPlant = _lead modelToWorld [0,-3,0]; //3 meters behind leader
  42. _posPlant set [2,0]; //ensure height atl = 0
  43. player allowDamage false; [] spawn {sleep 5; player allowDamage true}; //protect them in the case of fall damage or whatnot
  44. player setPosATL _posPlant;
  45. [player] join (group _lead);
  46. hint ((name player) + ", you have been teleported to the mission commander (" + (name _lead) + "), please ask them for assignment!");
  47. systemChat ((name player) + ", you have been teleported to the mission commander (" + (name _lead) + "), please ask them for assignment!");
  48. [
  49. [
  50. [_lead,player],
  51. {
  52. params ["_leader","_joiner"];
  53. hint ((name _joiner) + " is a JIP (" + getText(configFile >> "CfgVehicles" >> (typeOf _joiner) >> "displayName") + ") and has been teleported just behind your location. Assign them to a team, " + (name _leader) + "!");
  54. systemChat ((name _joiner) + " is a JIP (" + getText(configFile >> "CfgVehicles" >> (typeOf _joiner) >> "displayName") + ") and has been teleported just behind your location. Assign them to a team, " + (name _leader) + "!");
  55. }
  56. ],
  57. "BIS_fnc_spawn",
  58. _lead
  59. ] call BIS_fnc_MP;
  60. };
  61. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement