Jump to content

Flightcaptain93

Member
  • Content Count

    22
  • Joined

  • Last visited

  • Medals

Posts posted by Flightcaptain93


  1. _spawn1 = player addAction
    [
        "Place spawn",    // title
        "scripts\placerespawn.sqf", // script 
        [_tent,_spawn2],    <========= HERE spawn2 cant be used in the placerespawn.sqf     // arguments
        1.5,        // priority
        true,        // showWindow
        true,        // hideOnUse
        "",            // shortcut
        "true",     // condition
        50,            // radius
        false,        // unconscious
        "",            // selection
        ""            // memoryPoint
    ];

     

    _spawn2 = player addAction
    [
        "Cancel placing spawn",    // title
        "scripts\cancelrespawn.sqf",// script 
        [_tent,_spawn1],        // arguments
        1.5,        // priority
        true,        // showWindow
        true,        // hideOnUse
        "",            // shortcut
        "true",     // condition
        50,            // radius
        false,        // unconscious
        "",            // selection
        ""            // memoryPoint
    ];

     

    I added two addActions via one script. _spawn2 can handle the passed variable _spawn1 but _spawn1 cant handle the passed variable _spawn2 because it is created later... How can i pass _spawn2 into the script from _spawn1? in both scripts both of these actions are deleted. 

    or should i use another approach?


  2. I got "Base" Respawn enabled with map selection. It works.

    I have two markers one named "respawn_west" and one is named "respawn_UNITNAME"

    The unit I want to have both respawns accessible is named UNITNAME. 

    When I respawn i only can choose the point at respawn west.

    If i change the name from respawn_UNITNAME to respawn_west2 it works fine. but i want that one position only for that unit available. 

    Can someone help me pls.

    http://killzonekid.com/arma-scripting-tutorials-respawn-on-marker/


  3. 16 hours ago, dchan200 said:

    I can see the part where the script handles killing civilians, but it's not readily apparent where it's supposed to handle killing teammates?

     

    You probably need to add an OR statement to your script to deal with killing teammates. Something like this:

    
    (side (_this select 0) == civilian || side (_this select 0) == west)

    Note that the second statement does not check the  player's side (i.e., side (_this select 0) == side(player)) as they will be moved to another side after their rating drops low enough.

    :) no there should be no punishment for killing teammates. the first statement (_this select 1) == player) checks if the killer is an player. the second one (_this select 0) == civilian) if an civilian was killed. if both of them are true my script should be executed. That works... but accidentally the trigger fires when the player killes 2 blufor units.... and that is weird. I dont get why the script does this??? mayby i miss something important?


  4. _civkilled = addMissionEventHandler ["EntityKilled",{if (((_this select 1) == player) && (side (_this select 0) == civilian)) then {[[], "ray_lose_fnc", true, true] call BIS_fnc_MP; [[(_this select 1)], "ray_killer_fnc", true, true] call BIS_fnc_MP; }else{}; }];

     

    I have this type of code... it works correctly. But if i kill the second teammate in the group of the player (blufor) the trigger fires...

    Thanks :)


  5. After i switchet the car variable to a local one. _car.

    The variable _car is first called in my ray_traffic_fnc where the car is spawned... is it possible to give the information about _car into the part of the script after the ray_traffic_fnc?? because now i get the error that the variable _car is not defined...

     

     call ray_traffic_fnc;
                _driver = driver car;


  6. This is the code of the carspawnscript. I have a roadblock with a bargate. If 1 car is standing infront of it the second car has to hold at an other spot. The car holds infront of the bargate and continues driving if the bargate is opend.

    But if the second car spawn the first won´t continue after i open the gate...

     

     

    if (isServer) then {

        _cs = (_this select 0);
        _hpfirst = (_this select 1);
        _hpsecond = (_this select 2);
        _dest = (_this select 3);
        

                
        sleep 1;
        
            if (firstpoint) then
                {
                sleep 5;
                };
                
            if (firstpoint) then
                {
                firstpoint = false;
                publicvariableserver "firstpoint";
                call ray_traffic_fnc;
                _driver = driver car;
                _groupd = group _driver;
                sleep 1;
                _wp = _groupd addWaypoint [_hpfirst, 0];    
                _wp setWaypointCombatMode "BLUE";
                _wp setWaypointSpeed "Limited";
                _wp setWaypointBehaviour "CARELESS";
                _wp setWaypointtype "MOVE";    
        
                waituntil {sleep 1; (((bargate animationPhase "Door_1_rot") == 1) && ((car distance2D bargate) <= 20) && ((speed car) <= 1))};
                firstpoint = true;
                publicvariableserver "firstpoint";
                sleep 1;            
                _wp = _groupd addWaypoint [[11509.3,6270.87,0],0];
                _wp = _groupd addWaypoint [_dest, 0];    
                _wp setWaypointCombatMode "BLUE";
                _wp setWaypointSpeed "Limited";
                _wp setWaypointBehaviour "CARELESS";
                _wp setWaypointtype "MOVE";    
        
                waituntil {(car distance2D _dest) <= 50};
        
                {car deleteVehicleCrew _x} forEach crew car; deletevehicle car;
                
                } else {
                
                    if (secondpoint) then
                        {
                        secondpoint = false;
                        publicvariableserver "secondpoint";
                        call ray_traffic_fnc;
                        _driver = driver car;
                        _groupd = group _driver;
                
                        _wp = _groupd addWaypoint [_hpsecond, 0];    
                        _wp setWaypointCombatMode "BLUE";
                        _wp setWaypointSpeed "Limited";
                        _wp setWaypointBehaviour "CARELESS";
                        _wp setWaypointtype "MOVE";    
        
                        waituntil {sleep 1; firstpoint};
                        _firstpoint = false;
                        _secondpoint = true;
                        publicvariableserver "firstpoint";
                        publicvariableserver "secondpoint";
                        sleep 10;
                        _wp = _groupd addWaypoint [_hpfirst, 0];    
                        _wp setWaypointCombatMode "BLUE";
                        _wp setWaypointSpeed "Limited";
                        _wp setWaypointBehaviour "CARELESS";
                        _wp setWaypointtype "MOVE";    
        
                        waituntil {sleep 1; (((bargate animationPhase "Door_1_rot") == 1) && ((car distance2D bargate) <= 20) && ((speed car) <= 1))};
                        _wp = _groupd addWaypoint [[11509.3,6270.87,0],0];
                        _firstpoint = true;
                        publicvariableserver "firstpoint";
                        sleep 1;
                        _wp = _groupd addWaypoint [_dest, 0];    
                        _wp setWaypointCombatMode "BLUE";
                        _wp setWaypointSpeed "Limited";
                        _wp setWaypointBehaviour "CARELESS";
                        _wp setWaypointtype "MOVE";    
        
                        waituntil {(car distance2D _dest) <= 50};
        
                        {car deleteVehicleCrew _x} forEach crew car; deletevehicle car;
                        
                        } else {
                        hint "NO SPAWN POSSIBLE";
                                };
                                
                        };
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
    };

     

    and the traffic_function

     

    ray_traffic_fnc = {

        _cararray = ["C_truck_02_covered_F","C_offroad_01_F","C_SUV_01_F","I_C_Offroad_02_unarmed_F"];
        _carspawn = _cararray call BIS_fnc_selectRandom;
        car = _carspawn createVehicle _cs;
        car setdir 180;
        clearweaponcargoglobal car; clearmagazinecargoglobal car; clearitemcargoglobal car; clearbackpackcargoglobal car;
        
        
        _freePositionscargo = car emptyPositions "cargo";
        hint format ["Cargoplaces car: %1",_freePositionscargo];
        sleep 2;
        _comander = car emptyPositions "Commander";
        _gunner = car emptyPositions "Gunner";
        _comgun = _comander + _gunner;
        _unitcountcar = _freePositionscargo + _comgun + 1;
        hint format ["Cargo with driver, gunner etc: %1",_unitcountcar];
        sleep 2;
        _randompassenger = floor (random _unitcountcar);
        hint format ["Crew (minus): %1",_randompassenger];
        sleep 2;
        _crewnumber = _unitcountcar - _randompassenger;
        hint format ["Crew (spawn): %1",_crewnumber];
        sleep 3;
        
        for "_i" from 1 to _crewnumber do                                     
                {
            grp = creategroup civilian;
        
            _man = grp createUnit ["C_Man_casual_4_F_tanoan", _cs, [], 5, "PRIVATE"];
            _needofdriver = car emptyPositions "Driver";
            
            if (_needofdriver == 1) then
                    {
                    _man moveindriver car;
                    } else {
                    _man moveincargo car;
                    };
        
                };
        };


  7. Hello :)

    I have this type of code in one of my missions.

     

    for "_i" from 1 to 100 do

    {

        _nil = [_cs,_hpfirst,_hpsecond,_dest] execVM "scripts\carspawn.sqf";
        _number = floor (random 941) + 60;
        sleep _number;
        };

     

    In the script different cars with a different amount of passengers are generated. They get waypoints etc. But i think does once the script startet twice it affect the other script. Is it possible to start the script multiple times without having any influence on each other?
    I´m new into scripting.

    Thanks guys.

×