View Issue Details

IDProjectCategoryView StatusLast Update
0009827New Feature Requests[All Projects] Generalpublic2018-09-22 18:59
ReporterrafikicrozAssigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Summary0009827: the function onPlayerWeaponFire dont hive Element whit Sniper
Description

I think a video can explain more than me whit other weapons all is fine but whit sniper when the player get shot dont recive the element.

https://youtu.be/uWGuBbUve9c

Steps To Reproduce

i use this function to test the weapons

function onPlayerWeaponFire (weapon, endX, endY, endZ, hitElement, startX, startY, startZ)
outputChatBox("Return: "..tostring(isElement(hitElement)) , source)
end
addEventHandler("onPlayerWeaponFire", getRootElement(), onPlayerWeaponFire)

TagsNo tags attached.

Activities

rafikicroz

2018-03-28 01:49

viewer   ~~0026491

please remind to the developers dont forget this error, I think it is a pretty serious error, if I could find some answer on this problem would be very rewarding.

ccw

2018-03-28 03:07

administrator   ~~0026492

Does onClientPlayerWeaponFire work?

rafikicroz

2018-03-28 03:12

viewer   ~~0026493

Yes onClientPlayerWeaponFire works perfectly with all the weapons

ccw

2018-03-28 03:45

administrator   ~~0026494

There is a problem with onPlayerWeaponFire in that the hit player argument could be incorrect (for all weapons)
This is because the hit information is coming solely from the shooting player, and has not yet been confirmed by the victim player.

The solution is to use onClientPlayerDamage and send back a custom event to the server with the correct hit infomation.

Issue History

Date Modified Username Field Change