View Issue Details

IDProjectCategoryView StatusLast Update
0005227Multi Theft Auto : San AndreasScriptingpublic2010-05-16 00:40
ReporterkwksndAssigned Toryden 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target Version1.0.4Fixed in Version1.0.4 
Summary0005227: onClientPlayerWeaponFire returns "nil" for hitElement on destroyable objects
Description

onClientPlayerWeaponFire returns "nil" for hitElement on some models
for instance the targets from the amunations shooting ranges
you hit them they explode
but nil is returned for the element that was hit
but server side when using onPlayerTarget it shows the elements id when aiming at them

i suspect its because these models are from interiors originaly
and were placed in the main map outside when this ocured

Steps To Reproduce

map some objects from these ids

1583
1584

1588
1589
1590
1591
1592

3018
3019
3020
3021
3022
3023
3024

fire at the models to destroy them
use the script below to test if needed
and youll find most dont return any id for hitElement

function ClientPlayerWeaponFired(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement )
outputDebugString("weapon"..tostring(weapon).."")
outputDebugString("hitElement"..tostring(hitElement).."")
if hitElement ~= nil then
triggerServerEvent ( "SetStats", getRootElement(),source,weapon,hitElement)
end
end

addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), ClientPlayerWeaponFired )

TagsNo tags attached.

Activities

Kayl

2010-05-15 15:40

developer   ~~0011470

I confirm this bug in 1.0.3.
The interior might have nothing to do with it because getPedTarget before and after the shot indeed show a difference.

However, hitElement remains empty.
Could it be because MTA performs the test (to trigger onClientPlayerWeaponFire) too late when the object is already "destroyed" and therefore the ray test fails?

ryden

2010-05-16 00:38

manager   ~~0011474

Last edited: 2010-05-16 00:40

Fixed in r1629 ( http://code.google.com/p/mtasa-blue/source/detail?r=1629 ).

Issue History

Date Modified Username Field Change