Jump to content

riouken

Member
  • Content Count

    570
  • Joined

  • Last visited

  • Medals

Posts posted by riouken


  1. Thanks, but I can't seem to get it to work. I put it in x_vehirespawn.sqf to test since I have some ATVs using that respawn script.

    x_vehirespawn.sqf

    #include "x_setup.sqf"

    private ["_delay","_disabled","_moved","_newveh","_startdir","_startpos","_type","_vehicle"];

    if (!isServer) exitWith{};

    _vehicle = _this select 0;

    _delay = _this select 1;

    _moved = false;

    _startpos = position _vehicle;

    _startdir = getDir _vehicle;

    _type = typeOf _vehicle;

    _myvehicles = ["ATV_US_EP1"];

    _vehicle setVariable ["d_vec_islocked", if (locked _vehicle) then {true} else {false}];

    while {true} do {

    sleep (_delay + random 15);

    _empty = if ((_vehicle call XfGetAliveCrew) > 0) then {false} else {true};

    if (_empty) then {

    _moved = if (_vehicle distance _startpos > 5) then {true} else {false};

    _disabled = if (damage _vehicle > 0) then {true} else {false};

    if ((_disabled && _empty) || (_moved && _empty) || (_empty && !(alive _vehicle))) then {

    _isitlocked = _vehicle getVariable "d_vec_islocked";

    deletevehicle _vehicle;

    _vehicle = objNull;

    sleep 0.5;

    _vehicle = createVehicle [_type, _startpos, [], 0, "NONE"];

    _vehicle setpos _startpos;

    _vehicle setdir _startdir;

    _vehicle setVariable ["d_vec_islocked", _isitlocked];

    if (_isitlocked) then {_vehicle lock true};

    if (_vehicle in _myvehicles) then {_vehicle addAction ["testaction","test.sqf",1]};

    #ifndef __ACE__

    if ((getNumber(configFile >> "CfgVehicles" >> _type >> "ARTY_IsArtyVehicle")) == 1) then {

    switch (_type) do {

    case "MLRS": {

    _vehicle removeMagazine "12Rnd_MLRS";

    _vehicle addMagazine "ARTY_12Rnd_227mmHE_M270";

    };

    case "GRAD_RU": {

    _vehicle removeMagazine "40Rnd_GRAD";

    _vehicle addMagazine "ARTY_40Rnd_120mmHE_BM21";

    };

    case "MLRS_DES_EP1": {

    _vehicle removeMagazine "12Rnd_MLRS";

    _vehicle addMagazine "ARTY_12Rnd_227mmHE_M270";

    };

    case "GRAD_TK_EP1": {

    _vehicle removeMagazine "40Rnd_GRAD";

    _vehicle addMagazine "ARTY_40Rnd_120mmHE_BM21";

    };

    };

    ["d_bi_a_v", _vehicle] call XNetCallEvent;

    };

    #endif

    };

    };

    };

    No action shows up at all. I even tried changing it to setdamage and nothing happened.

    Sorry Strikor try this:

    [color="Red"]if (_type in _myvehicles) then {_vehicle addAction ["testaction","test.sqf",1]};[/color]
    


  2. Strikor,

    This is not tested but something like this should work, this is for the vehicle.sqf so this will only work for those vehicles your respawning this way.

    in the vehicle.sqf try this:

    _myvehicles = [whatever,Cars,you,want,to,put,addaction,on];
    

    then further down in the vehicle.sqf: (My additions are in Red.)

    // Respawn vehicle
         if (_dead) then 
    {	
    	if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep                 _delay;};
    	if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;};
    	if (_explode) then {_effect = "M_TOW_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;};
    	sleep 0.1;
    
    	deleteVehicle _unit;
    	sleep 2;
    	_unit = _type createVehicle _position;
    	_unit setPosASL _position;
    	_unit setDir _dir;
    
                   [color="Red"]if (_unit in _myvehicles) then {_unit addAction ["My Action1","doittoit.sqf",1]};[/color]
    
    	if (_haveinit) then 
    				{_unit setVehicleInit format ["%1;", _unitinit];
    				processInitCommands;};
    	if (_hasname) then 
    				{_unit setVehicleInit format ["%1 = this; this               setVehicleVarName ""%1""",_unitname];
    				processInitCommands;};
    	_dead = false;
    
    	// Check respawn amount
    	if !(_noend) then {_rounds = _rounds + 1};
    	if ((_rounds == _respawns) and !(_noend)) then {_run = false;};
    };
    


  3. Also if you do not want to use a trigger you can add all of it form the init.sqf

    init.sqf

    co addAction ["Whatever","doit.sqf",1];
    co addAction ["Whatever2","doit2.sqf",1];
    etc.
    

    You can also use one script and use the switch statements like ST_Dux said from these: (the # at the end is passed along to the script)(Change it to what ever you need)

    then in actions.sqf you will need

    _var = _this select 3;
    

    and now _var is what ever number you assigned it in your addaction's.


  4. I had some add action commands that were being added by the init.sqf. But they are not working since the new patch. We tested it on two different computers, the only way I could get an addAction command to work was by putting it in the objects init line.

    this was the code in the init.sqf

    It worked properly before the patch in both A2 and OA.

    It would add the action to the object.

    rc1 addAction ["200m Targets Up","reset1u.sqf",1];
    

    Does anyone know if they changed something?


  5. I had this problem too when I got the demo, the problem is everyone who has the demo has the same player ID, to fix go into the demo game folder and find the ban.txt there should only be one player ID in there something like 9999. Take it out and save and your problem will be all fixed.


  6. Thanks for the help kylania (lol you must live on these boards, you answer them so fast!)

    Any ways I have the rearm scripts working as different scripts but I would like to combine them into one big rearm script. I have planes named "pln1,pln2 etc" Now I want to execute this script for all planes and use if statements to give them different load outs but I cant seem to get the if statement to fire.

    plns = [pln1,pln2,pln3,pln4,pln5,pln6,pln7,pln8,pln9,pln10];
    
    {_x execVM "masterloadout.sqf"} forEach plns;
    
    hintSilent "Its running";
    
    if (_x = pln1) then
    {
    	hintSilent "If statement is running";
           };
    

    Any help?


  7. I wrote a script to rearm an airplane (an AV-8B in this case), Now functionally the script works great. But I was looking for more information on if the pylons are selectable or about the way the weapons are modeled in-game. For what ever reason when I add weapons back it will skip the FFAR pod pylon if I am not adding an FFAR pod back. Also if there are not enough pylons to support the weapons that are re-loaded the missiles will fire from the very center of the plane.

    I have been searching for more information on this all day yesterday and I could not find very much information. Any help would be appreciated.

    pln1 removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z",[-1]];
    pln1 removeMagazinesTurret ["6Rnd_Mk82",[-1]];
    pln1 removeMagazinesTurret ["14Rnd_FFAR",[-1]];
    pln1 removeMagazinesTurret ["6Rnd_GBU12_AV8B",[-1]];
    pln1 removeMagazinesTurret ["2Rnd_Maverick_A10",[-1]];
    
    pln1 removeWeapon "MaverickLauncher";
    pln1 removeWeapon "Mk82BombLauncher_6";
    pln1 removeWeapon "SidewinderLaucher_AH1Z";
    pln1 removeWeapon "FFARLauncher_14";
    pln1 removeWeapon "BombLauncher";
    
    pln1 addWeapon "Mk82BombLauncher_6";
    //pln1 addWeapon "BombLauncher";
    //pln1 addWeapon "FFARLauncher_14";
    pln1 addWeapon "MaverickLauncher";
    pln1 addWeapon "SidewinderLaucher_AH1Z";
    
    pln1 addMagazineTurret ["6Rnd_Mk82",[-1]];
    //pln1 addMagazineTurret ["6Rnd_GBU12_AV8B",[-1]];
    //pln1 addMagazineTurret ["14Rnd_FFAR",[-1]];
    pln1 addMagazineTurret ["2Rnd_Maverick_A10",[-1]];
    pln1 addMagazineTurret ["2Rnd_Sidewinder_AH1Z",[-1]];
    


  8. I wrote this script to change the starting loadouts of players. It works fine in the editor but when I host a multilayer game it does not work.

    I am executing the script from the init.sqf.

    _x = [s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, s_10, rm1, rm2, rm3];
    
    { removeAllWeapons _x} forEach _x;
    { removeAllItems _x} forEach _x;
    
    
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addMagazine "30Rnd_556x45_Stanag"} forEach _x;
    { _x addWeapon "ACE_M16A4_IRON"} forEach _x;
    { _x addWeapon "Binocular"} forEach _x;
    


  9. I have Arma 2 + OA, When I join a server I can not see any of the player slots, its just blank, the screen is there just none of the players or the slots are visible. If I hit ok to load the mission it just starts like its going to download the mission and freezes. It was working fine last night, now all of the sudden this happens. I tried joining 15-20 servers and they were all doing it. Also it is happening in both Arma 2 and OA.

    I tried searching but I have not been able to find anything about this problem.

    * Edit *

    I fixed it, I hooked up another router two days ago and I had this computer on the DMZ, now it worked just fine the first two days, but now the game only works if I do not run my computer in the DMZ. Go figure, still not sure why but that seemed to have fixed the problem.

×