Home   Help Search Login Register  

Author Topic: How to detect if player is in a vehicle  (Read 1027 times)

0 Members and 1 Guest are viewing this topic.

Maclav

  • Guest
How to detect if player is in a vehicle
« on: 08 Apr 2004, 11:13:15 »
is there any command or something which detects if player is in a vehicle (any vehicle) except this : ? player in name1 or player in name2 etc.? plz help

Offline Marvin

  • Members
  • *
  • One day they will come
Re:How to detect if player is in a vehicle
« Reply #1 on: 08 Apr 2004, 11:14:21 »
(vehicle player != player)
Is there any games than Flashpoint?

Maclav

  • Guest
Re:How to detect if player is in a vehicle
« Reply #2 on: 08 Apr 2004, 13:21:02 »
thx a lot.

i`ve got this script:

~4
#wybuchy
~2
? not (alive ja) : goto "dead"
posx = getpos ja select 0
posy = getpos ja select 1
posz = getpos ja select 2
random1 = random 40   
random2 = random 40
random1a = random 3.5
random2a = random 3.5
random3a = random 3.5
dirpl = getdir ja
? posz > 10 : goto "wysoko" (if player is in a helicopter or a plane, there are bullets simulating AA fire)
?posz <= 10 and  vehicle player != player : goto "nisko"  (if player is in a vehicle, on the ground)(this didnt work, though i wrote the "vehicle player != player )
?:vehicle player == player : goto "niskonogi" (if player isnt in a vehicle, OFP creates grenades, cause shell73s are too powerfull for the infantry)
#wysoko
dirpl = getdir ja
wybuch1 = "shell73" camcreate [(posx-random1a),(posy-random2a),(posz+random3a)]
wybuch1 setdir dirpl-180
wybuch2 = "shell73" camcreate [(posx+random1a),(posy+random2a),(posz+random3a)]
wybuch2 setdir dirpl-180
goto "wybuchy"
#nisko
wybuch1 = "shell73" camcreate [(posx-random1),(posy-random2),0]
wybuch2 = "shell73" camcreate [(posx+random1),(posy+random2),0]
~0.01
wybuch1a = "heat73" camcreate [(posx-random1),(posy-random2),0]
wybuch2a = "heat73" camcreate [(posx+random1),(posy+random2),0]
goto "wybuchy"
#niskonogi
wybuch1 = "grenade" camcreate [(posx-random1),(posy-random2),0]
wybuch2 = "grenade" camcreate [(posx+random1),(posy+random2),0]
~0.02
wybuch1a = "grenade" camcreate [(posx-random1),(posy-random2),0]
wybuch2a = "grenade" camcreate [(posx+random1),(posy+random2),0]
goto "wybuchy"


#dead

exit


and i dont know how to check if player isnt in any vehicle, i wrote "vehicle player == player".....

i hope someone will be able to understand something from this mess above :)

« Last Edit: 08 Apr 2004, 14:06:15 by Maclav »

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:How to detect if player is in a vehicle
« Reply #3 on: 08 Apr 2004, 14:50:42 »
Do you still have a problem, or did you fix it yourself by
what you said in your last post then?  ???

vehicle player == player

is fine for checking if the player isn't in a vehicle

and as marvin already said:

vehicle player != player

if fine for checking if the player is inside a vehicle

:edit - err wait, i see - you posted the question as a comment
inside your script  :)

hmm - not sure, if your comment belongs to posz + vehicle player
line, or the next one - but if it's the next one then here we go:

?:vehicle player == player : goto "niskonogi" (if player isnt in a vehicle, OFP creates grenades, cause shell73s are too powerfull for the infantry)

remove the : like that:

?vehicle player == player : goto "niskonogi" (if player isnt in a vehicle, OFP creates grenades, cause shell73s are too powerfull for the infantry)

::edit - ah CrashnBurn already gave you the answer too  :)

~S~ CD
« Last Edit: 08 Apr 2004, 15:05:55 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

CrashnBurn

  • Guest
Re:How to detect if player is in a vehicle
« Reply #4 on: 08 Apr 2004, 14:55:51 »
thx a lot.

i`ve got this script:

~4
#wybuchy
~2
? not (alive ja) : goto "dead"
posx = getpos ja select 0
posy = getpos ja select 1
posz = getpos ja select 2
random1 = random 40   
random2 = random 40
random1a = random 3.5
random2a = random 3.5
random3a = random 3.5
dirpl = getdir ja
? posz > 10 : goto "wysoko" (if player is in a helicopter or a plane, there are bullets simulating AA fire)
?posz <= 10 and  vehicle player != player : goto "nisko"  (if player is in a vehicle, on the ground)(this didnt work, though i wrote the "vehicle player != player )
?:vehicle player == player : goto "niskonogi" (if player isnt in a vehicle, OFP creates grenades, cause shell73s are too powerfull for the infantry)
#wysoko
dirpl = getdir ja
wybuch1 = "shell73" camcreate [(posx-random1a),(posy-random2a),(posz+random3a)]
wybuch1 setdir dirpl-180
wybuch2 = "shell73" camcreate [(posx+random1a),(posy+random2a),(posz+random3a)]
wybuch2 setdir dirpl-180
goto "wybuchy"
#nisko
wybuch1 = "shell73" camcreate [(posx-random1),(posy-random2),0]
wybuch2 = "shell73" camcreate [(posx+random1),(posy+random2),0]
~0.01
wybuch1a = "heat73" camcreate [(posx-random1),(posy-random2),0]
wybuch2a = "heat73" camcreate [(posx+random1),(posy+random2),0]
goto "wybuchy"
#niskonogi
wybuch1 = "grenade" camcreate [(posx-random1),(posy-random2),0]
wybuch2 = "grenade" camcreate [(posx+random1),(posy+random2),0]
~0.02
wybuch1a = "grenade" camcreate [(posx-random1),(posy-random2),0]
wybuch2a = "grenade" camcreate [(posx+random1),(posy+random2),0]
goto "wybuchy"


#dead

exit


and i dont know how to check if player isnt in any vehicle, i wrote "vehicle player == player".....

i hope someone will be able to understand something from this mess above :)




Your syntax was off a bit. Remove the colon after the question mark.

Maclav

  • Guest
Re:How to detect if player is in a vehicle
« Reply #5 on: 08 Apr 2004, 15:24:44 »
i see...

thx!!!!!

it will be useful in omaha-like missions with mortar fire :)
« Last Edit: 08 Apr 2004, 15:28:01 by Maclav »