Jump to content

Looking for simple teleport script!


spitfirez404

Recommended Posts

place the code below at the end of the spawn file

   _loop = true;		
    while {_loop} do {
	    _count = {alive _x} count UNITS _unitGroup;
        if (_count == 0) then {
	        _loop = false;
	    };
    };
	
	allAiDead = true;
	publicvariable "allAiDead";

in your fn_selfaction.sqf put this:

	_target = cursorTarget isKindOf "Notebook";
    if ((speed player <= 1) && _target && (player distance cursorTarget < 5) && allAiDead) then {
        if (s_player_teleport < 0) then {
            s_player_teleport = player addAction ["Teleport","scripts\teleport.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_teleport;
        s_player_teleport = -1;
    };

create a teleport.sqf file in your scripts folder.

and place this code in the file you just created:

cutText ["you will be teleporting in 5 seconds", "PLAIN"];
sleep 5;
player setPos [5990.6221, 13480.346, 0];

think about changing the coordinates.

tested and functional.

Link to comment
Share on other sites

I don't have one for those files for those ai, I did not know how else to add them in but using the editor at the time. the file that I used was the mission.sqm from my server then trough the a2 editor I merged the new one with the original...Lazy I know but it works! lol so basically here is what this Sector HC is what I call it does. The players can come in only one way and are forced to fight through the ai I have placed. they then (if they make it) go to the back of the sector where there is a bunker with a laptop on the ground next to it to teleport to another location (A cave) for the loot, once they grab the loot they need to teleport back to the laptop through a field toilet  I put down XD

So really I'm only needing the (And I have no idea how to script so bare with me....

cursorTarget isKindOf "Notebook" to TP to the off site cave and then say like cursorTarget isKindOf "fieldtoilet" for them to come back after they get the loot.
Link to comment
Share on other sites

1 hour ago, spitfirez404 said:

I don't have one for those files for those ai, I did not know how else to add them in but using the editor at the time. the file that I used was the mission.sqm from my server then trough the a2 editor I merged the new one with the original...Lazy I know but it works! lol so basically here is what this Sector HC is what I call it does. The players can come in only one way and are forced to fight through the ai I have placed. they then (if they make it) go to the back of the sector where there is a bunker with a laptop on the ground next to it to teleport to another location (A cave) for the loot, once they grab the loot they need to teleport back to the laptop through a field toilet  I put down XD

So really I'm only needing the (And I have no idea how to script so bare with me....


cursorTarget isKindOf "Notebook" to TP to the off site cave and then say like cursorTarget isKindOf "fieldtoilet" for them to come back after they get the loot.

If I'm understanding correctly you could always try spawning the ai with WAI in this folder WAI\static\chernarus.sqf OR default.sqf. Then you can try and add the ai dead code to the bottom of that file. WAI also has lots more options to use then spawning ai with editor I think

Link to comment
Share on other sites

Seems easy and that way I have the file...So I should just be able to copy and paste the same code at the bottom where it says place your custom group spawns then edit it to where and how many ai spawn every restart?

if(isServer) then {


    //Custom Spawns file//
    /*
    Custom group spawns Eg.

    [
        [953.237,4486.48,0.001],    // Position
        4,                                             // Number Of units
        "Random",                            // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                   // Backpack classname, use "Random" or classname here
        "Random",                   // Skin classname, use "Random" or classname here
        "Random",                   // Gearset number. "Random" for random gear set
        "Bandit"                       // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    Place your custom group spawns below
    */

Then Mig's code to where he said? 

Link to comment
Share on other sites

29 minutes ago, spitfirez404 said:

Seems easy and that way I have the file...So I should just be able to copy and paste the same code at the bottom where it says place your custom group spawns then edit it to where and how many ai spawn every restart?

if(isServer) then {


    //Custom Spawns file//
    /*
    Custom group spawns Eg.

    [
        [953.237,4486.48,0.001],    // Position
        4,                                             // Number Of units
        "Random",                            // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                   // Backpack classname, use "Random" or classname here
        "Random",                   // Skin classname, use "Random" or classname here
        "Random",                   // Gearset number. "Random" for random gear set
        "Bandit"                       // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    Place your custom group spawns below
    */

Then Mig's code to where he said? 

Yeah or you could just edit that block and uncomment it, shouldn't really make much difference. Then do mig's code at the very bottom.

 

Mkae sure you add 

s_player_teleport = -1;

to you variables too 

Link to comment
Share on other sites

okay! So like this after the diag_log format ay the very bottom right? Just wanna make sure I don't screw it up :)

 

   diag_log format["WAI: Static mission for %1 loaded", missionName];
 
    _loop = true;        
    while {_loop} do {
        _count = {alive _x} count UNITS _unitGroup;
        if (_count == 0) then {
            _loop = false;
        };
    };
    
    allAiDead = true;
    publicvariable "allAiDead";
};

Link to comment
Share on other sites

Just now, spitfirez404 said:

okay! So like this after the diag_log format ay the very bottom right? Just wanna make sure I don't screw it up :)

 

   diag_log format["WAI: Static mission for %1 loaded", missionName];
 
    _loop = true;        
    while {_loop} do {
        _count = {alive _x} count UNITS _unitGroup;
        if (_count == 0) then {
            _loop = false;
        };
    };
    
    allAiDead = true;
    publicvariable "allAiDead";
};

Yup you can try above that too but shouldn't make much difference 

Link to comment
Share on other sites

Okay! and one more question so I know...If I want the players to teleport back to the Notebook or laptop from say a field toilet can I just change the codes name or ID like so and place in the fn_selfaction.sqf under the one he gave me?

 

_target = cursorTarget isKindOf "Fieldtoilet";
    if ((speed player <= 1) && _target && (player distance cursorTarget < 5) && allAiDead) then {
        if (s_player_teleport < 0) then {
            s_player_teleport = player addAction ["Teleport","scripts\teleport.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_teleport;
        s_player_teleport = -1;
    };
 
Link to comment
Share on other sites

Spoiler

//Custom Spawns file//

// These custom spawns are for use in static mission locations. You can set markers in mission.sqm if you want them.

/*
Custom group spawns Eg.

[
	[953.237,4486.48,0.001],		// Position
	4,								// Number Of units
	"Random",						// Skill level of unit (easy, medium, hard, extreme, Random)
	"Random", or ["Random","at"],	// Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
	4,								// Number of magazines
	"Random",						// Backpack classname, use "Random" or classname here
	"Random",						// Skin classname, use "Random" or classname here
	"Random",						// Gearset number. "Random" for random gear set
	"Bandit"						// AI Type, "Hero" or "Bandit".
] call spawn_group;

Place your custom group spawns below
*/
private ["_unitGroup","_loop"]

_unitGroup = [
	[953.237,4486.48,0.001],		// Position
	4,								// Number Of units
	"Random",						// Skill level of unit (easy, medium, hard, extreme, Random)
	"Random", or ["Random","at"],	// Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
	4,								// Number of magazines
	"Random",						// Backpack classname, use "Random" or classname here
	"Random",						// Skin classname, use "Random" or classname here
	"Random",						// Gearset number. "Random" for random gear set
	"Bandit"						// AI Type, "Hero" or "Bandit".
] call spawn_group;

    _loop = true;        
    while {_loop} do {
        _count = {alive _x} count UNITS _unitGroup;
        if (_count == 0) then {
            _loop = false;
        };
    };
    
    allAiDead = true;
    publicvariable "allAiDead";


diag_log format["WAI: Static mission for %1 loaded", missionName];

 

modify your spawn file like this, it should work.

 

Link to comment
Share on other sites

Place your custom group spawns below
    */
    private ["_unitGroup","_loop"]
    _unitGroup = [
    [
        [6337.23,14089.3,0.001],            // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    [
        [6390.56,14103.6,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    [
        [6472.06,14134.4,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    [
        [642953,14163.5,0],                    // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;
    
    [
        [6355.32,14135.9,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    [
        [6454.96,14211.6,0],            // Position
        6,                                    // Number Of units
        "hard",                            // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;
    
    
    
    
    
    /*
    Custom static weapon spawns Eg. (with mutiple positions)

    [
        [                                    // Position(s) (can be multiple)
            [911.21,4532.76,2.62],
            [921.21,4542.76,2.62]
        ],
        "M2StaticMG",                        // Classname of turret
        "easy",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Bandit2_DZ",                        // Skin classname, use "Random" or classname here
        "Bandit",                            // AI Type, "Hero" or "Bandit".
        "Random",                            // Primary gun set number. "Random" for random weapon set
        2,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random"                            // Gearset classname, use "Random" or classname here
    ] call spawn_static;

    Place your custom static weapon spawns below
    */

    /*
    Custom Chopper Patrol spawn Eg.

    [
        [725.391,4526.06,0],                // Position to patrol
        [0,0,0],                            // Position to spawn chopper at
        2000,                                // Radius of patrol
        10,                                    // Number of waypoints to give
        "UH1H_DZ",                            // Classname of vehicle (make sure it has driver and two gunners)
        "Random",                            // Skill level of units (easy, medium, hard, extreme, Random)
        "Random",                            // Skin classname, use "Random" or classname here
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] spawn heli_patrol;


    Place your heli patrols below
    */

    /* 
    Custom Vehicle patrol spawns Eg. (Watch out they are stupid)

    [
        [725.391,4526.06,0],                // Position to patrol
        [725.391,4526.06,0],                // Position to spawn at
        200,                                // Radius of patrol
        10,                                    // Number of waypoints to give
        "HMMWV_Armored",                    // Classname of vehicle (make sure it has driver and gunner)
        "Random",                            // Skill level of units (easy, medium, hard, extreme, Random)
        "Random",                            // Skin classname, use "Random" or classname here
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] spawn vehicle_patrol;

    Place your vehicle patrols below this line
    */

    /*
    Paradropped unit custom spawn Eg.

    [
        [911.21545,4532.7612,2.6292224],    // Position that units will be dropped by
        [0,0,0],                            // Starting position of the heli
        400,                                // Radius from drop position a player has to be to spawn chopper
        "UH1H_DZ",                            // Classname of chopper (Make sure it has 2 gunner seats!)
        5,                                    // Number of units to be para dropped
        "Random",                            // Skill level of units (easy, medium, hard, extreme, Random)
        "Random",                            // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Bandit2_DZ",                        // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set.
        "Bandit",                            // AI Type, "Hero" or "Bandit".
        true                                // true: Aircraft will stay at position and fight. false: Heli will leave if not under fire. 
    ] spawn heli_para;

    Place your paradrop spawns under this line
    */
    
    ] call spawn_group;

    _loop = true;        
    while {_loop} do {
        _count = {alive _x} count UNITS _unitGroup;
        if (_count == 0) then {
            _loop = false;
        };
    };
    
    allAiDead = true;
    publicvariable "allAiDead";


    diag_log format["WAI: Static mission for %1 loaded", missionName];

Link to comment
Share on other sites

Spoiler


private ["_unitGroupA","_unitGroupB","_unitGroupC","_unitGroupD","_unitGroupE","_unitGroupF","_loop","_count"];

	
_unitGroupA = [
        [6337.23,14089.3,0.001],            // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

_unitGroupB = [
        [6390.56,14103.6,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

_unitGroupC = [
        [6472.06,14134.4,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

_unitGroupD = [
        [642953,14163.5,0],                    // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;
    
_unitGroupE = [
        [6355.32,14135.9,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

_unitGroupF = [
        [6454.96,14211.6,0],            // Position
        6,                                    // Number Of units
        "hard",                            // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;
	
	diag_log format["WAI: Static mission for %1 loaded", missionName];
    

{

    _loop = true;        
    while {_loop} do {
        _count = {alive _x} count (units _unitGroupA)+(units _unitGroupB)+(units _unitGroupC)+(units _unitGroupD)+(units _unitGroupE)+(units _unitGroupF);
        if (_count == 0) then {
            _loop = false;
        };
    };
 
    allAiDead = true;
    publicvariable "allAiDead";

 

 

 

Link to comment
Share on other sites

if(isServer) then {


	//Custom Spawns file//
	/*
	Custom group spawns Eg.

	[
		[953.237,4486.48,0.001],			// Position
		4,									// Number Of units
		"Random",							// Skill level of unit (easy, medium, hard, extreme, Random)
		"Random",	or ["Random","at"],		// Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
		4,									// Number of magazines
		"Random",							// Backpack classname, use "Random" or classname here
		"Random",							// Skin classname, use "Random" or classname here
		"Random",							// Gearset number. "Random" for random gear set
		"Bandit"							// AI Type, "Hero" or "Bandit".
	] call spawn_group;

	Place your custom group spawns below
	*/
    private ["_unitGroupA","_unitGroupB","_unitGroupC","_unitGroupD","_unitGroupE","_unitGroupF","_loop","_count"];

	
    _unitGroupA = [
        [6337.23,14089.3,0.001],            // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    _unitGroupB = [
        [6390.56,14103.6,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    _unitGroupC = [
        [6472.06,14134.4,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    _unitGroupD = [
        [642953,14163.5,0],                    // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;
    
    _unitGroupE = [
        [6355.32,14135.9,0],                // Position
        6,                                    // Number Of units
        "hard",                                // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;

    _unitGroupF = [
        [6454.96,14211.6,0],            // Position
        6,                                    // Number Of units
        "hard",                            // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",    or ["Random","at"],        // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
        4,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "Random",                            // Skin classname, use "Random" or classname here
        "Random",                            // Gearset number. "Random" for random gear set
        "Bandit"                            // AI Type, "Hero" or "Bandit".
    ] call spawn_group;
	
	diag_log format["WAI: Static mission for %1 loaded", missionName];
    

{

    _loop = true;        
    while {_loop} do {
        _count = {alive _x} count (units _unitGroupA)+(units _unitGroupB)+(units _unitGroupC)+(units _unitGroupD)+(units _unitGroupE)+(units _unitGroupF);
        if (_count == 0) then {
            _loop = false;
        };
    };
 
    allAiDead = true;
    publicvariable "allAiDead";




	/*
	Custom static weapon spawns Eg. (with mutiple positions)

	[
		[									// Position(s) (can be multiple)
			[911.21,4532.76,2.62],
			[921.21,4542.76,2.62]
		],
		"M2StaticMG",						// Classname of turret
		"easy",								// Skill level of unit (easy, medium, hard, extreme, Random)
		"Bandit2_DZ",						// Skin classname, use "Random" or classname here
		"Bandit",							// AI Type, "Hero" or "Bandit".
		"Random",							// Primary gun set number. "Random" for random weapon set
		2,									// Number of magazines
		"Random",							// Backpack classname, use "Random" or classname here
		"Random"							// Gearset classname, use "Random" or classname here
	] call spawn_static;

	Place your custom static weapon spawns below
	*/





	/*
	Custom Chopper Patrol spawn Eg.

	[
		[725.391,4526.06,0],				// Position to patrol
		[0,0,0],							// Position to spawn chopper at
		2000,								// Radius of patrol
		10,									// Number of waypoints to give
		"UH1H_DZ",							// Classname of vehicle (make sure it has driver and two gunners)
		"Random",							// Skill level of units (easy, medium, hard, extreme, Random)
		"Random",							// Skin classname, use "Random" or classname here
		"Bandit"							// AI Type, "Hero" or "Bandit".
	] spawn heli_patrol;


	Place your heli patrols below
	*/





	/* 
	Custom Vehicle patrol spawns Eg. (Watch out they are stupid)

	[
		[725.391,4526.06,0],				// Position to patrol
		[725.391,4526.06,0],				// Position to spawn at
		200,								// Radius of patrol
		10,									// Number of waypoints to give
		"HMMWV_Armored",					// Classname of vehicle (make sure it has driver and gunner)
		"Random",							// Skill level of units (easy, medium, hard, extreme, Random)
		"Random",							// Skin classname, use "Random" or classname here
		"Bandit"							// AI Type, "Hero" or "Bandit".
	] spawn vehicle_patrol;

	Place your vehicle patrols below this line
	*/





	/*
	Paradropped unit custom spawn Eg.

	[
		[911.21545,4532.7612,2.6292224],	// Position that units will be dropped by
		[0,0,0],							// Starting position of the heli
		400,								// Radius from drop position a player has to be to spawn chopper
		"UH1H_DZ",							// Classname of chopper (Make sure it has 2 gunner seats!)
		5,									// Number of units to be para dropped
		"Random",							// Skill level of units (easy, medium, hard, extreme, Random)
		"Random",							// Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
		4,									// Number of magazines
		"Random",							// Backpack classname, use "Random" or classname here
		"Bandit2_DZ",						// Skin classname, use "Random" or classname here
		"Random",							// Gearset number. "Random" for random gear set.
		"Bandit",							// AI Type, "Hero" or "Bandit".
		true								// true: Aircraft will stay at position and fight. false: Heli will leave if not under fire. 
	] spawn heli_para;

	Place your paradrop spawns under this line
	*/

	diag_log format["WAI: Static mission for %1 loaded", missionName];

};

And here is the bottom half of where I put your code in my fn_selfaction.sqf 

} else {
	player removeAction s_player_movedog;		
	s_player_movedog = -1;
	player removeAction s_player_speeddog;
	s_player_speeddog = -1;
	player removeAction s_player_calldog;
	s_player_calldog = -1;
};

//Monitor
player setVariable ["selfActions", diag_ticktime, false];
        
//Sector TP
		_target = cursorTarget isKindOf "Laptop";
        if ((speed player <= 1) && _target && (player distance cursorTarget < 5) && allAiDead) then {
        if (s_player_teleport < 0) then {
            s_player_teleport = player addAction ["Teleport","scripts\teleport.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_teleport;
        s_player_teleport = -1;
};

 

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...