Az nekem se jó!Ezt próbáld:
[pawn]public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
{
if(!IsPlayerAdmin(playerid)) return 0;
new
Float: fVehicle[3],
Float:health;
GetVehiclePos(vehicleid, fVehicle[0], fVehicle[1], fVehicle[2]);
if(IsPlayerInRangeOfPoint(playerid, 10, fVehicle[0], fVehicle[1], fVehicle[2]))
{
new panelss, doorss, lightss, tiress;
GetVehicleDamageStatus(vehicleid, panelss, doorss, lightss, tiress);
tiress = encode_tires(random(4), random(4), random(4), random(4));
panelss = encode_panels(random(4), random(4), random(4), random(4), random(4), random(4), random(4));
doorss = encode_doors(random(4), random(4), random(4), random(4), random(4), random(4));
lightss = encode_lights(random(4), random(4), random(4), random(4));
UpdateVehicleDamageStatus(vehicleid,panelss,doorss,lightss,tiress);
GetVehicleHealth(vehicleid, health);
SetVehicleHealth(vehicleid, health - 2.5);
}
return 1;
}
encode_tires(tire1, tire2, tire3, tire4) return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
encode_panels(flp, frp, rlp, rrp, windshield, front_bumper, rear_bumper)
{
return flp | (frp << 4) | (rlp <<
| (rrp << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24);
}
encode_doors(bonnett, boott, driver_door, passenger_door, behind_driver_door, behind_passenger_door)
{
#pragma unused behind_driver_door
#pragma unused behind_passenger_door
return bonnett | (boott <<
| (driver_door << 16) | (passenger_door << 24);
}
encode_lights(light1, light2, light3, light4)
{
return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}[/pawn]