Home   Help Search Login Register  

Author Topic: functions  (Read 350 times)

0 Members and 1 Guest are viewing this topic.

Offline Hauk

  • Members
  • *
  • I sail under the Jolly Roger!! Pirates are kings!!
functions
« on: 17 Apr 2004, 15:01:30 »

I've recently been learning functions thanks to snYpirs tutorial, but have come across a problem.
As you said (snYpir) , i tried to  write the function myself which was obviously wrong, so I went to the link in the functions library and copy-and-pasted the written function there. there's the problem.
When I copy and pasted the function and saved it and alt-tabbed back into flashpoint i radio'ed him to get out but all I got was a problem  with the "if" part of the If-Then-Else. It reads like this:

// is the unit in a vehicle?
 If (jeep _soldier != _soldier) then
 {

"jeep" is my vehicle and "soldier" is my unit but flashpoint returns an error unknown operator with the _soldier that comes after jeep. I did copy-and-paste it so I'm guessing that others might have had the same problem.
Any help would be appreciated.

Thnx,

Hauk

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:functions
« Reply #1 on: 17 Apr 2004, 15:08:56 »
I'm not sure about if that works.

I always thought it was:

if (vehicle unit != unit) then

I'm not sure if it works with a vehicle that has been named.

Just try:

if (vehicle _soldier != _soldier) then


Planck
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:functions
« Reply #2 on: 17 Apr 2004, 16:13:44 »
The vehicle is an OFP command...
Not meaning that 'substitute this with the name of your vehicle'...

So use vehicle, not the name of the vehicle in question...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Hauk

  • Members
  • *
  • I sail under the Jolly Roger!! Pirates are kings!!
Re:functions
« Reply #3 on: 17 Apr 2004, 16:22:14 »
I'll give it a shot and get back to you.

Thnx,

Hauk

Offline Hauk

  • Members
  • *
  • I sail under the Jolly Roger!! Pirates are kings!!
Re:functions
« Reply #4 on: 17 Apr 2004, 16:31:52 »
Got it workin'

thnx for the tip

Hauk