You have to change the concommand flags to make it non-executable from the client.
[QUOTE=KingPommes;52523412][editline]a[/editline] Ok the solution was pretty simple. I just got the way source handels textures confused. the whole naming thing is indeed only for cubemaps.
[CODE]local mat = Material( "kingpommes/venator/interior/corridor/corridor_wall_lamps" )
mat:SetTexture( "$basetexture", "kingpommes/venator/interior/corridor/corridor_lights" )
[/CODE][/QUOTE]
Why not just edit the material itself then?
[editline]31st July 2017[/editline]
[QUOTE=TheEmp;52523566]I'm assuming that your running that on a listen server right? I booted up GMod and started up a listen server and everything worked as expected?
[IMG]https://i.gyazo.com/f273bd6a25f092a13977f4af08bbcc83.png[/IMG]
Obviously it won't print clientside and would only print in the serverside console as to be expected. But the ability to execute a serverside console command from the clientside is there.[/QUOTE]
That was a singleplayer game. Perhaps it works in servers only?
[QUOTE=NeatNit;52524607]That was a singleplayer game. Perhaps it works in servers only?[/QUOTE]
Does lua_run_cl even work in singleplayer?
[QUOTE=SFArial;52524661]Does lua_run_cl even work in singleplayer?[/QUOTE]
Yes
Hey guys, I made a very recent post asking for some help using an elseif thing, and someone helped me with that. I'm very grateful for that but its been a few days, and I've been working on another issue. I wouldnt really want to bring it up here but I cant move on to anything else until its fixed.
[CODE]if (zombiespawn) then
local rng1 = math.random(9)
if (rng1 == 1) then
spawnables["npc_vj_mwjuggernaut"] = maxzombies - #zombies
elseif (rng1 == 2) then
spawnables["npc_loner_exo_unit"] = maxzombies - #zombies
elseif (rng1 == 3) then
spawnables["npc_uar_veteran"] = maxzombies - #zombies
elseif (rng1 == 4) then
spawnables["npc_monolith_s"] = maxzombies - #zombies
elseif (rng1 == 5) then
spawnables["npc_winter_s"] = maxzombies - #zombies
elseif (rng1 == 6) then
spawnables["npc_mil_stalker"] = maxzombies - #zombies
elseif (rng1 == 7) then
spawnables["npc_st_bandit_master"] = maxzombies - #zombies
elseif (rng1 == 8) then
spawnables["npc_st_bandit"] = maxzombies - #zombies
elseif (rng1 == 9) then
spawnables["npc_fastzombie"] = maxzombies - #zombies
end
end[/CODE]
This is what the other guy and I worked out, and it works fine, it will spawn any NPC that are called, but the issue is the npcs wont spawn with weapons. The NPCs will spawn with weapons when spawned from the spawn menu and I know how to edit and add different weapons they're allowed to spawn with, but for some reason they dont spawn with weapons here. Is there some weapon override I can add right here?
After spawning the NPC, give it a weapon with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/NPC/Give]NPC:Give[/url]
[QUOTE=Gmod4phun;52524863]After spawning the NPC, give it a weapon with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/NPC/Give]NPC:Give[/url][/QUOTE]
Was about to write an edit saying I tried that, but I got to ask real quick if it will work with SWEPs and maybe thats why it doesnt work? Or maybe Im not doing it right, im not sure
You can use a hashtable to match the number to the NPC class.
I'm trying to add in protection to make sure that the dupe tool can't be used to get around restrictions in spawning entities. That works fine but when duplications are made with the entity, the entity doesn't have any constraints.
This is the code that i'm using;
[CODE]if SERVER then
function FadeOut( ent )
if IsValid( ent ) then
local col = ent:GetColor()
local r, g, b, a = col.r, col.g, col.b, col.a
if a > 150 then
if ent.sd != nil then
ent.sd.grow = false
end
newA = a-5
ent:SetColor(Color(r, g, b, newA))
timer.Simple( 0.1, FadeOut, ent )
else
ent:Remove()
end
end
end
function CreateAmmo( pl, pos )
if ( IsValid( pl ) && !pl:CheckLimit( "roundshot" ) ) then
return false
end
local newammo = ents.Create( "sd_roundshot" )
local spawnfx = EffectData()
newammo:SetPos( pos )
newammo:Spawn()
spawnfx:SetEntity( newammo )
undo.Create("cannon") --let us undo it
undo.AddEntity( newammo )
undo.SetPlayer( pl )
undo.Finish()
if ( IsValid(pl) ) then
pl:AddCount( "roundshot", newammo )
pl:AddCleanup( "roundshot", newammo )
pl:AddCleanup( "cannonammo", newammo )
end
end
function CreateCannon( pl, ang, pos, update, updateent, distmul, expDamage, expBlastRadius, incBlastRadius, spreadmul, fuseLength, breechLoad, bRemove, bReuse, ballReuseDelay, cShotNum, loadTime, destroy, sound, trail, shotGrav, cShotDamage, burnTime)
if update then
spawnfx = EffectData()
spawnfx:SetEntity( updateent )
util.Effect( "propspawn", spawnfx, true, true )
updateent.distmul = distmul --give it the new settings
updateent.expDamage = expDamage
updateent.expBlastRadius = expBlastRadius
updateent.incBlastRadius = incBlastRadius
updateent.spreadmul = spreadmul
updateent.fuseLength = fuseLength
updateent.breechLoad = breechLoad
updateent.shouldRemove = bRemove
updateent.ballReuse = bReuse
updateent.ballReuseDelay = ballReuseDelay
updateent.cShotNum = cShotNum
updateent.loadTime = loadTime
updateent.shoulddestroy = destroy
updateent.playsound = sound
updateent.shottrail = trail
updateent.shotGrav = shotGrav
updateent.cShotDamage = cShotDamage
updateent.burnTime = burnTime
else
if ( IsValid( pl ) && !pl:CheckLimit( "cannons" ) ) then
return false
end
local newcan = ents.Create( "sd_cannon" ) --make a new one and give it settings
local spawnfx = EffectData()
newcan:SetAngles( ang )
newcan:SetPos( pos )
newcan.distmul = distmul
newcan.expDamage = expDamage
newcan.expBlastRadius = expBlastRadius
newcan.incBlastRadius = incBlastRadius
newcan.spreadmul = spreadmul
newcan.fuseLength = fuseLength
newcan.breechLoad = breechLoad
newcan.shouldRemove = bRemove
newcan.ballReuse = bReuse
newcan.ballReuseDelay = ballReuseDelay
newcan.cShotNum = cShotNum
newcan.loadTime = loadTime
newcan.shoulddestroy = destroy
newcan.playsound = sound
newcan.shottrail = trail
newcan.shotGrav = shotGrav
newcan.cShotDamage = cShotDamage
newcan.burnTime = burnTime
newcan:Spawn()
spawnfx:SetEntity( newcan )
util.Effect( "propspawn", spawnfx, true, true )
newcan:Activate()
undo.Create("cannon") --let us undo it
undo.AddEntity( newcan )
undo.SetPlayer( pl )
undo.Finish()
if ( IsValid( pl ) ) then
pl:AddCount( "cannons", newcan )
pl:AddCleanup( "cannons", newcan )
end
end
end
duplicator.RegisterEntityClass( "sd_cannon", CreateCannon, "Ang", "Pos", "false", "nil", "distmul", "expDamage", "expBlastRadius", "incBlastRadius", "spreadmul", "fuseLength", "breechLoad", "shouldRemove", "ballReuse", "ballReuseDelay", "cShotNum", "loadTime", "shoulddestroy", "sound", "shottrail", "shotGrav", "cShotDamage", "burnTime" )
end[/CODE]
Anyone know what might be causing this?
[QUOTE=Evilsweetbloc;52524871]Was about to write an edit saying I tried that, but I got to ask real quick if it will work with SWEPs and maybe thats why it doesnt work? Or maybe Im not doing it right, im not sure[/QUOTE]
If you attempt to give the NPC a SWEP, the SWEP has to be set up to work properly with NPCs in the first place
When a player connects, is there a way to get the steamid / nwstring / nwint of them? I noticed the "PlayerConnect" function only takes the player's name as an argument, not the actual player entity
Hello.
Is there any ways to make a file of serverside errors?
For example there's a file with clientside errors in root folder of gmod.
Thanks
[QUOTE=xDoomx;52526301]When a player connects, is there a way to get the steamid / nwstring / nwint of them? I noticed the "PlayerConnect" function only takes the player's name as an argument, not the actual player entity[/QUOTE]
That hook triggers when the player starts connecting to the server. What you want is [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerInitialSpawn]GM:PlayerInitialSpawn[/url], which triggers just as the player finishes connecting.
I'm playing around with stencils and managed to draw the inside of a crate. The viewmodel gets cut off by the stencil cutout if I don't draw it again, but it clips with the props "inside" the crate if I don't use render.ClearDepth(). The problem with that is that some lights around the map start drawing over everything else when I use render.ClearDepth().
With render.ClearDepth():
[t]http://i.imgur.com/avKvp1M.jpg[/t]
Without render.ClearDepth():
[t]http://i.imgur.com/EMaEotN.jpg[/t]
Here's the code:
[CODE]
function ENT:Initialize()
self:SetModel(self.Model)
self:PhysicsInit(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
phys:Wake()
if CLIENT then
self.interiors = {}
for i = 1,5 do
self.interiors[i] = ClientsideModel(self.Model, RENDERGROUP_OPAQUE)
self.interiors[i]:SetNoDraw(true)
end
end
end
...
function ENT:Draw()
self:DrawModel()
render.ClearStencil()
render.SetStencilEnable(true)
render.SetStencilReferenceValue(1)
render.SetStencilCompareFunction(STENCIL_ALWAYS)
render.SetStencilPassOperation(STENCIL_REPLACE)
render.SetStencilWriteMask(255)
render.SetStencilTestMask(255)
local mask_pos = self:GetPos()
local obbmax, obbmin = self:OBBMaxs(), self:OBBMins()
mask_pos = mask_pos + self:GetUp() * 19.8
mask_pos = mask_pos - self:GetForward() * 20
mask_pos = mask_pos - self:GetRight() * 34
local size_x = obbmax.x - obbmin.x
local size_y = obbmax.y - obbmin.y
cam.Start3D2D(mask_pos, self:GetAngles(), 1)
surface.SetDrawColor(0, 0, 0)
surface.DrawRect(0, 0, size_x, size_y)
cam.End3D2D()
render.SetStencilCompareFunction(STENCIL_EQUAL)
cam.IgnoreZ(true)
local pos = self:GetPos()
self.interiors[1]:SetPos(pos - self:GetUp() * 35)
self.interiors[2]:SetPos(pos - self:GetRight() * 66)
self.interiors[3]:SetPos(pos + self:GetRight() * 66)
self.interiors[4]:SetPos(pos + self:GetForward() * 38)
self.interiors[5]:SetPos(pos - self:GetForward() * 38)
for k,v in pairs(self.interiors) do
v:SetAngles(self:GetAngles())
v:DrawModel()
end
cam.IgnoreZ(false)
render.ClearDepth()
local fov = LocalPlayer():GetActiveWeapon().ViewModelFOV or (LocalPlayer():GetFOV() - 21.5)
cam.Start3D(EyePos(), EyeAngles(), fov)
cam.IgnoreZ(true)
LocalPlayer():GetViewModel():DrawModel()
cam.IgnoreZ(false)
cam.End3D()
render.SetStencilEnable(false)
render.ClearStencil()
end
[/CODE]
Any way to get the viewmodel to draw on top of the stencil cutout while not having those lights draw on top of everything?
[QUOTE=Gmod4phun;52525950]If you attempt to give the NPC a SWEP, the SWEP has to be set up to work properly with NPCs in the first place[/QUOTE]
The SWEPs work fine, and in fact I can spawn the NPCs with the weapons using the spawnmenu, they just wont spawn with weapons using this code. Still tinkering with it though!
Edit: I finally broke down and asked my great friend Sandbox to help me write it and he did! shoutouts and kudos to him, hes a great guy!
Does anyone have a list of "SWEP.IconLetter"? I need the HL2 icon letters.
How do you set a custom sound for a SWEP? I've gotten one, but it keeps playing the AR2 shoot sounds overlapping the custom one? This only happens on a multiplayer game
[code]
classButton.DoClick = function(classButton)
local classPanel = Menu:Add("ClassPanel")
classPanel.Paint = function()
surface.SetDrawColor(50,50,50,255)
surface.DrawRect(0,0,classPanel:GetWide(),classPanel:GetTall())
surface.SetTextColor(255, 255, 255, 255)
surface.CreateFont("HeaderFont", {font="default", size=35, weight=1000})
surface.SetFont("HeaderFont")--nothing is written it is just ready to be written
surface.SetTextPos(0, 0)
surface.DrawText("Choose your class")
if LocalPlayer():Team() == 1 then -- alien
local aliensolider = vgui.Create("DButton")
aliensolider:SetParent(classPanel)
aliensolider:SetText("")
aliensolider:SetSize(100, 50)
aliensolider:SetPos(0, 50)
aliensolider.Paint = function()
surface.SetDrawColor(80, 244, 66, 255) -- color of button
surface.DrawRect(0, 0, aliensolider:GetWide(), aliensolider:GetTall())
surface.SetDrawColor(0, 0, 0, 255) -- color of borders
surface.DrawRect(0, 49, aliensolider:GetWide(), 1)
surface.DrawRect(99, 0, 1, aliensolider:GetTall())
draw.DrawText("Solider LV 4", "DermaDefault", aliensolider:GetWide() /2, 17, Color(255, 255, 255, 255), 1)
end
aliensolider.DoClick = function()
RunConsoleCommand("set_class", 4)
end
elseif LocalPlayer():Team() == 2 then -- robot
elseif LocalPlayer():Team() == 3 then --human
end
end
end
[/code]
The button now works if you spam click it like crazy. I am still really not sure why it does not work, the runconsolecommand function works fine for other people (non-admins) when changing to a different team and class (even at the same time)
[QUOTE=Lil_Roach;52528191]Does anyone have a list of "SWEP.IconLetter"? I need the HL2 icon letters.[/QUOTE]
I haven't found a resource online, but you can inspect the ttf in resource/fonts. I'll create a page on the wiki for it soon.
[editline]1st August 2017[/editline]
[QUOTE=Reaper3;52528319][code]
classButton.DoClick = function(classButton)
local classPanel = Menu:Add("ClassPanel")
classPanel.Paint = function()
surface.SetDrawColor(50,50,50,255)
surface.DrawRect(0,0,classPanel:GetWide(),classPanel:GetTall())
surface.SetTextColor(255, 255, 255, 255)
surface.CreateFont("HeaderFont", {font="default", size=35, weight=1000})
surface.SetFont("HeaderFont")--nothing is written it is just ready to be written
surface.SetTextPos(0, 0)
surface.DrawText("Choose your class")
if LocalPlayer():Team() == 1 then -- alien
local aliensolider = vgui.Create("DButton")
aliensolider:SetParent(classPanel)
aliensolider:SetText("")
aliensolider:SetSize(100, 50)
aliensolider:SetPos(0, 50)
aliensolider.Paint = function()
surface.SetDrawColor(80, 244, 66, 255) -- color of button
surface.DrawRect(0, 0, aliensolider:GetWide(), aliensolider:GetTall())
surface.SetDrawColor(0, 0, 0, 255) -- color of borders
surface.DrawRect(0, 49, aliensolider:GetWide(), 1)
surface.DrawRect(99, 0, 1, aliensolider:GetTall())
draw.DrawText("Solider LV 4", "DermaDefault", aliensolider:GetWide() /2, 17, Color(255, 255, 255, 255), 1)
end
aliensolider.DoClick = function()
RunConsoleCommand("set_class", 4)
end
elseif LocalPlayer():Team() == 2 then -- robot
elseif LocalPlayer():Team() == 3 then --human
end
end
end
[/code]
The button now works if you spam click it like crazy. I am still really not sure why it does not work, the runconsolecommand function works fine for other people (non-admins) when changing to a different team and class (even at the same time)[/QUOTE]
Try networking manually? Also, cache LocalPlayer():Team()'s return so that you don't have to call it more than once.
[QUOTE=Atebite;52526546]I'm playing around with stencils and managed to draw the inside of a crate. The viewmodel gets cut off by the stencil cutout if I don't draw it again, but it clips with the props "inside" the crate if I don't use render.ClearDepth(). The problem with that is that some lights around the map start drawing over everything else when I use render.ClearDepth().
With render.ClearDepth():
[t]http://i.imgur.com/avKvp1M.jpg[/t]
Without render.ClearDepth():
[t]http://i.imgur.com/EMaEotN.jpg[/t]
Here's the code:
[CODE]
function ENT:Initialize()
self:SetModel(self.Model)
self:PhysicsInit(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
phys:Wake()
if CLIENT then
self.interiors = {}
for i = 1,5 do
self.interiors[i] = ClientsideModel(self.Model, RENDERGROUP_OPAQUE)
self.interiors[i]:SetNoDraw(true)
end
end
end
...
function ENT:Draw()
self:DrawModel()
render.ClearStencil()
render.SetStencilEnable(true)
render.SetStencilReferenceValue(1)
render.SetStencilCompareFunction(STENCIL_ALWAYS)
render.SetStencilPassOperation(STENCIL_REPLACE)
render.SetStencilWriteMask(255)
render.SetStencilTestMask(255)
local mask_pos = self:GetPos()
local obbmax, obbmin = self:OBBMaxs(), self:OBBMins()
mask_pos = mask_pos + self:GetUp() * 19.8
mask_pos = mask_pos - self:GetForward() * 20
mask_pos = mask_pos - self:GetRight() * 34
local size_x = obbmax.x - obbmin.x
local size_y = obbmax.y - obbmin.y
cam.Start3D2D(mask_pos, self:GetAngles(), 1)
surface.SetDrawColor(0, 0, 0)
surface.DrawRect(0, 0, size_x, size_y)
cam.End3D2D()
render.SetStencilCompareFunction(STENCIL_EQUAL)
cam.IgnoreZ(true)
local pos = self:GetPos()
self.interiors[1]:SetPos(pos - self:GetUp() * 35)
self.interiors[2]:SetPos(pos - self:GetRight() * 66)
self.interiors[3]:SetPos(pos + self:GetRight() * 66)
self.interiors[4]:SetPos(pos + self:GetForward() * 38)
self.interiors[5]:SetPos(pos - self:GetForward() * 38)
for k,v in pairs(self.interiors) do
v:SetAngles(self:GetAngles())
v:DrawModel()
end
cam.IgnoreZ(false)
render.ClearDepth()
local fov = LocalPlayer():GetActiveWeapon().ViewModelFOV or (LocalPlayer():GetFOV() - 21.5)
cam.Start3D(EyePos(), EyeAngles(), fov)
cam.IgnoreZ(true)
LocalPlayer():GetViewModel():DrawModel()
cam.IgnoreZ(false)
cam.End3D()
render.SetStencilEnable(false)
render.ClearStencil()
end
[/CODE]
Any way to get the viewmodel to draw on top of the stencil cutout while not having those lights draw on top of everything?[/QUOTE]
First of all, definitely DO NOT use render.ClearDepth. It doesn't surprise me that it makes stuff show through walls. That's literally what it's supposed to do.
As for actual solutions, I think the cleanest solution would definitely be to forget about doing it in Lua, instead just make a model in the shape that you want. If I understood your code correctly, that's pretty much the result you're trying to get anyway. I don't know much about modeling, but surely the [url=https://facepunch.com/forumdisplay.php?f=40]modelling forum[/url] can help you out with the basics.
If for whatever reason that's out of the question, you'd either have to either dig deeper into why this is happening, or try some other method of rendering it. I think the problem may have to do with the way you're using cam.IgnoreZ. Instead of that, try [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/ClearBuffersObeyStencil]render.ClearBuffersObeyStencil[/url](0, 0, 0, 0, true) and keep the rest of the code the same (WITHOUT CLEARDEPTH!). Report back if it works!
[editline]1st August 2017[/editline]
Wait, why are you drawing the viewmodel in your entity's draw function at all? Don't do that. Definitely don't do that.
Edit:
[lua]function ENT:Draw()
self:DrawModel()
render.ClearStencil()
render.SetStencilEnable(true)
render.SetStencilReferenceValue(1)
render.SetStencilCompareFunction(STENCIL_ALWAYS)
render.SetStencilPassOperation(STENCIL_REPLACE)
render.SetStencilWriteMask(255)
render.SetStencilTestMask(255)
local mask_pos = self:GetPos()
local obbmax, obbmin = self:OBBMaxs(), self:OBBMins()
mask_pos = mask_pos + self:GetUp() * 19.8
mask_pos = mask_pos - self:GetForward() * 20
mask_pos = mask_pos - self:GetRight() * 34
local size_x = obbmax.x - obbmin.x
local size_y = obbmax.y - obbmin.y
cam.Start3D2D(mask_pos, self:GetAngles(), 1)
surface.SetDrawColor(0, 0, 0)
surface.DrawRect(0, 0, size_x, size_y)
cam.End3D2D()
render.SetStencilCompareFunction(STENCIL_EQUAL)
--cam.IgnoreZ(true) -- don't do this, instead use:
render.ClearBuffersObeyStencil(0, 0, 0, 0, true)
local pos = self:GetPos()
self.interiors[1]:SetPos(pos - self:GetUp() * 35)
self.interiors[2]:SetPos(pos - self:GetRight() * 66)
self.interiors[3]:SetPos(pos + self:GetRight() * 66)
self.interiors[4]:SetPos(pos + self:GetForward() * 38)
self.interiors[5]:SetPos(pos - self:GetForward() * 38)
for k,v in pairs(self.interiors) do
v:SetAngles(self:GetAngles())
v:DrawModel()
end
--cam.IgnoreZ(false)
--render.ClearDepth() -- none of this
-- definitely none of this
--local fov = LocalPlayer():GetActiveWeapon().ViewModelFOV or (LocalPlayer():GetFOV() - 21.5)
--cam.Start3D(EyePos(), EyeAngles(), fov)
-- cam.IgnoreZ(true)
-- LocalPlayer():GetViewModel():DrawModel()
-- cam.IgnoreZ(false)
--cam.End3D()
render.SetStencilEnable(false)
render.ClearStencil()
end[/lua]
[QUOTE=NeatNit;52528662]I think the problem may have to do with the way you're using cam.IgnoreZ. Instead of that, try [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/ClearBuffersObeyStencil]render.ClearBuffersObeyStencil[/url](0, 0, 0, 0, true) and keep the rest of the code the same (WITHOUT CLEARDEPTH!). Report back if it works![/QUOTE]
This works perfectly. Thanks!
[QUOTE=JA4AKE;52528293]How do you set a custom sound for a SWEP? I've gotten one, but it keeps playing the AR2 shoot sounds overlapping the custom one? This only happens on a multiplayer game[/QUOTE]
Are you sure you're playing the custom sound on both the server and the client?
Put the sound right at the top of the fire function away from any if SERVER / CLIENT checks and see if it works.
I have an entity that is meant to represent the model of a player (it's for a prop hunt type thing). I've had problems with the entity being invisible sometimes for some players, and after a bit of testing I figured out that sometimes the entity's position is not updated on the client's end.
Using this code did NOT fix it:
[CODE]
function ENT:UpdateTransmitState()
return TRANSMIT_ALWAYS
end
[/CODE]
The model has been set, but I did not initialize the physics object.
The entity originally was parented to the player, but when the bug showed up I disabled that and instead had the entity move it's position using its Think hook. As you can guess, that didn't fix it either.
Any ideas??
EDIT: Here's the code as it is at this point. It's so messy because I've been rushing to get this out for the gmod store contests, and this bug is driving me nuts.
[url]https://github.com/raubana/AttackOfTheMimics/blob/master/gamemodes/attack_of_the_mimics/entities/entities/sent_aotm_mimicbody.lua[/url]
EDIT: Bull assisted me a bit. We determined that the entity was NOT dormant. Putting SetPos in a timer didn't fix it.
[QUOTE=Atebite;52529149]This works perfectly. Thanks![/QUOTE]
Glad to hear it. I still say you should make a model for it though. It's a fairly simple shape.
Is there a function for panels like GetTall() or GetWide() but for screen position? I want to just get, for instance, the y coordinate of a panel, rather than call GetPos().
[QUOTE=PigeonTroll;52530398]Is there a function for panels like GetTall() or GetWide() but for screen position? I want to just get, for instance, the y coordinate of a panel, rather than call GetPos().[/QUOTE]
Don't believe so, but if you only want the y coordinate you could do
[code]
local y = select(2, panel:GetPos())
[/code]
[QUOTE=bigdogmat;52530419]Don't believe so, but if you only want the y coordinate you could do
[code]
local y = select(2, panel:GetPos())
[/code][/QUOTE]
Or you can do this:
[code]
local _, y = panel:GetPos()
[/code]
[QUOTE=mijyuoon;52530904]Or you can do this:
[code]
local _, y = panel:GetPos()
[/code][/QUOTE]
That's true, though I figured they were already doing this.
How would I go about drawing a hollow circle with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/surface/DrawPoly]surface.DrawPoly[/url] and stencils?
Sorry, you need to Log In to post a reply to this thread.