• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=meowking1;47551369]How would I add a custom check to an entity like a money printer in DarkRP. I tried this: [lua] customCheck = function(ply) return ply:CheckGroup("vip") or ply:IsAdmin() end, CustomCheckFailMsg = "This is VIP only!" [/lua] but all it did was spew errors at me whenever I tried to use the entity.[/QUOTE] I've never seen the Player:CheckGroup() function, try this [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/IsUserGroup]Player:IsUserGroup[/url].
[QUOTE=James xX;47551377]I've never seen the Player:CheckGroup() function, try this [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/IsUserGroup]Player:IsUserGroup[/url].[/QUOTE] I changed ply:CheckGroup to Player:IsUserGroup and it broke the F4 menu.
[QUOTE=meowking1;47551518]I changed ply:CheckGroup to Player:IsUserGroup and it broke the F4 menu.[/QUOTE] Can you post the code? My guess is that you didn't replace "Player" with your player variable.
[QUOTE=James xX;47551561]Can you post the code? My guess is that you didn't replace "Player" with your player variable.[/QUOTE] You should really read into things before you post. I don't think a single one of your posts has been helpful at all. Just because ply:CheckGroup isn't a vanilla function doesn't mean it doesn't exist. As for the problem, if the code posted initially actually runs, then there is no syntactical problem meaning that you are probably using your CheckGroup function wrong. I can't really help more unless I know what admin mod you are using and what your groups are called.
If it spews errors, would you be so kind as to paste the error here? It might not be that code causing the problem.
Is there a way to get any sort of metadata from a Shoutcast stream with http.Fetch or http.Post?
Is it possible to add images to a RichText element? (Smilies, tags, that sort of thing?)
How does one draw a wireframe box around an entity? The following code is not working. I see nothing on screen. [CODE]function ENT:Draw() self:DrawModel() local pos = self:GetPos() cam.Start3D() render.DrawWireframeBox( pos , Angle(0,0,0), Vector(pos.x-100, pos.y-100, pos.z), Vector(pos.x+100, pos.y+100, pos.z+100), Color(255,0,0,255), false ) cam.End3D() end[/CODE]
[QUOTE=SeveredSkull;47552733]How does one draw a wireframe box around an entity? The following code is not working. I see nothing on screen. [CODE]function ENT:Draw() self:DrawModel() local pos = self:GetPos() cam.Start3D() render.DrawWireframeBox( pos , Angle(0,0,0), Vector(pos.x-100, pos.y-100, pos.z), Vector(pos.x+100, pos.y+100, pos.z+100), Color(255,0,0,255), false ) cam.End3D() end[/CODE][/QUOTE] I don't have much experience with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/cam/Start3D]cam.Start3D[/url] but have you tried moving the position into the argument of the function, and removing it from the vectors in the render.DrawWireFrameBox() ?
[QUOTE=James xX;47552851]I don't have much experience with [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/cam/Start3D"]cam.Start3D[/URL] but have you tried moving the position into the argument of the function, and removing it from the vectors in the render.DrawWireFrameBox() ?[/QUOTE] Yes. I found this thread: [URL]http://facepunch.com/showthread.php?t=1333309[/URL] which shows a working solution in game. However, whenever I make a change to it by removing the use of the bounding box it stops rendering. I cannot figure out why. The wiki [B][I][U]shows that the 2 vectors are relative to the origin[/U][/I][/B], so I dont understand why it is not rendering correctly. Edit: Nevermind Im an idiot and not thinking right. The [B][I][U]answer is right there in front of me[/U][/I][/B].
Is there a way to make a player use an entity without having to network anything to the server?
[QUOTE=meharryp;47552958]Is there a way to make a player use an entity without having to network anything to the server?[/QUOTE] Just pass in the player to both of the arguments to the Use() function.
[QUOTE=SeveredSkull;47553143]Just pass in the player to both of the arguments to the Use() function.[/QUOTE] The use function is serverside though, I'm wanting to run it clientside.
[QUOTE=meharryp;47553210]The use function is serverside though, I'm wanting to run it clientside.[/QUOTE] You could always hook into when keys are pressed, check if the key is the bind for use, do a trace for entities, and run the entity's use function like that, though there's probably a better way of doing it.
[QUOTE=LUModder;47552555]Is there a way to get any sort of metadata from a Shoutcast stream with http.Fetch or http.Post?[/QUOTE] What specifically? All metadata or just current song? Also is this Shoutcast v1, v2 or both?
I want something that lets me place models on my player character in-game. Pointshop doesn't sound like a good option though. Basically, I want something similar to the SCK (Swep Construction Kit) except I can make armor. Also good would be the ability to make models in the real world using a similar system, just to get lua code to create them. I'm posting in this thread cus I'm 99.99% sure it exists, and was hoping someone could help me out with this problem I'm having trying to find this stuff.
[QUOTE=WalkingZombie;47553422]I want something that lets me place models on my player character in-game. Pointshop doesn't sound like a good option though. Basically, I want something similar to the SCK (Swep Construction Kit) except I can make armor. Also good would be the ability to make models in the real world using a similar system, just to get lua code to create them. I'm posting in this thread cus I'm 99.99% sure it exists, and was hoping someone could help me out with this problem I'm having trying to find this stuff.[/QUOTE] I believe you're looking for PAC 3 by capsadmin. Its on workshop, check it out. [editline]18th April 2015[/editline] [QUOTE=SeveredSkull;47552891]Yes. I found this thread: [URL]http://facepunch.com/showthread.php?t=1333309[/URL] which shows a working solution in game. However, whenever I make a change to it by removing the use of the bounding box it stops rendering. I cannot figure out why. The wiki [B][I][U]shows that the 2 vectors are relative to the origin[/U][/I][/B], so I dont understand why it is not rendering correctly. Edit: Nevermind Im an idiot and not thinking right. The [B][I][U]answer is right there in front of me[/U][/I][/B].[/QUOTE] Im curious about this, what was wrong?
[code] function GM:PlayerSpawn( ply ) ply:SetPos(Vector(-1432.288330, 2020.853271, 36.370529)) end [/code] How can I make something like this to set a player's position somewhere else when they spawn? This gives no errors, but does not work.
[QUOTE=SwikCoder;47553607][code] function GM:PlayerSpawn( ply ) ply:SetPos(Vector(-1432.288330, 2020.853271, 36.370529)) end [/code] How can I make something like this to set a player's position somewhere else when they spawn? This gives no errors, but does not work.[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerSelectSpawn]GM/PlayerSelectSpawn[/url] Create entities wherever you want to have your spawn positions or something.
what is an good way to store variables inside an DModelPanel? [lua] local frame = vgui.Create("DFrame") frame:SetPos(ScrW()-700,ScrH()/3) frame:SetSize(660,300) frame:SetTitle("Test") frame:MakePopup() local grid = vgui.Create("DGrid", frame) grid:SetPos(10, 30) grid:SetCols( 8 ) grid:SetColWide( 80 ) grid:SetRowHeight( 80 ) for i = 1, #PlyModelList do local mdlbut = vgui.Create( "DModelPanel" ) function mdlbut:LayoutEntity( Entity ) return end mdlbut:SetModel(PlyModelList[i].model) -- works mdlbut:SetSize( 80, 80 ) mdlbut.Entity:SetPos( mdlbut.Entity:GetPos() - Vector( 0, 0, 4 ) ) mdlbut:SetCamPos( CamPos ) mdlbut:SetLookAt( LookAt ) mdlbut.DoClick = function(self) net.Start("Baus_plymdl") net.WriteString(self:GetModel()) net.WriteInt() -- PlyModelList[i].id doesn't work net.WriteString() -- PlyModelList[i].gender doesn't work net.SendToServer() frame:Close() end grid:AddItem( mdlbut ) end [/lua] My Problem is that i don't know to correctly attach the tabledata to the mdl button.
[QUOTE=LUModder;47552555]Is there a way to get any sort of metadata from a Shoutcast stream with http.Fetch or http.Post?[/QUOTE] No. Lobby for this [url]https://github.com/Facepunch/garrysmod-requests/issues/431[/url]
[QUOTE=Tomelyr;47553800]what is an good way to store variables inside an DModelPanel? [lua] local frame = vgui.Create("DFrame") frame:SetPos(ScrW()-700,ScrH()/3) frame:SetSize(660,300) frame:SetTitle("Test") frame:MakePopup() local grid = vgui.Create("DGrid", frame) grid:SetPos(10, 30) grid:SetCols( 8 ) grid:SetColWide( 80 ) grid:SetRowHeight( 80 ) for i = 1, #PlyModelList do local mdlbut = vgui.Create( "DModelPanel" ) function mdlbut:LayoutEntity( Entity ) return end mdlbut:SetModel(PlyModelList[i].model) -- works mdlbut:SetSize( 80, 80 ) mdlbut.Entity:SetPos( mdlbut.Entity:GetPos() - Vector( 0, 0, 4 ) ) mdlbut:SetCamPos( CamPos ) mdlbut:SetLookAt( LookAt ) mdlbut.DoClick = function(self) net.Start("Baus_plymdl") net.WriteString(self:GetModel()) net.WriteInt() -- PlyModelList[i].id doesn't work net.WriteString() -- PlyModelList[i].gender doesn't work net.SendToServer() frame:Close() end grid:AddItem( mdlbut ) end [/lua] My Problem is that i don't know to correctly attach the tabledata to the mdl button.[/QUOTE] Yeah that's perfectly acceptable. vgui.Create( "DModelPanel" ) returns a vgui item, but that's a table, so you can store data in it as you would any other table.
[QUOTE=Sheeplie;47553484]I believe you're looking for PAC 3 by capsadmin. Its on workshop, check it out.[/QUOTE] PAC 3 looks cool, but can it export into code like the SCK can? That's what I need!
[QUOTE=James xX;47553900]Yeah that's perfectly acceptable. vgui.Create( "DModelPanel" ) returns a vgui item, but that's a table, so you can store data in it as you would any other table.[/QUOTE] you mean something like this? [lua] mdlbut.customthingy = "teststring" mdlbut.DoClick = function(self) print(self.customthingy) end [/lua] because that is something i already tried. didnt worked. printed just nil.
[QUOTE=Tomelyr;47554248]you mean something like this? [lua] mdlbut.customthingy = "teststring" mdlbut.DoClick = function(self) print(self.customthingy) end [/lua] because that is something i already tried. didnt worked. printed just nil.[/QUOTE] Works for me [lua] PlyModelList = { { model = "generic model here" } } print( "running autoscript") function OpenDFrameForFacepunchPerson() print( "opening dframe" ) local frame = vgui.Create("DFrame") frame:SetPos(20,20) frame:SetSize(200,200) frame:SetTitle("Test") frame:MakePopup() local grid = vgui.Create("DGrid", frame) grid:SetPos(10, 30) grid:SetCols( 8 ) grid:SetColWide( 80 ) grid:SetRowHeight( 80 ) for i = 1, #PlyModelList do local mdlbut = vgui.Create( "DModelPanel" ) function mdlbut:LayoutEntity( Entity ) return end mdlbut:SetModel(PlyModelList[i].model) -- works mdlbut:SetSize( 80, 80 ) /*mdlbut.Entity:SetPos( mdlbut.Entity:GetPos() - Vector( 0, 0, 4 ) ) mdlbut:SetCamPos( CamPos ) mdlbut:SetLookAt( LookAt )*/ mdlbut.Blah = "mdlbut.Blah works" mdlbut.DoClick = function(self) print( self.Blah or "doesn't work" ) end grid:AddItem( mdlbut ) end frame:MakePopup() end concommand.Add( "OpenDFrameForFacepunchPerson", OpenDFrameForFacepunchPerson ) print ("after function" ) [/lua] console: [code] ] lua_openscript_cl autorun/client/auto.lua Running script autorun/client/auto.lua... running autoscript after function ] OpenDFrameForFacepunchPerson opening dframe mdlbut.Blah works [/code] Ignore the other prints, I was having trouble getting your code to work (didn't see the variables you hadn't declared, I edited out the 2 lines plus the set pos line for simplicity).
[QUOTE=WalkingZombie;47554218]PAC 3 looks cool, but can it export into code like the SCK can? That's what I need![/QUOTE] Im not too sure, actually. Thats not it's main feature, but Pac3 is a deep tool with a lot of ins and outs, I wouldnt be surprised if it was possible. Any Pac 3 experts on this thread?
[QUOTE=Sheeplie;47553484] Im curious about this, what was wrong?[/QUOTE] I was being a moron with my math and adding the entity's position to the offset. The 2 parameters are local space relative to the origin, where I was trying to put in world coordinates in there instead.
Hello, I'm having a slight problem with TTT. I'm using two addons (ULX Chat Tags and TTT Easy Scoreboard ranks) and whenever I set the tags/menu to be a different colour It always outputs white for some reason. I'm getting no errors in console both server and clientside, the only thing I can see that might resemble an error is this: [CODE]DLL_MessageEnd: Refusing to send user message TextMsg of 256 bytes to client, user message size limit is 255 bytes[/CODE] Any help would be appreciated thanks!
[QUOTE=James xX;47554493]Works for me console: Ignore the other prints, I was having trouble getting your code to work (didn't see the variables you hadn't declared, I edited out the 2 lines plus the set pos line for simplicity).[/QUOTE] Thanks a lot. Basicly that was the way i did it. but now FUCK ME SIDEWAYS. i found the whole mistake i did. It was working fine, but i forgott to pass the second arg to WriteInt.... [QUOTE=alexjerta;47555870]Hello, I'm having a slight problem with TTT. I'm using two addons (ULX Chat Tags and TTT Easy Scoreboard ranks) and whenever I set the tags/menu to be a different colour It always outputs white for some reason. I'm getting no errors in console both server and clientside, the only thing I can see that might resemble an error is this: [CODE]DLL_MessageEnd: Refusing to send user message TextMsg of 256 bytes to client, user message size limit is 255 bytes[/CODE] Any help would be appreciated thanks![/QUOTE] Could you please link your Chat Tags addon? TTT ESR can't be the problem, since it doesnt uses umsg.
Is there a function to make an entity's sequence only play once rather than continually as SetSequence seems to do?
Sorry, you need to Log In to post a reply to this thread.