is there something wrong here?
function DMTVCheckVelocity(%obj)
{
cancel(%obj.checkVelocitySchedule);
if(!isObject(%obj))
return;
if(vectorLen(%obj.getVelocity()) >= 10 && !%obj.isFly && %obj.isMovingForward(30))
{
if(isFly = 0 %obj)
{
%obj.playThread(0,"toFly");
%obj.isFly = 1;
}
}
if((vectorLen(%obj.getVelocity()) < 10 && %obj.isFly) || !%obj.isMovingForward(30))
{
if(isFly = 1 %obj)
{
%obj.playThread(0,"toIdle");
%obj.isFly = 0;
}
}
%obj.checkVelocitySchedule = schedule(100,0,DMTVcheckVelocity,%obj);
}
function Vehicle::addVelocity(%vehicle,%velocity)
{
%vehicle.setVelocity(vectorAdd(%vehicle.getVelocity(),%velocity));
}
function DMTVvehicle::onadd(%this,%obj)
{
%obj.PlayAudio(0,DMTVSound);
%obj.playThread(0,"toIdle");
%obj.isFly = 0;
}