Jump to content
Sign in to follow this  
mr_shadow

Delete vehicle

Recommended Posts

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 by mr_shadow

Share this post


Link to post
Share on other sites

i also tryed

if (typeOf(vehicle player) == "C_Offroad_01_F") then { 

_carofperson = "C_Offroad_01_F";
deleteVehicle _carofperson;

};  

Not working, any ideas?

Edited by mr_shadow

Share this post


Link to post
Share on other sites

{ deleteVehicle _x } forEach (crew heli); deleteVehicle heli;

Maybe that?

Share this post


Link to post
Share on other sites

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

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


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 by mr_shadow

Share this post


Link to post
Share on other sites

please post your entire script then maybe we can help more

Share this post


Link to post
Share on other sites

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

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

put this in your script

if (typeOf(vehicle player) == "C_Offroad_01_F") then { 
deletevehicle (vehicle player);
};

Edited by Ghost

Share this post


Link to post
Share on other sites

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

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

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

Jacmak actually im using this as alternative of mysql, for car saving by iniDB.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×