CyDoNgr 28 Posted September 7, 2016 I have this line in the init of the case:this setPos [getPos this select 0, getPos this select 1, 15]; take=0; act1 = this addaction ["Take Case","carry.sqf","",1,false,true,""] and this is my script: switch (take) do { case 0: { _scase = _this select 0; _man = _this select 1; _scase attachto [_man, [0.035,-.055,-0.22], "LeftHandMiddle1"]; _scase setdir 90; _scase removeAction act1; act1 = _man addaction ["Drop Case","carry.sqf","",1,false,true,""]; take=1;scase = _scase;taken=true; }; case 1: { _man = _this select 0; detach scase; scase setvelocity[0,0,-.3]; _man removeAction act1; act1 = scase addaction ["Take Case","carry.sqf","",1,false,true,""]; take=0; }; }; So i can pickup a case etc. My problem is that when I get in car or something the item is dropped. Do you have any idea how could this be changed?THX! Share this post Link to post Share on other sites
beno_83au 1369 Posted September 7, 2016 Edit: Never mind, bad info. Share this post Link to post Share on other sites
davidoss 552 Posted September 7, 2016 You cant store the case in any inventory without config patches. But you can attach the case to vehicle inside specific place or delete it and create+attach again when player get out from vehicle. Or hide dropped one and restore+attach on get out 1 Share this post Link to post Share on other sites
Tajin 349 Posted September 7, 2016 For sake of simplicity I would just use hideObjectGlobal on the briefcase whenever the carrier is in a vehicle and make it visible again when he gets out. In fact I think we could run a universal script that fixes this for everything attached to the player. put this in your init.sqf: if (hasInterface) then { waitUntil {alive player}; player addEventHandler ["GetInMan", { { [_x, true] remoteExec ["hideObjectGlobal",2,true]; } count attachedObjects; }]; player addEventHandler ["GetOutMan", { { [_x, false] remoteExec ["hideObjectGlobal",2,true]; } count attachedObjects; }]; player addEventHandler ["Killed", { params ["_unit"]; { if !(_unit isEqualTo (vehicle _unit) then { detach _x; _x setPos getPos _unit; [_x, false] remoteExec ["hideObjectGlobal",2,true]; } else { detach _x; }; } count attachedObjects; }]; }; That should take care of things (haven't tested it yet). Share this post Link to post Share on other sites
f2k sel 164 Posted September 7, 2016 I never tried it using "hideObjectGlobal" as the command didn't exist at the time but "hideobject" did so as Tajin says it should work. Share this post Link to post Share on other sites
beno_83au 1369 Posted September 7, 2016 You cant store the case in any inventory without config patches. Yes, good point, i was thinking of it being an item for some reason. My mistake. Share this post Link to post Share on other sites
CyDoNgr 28 Posted September 7, 2016 thx I will check it out today! Share this post Link to post Share on other sites