Garry's Mod Wiki

Entity:GetSequenceInfo

table Entity:GetSequenceInfo( number sequenceId )

Description

Returns a table of information about an entity's sequence.

Arguments

1 number sequenceId
The sequence id of the entity.

Returns

1 table
Table of information about the entity's sequence, or nil is ID is out of range. See Structures/SequenceInfo

Example

Draw each player's current sequence bounding box with sequence name, activity number, and activity name above their head.

function GM:PostPlayerDraw( ply ) seqinfo = ply:GetSequenceInfo( ply:GetSequence() ) seqinfo.player = ply render.DrawWireframeBox( ply:GetPos(), ply:GetAngles(), seqinfo.bbmin, seqinfo.bbmax, color_white, true ) end function GM:HUDPaint() local seqinfo, textpos = nil, nil for p, ply in pairs(player.GetAll()) do seqinfo = ply:GetSequenceInfo(ply:GetSequence()) textpos = ( ply:GetPos() + Vector( 0, 0, seqinfo.bbmax.z + 10 ) ):ToScreen() if ( textpos.visible ) then draw.SimpleText( seqinfo.label, "GModNotify", textpos.x, textpos.y, color_white, TEXT_ALIGN_CENTER ) draw.SimpleText( seqinfo.activity..": "..seqinfo.activityname, "GModNotify", textpos.x, textpos.y+20, color_white, TEXT_ALIGN_CENTER ) end end end
Output:

Page Links


Special Pages


Wikis

?

Render Time: 42ms

DB GetPage 4
Generate Html 11
SaveChanges 13
Render Body 0
Render Sidebar 12