I understand it at ServerSide Scripts, but I'm not sure how it's works at ClientSide Scripts.
Look at example: https://wiki.multitheftauto.com/wiki/OnC ... WeaponFire
One time is used localplayer, and another rootelement.
So:
-- First Example
function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement )
outputChatBox ( "Don't kill people with minigun, it's lame!", 255, 0, 0 )
end
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc )
-- Second Example:
function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement )
outputChatBox ( "Don't kill people with minigun, it's lame!", 255, 0, 0 )
end
addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), onClientPlayerWeaponFireFunc )
In first example it'll send message to one player, who initiated this event, and in second example it'll send message to all on-line players, yes?
But, if it's true, why in events like: https://wiki.multitheftauto.com/wiki/OnClientMouseEnter we use rootelement, not localplayer?