View Issue Details

IDProjectCategoryView StatusLast Update
0008082Multi Theft Auto : San AndreasClientpublic2017-10-02 19:25
ReporterarranTunaAssigned Tolopezloo 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.5.2 
Target VersionFixed in Version1.5.3 
Summary0008082: Custom weapons don't fully work with onClientPlayerDamage
Description

If a custom weapon (createWeapon) shoots you the attacker in onClientPlayerDamage will be false even though weapons are an element and even have the element type "weapon"

Steps To Reproduce

crun setElementPosition(localPlayer, 1920, -1406, 14)
crun wep = createWeapon("mp5", 1914, -1409, 13.5)
crun addEventHandler("onClientPlayerDamage", localPlayer, function(attacker, weapon) outputDebugString(tostring(weapon).." "..tostring(attacker)) end)
Stand infront of the gun
crun fireWeapon(wep)
29 false

TagsNo tags attached.

Activities

arranTuna

2016-05-18 22:16

manager   ~~0024697

Strange that it works fine with onClientVehicleDamage but not onClientPlayerDamage.

einheit-101

2016-05-19 14:23

reporter   ~~0024698

I use onClientWeaponFire to detect the hit and calculate the damage in the attached function.

lopezloo

2016-05-25 20:52

developer   ~~0024713

Last edited: 2016-05-25 21:09

View 2 revisions

Same problem with objects.
PR: https://github.com/multitheftauto/mtasa-blue/pull/46

qaisjp

2016-07-22 19:06

administrator   ~~0024968

Added in https://github.com/multitheftauto/mtasa-blue/commit/6d9f3bf8ed80dc9f75bf1ad11caa5854c24ac81b

Buildinfo: https://buildinfo.mtasa.com/?SHA=6d9f3bf8ed80dc9f75bf1ad11caa5854c24ac81b

Issue History

Date Modified Username Field Change