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
(vehiclemodel, infotype, Float:X, Float:Y, Float:Z)
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
switch(hittype)
{
case BULLET_HIT_TYPE_VEHICLE:
{
new Float:Offset[9], model = GetVehicleModel(hitid);
GetVehicleModelInfo(model, VEHICLE_MODEL_INFO_WHEELSFRONT, Offset[0], Offset[1], Offset[2]);
GetVehicleModelInfo(model, VEHICLE_MODEL_INFO_WHEELSREAR, Offset[3], Offset[4], Offset[5]);
GetVehicleModelInfo(model, 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;
}
Originally Posted by SA-MP Wiki
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
@Reboma - Yes, you need to create a new variable or just use GetVehicleModel(hitid), to make the code work.
|