03.08.2011, 09:49
I mean how to use: UpdateVehicleDamageStatus with this?
public OnEmptyVehicleDamage(vehicleid,playerid,exems)
{
new Float:VehHealth;
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
GetVehicleHealth(vehicleid,VehHealth);
if(GetPlayerWeapon(playerid) <= 15){SetVehicleHealth(vehicleid,VehHealth-random(100));}
else{SetVehicleHealth(vehicleid,VehHealth-random(200));}
//-------------------------
if(VehHealth <= 900 && VehHealth >= 700)
{
panels = encode_panels(1, 0, 1, 0, 1, 0, 1);
doors = encode_doors(1, 1, 1, 1, 1, 1);
}
else if(VehHealth <= 700 && VehHealth >= 500)
{
panels = encode_panels(1, 2, 1, 2, 1, 2, 1);
doors = encode_doors(2, 2, 2, 2, 2, 2);
}
else if(VehHealth <= 500 && VehHealth >= 300)
{
panels = encode_panels(3, 2, 3, 2, 3, 2, 3);
doors = encode_doors(3, 3, 3, 3, 3, 3);
}
else if(VehHealth <= 300)
{
panels = encode_panels(3, 3, 3, 3, 3, 3, 3);
doors = encode_doors(4, 4, 4, 4, 4, 4);
}
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
return 1;
}