Weapon/GetActivity

From Garry's Mod
Jump to: navigation, search
 Weapon:GetActivity( )

Contents

Description

Returns the sequence enumeration number that the weapon is playing.

BUG

This can return inconsistent results between the server and client.

Issue Tracker: #2543

Returns

number

Current activity, see ACT_ Enums. Returns 0 if the weapon doesn't have active sequence.

Examples

Example

This will return the ACT_ENUM that is currently active for the weapon.

local wep = Entity(1):GetActiveWeapon()
 
if ( IsValid( wep ) ) then // Makes sure that wep exists
 
    print( wep:GetActivity() ) // Prints the sequence number
 
end


Personal tools
Navigation