OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Trasher on 17 Aug 2004, 10:07:59
-
ok i just want W2 to have the action but anyone near him gets it heres the scripts
W2s init;
W2 addaction ["Call for air strike","Bombing.sqs"]
Bombing.sqs;
onMapSingleClick {[_pos] exec "airstrike.sqs"}; strikePilot sideChat "Give me a target"
and then the airstrike scrips goes
plz help its very anoying because i just want the radio operator to use it =(
-
One solution, which does not remove the action from other units though (dont know if thats possible):
if (_this select 1 != myRadioOperator) then { myRadioOperator GroupChat "HEY, GET YOUR FILTHY HANDS OFF MY RADIO" ; exit }
[foo] exec "airscript.sqs"
Syntax not guaranteed.
-
This is a "feature" of actions: they are available to any unit who is close to the object (namely you) that has the action attached to it.
There is nothing you can do about it appearing, though as Mud_Spike suggests you can prevent other units from using the action.
-
but when you play Cti only the commander have the Build menu even if you are close to him you dont get it! if nobody knows how this is working i try the hands of radio thingy ;) anyways thx
-
Well, if you know a mission where it works then unpbo it and see how its done. I'd be delighted to be proved wrong on this.
-
i will check this out but it will be hard because cti i just a script-mess :-[
-
sry macguba it to advanced for me i dont understand a s**t it just execs new scripts all the time =( sry i let you down :'(
-
Lol don't worry m8, at least you tried. :thumbsup:
-
well well cant you explain that "Get your hands of the radio" thingy a little bit more detailed i give it a try :D
-
easy just like that (ill put the script in beter way w/ explenation ;))
if (_this select 1 != _this select 0) then { _this select 0 GroupChat "HEY, GET YOUR FILTHY HANDS OFF MY RADIO" ; exit }
[foo] exec "airscript.sqs"
if (_this select 1 != _This select 0) : this part checks the condition.... so if the man that choose the action (_this select 1) is not the man that theaction is attached 2 (used the addaction on, _This select 0) the man who got the radio (_this select 0) will say the groupchat and then the script will exit.... else it will continue w/ watever u put in the script
:cheers:
LCD OUT
-
ok should i put in the units name somewhere ?? and they are not in the same group so can i change to Sidechat ?? anyway that helped =)
-
ok should i put in the units name somewhere ??
No, with LCD's addition you dont need to keep track of who owns the action.
and they are not in the same group so can i change to Sidechat
Changing it to a SideChat, GlobalChat, or whatever will work just fine.
-
ok this is a little bit embarrasing but that part
with foo who is he??? i dont get it??? this is a little bit to hard to me im a "semi-n00b" ;)
[foo] exec "airscript.sqs"
-
Just replace 'foo' with whatever name you gave your unit or group.
foo was just an example name.
Planck
-
ok heres one of the final parts i dont get should this be another script or should it be in the Bombing.sqs ?? anyways thx
-
W2s init;
W2 addaction ["Call for air strike","Bombing.sqs"]
Bombing.sqs;
if (_this select 1 != _this select 0) then { _this select 0 GroupChat "HEY, GET YOUR FILTHY HANDS OFF MY RADIO" ; exit }
onMapSingleClick {[_pos] exec "airstrike.sqs"}; strikePilot sideChat "Give me a target"
-
but when you play Cti only the commander have the Build menu even if you are close to him you dont get it! if nobody knows how this is working i try the hands of radio thingy ;) anyways thx
I believe that if you add an action to a unit when they are in a vehicle, then only that person or people in the vehicle can use the action. You'll also notice that when you get into a vehicle, all your actions that were added will go away until you get back out. Could be wrong though.
-
but you doesnt start in a vehicle! ??? anyone who knows mike melvin cant you ask him ;) anyways thx
-
but you doesnt start in a vehicle! ??? anyone who knows mike melvin cant you ask him ;) anyways thx
No, but you can detect when you get into the vehicle via a script, and add the action then, and also remove it if needed by detecting when you get out of the vehicle.
-
maybe you get in and out of the Hq tank in the beginning when the map is up =)