Author Topic: Vehicle Spawning/Respawning  (Read 449 times)

Code: [Select]
function fxDTSBrick::setVehicle(%brick, %vehicle)
{

if(isObject(%vehicle))
{





if(isObject(%brick.getGroup().client))
{
%client = %brick.getGroup().client;
if(%vehicle.Cost > 0)
{
if(%client.Roleplay["Gold"] >= %vehicle.Cost)
{

%client.Roleplay["Gold"] -= 60;
parent::setVehicle(%brick, %vehicle);
}
else
{
return;
}

}
else
{
messageClient(%brick.getGroup().client, '', "\c6Standard users may not spawn a\c3" SPC %vehicle.uiName @ "");
%vehicle = 0;
}
}
else
{
messageClient(%brick.getGroup().client, '', "\c6Standard users may not spawn a\c3" SPC %vehicle.uiName @ "");
%vehicle = 0;
}


}



parent::setVehicle(%brick, %vehicle);
}
That seems to work fine. I need to make it so when the vehicle dies, it does not respawn. How do I make it so vehicles do not respawn when they die?

Use fxDTSbrick::spawnVehicle(%this)

Can't this be done with Destiny's vehicle events? onVehicledeath- Setvehicle- none
and to respawn the MiniGame setting... if that's what you want it for.

Can't this be done with Destiny's vehicle events? onVehicledeath- Setvehicle- none
and to respawn the MiniGame setting... if that's what you want it for.
No. This is for a mod that akes it where you need to repair vehicles. Failure to do this results in needing to buy a new one