Home   Help Search Login Register  

Author Topic: what do i put to run this script?  (Read 460 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
what do i put to run this script?
« on: 24 Nov 2004, 05:49:58 »
hello,
I was givin this script by triggerhappy but he went on vacation and I need to know what to put in the activasion field to run this script. does anybody know how i get this script to run. besides putting it in my mission


PlaneCrash.sqs

Code: [Select]
 _plane = _this select 0
_player = player
_rNum = 10
_killCount = 0
_smokeCounter = 25

@(!alive _plane):_plane setdammage .7;_plane setfuel 0;goto "startcrash"

#startcrash
_plane lock true
_pilot = driver _plane
_cargo = crew _plane
?_player in _plane:_inplane = true;_player addeventhandler ["dammaged", {_player setdammage 0}];_player addeventhandler ["killed", {_player setdammage 0}];_player addeventhandler ["hit", {_player setdammage 0}]
_startheight = getpos _plane select 2
?(_plane getpos select 2) <= 2:goto "slide"
_pilot sidechat "Damn, we're hit! Brace for impact!"

_plane setdammage .5
_plane setvelocity [(velocity _plane select 0), (velocity _plane select 1), (velocity _plane select 2) - 5]
@_plane getpos select 2 <= 1:_plane setvelocity [(velocity _plane select 0), (velocity _plane select 1), (velocity _plane select 2) + 5];_InitVel = velocity _plane;titlecut ["","black out", 3];goto "slide"

#slide
_dir = getDir _plane
_vel1 = _InitVel select 0
_vel2 = _InitVel select 1
_vel1Diff = _vel1 * (5*10^(-20))
_vel2Diff = _vel2 * (5*10^(-20))
?(_dir > 90 && _dir <= 180):goto "southeast"
?(_dir > 180 && _dir <= 270):goto "southwest"
?(_dir > 270 && _dir <= 360):goto "northwest"

#northeast
_plane setdammage .8
"_x setdammage 0" foreach _cargo
_plane setvelocity [_(vel1 - _vel1Diff),(_vel2 - _vel2Diff),(velocity _plane select 2)]
_vel1Diff = _vel1Diff * 2
_vel2Diff = _vel2Diff * 2
~.01
?_vel1Diff >= _vel1: _plane setvelocity [0,0,0];_finalHeight = (getpos _plane select 2);_plane setdammage 1;goto "randomsurvival"
_smokecounter = _smokeCounter - 1
?_smokeCounter == 0:smoke = "crater" camcreate getpos _plane;_smokeCounter = 25
goto "northeast"

#southeast
_plane setdammage .8
"_x setdammage 0" foreach _cargo
_plane setvelocity [_(vel1 - _vel1Diff),(_vel2 + _vel2Diff),(velocity _plane select 2)]
_vel1Diff = _vel1Diff * 2
_vel2Diff = _vel2Diff * 2
~.01
?_vel1Diff >= _vel1: _plane setvelocity [0,0,0];_finalHeight = (getpos _plane select 2);_plane setdammage 1;goto "randomsurvival"
_smokecounter = _smokeCounter - 1
?_smokeCounter == 0:smoke = "crater" camcreate getpos _plane;_smokeCounter = 25
goto "southeast"

#southwest
_plane setdammage .8
"_x setdammage 0" foreach _cargo
_plane setvelocity [_(vel1 + _vel1Diff),(_vel2 + _vel2Diff),(velocity _plane select 2)]
_vel1Diff = _vel1Diff * 2
_vel2Diff = _vel2Diff * 2
~.01
?_vel1Diff >= _vel1: _plane setvelocity [0,0,0];_finalHeight = (getpos _plane select 2);_plane setdammage 1;goto "randomsurvival"
_smokecounter = _smokeCounter - 1
?_smokeCounter == 0:smoke = "crater" camcreate getpos _plane;_smokeCounter = 25
goto "southwest

#northwest
_plane setdammage .8
"_x setdammage 0" foreach _cargo
_plane setvelocity [_(vel1 + _vel1Diff),(_vel2 - _vel2Diff),(velocity _plane select 2)]
_vel1Diff = _vel1Diff * 2
_vel2Diff = _vel2Diff * 2
~.01
?_vel1Diff >= _vel1: _plane setvelocity [0,0,0];_finalHeight = (getpos _plane select 2);_plane setdammage 1;goto "randomsurvival"
_smokecounter = _smokeCounter - 1
?_smokeCounter == 0:smoke = "crater" camcreate getpos _plane;_smokeCounter = 25
goto ""northwest"

#randomsurvival
~3
_FallDistance = (_startHeight - _finalHeight)
_velocity = sqrt((_initvel select 0)^2 + (_initvel select 1)^2)
_Survival = (_FallDistance * _velocity)/2
?_Survival >= 100 && _Survival < 200:_rNum = 25;goto "kill"
?_Survival >= 200 && _Survival < 500:_rNum = 50;_killcount = 1;goto "kill"
?_Survival >= 500 && _Survival <= 1000:_rNum = 150;_killcount = 4;goto "kill"
?_Survival > 1000:_rNum = 250;_killcount = 15;goto "kill"

#kill
removealleventhandlers _player
_nCargo = count _Cargo
_kill = random _killcount
_nCargo <= _kill:"_x setdammage 1" foreach _cargo;goto "finish"
"_x setdammage (random _rnum)" foreach _cargo
_ncargo = _nCargo - 1
#KillLoop
?_kill == 0:goto "finish"
_dead = _Cargo select (random _nCargo)
_dead setdammage 1
_cargo = _cargo - _dead
_nCargo = _nCargo - 1
_kill = _kill - 1
goto "killLoop"

#finish
"_x setpos [((getpos _plane select 0) + (random 20) - (random 20)),((getpos _plane select 1) + (random 20) - (random 20)),(getpos _plane select 2)]" foreach _cargo
?_inplane:titlecut ["","black in",5]
exit
thank you
« Last Edit: 24 Nov 2004, 05:51:22 by penguinman »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:what do i put to run this script?
« Reply #1 on: 24 Nov 2004, 06:18:42 »
[NameOfPlane] exec "planecrash.sqs"

:beat: *Gets Shot* :beat:

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:what do i put to run this script?
« Reply #2 on: 24 Nov 2004, 20:13:45 »
that simple huh.
thanks il try it