SA-MP Forums Archive
OnPlayerWeaponShot: Using bullet hit coords to create an object? - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerWeaponShot: Using bullet hit coords to create an object? (/showthread.php?tid=532192)



OnPlayerWeaponShot: Using bullet hit coords to create an object? - Aerotactics - 17.08.2014

I am creating an object at the coords of a weapon shot, and it doesn't always like to create the object. I didn't know if it was my script, or a current bug.

It doesn't seen to work in a room I created, as well as on Grove Street (above my map, which is built under grove street).

EDIT: After further testing (getting the coords of the bullet hit) I realized that it says it's creating the objects at that point, yet it's not. On that note, I believe this to be a bug with OPWS conflicting with CreateObject when the object hit is a player-created object.

EDIT 2: After even further testing, I realized that when a player-created object or a car is shot, it uses relative coords. Is there any way to get exact coords when hitting player created objects? Or is there a way to calculate the hit coords from relative coords.






[ame]www.youtube.com/watch?v=Q3aXnNCTET4[/ame]


Re: OnPlayerWeaponShot: Using bullet hit coords to create an object? - Mauzen - 17.08.2014

Did you consider that when not hitting a player, object, or vehicle, the coordinates are relative and not absolute? So you would have to consider the targets coordinates and orientation to get the absolute coordinates.


Re: OnPlayerWeaponShot: Using bullet hit coords to create an object? - Aerotactics - 17.08.2014

Quote:
Originally Posted by Mauzen
View Post
Did you consider that when not hitting a player, object, or vehicle, the coordinates are relative and not absolute? So you would have to consider the targets coordinates and orientation to get the absolute coordinates.
Yes, but they are hitting objects.


Re: OnPlayerWeaponShot: Using bullet hit coords to create an object? - Ox1gEN - 17.08.2014

Maybe streaming problems I assume. If you're saying that sometimes it shows it and sometimes it doesn't.


Re: OnPlayerWeaponShot: Using bullet hit coords to create an object? - Aerotactics - 17.08.2014

Quote:
Originally Posted by Ox1gEN
View Post
Maybe streaming problems I assume. If you're saying that sometimes it shows it and sometimes it doesn't.
In the video I just uploaded, you can see it working on Grove Street, but I remember it not working once. I think that was a bug on my end, but the custom building should be working, as the code shows, but it's not.

BTW I'm not using a streamer.


Re: OnPlayerWeaponShot: Using bullet hit coords to create an object? - Buhami - 17.08.2014

Can you give me the full code .


Re: OnPlayerWeaponShot: Using bullet hit coords to create an object? - Aerotactics - 17.08.2014

Quote:
Originally Posted by Buhami
View Post
Can you give me the full code .
NOPE. That's all you need to help me with my problem.


Re: OnPlayerWeaponShot: Using bullet hit coords to create an object? - Aerotactics - 18.08.2014

Bump.