GetVehicleModelInfo + OnPlayerWeaponShoot
#2

You have to pass the model as first parameter, not the vehicle ID:

Parameters: (https://sampwiki.blast.hk/wiki/GetVehicleModelInfo)
pawn Код:
(vehiclemodel, infotype, Float:X, Float:Y, Float:Z)
pawn Код:
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;
}
Reply


Messages In This Thread
GetVehicleModelInfo + OnPlayerWeaponShoot - by Riddick94 - 18.01.2014, 19:27
Re: GetVehicleModelInfo + OnPlayerWeaponShoot - by Reboma - 18.01.2014, 19:34
Re: GetVehicleModelInfo + OnPlayerWeaponShoot - by Patrick - 18.01.2014, 19:43
Re: GetVehicleModelInfo + OnPlayerWeaponShoot - by Riddick94 - 18.01.2014, 19:44
Re: GetVehicleModelInfo + OnPlayerWeaponShoot - by Reboma - 18.01.2014, 20:09

Forum Jump:


Users browsing this thread: 1 Guest(s)