Home   Help Search Login Register  

Author Topic: Fuel Script  (Read 936 times)

0 Members and 1 Guest are viewing this topic.

Offline MythPro1

  • Members
  • *
  • That is not your daddy's shotgun, Cowboy!!!
Fuel Script
« on: 23 Jul 2004, 01:09:11 »
I'm just looking for a script that when you pass a trigger your fuel supply will continuously drain quickly. I know there is a script in the Editor's Corner for OFPEC but that zip file is corrupted when I always download it for some reason.

j-man

  • Guest
Re:Fuel Script
« Reply #1 on: 23 Jul 2004, 05:51:40 »
This might be the script you talking about:

drainfuel.sqs
Code: [Select]
;***************************************
;* Drain Fuel script                   *
;* By [icarus_uk]                      *
;* http://furryclan.net                *
;***************************************

; Call with [VehicleName]exec "drainfuel.sqs"

_vehicle = _this select 0

#drain

_amount = fuel _vehicle

;increase the value of 0.01 to a larger value (eg 0.1)
;to have the fuel drain faster.
;With a value of 0.1, it will take 5 seconds for a full tank to drain.

_amount = _amount - 0.01

_vehicle setfuel _amount

? _amount <= 0 : goto "exit"

~0.5
goto "drain"

#exit
exit

Offline MythPro1

  • Members
  • *
  • That is not your daddy's shotgun, Cowboy!!!
Re:Fuel Script
« Reply #2 on: 23 Jul 2004, 06:14:53 »
Yep, that is exactly what I was looking for. Thank you very much  :D

Offline MythPro1

  • Members
  • *
  • That is not your daddy's shotgun, Cowboy!!!
Re:Fuel Script
« Reply #3 on: 25 Jul 2004, 03:53:21 »
but one slight problem, i save that text in notepad and I name it "drainfuel.sqs". I put it in the missions folder but when I try to execute it, its telling me the script cannot be found. It is in the correct place  ???  ???

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Fuel Script
« Reply #4 on: 25 Jul 2004, 13:59:05 »
This is probably because it is really named 'drainfuel.sqs.txt'.

If you did not choose the All Files option for the File Type in Notepad save dialogue, this is what happens.  So it saves as type 'Text' and appends .txt to the end of your file name.

You will not be able to see the .txt extension if you have 'Hide file extensions for known file types enabled in your folder properties.


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

Offline MythPro1

  • Members
  • *
  • That is not your daddy's shotgun, Cowboy!!!
Re:Fuel Script
« Reply #5 on: 26 Jul 2004, 00:03:24 »
Yup that fixed it, thanks a bunch. Now another problem has arisen, I go through the trigger and then it says "_vehicle = _this select 0|#| Error Select: Type Object, expected Array"
i tried putting in the vehicle name where it says "vehicle" but that turned up with the same error.  

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Fuel Script
« Reply #6 on: 28 Jul 2004, 04:07:24 »
Make sure that you haven't confused your "this's" with your "_this's".  :P

If your vehicle is named "car" then you need to put this in the script activation line -

[car] exec "drainfuel.sqs"

NOT

car exec "drainfuel.sqs"

otherwise the script will look for an element in an array that doesn't exist.

Just my suggestion . . .



Roni

DBR_ONIX

  • Guest
Re:Fuel Script
« Reply #7 on: 22 Aug 2004, 10:57:38 »
Yeah, it's [this] exec "drainfuel.sqs"
- Ben

Bluelikeu

  • Guest
Re:Fuel Script
« Reply #8 on: 22 Aug 2004, 15:27:06 »
Or, you could just change the script from
_Vehicle = _This Select 0

To

_Vehicle = _This


!!!!!!!!!!!!!!!!
WOW----- :P
!!!!!!!!!!!!!!!!