I know it's relatively easy to set the model of a SpawnIcon using SetModel(), but I haven't been able to find an obligatory GetModel() function that can be used on this particular vgui class.
How would it be possible to get the model of a SpawnIcon?
I recommend if this needs to be done that you simply add a string to the panel when it is created, as panels are just tables.
[lua]
local SpawnI = vgui.Create( "SpawnIcon" , Panel ) -- SpawnIcon
SpawnI:SetPos( 75,75 )
SpawnI:SetModel( "models/props_borealis/bluebarrel001.mdl" )
SpawnI.model = "models/props_borealis/bluebarrel001.mdl"
[/lua]
[QUOTE=Ludicium;40127479]I recommenced if this needs to be done that you simply add a string to the panel when it is created, as panels are just tables.
[lua]
local SpawnI = vgui.Create( "SpawnIcon" , Panel ) -- SpawnIcon
SpawnI:SetPos( 75,75 )
SpawnI:SetModel( "models/props_borealis/bluebarrel001.mdl" )
SpawnI.model = "models/props_borealis/bluebarrel001.mdl"
[/lua][/QUOTE]
I've actually found that you can use SpawnIcon:GetModelName() to receive the model name. So I think I've solved this myself.
Ok :)
Sorry, you need to Log In to post a reply to this thread.