SetAmmo

From The KillerJim Mod Wiki

PlayerProxy::SetAmmo

SetAmmo.png

Client Only Function - This API call can only be called on clients.

Description

Set's the ammo on the supplied gun to the required amount.

If the "ReplenishClip" boolean is true then the ammo is first added to the clip, before spilling over (if any is left to) into the players "pocket". If it's false then the ammo is added to the pocket.

This API call can be used to give unlimited ammo by calling it every time a bullet is lost (via the GunRuntimeVariablesChanged event) with the boolean set to True.

If the player does not have the supplied gun, or the gun name was invalid, this operation has no effect.

Arguments
1 Integer Ammo
The amount of ammo the gun will have.
2 String GunName
The name of the gun to give ammo to (needs to be "on" by player)
1 Bool ReplenishClip
If true the clip is immediately filled with the count, spilling over into the pocket. If false, then the pocket is replenished and the clip is left as it is.

Playing

Developers

Developer Reference