Jump to content
Sign in to follow this  
dragon zen

Would this way make any bug??

Recommended Posts

Hey guys:

I have some question on deleteVehicle.

First, to delete empty vehicle, I use the carstatus.sqf (below).

As you see, while the car is existing, it will be checked again and again.

_veh=_this select 0;

while {(getDammage _veh)<0.85} do {

if(count crew _veh==0)then{

_veh setDamage (getDammage _veh) + 0.05;

if(getDammage _veh>0.85)then{_veh setDamage 1;};

};sleep 30;

};

_veh setDamage 1;sleep 30;deletevehicle _veh;

exit;

My question is : if I run some other script, in which this car be deleted directly. How carstatus.sqf work? It may still check (getDammage _veh), but _veh has been deleted !

I just want to ask: whether this sqf will exit normally, or there will be some bug? I will use this sqf many many many times, if the sqf can't close normally, in another word, it remains in RAM, it will be a disaster for my mission!!

Dose anybody make an answer?

THX

Share this post


Link to post
Share on other sites

Add

&& !isNull _veh

To your while.

However, unless you have lots of vehicles I wouldn't worry about RAM usage of this script.

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  

×