OnPedWeaponReload: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 21: Line 21:
     outputChatBox("A ped reloaded "..getWeaponNameFromID(iWeaponID)..", clip: "..iClip..", ammo: "..iAmmo.."!");
     outputChatBox("A ped reloaded "..getWeaponNameFromID(iWeaponID)..", clip: "..iClip..", ammo: "..iAmmo.."!");
end
end
addEventHandler("OnPedWeaponReload", root, weaponReload);
addEventHandler("onPedWeaponReload", root, weaponReload);
</syntaxhighlight>
</syntaxhighlight>


{{See also/Server event|Ped events}}
{{See also/Server event|Ped events}}

Revision as of 21:17, 17 August 2025

This event is triggered when a ped reloads his weapons.

Parameters

int weapon, int clip, int ammo
  • weapon: an int representing the weapon that has been reloaded.
  • clip: an int representing the weapon clip size.
  • ammo: an int representing the weapon ammo.

Source

The source of this event is the ped that reloaded his weapon.

Example

This example outputs a line to the chat box whenever a ped reloads weapons.

function weaponReload(iWeaponID, iClip, iAmmo)
    outputChatBox("A ped reloaded "..getWeaponNameFromID(iWeaponID)..", clip: "..iClip..", ammo: "..iAmmo.."!");
end
addEventHandler("onPedWeaponReload", root, weaponReload);

See Also

Ped events


Event functions