OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: marcus3 on 13 Mar 2005, 00:49:46

Title: removeaction
Post by: marcus3 on 13 Mar 2005, 00:49:46
ok now i have a script for buying a car.
when you walk up to the car dealer a action comes up saying
"buy cars" then if you click it that action go's away then a nother action comes up "buy red car"
then if you click that it go's away then 2 actions come up "no thanks" and "buy red car"
if you click "no thanks" all the actions go away. then you can walk away then back and do the same thing over and over agin and i wont matter.
now its all set up but the problem is...
that after you buy the car a come back you can buy it all over agin
so what i need is a way to remove the action "buy red car"
but not remove the action "buy cars"
so thanks for your help.
Title: Re:removeaction
Post by: Flauta on 13 Mar 2005, 02:22:42
maybe doing this?

having this
buyredcar = cardealer addaction ["buy red  cars",buycars.sqs]
use this
cardealer removeaction buyredcar

not sure about the removeaction command..

cheers
Title: Re:removeaction
Post by: Kyle Sarnik on 13 Mar 2005, 22:49:03
The easiest way (I find) to remove an addaction wen used is buy this:

buycars.sqs
Code: [Select]
_obj = _this select 0
_ID = _this select 2

_obj removeaction _ID

Title: Re:removeaction
Post by: marcus3 on 14 Mar 2005, 16:37:45
it still dont work
i need it where after i buy the car i cant buy it over agin.
my cant think of how to do it
Title: Re:removeaction
Post by: Kyle Sarnik on 14 Mar 2005, 20:30:13
Are you sure you copied it right? What I posted should work, it will remove the action when it is activated.
Title: Re:removeaction
Post by: marcus3 on 18 Mar 2005, 21:21:45
thanks guys i got it to work
:)