Weapon.GetActivity

From GMod Wiki

Jump to: navigation, search


Function
Syntax Weapon:GetActivity( )
Description:
Returns the sequence enumeration number that the weapon is playing.
Returns: Enum
In Object: Weapon
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Weapon.GetActivity]Weapon.GetActivity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionThis will retun the Entity object of the crowbar of player 1.
Used onNewerServer.png
Code
local wep = player.GetByID(1):GetActiveWeapon()
 
if( wep ) then // Makes sure that wep exists
 
    print(wep:GetViewModel():GetActivity() ) // Prints the sequence number
 
end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox