Just printed the params on the client. It seems fine for me. If there is no hit there can't be an impact normal so it's 0.0.
I'm going to add the weapon id on the client.
Thanks.
Announcement
Collapse
No announcement yet.
[Lua] OnPlayerWeaponShot doing messed up things
Collapse
X
-
[Lua] OnPlayerWeaponShot doing messed up things
Hello there! I have found out that the OnPlayerWeaponShot function is quite messy.- 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.Tags: None
Leave a comment: