Difference between revisions of "SetWeaponClipAmmo"

From Multi Theft Auto: Wiki
Jump to: navigation, search
(Example)
m
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{Client function}}
 
{{Client function}}
{{Needs_Example}}
 
 
Set the ammo in a custom weapons magazine/clip.
 
Set the ammo in a custom weapons magazine/clip.
  

Revision as of 05:47, 17 November 2013

Set the ammo in a custom weapons magazine/clip.

Syntax

bool setWeaponClipAmmo ( weapon theWeapon, int clipAmmo )

Required Arguments

  • theWeapon: The weapon to set the clip ammo of.
  • clipAmmo: The amount of ammo in the clip.

Example

function createWepCmd()
	local wep = createWeapon("m4", 0, 0, 0)
	setWeaponClipAmmo(wep, 50)
end
addCommandHandler("weapon", createWepCmd)

Requirements

Minimum supported server n/a
Minimum supported client 1.3.0-9.04555
Note: Using this function requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.0-9.04555" />

See Also