OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RolsRois on 19 Oct 2005, 12:02:27
-
ok, so, i know there is a script like that, but i didn't find it...
so can someone make me a script, let's say u enter a car, then u click on the map and the certain car will drive over there.
if u r not in the car u can't click on the map and the car will drive to there.
and the dude under me, your script isn't working
-
carname exec "taxi.sqs"
_taxi = _this
#loop
@player in _taxi
onmapsingleclick {_taxi domove _pos}
@!(player in _taxi)
onmapsingleclick {}
goto "loop"
not garuneteed, and a very basic idea, but if this is what you want(and it works ::) ) i could spruce it up a bit for ya
-
RolsRois,
You have been taken to task previously about consecutive posting.
Please use the Modify button to edit your previous post rather than post again.
Planck
-
and the dude under me, your script isn't working
i wonder if you realize just how useless that is to me...
whats happens? do you get an error message? describe how you set everything up. give me something to work with, plz.
oh, and another thing, i like being called by name, ty
-
Sorry, Triggerhappy.
look, The script is fine, but it does nothing, there is not an error messege or something.
i meen im in the car, im pressing on the map and it does nothing.
really, so, can u fix the script and plz try it 1st?
-
okay, a shot in the dark.
for every car you want to be a taxi, add this in their init line:
this addEventHandler ["init",{(_this select 0) exec "taxi.sqs"}]
and use triggerhappy's script.
I don't know why it doesn't work for you though.
try this. It's a longer version, but it might make it work:
;named taxi.sqs
_taxi = _this
#loop
? (player in _taxi) : goto "InTaxi"
? !(alive _taxi) : exit
goto "loop"
#InTaxi
onMapSingleClick {_taxi domove _pos}
~1
onMapSingleClick {}
goto "loop"
that might do it.
[EDIT]: Script is untested. If that doesn't work, please let me know what happened etc.
-
An improved script, so I posted it seperate...
;named taxi.sqs
_taxi = _this
_taxiOnMove = false
#loop
? (player in _taxi) : goto "InTaxi"
? !(alive _taxi) : exit
? (unitReady _taxi) : _taxiOnMove = false
~1
goto "loop"
#InTaxi
? (_taxiOnMove): goto "loop"
onMapSingleClick {_taxi domove _pos}
~1
onMapSingleClick {}
_taxiOnMove = true
goto "loop"
Syntax not guareteed. All I did was add a check to see if the taxi was at the new place so that the player did not constantly get onMapSingleClick prompts and inadvertently use one. Also added a delay on the loop so that it doesn't absorb memory like no other. ;D The '@' condition doesn't allow for multiple values to be tested simultaneously.
-
THANKS ALOT!
-
Does it work?
-
o well o well o wello...
just tested it, it doesnt work... maybe im using it all wrong,
can u make an exmaple mission or something? and fix the script? thanks
-
Yeah, I'm working on it. I'm on a breakthrough, but it can only be used once so far. I'll post it later if I fix it.
-
Put this in every car's init:
this addEventHandler ["get in",{[(_this select 0)] exec "taxi.sqs"}]
And for taxi.sqs.
;named taxi.sqs
_taxi = _this
onMapSingleClick {_taxi doMove _pos; onMapSingleClick {}}
That should do it. I realized it didn't need to be that fancy...
-
thanks ill try it out