Hello there! I have found out that the OnPlayerWeaponShot function is quite messy.
I have tried to figure out, what and where do I receive with some good old outputs.
I have also set up a table, that I could use to associate indices with strings, so I was more readable.
I have tried to create a script which records the source and direction of every shot and draws a 3D line with the data (even if there was no recorded hit), but I was unable to because most of the time I did not get usable data.
- If there is no hit, then there is no normals, no usable data
- Parameters do not match the documented version, in fact I noticed some variation of received parameters depending on hitting the ground, hitting nothing, hitting something in front of you, being on server or client side
- On client side it does not provide a weapon identifier
I have tried to figure out, what and where do I receive with some good old outputs.
Code:
AddEvent("OnPlayerWeaponShot", function(...) for i, v in pairs({...}) do AddPlayerChat(i.." | "..v) end end)
I have tried to create a script which records the source and direction of every shot and draws a 3D line with the data (even if there was no recorded hit), but I was unable to because most of the time I did not get usable data.
Comment