18.01.2014, 19:43
@Reboma - Yes, you need to create a new variable or just use GetVehicleModel(hitid), to make the code work.
@Riddick94 - GetVehicleModelInfo first parameter is vehiclemodel, sometimes you need to check the parameter of the function you are using if you're doing it right or wrong.
Result ( Vehicle ID:498 )
@Riddick94 - GetVehicleModelInfo first parameter is vehiclemodel, sometimes you need to check the parameter of the function you are using if you're doing it right or wrong.
Quote:
Originally Posted by SA-MP Wiki
pawn Код:
|
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
switch(hittype)
{
case BULLET_HIT_TYPE_VEHICLE:
{
new
Float:Offset[3][3];
GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_WHEELSFRONT, Offset[0][0], Offset[0][1], Offset[0][2]);
GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_WHEELSREAR, Offset[1][0], Offset[1][1], Offset[1][2]);
GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_PETROLCAP, Offset[2][0], Offset[2][1], Offset[2][2]);
printf("Front wheels: %.3f, %.3f, %.3f", Offset[0][0], Offset[0][1], Offset[0][2]);
printf("Read wheels: %.3f, %.3f, %.3f", Offset[1][0], Offset[1][1], Offset[1][2]);
printf("Petrol cap: %.3f, %.3f, %.3f", Offset[2][0], Offset[2][1], Offset[2][2]);
}
}
return 1;
}
Код:
[20:51:40] Front wheels: 1.090, 2.410, -0.579 [20:51:40] Read wheels: 0.990, -1.740, -0.579 [20:51:40] Petrol cap: -1.299, -0.009, 0.090 [20:51:41] Front wheels: 1.090, 2.410, -0.579 [20:51:41] Read wheels: 0.990, -1.740, -0.579 [20:51:41] Petrol cap: -1.299, -0.009, 0.090 [20:51:47] Front wheels: 1.090, 2.410, -0.579 [20:51:47] Read wheels: 0.990, -1.740, -0.579 [20:51:47] Petrol cap: -1.299, -0.009, 0.090