25.08.2015, 19:00
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && isNearSpikestrip(playerid, 2.5))
{
if(!tireDamage(GetPlayerVehicleID(playerid))
{
UpdateVehicleDamage(GetPlayerVehicleID(playerid), encode_tires(1, 1, 1, 1);
}
}
return 1;
}
UpdateVehicleDamage(vehicleid, tires)
{
new panels, doors, lights, tires_old;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires_old);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
return 1;
}