GHelicopter

Moderator: Inkwizytor

ODPOWIEDZ
Haker123
Posty: 5
Rejestracja: 05 czerwca 2008, 15:00
ID Steam:
ID gracza: 0

GHelicopter

Post autor: Haker123 »

Witam!
Mam takie małe pytanie odnośnie skryptu GHelicopter (desant na linie). Co wpisać śmigłowcowi, żeby spuszczł wojaków??
Za pomoc dzieki .

Kod: Zaznacz cały

; ********************************************************************************
; ** Operation Flashpoint Script File
; ********************************************************************************
; ** Sintaxis
; ** [heliW2,[grpW1],[helipad1,0, true], [helipad2,true], 2,"accion.sqs", [333, 15531]] exec "Ghelicopter.sqs"
; ********************************************************************************
; ** Elemento Nş 1 de cuarto parametro es:
; **             nill: Para que el heli recoja en la posicion del grupo 
; **    nombre_objeto: Para que el heli recoja en la posicion del objeto
; ********************************************************************************

;//--- Vehiculo transportador
_heli = _this select 0

;//--- Vector de grupo a transportar
_grps = _this select 1

;//--- Objeto/referencia coordenedas de recogida y tiempo de espera (0: ilimitado)
_intro = _this select 2

;//--- Objeto/referencia coordenedas de insercion de grupos
_out = _this select 3

;//--- Modalidad de insercion (0: desembarcar, 1:Rapel, 2: Paracaidas)
_modo = _this select 4

;//--- Script de accion/grupo insertado
_acc  = _this select 5

;//--- Secuencia de posiciones intermedias para ruta de aproximación
_ruta  = _this select 6

;//--- Datos para posicionar cuerda/rapel
_ang = -90.00
_ang2= 90.00
_distR = 1.20
_lngSoporte = 0.00
_abajo = 1.5

#inicio
? not(local server): goto "salida"

_primera = true
_altdrop = 100

_in = _intro select 0
_wait = _intro select 1
_cover = false
? count _intro == 3: _cover = _intro select 2

_cover2 = _out select 1
_out = _out select 0

? _in distance _out < 100: goto "salida"

;----------------------------------
;--- Determinar engine
;----------------------------------
_simulador = nill

_OFP  = "scalar bool array string 0xfcffffef"
_ArmA = "scalar bool array string 0xe0ffffef"

_param = _ArmA
? format["%1",_simulador] == _OFP  : _param = _OFP
? format["%1",_simulador] == _ArmA : _param = _ArmA

_orden = 0
_trip = count(crew _heli)

_posfin = [getpos _heli select 0, getpos _heli select 1, 0]
_dest = "HeliHempty" createvehicle _posfin
_alt = 30

#ciclo
_grp = _grps select _orden
;;;;;;;;;;;? _out distance (leader _grp) < 500 : goto "retoma_1"
;--- Anulado provisoriamente -----------------------------------
;? _primera and ((getpos _heli) select 2) > 10: goto "cargado"
;---------------------------------------------------------------
? _heli distance (leader _grp) > 100: goto "recoge"

#cargado
{_x assignascargo _heli} foreach units _grp
{_x moveincargo _heli} foreach units _grp
goto "a_destino"

;-----------------------------------------------------
#recoge
? not alive(_heli): goto "salida"
~1
? format["%1",_in] == _param :_dest setpos getpos (leader _grp); goto "recoge_1"
_dest setpos getpos _in
;_heli action["engine on"]

#recoge_1
_heli domove getpos _dest
? _heli distance _dest < 100: _heli flyinheight 0
? _heli distance _dest > 100: goto "recoge"
_heli setspeedmode "LIMITED"
_heli land "get in"

#desciende1
? not alive(_heli): goto "salida"
? ((getpos _heli) select 2) < 10: goto "carga"
~1
_heli flyinheight ((getpos _heli) select 2) - 0.5
goto "desciende1"

;-----------------------------------------------------
#carga
_heli flyinheight 0
{_x assignascargo _heli} foreach units _grp
(units _grp) ordergetin true
_tiempo = _wait
_salto = "carga_01"
? _cover : goto "descarga_0"

#carga_01
? not alive(_heli): goto "salida"
? count(crew _heli) == (count(units _grp) + _trip): goto "a_destino"
~1
_viv = 0
{if (alive(_x)) then {_viv = _viv + 1}} forEach units _grp
? _viv == 0 : goto "retoma_1"
? _wait == 0: goto "carga_01" 
_tiempo = _tiempo - 1
? (_tiempo > 0): goto "carga_01"
? (count(crew _heli) > _trip): goto "carga_01"
? _heli distance (leader _grp) < 100: goto "carga_01"

;_heli flyinheight _alt
{UnassignVehicle _x} foreach units _grp
goto "retoma_1"

;-----------------------------------------------------
#a_destino
_heli flyinheight _alt
_heli setspeedmode "NORMAL"
_wpmax = count _ruta
_wpact = 0

#a_destino_0
? _wpmax > 0:  _heli domove getpos (_ruta select _wpact)

#a_destino_1
? not alive(_heli): goto "salida"
~1
? _wpmax == 0: _heli domove getpos _out; goto "a_destino_2"
? (_heli distance (_ruta select _wpact)) > 150: goto "a_destino_1"
_wpact = _wpact + 1
? _wpact < _wpmax: goto "a_destino_0"

_wpmax = 0
_heli domove getpos _out

#a_destino_2
? (_modo == 0) and (_heli distance _out) < 150: goto "despliega"
? (_modo == 1) and (_heli distance _out) < 150: goto "rapel"
? (_modo == 2) and (_heli distance _out) < 400: goto "paraca"
goto "a_destino_1"

;-----------------------------------------------------
#paraca
_alt = ((getpos _heli) select 2)

#paraca_1
? not alive(_heli): goto "salida"
_heli flyinheight _altdrop
~1
? ((getpos _heli) select 2) < _altdrop: goto "paraca_1"
~3
_max = (count units _grp) - 1

#salto
~1
_quien = ((units _grp) select _max)
_quien action ["eject", _heli]
_quien setvelocity velocity(_heli)
unassignvehicle _quien
_max = _max - 1
? _max >= 0: goto "salto"
~5
_heli flyinheight _alt
goto "retoma"

;-----------------------------------------------------
#rapel
_heli setspeedmode "LIMITED"
 _heli flyinheight 15

#rapel_ini
? not alive(_heli): goto "salida"
_heli domove getpos _out
~0.5
? _heli distance _out > 100: goto "rapel_ini"
? getpos _heli select 2 > 15 and (speed _heli < 3): goto "rapel_ini"

#rapel_1
_vec = units _grp
_can = count _vec
_pos = 0
_InitCuerda = false
~3

#rapel_2
_man  = _vec select _pos
_donde = getpos _heli
_dx    = _donde select 0
_dy    = _donde select 1
_alt   = _donde select 2
? not(_InitCuerda): _cuerda = "FSM_FastRope" createvehicle [0,0,0]
_InitCuerda = true

#rapel_2_1
_dir = direction _heli
_donde = getpos _heli
_dx    = _donde select 0
_dy    = _donde select 1
_dz    = _donde select 2

;############################################
_ang = 300.00
_ang2= 90.00
_distR = 1.50
_lngSoporte = 0.00
_abajo = -2.50
;############################################

_dif = 1
? _ang < 0 : _dif = -1
_dirC2= (_dir + _ang2)
_dirC = (_dir + _ang)
_pxC = _dx + (_distR * sin(_dirC))
_pyC = _dy + (_distR * cos(_dirC))

_cuerda setpos [_pxC, _pyC, _dz + _abajo]
_cuerda setdir _dirC2

#rapel_3
unassignvehicle _man
_man setdir random(360)
_man setpos [ _dx, _dy, _alt]
_man switchmove "AidlPercMstpSnonWnonDnon04"

#rapel_4
 _heli setvelocity [0,0,0]
_dir = direction _heli
_donde = getpos _heli
_dx    = _donde select 0
_dy    = _donde select 1
_dz    = _donde select 2

_dirC = (_dir + _ang)
_pxC = _dx + (_distR * sin(_dirC))
_pyC = _dy + (_distR * cos(_dirC))
_cuerda setdir _dirC
_cuerda setpos [_pxC, _pyC, _dz + 2]

_height = (getpos _man select 2)
_height = _height - 0.080

_dirC = (_dir + _ang)
_Ndir = ((getdir _man) + (_height * 0.2))
_pxM = _dx + ((_distR + _lngSoporte) * sin(_dirC))
_pyM = _dy + ((_distR + _lngSoporte) * cos(_dirC))
_man setdir _Ndir
_man setpos [ _pxM, _pyM, _height]
_cuerda2 setpos [_pxM, _pyM, _height]
_cuerda2 setdir _Ndir
_man setvelocity [0,0,0.25]
~0.01

? not(alive _man) : _man switchmove ""; goto "rapel_99"
? _height > 1.7 : goto "rapel_4"

_nx = getpos _man select 0
_ny = getpos _man select 1
_man switchMove "AcrgPknlMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon_getOutHigh"

_man setpos [_pxM, _pyM, 0]
_man domove [_nx+1+random(20)-10, _ny+1+random(20)-10, 0]

#rapel_99
_can = _can - 1
_pos = _pos + 1
? _can > 0: goto "rapel_2"

#rapel_99_1
~1

;####################################### Suelta cuerdas
#rapel_99_2
_cuerda setpos [_pxC, _pyC, _dz - 0.2]
_vec = vectorUP _cuerda
_dz = (position _cuerda) select 2
~0.000000001
? _dz > 0 : goto "rapel_99_2"
deletevehicle _cuerda
deletevehicle _cuerda2

;####################################### Avance momentaneo
_heli flyinheight 30
_avX = _dx + (500 * sin(getdir _heli))
_avY = _dy + (500 * cos(getdir _heli))
_heli domove [_avX, _avY, 0]
@unitready _heli
goto "retoma"

;-----------------------------------------------------
#despliega
_heli setspeedmode "LIMITED"
_heli land "get out"
_salto = "descarga_2"

#desciende2
? not alive(_heli): goto "salida"
_heli flyinheight ((getpos _heli) select 2) - 0.5
? ((getpos _heli) select 2) < 2: goto "descarga"
~1
goto "desciende2"

#descarga
_heli flyinheight 0
? not _cover2 : goto "descarga_2"

#descarga_0
_heli flyinheight 0
_cansmoke = 2

#descarga_1
_sep = 15

? daytime < 7.00 or daytime > 18.00: goto "descarga_2"

_px = getpos _heli select 0
_py = getpos _heli select 1
_pz = getpos _heli select 2
_dir = random(360)
_px = _px + (_sep * sin(_dir))
_py = _py + (_sep * cos(_dir))
_humo = "smokeshell" createvehicle [_px, _py, _pz]
_cansmoke = _cansmoke - 1
? _cansmoke > 0: goto "descarga_1"
goto _salto

#descarga_2
_pos = 0
_can = count(units _grp)

#descarga_3
_man = (units _grp) select _pos
_man action ["EJECT",_heli]
unassignvehicle _man
~0.75
_pos = _pos + 1
_can = _can - 1
? _can >= 0: goto "descarga_3"

#retoma
? _acc != "": [_grp] exec _acc

#retoma_1
_heli flyinheight _alt
_heli setspeedmode "NORMAL"
_primera = false
_orden = _orden + 1
? _orden < (count _grps): goto "ciclo"

;-----------------------------------------------------
#retorna
? not alive(_heli): goto "salida"
_dest setpos _posfin
_heli domove getpos _dest
~1
? _heli distance _dest > 100: goto "retorna"
_heli land "land"

;-----------------------------------------------------
#salida
deletevehicle _dest
exit
centurion_94
Posty: 389
Rejestracja: 07 maja 2008, 06:54
ID Steam:
ID gracza: 0
Lokalizacja: Chrzanów

Re: GHelicopter

Post autor: centurion_94 »

to jest do operation flashpoint??
Haker123
Posty: 5
Rejestracja: 05 czerwca 2008, 15:00
ID Steam:
ID gracza: 0

Re: GHelicopter

Post autor: Haker123 »

Sam jesteś Operation Flashpoint: :roll: http://www.armaholic.com/page.php?id=2240
ODPOWIEDZ

Wróć do „Edytor - tworzenie misji, skrypty oraz programowanie”