mr_shadow 3 Posted January 6, 2016 Hello there, I would like to ask how should look the "addaction" on the object which was created by player. So that object have an action which will teleport any other player right to the postion of the owner of this object. Share this post Link to post Share on other sites
Bnae 1430 Posted January 6, 2016 this addAction ["Teleport", "player setpos (getpos unit_01)"]; //unit_01 created object Share this post Link to post Share on other sites
R3vo 2650 Posted January 6, 2016 ObjectName addAction ["Teleport",{ param [1] setPos getPos objectNameToTeleportTo; //param [1] is the player who uses the addAction}]; right to the postion of the owner of this object. I'd need more details about that. What do you mean by "owner of this object". Share this post Link to post Share on other sites
mr_shadow 3 Posted January 6, 2016 is there a way to make like _this select I can't give names for every units like unit_1. I want the player to createvehicle object on key press, and add the action to this object so everybody will be able teleport to this player by using this object. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted January 6, 2016 So, if I get it right, this might be what you want (untested code!): _object = createVehicle ["Land_Calvary_02_V1_F", screenToWorld [0.5, 0.5], [], 0, "NONE"]; _object setVariable ["unit", player, true]; [ [ _object, { _this addAction [format ["Teleport to %1", name player], {player setPosATL getPosATL ((_this select 0) getVariable "unit");}, [], 6, false, true, "", "!isNull (_target getVariable ['unit', objNull])"]; } ], "BIS_fnc_call", true, true, true ] call BIS_fnc_MP; Share this post Link to post Share on other sites
mr_shadow 3 Posted January 6, 2016 Seems like it is, but sadly it doesn't work. Not adding an action. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted January 6, 2016 Working example below. Does it say anything in the logs? Try this: snip If it works, add the action condition and see if the action is still visible. Share this post Link to post Share on other sites
mr_shadow 3 Posted January 6, 2016 This one is also not showing a thing. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted January 6, 2016 Alright, when I get home, I'll be able to produce something which I can debug. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted January 6, 2016 OK, there were two errors I did not see right away. This here works when I execute it on the client in multiplayer: _object = createVehicle ["Land_Calvary_02_V1_F", screenToWorld [0.5, 0.5], [], 0, "NONE"]; _object setVariable ["unit", player, true]; [ [ _object, [format ["Teleport to %1", name player], {player setPosATL getPosATL ((_this select 0) getVariable "unit");}, [], 6, false, true, "", "!isNull (_target getVariable ['unit', objNull])"] ], "addAction", true, true, true ] call BIS_fnc_MP; Share this post Link to post Share on other sites
mr_shadow 3 Posted January 7, 2016 Gonna test this in MP and then reply. It shows the action in the local mission. Share this post Link to post Share on other sites