[Include] [0.3z]a_OnPlayerShootVehiclePart
#26

There is a much better way to detect gas tank shots and tires.

Note that you'll need to do a few corrections for some vehicles tires such as the trashmaster.

pawn Код:
new Float:dist;
        new Float:width;
       
        new line[128];

        GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_SIZE, width, Float:y, Float:z);
        format(line, sizeof(line), "Vehicle width: %f", width);
        SendClientMessage(playerid, -1, line);

        GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_PETROLCAP, Float:x, Float:y, Float:z);
        dist=GetDistance(x,y,z,fX,fY,fZ);
        format(line, sizeof(line), "Fuel tank Distance: %f", dist);
        SendClientMessage(playerid, -1, line);
       
        GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_WHEELSFRONT, Float:x, Float:y, Float:z);
        new Float:FrontRight = x;
        new Float:FrontLeft = x-width;
       
        dist=GetDistance(FrontRight,y,z,fX,fY,fZ);
        format(line, sizeof(line), "Front Right Distance: %f", dist);
        SendClientMessage(playerid, -1, line);

        dist=GetDistance(FrontLeft,y,z,fX,fY,fZ);
        format(line, sizeof(line), "Front Left Distance: %f", dist);
        SendClientMessage(playerid, -1, line);

        GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_WHEELSREAR, Float:x, Float:y, Float:z);
        new Float:RearRight = x;
        new Float:RearLeft = x-width;

        dist=GetDistance(RearRight,y,z,fX,fY,fZ);
        format(line, sizeof(line), "Read Right Distance: %f", dist);
        SendClientMessage(playerid, -1, line);

        dist=GetDistance(RearLeft,y,z,fX,fY,fZ);
        format(line, sizeof(line), "Rear Left Distance: %f", dist);
        SendClientMessage(playerid, -1, line);
Reply


Messages In This Thread
[0.3z]a_OnPlayerShootVehiclePart - by Admigo - 19.01.2014, 19:33
Respuesta: [0.3z]a_OnPlayerShootVehiclePart - by Swedky - 19.01.2014, 19:37
Re: [0.3z]a_OnPlayerShootVehiclePart - by Patrick - 19.01.2014, 19:39
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 19.01.2014, 19:45
Re: [0.3z]a_OnPlayerShootVehiclePart - by KingHual - 19.01.2014, 19:51
Re: [0.3z]a_OnPlayerShootVehiclePart - by Pottus - 19.01.2014, 20:05
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 19.01.2014, 20:13
Re: [0.3z]a_OnPlayerShootVehiclePart - by Akcent_Voltaj - 20.01.2014, 14:26
Re: [0.3z]a_OnPlayerShootVehiclePart - by iZN - 20.01.2014, 15:24
Re: [0.3z]a_OnPlayerShootVehiclePart - by Lordzy - 20.01.2014, 15:58
Re: [0.3z]a_OnPlayerShootVehiclePart - by PaulDinam - 20.01.2014, 18:17
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 20.01.2014, 20:13
Re: [0.3z]a_OnPlayerShootVehiclePart - by Kar - 21.01.2014, 00:10
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 21.01.2014, 07:33
Re: [0.3z]a_OnPlayerShootVehiclePart - by PaulDinam - 21.01.2014, 15:15
Re: [0.3z]a_OnPlayerShootVehiclePart - by Ace155 - 21.01.2014, 15:55
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 21.01.2014, 16:22
Re: [0.3z]a_OnPlayerShootVehiclePart - by Diesel5 - 21.01.2014, 17:25
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 21.01.2014, 20:37
Re: [0.3z]a_OnPlayerShootVehiclePart - by PT - 21.01.2014, 20:47
Re: [0.3z]a_OnPlayerShootVehiclePart - by Kar - 21.01.2014, 20:58
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 21.01.2014, 21:03
Re: [0.3z]a_OnPlayerShootVehiclePart - by Kar - 21.01.2014, 23:12
Re: [0.3z]a_OnPlayerShootVehiclePart - by Mauzen - 21.01.2014, 23:25
Re: [0.3z]a_OnPlayerShootVehiclePart - by Kar - 21.01.2014, 23:48
Re: [0.3z]a_OnPlayerShootVehiclePart - by Pottus - 22.01.2014, 03:17
Re: [0.3z]a_OnPlayerShootVehiclePart - by Luis- - 22.01.2014, 13:58
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 22.01.2014, 14:30
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 22.01.2014, 20:55
Re: [0.3z]a_OnPlayerShootVehiclePart - by Kar - 22.01.2014, 22:39
Re: [0.3z]a_OnPlayerShootVehiclePart - by Admigo - 29.01.2015, 16:55
Re: [0.3z]a_OnPlayerShootVehiclePart - by Ritzy2K - 24.02.2015, 18:28
Re: [0.3z]a_OnPlayerShootVehiclePart - by 26_RUSSS - 18.03.2015, 23:29
Re: [0.3z]a_OnPlayerShootVehiclePart - by Abagail - 19.03.2015, 02:30
Re: [0.3z]a_OnPlayerShootVehiclePart - by IzadorO - 18.06.2015, 19:09
Re: [0.3z]a_OnPlayerShootVehiclePart - by TheArcher - 18.06.2015, 19:27

Forum Jump:


Users browsing this thread: 2 Guest(s)