Home   Help Search Login Register  

Author Topic: Mission scripts.!  (Read 1107 times)

0 Members and 1 Guest are viewing this topic.

Offline SWAT

  • Members
  • *
Mission scripts.!
« on: 01 Jun 2008, 12:53:29 »
 :confused: hi  add new Vehicles  ( F-16C (GBU) F-16C (CAP) F-16C (CAS) M60A3)or addon to  Evolution so problem  Rank scripts to Vehicles  to add not working ..I need help.  :weeping:   
_

Code: [Select]
unit = _this select 0;
_vec = _this select 1;
_Vehicle = typeOf _vec;
_rank1 = rank1;
_rank2 = rank2;
_rank3 = rank3;
_rank4 = rank4;
_rank5 = rank5;
_rank6 = rank6;
_dunit = _unit;
_warning = 0;
if (not (local _unit)) exitwith {};


EVO_Eject =
{
_unit = _this select 0;
_unit action ["ENGINEOFF", vehicle _unit];
_unit action ["Eject",vehicle _unit];
sleep 1;
_unit action ["Eject",vehicle _unit];
};


if (getdammage _vec == 0) then
{
_vec setdammage 0.01;
};
if (not (isPlayer _unit)) then
{
_dunit = (leader _unit);
};
switch (_Vehicle) do
{
    case "DC3":
    {
if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
if(_unit == player and _vec in list AirportIn) then {wcam = _vec addaction ["Taxi to runway", "actions\taxi.sqf",0,1, false, true,"test2"]};
    };
    case "F-16CP":
    {
if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};
init = _vec addAction ["Call ILS", "ofpec_ils\ofpec_open_airfieldselector.sqf"];
};
    case "AH1W":
    {
if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};
    };
    case "M60A3":
    {
if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "F16CC":
    {
if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};
init = _vec addAction ["Call ILS", "ofpec_ils\ofpec_open_airfieldselector.sqf"];
    };
    case "Stryker_TOW":
    {
if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "F16CG":
    {
if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};
init = _vec addAction ["Call ILS", "ofpec_ils\ofpec_open_airfieldselector.sqf"];
    };
    case "AH6":
    {
if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };   
    case "UH60":
    {
if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
towInt = _vec addAction ["*Hitch Vehicle*","scripts\towVcl.sqs"];
    };
    case "Vulcan":
    {
if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };   
    case "UH60MG":
    {
if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
towInt = _vec addAction ["*Hitch Vehicle*","scripts\towVcl.sqs"];
    };
    case "M113":
    {
if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "Stryker_ICV_MK19":
    {
if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };   
    case "Stryker_ICV_M2":
    {
if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "MH6":
    {
if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "HMMWVTOW":
    {
if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "Truck5tMG":
    {
if (score _dunit < _rank1) then {_handle = [_dunit,_rank1] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
           };
     case "Truck5t":
    {
if (score _dunit < _rank0) then {_handle = [_dunit,_rank0] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
loadr= _vec addaction ["Load static", "load_static.sqf"];
};
    case "HMMWVMK":
    {
if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };     
    case "HMMWV50":
    {
if (score _dunit < _rank1) then {_handle = [_dunit,_rank1] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };   
    case "ZSU":
    {
if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    }; 
    case "BMP2":
    {
if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    }; 
    case "BRDM2":
    {
if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "BRDM2_ATGM":
    {
if (score _dunit < _rank3) then {_handle = [_dunit,_rank3] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "T72":
    {
if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "UAZMG":
    {
if (score _dunit < _rank1) then {_handle = [_dunit,_rank1] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };
    case "UAZ_AGS30":
    {
if (score _dunit < _rank2) then {_handle = [_dunit,_rank2] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
    };   
    case "Su34":
    {
if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};
init = _vec addAction ["Call ILS", "ofpec_ils\ofpec_open_airfieldselector.sqf"];
    };
    case "Su34B":
    {
if (score _dunit < _rank6) then {_handle = [_dunit,_rank6] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};
init = _vec addAction ["Call ILS", "ofpec_ils\ofpec_open_airfieldselector.sqf"];
    };     
    case "KA50":
    {
if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
if(_unit == player) then {wcam = _vec addaction [localize "EVO_025", "actions\wepcam.sqf",0,1, false, true,"test2"]};
    };
    case "Mi17":
    {
if (score _dunit < _rank4) then {_handle = [_dunit,_rank4] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
towInt = _vec addAction ["*Hitch Vehicle*","scripts\towVcl.sqs"];
    };
    case "Mi17_MG":
    {
if (score _dunit < _rank5) then {_handle = [_dunit,_rank5] execVM "scripts\req.sqf";[_unit] call EVO_Eject};
towInt = _vec addAction ["*Hitch Vehicle*","scripts\towVcl.sqs"];
    };
    case "M113Ambul":
    {
if (!(player isKindOf "SoldierWMedic")) then {[_unit] call EVO_Eject};
    };
    case "BMP2Ambul":
    {
if (!(player isKindOf "SoldierWMedic")) then {[_unit] call EVO_Eject};
    };
    case "Truck5tRepair":
    {
    if (player isKindOf "SoldierWMiner") then
    {   
    if(not (isNull ltrk)) then
    {
    ltrk removeaction elock;
    ltrk lock false;
    };
    if(ltrk != _vec) then {elock = _vec addaction ["Lock Truck", "actions\englock.sqf",0,1, false, true,"test2"];ltrk = _vec};
    };
    };
    case "UralRepair":
    {
    if (player isKindOf "SoldierWMiner") then
    {
    if(not (isNull ltrk)) then
    {
    ltrk removeaction elock;
    ltrk lock false;
    };
    if(ltrk != _vec) then {elock = _vec addaction ["Lock Truck", "actions\englock.sqf",0,1, false, true,"test2"];ltrk = _vec};
    };
     };
};
if(_unit != player) exitWith {};
if(_vec isKindOf "Air") then
{
if(_Vehicle == "AV8B") then
{
_fireb = _vec addEventHandler["Fired",{if ((_this select 2) == "BombLauncher") then {trkbmb = [(_this select 0)] execVM "scripts\Trkbmb.sqf"}}];
};
/*
_hit = player addEventHandler ["hit",
{
_rnd = round(random 2);
switch (_rnd) do
{
case 0:
{
driver (_this select 0) say "Hit1";
hint "hit1";
};
case 1:
{
driver (_this select 0) say "Hit2";
hint "hit2";
};
case 2:
{
driver (_this select 0) say "Hit1";
hint "hit3";
};
};
}];
if(_hit > 0) then {_vec removeEventHandler ["hit", _hit]};
*/
setViewDistance avdist;
};
_getin = _vec addEventHandler ["GetIn", {handle = [(_this select 0),(_this select 1)] execVM call EVO_Boarding}];

if(_getin > 1) then {_vec removeEventHandler ["GetIn", _getin];};

Waituntil {player != driver _vec};
_vec removeaction wcam;
_vec removeaction towInt;
_vec removeaction init;
_vec removeaction loadr;
_vec removealleventhandlers "Fired";
setViewDistance vdist;
« Last Edit: 01 Jun 2008, 13:18:05 by SWAT »

Offline Cheetah

  • Former Staff
  • ****
Re: Mission scripts.!
« Reply #1 on: 02 Jun 2008, 21:47:12 »
Welcome to OFPEC!

Are you sure that the classnames used are correct?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline SWAT

  • Members
  • *
Re: Mission scripts.!
« Reply #2 on: 03 Jun 2008, 22:45:20 »
Welcome to OFPEC!

Are you sure that the classnames used are correct?


tenks'' Type 'F-16C (GBU) F-16C (CAP) F-16C (CAS) M60A3' also all name orjinal Pbo file that copy and paste only ''F-16 troops addon Beta .anda Sicirpt code  Not orjianal to Modify 'add class name..waht wrong.?
« Last Edit: 03 Jun 2008, 22:47:24 by SWAT »