SA-MP Forums Archive
[Include] [0.3z]a_OnPlayerShootVehiclePart - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [0.3z]a_OnPlayerShootVehiclePart (/showthread.php?tid=488920)

Pages: 1 2


Re: [0.3z]a_OnPlayerShootVehiclePart - Kar - 21.01.2014

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


Re: [0.3z]a_OnPlayerShootVehiclePart - Admigo - 21.01.2014

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.


Re: [0.3z]a_OnPlayerShootVehiclePart - Kar - 21.01.2014

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


Re: [0.3z]a_OnPlayerShootVehiclePart - Mauzen - 21.01.2014

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.


Re: [0.3z]a_OnPlayerShootVehiclePart - Kar - 21.01.2014

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*


Re: [0.3z]a_OnPlayerShootVehiclePart - Pottus - 22.01.2014

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);



Re: [0.3z]a_OnPlayerShootVehiclePart - Luis- - 22.01.2014

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


Re: [0.3z]a_OnPlayerShootVehiclePart - Admigo - 22.01.2014

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.


Re: [0.3z]a_OnPlayerShootVehiclePart - Admigo - 22.01.2014

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.


Re: [0.3z]a_OnPlayerShootVehiclePart - Kar - 22.01.2014

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..


Re: [0.3z]a_OnPlayerShootVehiclePart - Admigo - 29.01.2015

Thanks, any suggestions for a next update?


Re: [0.3z]a_OnPlayerShootVehiclePart - Ritzy2K - 24.02.2015

Nice.


Re: [0.3z]a_OnPlayerShootVehiclePart - 26_RUSSS - 18.03.2015

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;



Re: [0.3z]a_OnPlayerShootVehiclePart - Abagail - 19.03.2015

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.


Re: [0.3z]a_OnPlayerShootVehiclePart - IzadorO - 18.06.2015

Not bad at all!


Re: [0.3z]a_OnPlayerShootVehiclePart - TheArcher - 18.06.2015

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