[Include] [0.3z]a_OnPlayerShootVehiclePart
#21

Quote:
Originally Posted by Admigo
Посмотреть сообщение
Updated the include to version 2.0.
Код:
2.0 - Added EnableVehicleDamage();
 - Added EnableVehiclePetrolCapExplosion();
 - Added EnableVehicleWheelTirePop(); - Changed the define BULLET_HIT_VEHICLE to BULLET_HIT_BODY - Fixed the Petrol Caps offsets. The Petrol Caps is now accurate.
Did you even tested the include? Version 2.0 will fix the petrol cap offsets.
Other offsets will be done later.
I did check it, you can't just minus and add the values like that.

I did not test it, I haven't been on 0.3z but anyone can tell you that...

don't believe me? put it on a slope and flip it and stuff, do some testing with all kinds of angles
Reply
#22

Quote:
Originally Posted by Kar
Посмотреть сообщение
I did check it, you can't just minus and add the values like that.

I did not test it, I haven't been on 0.3z but anyone can tell you that...

don't believe me? put it on a slope and flip it and stuff, do some testing with all kinds of angles
Read the notice. I will make the offsets later. Yesterday i made the offsets for the petrol caps.
In future update will add more vehicle parts with offsets.
Tomorrow will add new vehicle parts.
Reply
#23

Okay? and all the notice says is this

"- Not all vehicles have the right offset for the vehicle parts (Wheels only). I will improve the offsets later."

W/e, this is what I get for trying to help people.

Goodluck
Reply
#24

The Enable... functions arent needed here. In some cases it could be useful to disable it again, so you should rather change them to setters with a parameter (you could also replace them with defines, thats the fastest way to handle getter/setter-functions in pawn).
The reason why samp uses such "one-time-enablers" is probably because they change the way the server is initialized, and it would be pretty difficult or technically impossible to disable them during the server runtime.
Here it would be no problem, and, as said, in some cases even pretty useful, to disable the detecions.

Nice work nevertheless.

Quote:
Originally Posted by Kar
Посмотреть сообщение
I did check it, you can't just minus and add the values like that.
I did not test it, I haven't been on 0.3z but anyone can tell you that...
don't believe me? put it on a slope and flip it and stuff, do some testing with all kinds of angles
Im also curious, but too lazy to test, if the OnPlayerWeaponShot offsets are relative to the rotation/angle. If they are, this should work correctly. Would be pretty useless to give unrotated offsets though, but maybe thats the way GTA provides that data.
Reply
#25

True but I did find a small issue with some rotations but nevertheless it basically works

this is indeed an issue

"- Not all vehicles have the right offset for the vehicle parts (Wheels only). I will improve the offsets later."

also.. idk but are all the wheel components the same size? maybe you could also consider that for more accuracy *shrugs*
Reply
#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
#27

How could I add checks to see if the vehicles tire has already been shot at?
Reply
#28

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
The Enable... functions arent needed here. In some cases it could be useful to disable it again, so you should rather change them to setters with a parameter (you could also replace them with defines, thats the fastest way to handle getter/setter-functions in pawn).
The reason why samp uses such "one-time-enablers" is probably because they change the way the server is initialized, and it would be pretty difficult or technically impossible to disable them during the server runtime.
Here it would be no problem, and, as said, in some cases even pretty useful, to disable the detecions.

Nice work nevertheless.


Im also curious, but too lazy to test, if the OnPlayerWeaponShot offsets are relative to the rotation/angle. If they are, this should work correctly. Would be pretty useless to give unrotated offsets though, but maybe thats the way GTA provides that data.
Tonight i will test if the include needs angles
Quote:
Originally Posted by Kar
Посмотреть сообщение
True but I did find a small issue with some rotations but nevertheless it basically works

this is indeed an issue

"- Not all vehicles have the right offset for the vehicle parts (Wheels only). I will improve the offsets later."

also.. idk but are all the wheel components the same size? maybe you could also consider that for more accuracy *shrugs*
Why are you being so negative? The include is not even a week released. Please give it time. I will improve the offsets this week and i will more vehicle parts. Also about the wheel components, i dont improved the wheels yet. Will also be done this week.
Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
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);
I already tried the Petrol Cap with GetVehicleModelInfo but it doesnt seem te work accurate. About the distance nice suggestion.
Quote:
Originally Posted by Luis-
Посмотреть сообщение
How could I add checks to see if the vehicles tire has already been shot at?
Tonight i will make a quick update with a check for the vehicle tires. Thanks for the suggestion.
Reply
#29

Quote:
Originally Posted by PT
Посмотреть сообщение
Nice Work.

add some way do destroy engine ( good to RP )
Thanks, yes i will add ENGINE detection. Will be done tomorrow.
Quote:
Originally Posted by Mauzen
Посмотреть сообщение
The Enable... functions arent needed here. In some cases it could be useful to disable it again, so you should rather change them to setters with a parameter (you could also replace them with defines, thats the fastest way to handle getter/setter-functions in pawn).
The reason why samp uses such "one-time-enablers" is probably because they change the way the server is initialized, and it would be pretty difficult or technically impossible to disable them during the server runtime.
Here it would be no problem, and, as said, in some cases even pretty useful, to disable the detecions.

Nice work nevertheless.


Im also curious, but too lazy to test, if the OnPlayerWeaponShot offsets are relative to the rotation/angle. If they are, this should work correctly. Would be pretty useless to give unrotated offsets though, but maybe thats the way GTA provides that data.
I did some test with the offsets in different angles with the petrol cap. Works great. About the Enable function. Tomorrow i will add a toggle function.
Reply
#30

Quote:
Originally Posted by Admigo
Посмотреть сообщение
Why are you being so negative? The include is not even a week released. Please give it time. I will improve the offsets this week and i will more vehicle parts. Also about the wheel components, i dont improved the wheels yet. Will also be done this week.
I'm not being negative your just refusing to listen to me while I'm giving tips, if you want to be the one who makes this then I'm just trying to help you out and maybe if you didn't rush it to be the first and really test it these problems wouldn't have occured :P

Quote:
Originally Posted by Admigo
Посмотреть сообщение
I already tried the Petrol Cap with GetVehicleModelInfo but it doesnt seem te work accurate. About the distance nice suggestion.
I told you this. Glad you realized.... Also some petrol caps may be larger

instead of checking for a square use the distance because most likely if you shoot the edges of a petrol tank it won't really explode so thats not of high priority.

Quote:
Originally Posted by Admigo
Посмотреть сообщение
I did some test with the offsets in different angles with the petrol cap. Works great. About the Enable function. Tomorrow i will add a toggle function.
Heh..
Reply
#31

Thanks, any suggestions for a next update?
Reply
#32

Nice.
Reply
#33

help
Код:
C:\Users\super\Desktop\pawno\include\a_vshot.inc(407) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Users\super\Desktop\pawno\include\a_vshot.inc(407) : warning 219: local variable "lights" shadows a variable
at a preceding level
strok 407
Код:
new panels, doors, lights, tires;
Reply
#34

I am going to suggest adding the X, Y and Z offsets of the according vehicle part. For example, a shot to the tire off by 2 X, 3 Y and 1 Z would return the offsets:
2.0, 3.0, 1.0

accordingly.
Reply
#35

Not bad at all!
Reply
#36

I see in the video the gas can is not that accurate?
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)