Vegastr Posted November 2, 2017 Share Posted November 2, 2017 Hello everyone. I have a question about strange situation with onPlayerWasted event. addEventHandler( "onPlayerWasted", getRootElement( ), function(ammo,killer,weapon,bodypart) if killer and getElementType(killer) == "player" then outputChatBox("PLAYER") local faction = tonumber(getElementData(killer,"faction")) if faction and isFactionActiveWar(faction) then addKillToGangWar(faction) end end end ) When player killed by shot in the head, killer type is boolean, but if shot was in the body, killer is player. Idk how to fix it and why this event returnes thet exception result Link to comment
Moderators IIYAMA Posted November 2, 2017 Moderators Share Posted November 2, 2017 That doesn't sounds right, unless there is another script interfering. Link to comment
Vegastr Posted November 2, 2017 Author Share Posted November 2, 2017 Just now, IIYAMA said: That doesn't sounds right, unless there is another script interfering. how another script can changes arguments of event? Link to comment
Moderators IIYAMA Posted November 2, 2017 Moderators Share Posted November 2, 2017 It can not change them, but it can fake them: triggerEvent triggerServerEvent https://wiki.multitheftauto.com/wiki/TriggerEvent https://wiki.multitheftauto.com/wiki/TriggerServerEvent Link to comment
Vegastr Posted November 2, 2017 Author Share Posted November 2, 2017 Just now, IIYAMA said: It can not change them, but it can fake them: triggerEvent triggerServerEvent https://wiki.multitheftauto.com/wiki/TriggerEvent https://wiki.multitheftauto.com/wiki/TriggerServerEvent reason is found, thanks There was event onClientPlayerDamage, it killed player by setElementHealth Close topic please 1 Link to comment
Moderators IIYAMA Posted November 2, 2017 Moderators Share Posted November 2, 2017 Ah, interesting insight. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now