• Can't get weapons icon show correctly.
    6 replies, posted
Hi ! I can't get weapons spawn icon in my derma custom menu show correctly. Some one can help me please ? [lua]if CLIENT then function proplist() local slframe = vgui.Create("DFrame") local IconList = vgui.Create("DPanelList", slframe) slframe:Center() slframe:SetSize(222,284) slframe:SetTitle("Prop Catalog") slframe:MakePopup() IconList:EnableVerticalScrollbar( true ) IconList:EnableHorizontal( true ) IconList:SetPadding( 4 ) IconList:SetPos(10,30) IconList:SetSize(200,240) for k,v in pairs( weapons.GetList() ) do local icon = vgui.Create( "SpawnIcon", IconList ) icon:SetModel( v.PrintName ) -- I think the problem is there ?? icon:SetIconSize(50) IconList:AddItem( icon ) icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v) end end end concommand.Add("slist", proplist) function GAMEMODE:OnSpawnMenuOpen( ply ) LocalPlayer():ConCommand("slist") end end [/lua]
v.PrintName Uhm, are you really supposed to set the model to something like: AK-47?
oh yeah i'm supposed to get the name with .mdl and not the name only oops.
Uhm, you might wanna take the world model or something. as the PrintName can be anything
any idea how to get the weapons name with this spawnlist code ?
what i did for no one give me a solution about my code ? It's because is unrealisable or because ... ?
You cant put the name of the weapon on a spawn icon anyways :tinfoil: Use the world model instead as i suggested
Sorry, you need to Log In to post a reply to this thread.