05-21-2012, 11:16
Hello
Here is a new tutorial explaining 2 ammo commands: anyAmmoForWeaponModes and itemWeaponSetAmmo.
The first one will return true if you have ammo of a particular weapon, if you have no ammo it will return false. It works like this:
An example:
In the example above if you dont have ammo on your weapon clip, it will fill it up.
The other command: itemWeaponSetAmmo, gives ammo to a weapon which is dropped on the ground, it works like this:
Example:
The example above will drop to your ground your weapon and set its clip ammo to 1 and its stock ammo to 5.
I hope you have enjoyed the tutorial, for any questions reply to this thread.
Thanks, @Yamato
Here is a new tutorial explaining 2 ammo commands: anyAmmoForWeaponModes and itemWeaponSetAmmo.
The first one will return true if you have ammo of a particular weapon, if you have no ammo it will return false. It works like this:
Code:
anyAmmoForWeaponModes( weapon )
An example:
Code:
if( self anyAmmoForWeaponModes( self getCurrentWeapon() ) )
self setWeaponAmmoClip( self getCurrentWeapon(), WeaponClipSize( self getCurrentWeapon() ) );
In the example above if you dont have ammo on your weapon clip, it will fill it up.
The other command: itemWeaponSetAmmo, gives ammo to a weapon which is dropped on the ground, it works like this:
Code:
itemWeaponSetAmmo( ammo for the clip, ammo for the stock, ammo for alternative weapon in case there is one like grenade launcher )
Example:
Code:
weapon = self DropItem( self getCurrentWeapon() );
weapon itemWeaponSetAmmo( 1, 5 );
The example above will drop to your ground your weapon and set its clip ammo to 1 and its stock ammo to 5.
I hope you have enjoyed the tutorial, for any questions reply to this thread.
Thanks, @Yamato