18.01.2014, 19:27
Simply, GetVehicleModelInfo is returning null values when player shoot a vehicle.
Code:
Log:
Code:
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
switch(hittype)
{
case BULLET_HIT_TYPE_VEHICLE:
{
new Float:Offset[9];
GetVehicleModelInfo(hitid, VEHICLE_MODEL_INFO_WHEELSFRONT, Offset[0], Offset[1], Offset[2]);
GetVehicleModelInfo(hitid, VEHICLE_MODEL_INFO_WHEELSREAR, Offset[3], Offset[4], Offset[5]);
GetVehicleModelInfo(hitid, VEHICLE_MODEL_INFO_PETROLCAP, Offset[6], Offset[7], Offset[8]);
printf("Front wheels: %f, %f, %f", Offset[0], Offset[1], Offset[2]);
printf("Read wheels: %f, %f, %f", Offset[3], Offset[4], Offset[5]);
printf("Petrol cap: %f, %f, %f", Offset[6], Offset[7], Offset[8]);
}
}
return 1;
}
Код:
[20:39:15] Front wheels: 0.000000, 0.000000, 0.000000 [20:39:15] Read wheels: 0.000000, 0.000000, 0.000000 [20:39:15] Petrol cap: 0.000000, 0.000000, 0.000000