mr_shadow 4 Posted October 25, 2013 (edited) Hello, Im trying to delete the vehicle, when im pressing on action. But its only deleting if i am looking on offroad. If im driver- no. The part of script which detecting me as driver is working, but deleting only works If I aim to offroad. Is there any way to delete it when im pressing on action when im driver? if (typeOf(vehicle player) == "C_Offroad_01_F") then { _nearcar = nearestObjects [player, ["C_Offroad_01_F"], 10]; _carofperson = _nearcar select 0; if (count crew _carofperson == 0) then { deleteVehicle _carofperson; }; }; Edited October 25, 2013 by mr_shadow Share this post Link to post Share on other sites
XxCRSxX 10 Posted October 25, 2013 (edited) ..... Edited October 25, 2013 by XxCRSxX Share this post Link to post Share on other sites
mr_shadow 4 Posted October 25, 2013 (edited) i also tryed if (typeOf(vehicle player) == "C_Offroad_01_F") then { _carofperson = "C_Offroad_01_F"; deleteVehicle _carofperson; }; Not working, any ideas? Edited October 25, 2013 by mr_shadow Share this post Link to post Share on other sites
XxCRSxX 10 Posted October 25, 2013 { deleteVehicle _x } forEach (crew heli); deleteVehicle heli; Maybe that? Share this post Link to post Share on other sites
iceman77 18 Posted October 25, 2013 Untested. _objects = nearestObjects [player, [[color=#000000][color=#DD0000]"C_Offroad_01_F"[/color][/color]], 10]; if ({alive _x} count crew (_objects select 0) == 0) then { {deleteVehicle _x;} foreach _objects; }; Share this post Link to post Share on other sites
-LTac- Imperator 10 Posted October 25, 2013 If I understand correctly, this is to delete ANY vehicle? or just land vehicles? You are currently checking to see if the Vehicle is the "C_Offroad_01_F" class name, which means the code inside of the If Conditional will only happen if the vehicle that is passed by vehicle player is "C_Offroad_01_F". You need to check for a more simple type, such as "car". I highly recommend you take a read over: https://community.bistudio.com/wiki/isKindOf https://community.bistudio.com/wiki/isTypeOf and determine exactly what you are trying to do before you script it. Share this post Link to post Share on other sites
mr_shadow 4 Posted October 25, 2013 (edited) if (typeOf(vehicle player) == "C_Offroad_01_F") then { _objects = nearestObjects [player, ["C_Offroad_01_F"], 10]; if ({alive _x} count crew (_objects select 0) == 0) then { {deleteVehicle _x;} foreach _objects; }; }; This one is not working. ---------- Post added at 20:09 ---------- Previous post was at 20:08 ---------- Noone knows? Is it possible to fix that? if (typeOf(vehicle player) == "C_Offroad_01_F") then { _carofperson = "C_Offroad_01_F"; deleteVehicle _carofperson; }; Edited October 25, 2013 by mr_shadow Share this post Link to post Share on other sites
Ghost 40 Posted October 25, 2013 please post your entire script then maybe we can help more Share this post Link to post Share on other sites
mr_shadow 4 Posted October 25, 2013 Thats the script, the only thing that is no here is action to enable it. I just need to delete the type of vehicle when im driver. Something simple. But it must check for me as driver of "vehicle type". Share this post Link to post Share on other sites
Kunsa 10 Posted October 25, 2013 if (typeOf(vehicle player) == "C_Offroad_01_F") then { player action ["Eject", vehicle player]; deleteVehicle ((getPos player) nearestObject "C_Offroad_01_F"); }; How about that? not sure but I think if your in a vehicle your position is different to when your not in a vehicle.? or am i thinking of houses Share this post Link to post Share on other sites
Ghost 40 Posted October 25, 2013 (edited) put this in your script if (typeOf(vehicle player) == "C_Offroad_01_F") then { deletevehicle (vehicle player); }; Edited October 25, 2013 by Ghost Share this post Link to post Share on other sites
mr_shadow 4 Posted October 25, 2013 Hah kunsa nice idea with ejecting. Thanks for solution. It's working, By the way Ghost this one is not working if (vehicle player == "C_Offroad_01_F") then { deletevehicle (vehicle player); }; Share this post Link to post Share on other sites
Ghost 40 Posted October 25, 2013 probably because I forgot a couple things, had it setup to delete any vehicle the player was in than I read over your post again and saw you wanted a specific vehicle so did a half ass edit. Sorry This works now if (typeOf(vehicle player) == "C_Offroad_01_F") then { deletevehicle (vehicle player); }; Share this post Link to post Share on other sites
jacmac 2 Posted October 25, 2013 I'd love to see the vehicle eject a player then delete at high speed. :D Share this post Link to post Share on other sites
mr_shadow 4 Posted October 25, 2013 Jacmak actually im using this as alternative of mysql, for car saving by iniDB. Share this post Link to post Share on other sites