Sandbird Posted December 10, 2013 Report Share Posted December 10, 2013 I am trying for the past 2h to do a simple thing....but i cant. I want to add an addaction to a vehicle that the player is looking at and pass that vehicle to the action script which will then add a variable to it. But i dont understand some things....I'll try to explain...here is my code: if (_isCar and (player distance _cursorTarget < 3) and !locked _cursorTarget) then { _isTagged= _cursorTarget getVariable ["isittagged",false]; if (!_isTagged) then { _vN = cursorTarget; if (s_player_taggit < 0) then { s_player_taggit = _vN addaction [("<t color=""#00FF04"">" + ("Tag Vehicle") +"</t>"),"custom\tagvehicle.sqf",_vN,6,false,true,"", ""] }; } else { player removeAction s_player_taggit; s_player_taggit = -1; }; }; I want to send to tagvehicle.sqf the vehicle that the user is looking at. and then in that script to do.... _vN setVariable ["isittagged",1,true]; My biggest question is WHAT are these for in the action : ,false,true,"", ""] and what is the proper select to get what i want. I mean what will these return in tagvehicle.sqf ? _x = _this select 0; // the _vN ?! _y = _this select 1; // ... ? _z = _this select 2; // ... ? I've seen people selecting crap from the addaction but i cant figure out what they are or how to properly set them in addaction. Any help would be highly appreciated. ps: what is the difference between: _isCar = _cursorTarget isKindOf "Car"; _isCar = _cursorTarget isKindOf "LandVehicle"; cause i want to do the above to a HMMV and as LandVehicle it doesnt recognize it... Link to comment Share on other sites More sharing options...
0 Axe Cop Posted December 10, 2013 Report Share Posted December 10, 2013 ID = unit addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition] There are very good explanations for the addAction command in the wiki, take a look: http://community.bistudio.com/wiki/addAction for the difference between "LandVehicle" and "Car": http://community.bistudio.com/wiki/ArmA_2:_CfgVehicles Link to comment Share on other sites More sharing options...
0 Sandbird Posted December 10, 2013 Author Report Share Posted December 10, 2013 Thanks Axe, for both the links :) Link to comment Share on other sites More sharing options...
Question
Sandbird
I am trying for the past 2h to do a simple thing....but i cant.
I want to add an addaction to a vehicle that the player is looking at and pass that vehicle to the action script which will then add a variable to it.
But i dont understand some things....I'll try to explain...here is my code:
I want to send to tagvehicle.sqf the vehicle that the user is looking at. and then in that script to do....
_vN setVariable ["isittagged",1,true];
My biggest question is WHAT are these for in the action : ,false,true,"", ""]
and what is the proper select to get what i want.
I mean what will these return in tagvehicle.sqf ?
_x = _this select 0; // the _vN ?!
_y = _this select 1; // ... ?
_z = _this select 2; // ... ?
I've seen people selecting crap from the addaction but i cant figure out what they are or how to properly set them in addaction.
Any help would be highly appreciated.
ps: what is the difference between:
_isCar = _cursorTarget isKindOf "Car";
_isCar = _cursorTarget isKindOf "LandVehicle";
cause i want to do the above to a HMMV and as LandVehicle it doesnt recognize it...
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now