IsSpecial <- false;
function onPlayerCommand( pPlayer, szCommand, szText )
{
if ( szCommand == "veh_special" )
{
if ( szText == "1" )
{
local pos = pPlayer.Pos;
local vehspc = CreateVehicle( VEH_PATRIOT, Vector( pos.x + 5, pos.y, pos.z + 2 ), pPlayer.Angle, 0, 6 );
vehspc.OneTime = true;
CallFunc( "Scripts/Main/specials.nut", "onVehicleHealthChange", vehspc );
IsSpecial = true;
}
}
return 1;
}
function onVehicleHealthChange( vehspc, oldhp, newhp )
{
if ( newhp < 1000 )
{
if ( vehspc.Driver.Name == "ADFENO" && IsSpecial == true ) vehspc.Fix();
}
return 1;
}