Home   Help Search Login Register  

Author Topic: while the player is and isnt in a vehicle (in sqf)  (Read 1073 times)

0 Members and 1 Guest are viewing this topic.

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
while the player is and isnt in a vehicle (in sqf)
« on: 23 Oct 2007, 23:01:49 »
in sqs, the condition for when the player is in a vehicle is: !(vehicle player != player);   and (vehicle player = player) for when the player isnt.

but in sqf whats the condition to determine whether or not the player is in a vehicle?

surdus
Campaigns are hard, I'll stick with scripting for now!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: while the player is and isnt in a vehicle (in sqf)
« Reply #1 on: 23 Oct 2007, 23:33:57 »
same thing


if (vehicle player == player) then {};

if (vehicle player != player) then {};

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: while the player is and isnt in a vehicle (in sqf)
« Reply #2 on: 23 Oct 2007, 23:40:32 »
You beat me to that one, but I'll just clarify by pointing out that:
Code: [Select]
!(vehicle player != player)

is exactly the same as:
Code: [Select]
(vehicle player == player)

Logic thankfully hasn't changed at all between SQS and SQF, just the programming structures that use them (so you would use "? condition : stuff" in the archaic SQS, where you'd use "if (condition) then { stuff };" in shiny new SQF).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: while the player is and isnt in a vehicle (in sqf)
« Reply #3 on: 24 Oct 2007, 00:03:34 »
im beginning to wonder just how closely related sqf is to VB or javascript :P
Campaigns are hard, I'll stick with scripting for now!