• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=PortalGod;47658718][url]http://wiki.garrysmod.com/page/Category:DAdjustableModelPanel[/url][/QUOTE] Works great except for one problem: the model does not appear immediately after setting the model. Instead, you have to click to get the model to show up. The model is oriented properly, and this only seems to happen with the adjustable panel, not the regular one.
[QUOTE=AK to Spray;47658918]Works great except for one problem: the model does not appear immediately after setting the model. Instead, you have to click to get the model to show up. The model is oriented properly, and this only seems to happen with the adjustable panel, not the regular one.[/QUOTE] You have to layout the entity how you like.
[QUOTE=vexx21322;47659082]You have to layout the entity how you like.[/QUOTE] Why would my entity layout work for a regular DModelPanel and not an adjustable one? All of the properties are the exact same, just added adjust to the vgui.Create function.
Hey, I saw a job on scriptfodder where someone was asking how to limit commands for moderators to a certain DarkRP job like "Staff On Duty" so they wouldnt be able to use commands like noclip and godmode while they are roleplaying. How would I do this for my server?
Posting this here since any thread I post in Help & Support seems to get ignored/takes an annoyingly long time to get answered. I recall seeing an addon, on CoderHire/ScriptFodder or otherwise, that allowed players to select what loading screen music they wanted/if any while in-game. Does anyone remember what it was called?
[QUOTE=WitheredPyre;47659379]Posting this here since any thread I post in Help & Support seems to get ignored/takes an annoyingly long time to get answered. I recall seeing an addon, on CoderHire/ScriptFodder or otherwise, that allowed players to select what loading screen music they wanted/if any while in-game. Does anyone remember what it was called?[/QUOTE] I remember seeing it released in Gamemode & Addons for free when I was browsing. If I recall correctly.
[QUOTE=meowking1;47659467]I remember seeing it released in Gamemode & Addons for free when I was browsing. If I recall correctly.[/QUOTE] [url]http://facepunch.com/showthread.php?t=1427404[/url] This looks to be it. Thanks!
Hello guys, I'm searching for script to gamemode vote after some time or function that could change my gamemode. Thanks
[QUOTE=fredster;47659520]Hello guys, I'm searching for script to gamemode vote after some time or function that could change my gamemode. Thanks[/QUOTE] I don't know if this is the best method, but while I don't have a vote system for you, you can do this: [CODE]RunConsoleCommand( "gamemode", "insertgamemodenamehere" )[/CODE] [editline] [/editline] If you want a mapchange code(using the gamemode console command requires that you change the map before the gamemode change takes effect), then here's a script for that and the gamemode command: [CODE]RunConsoleCommand( "gamemode", "insertgamemodenamehere" ) function MapChange( maps ) game.ConsoleCommand("changelevel " ..table.Random(maps).. "\n") end [/CODE] Use it like this: [CODE]MapChange( { "mapname", "mapname2" } )[/CODE] Hope this helped.
I need to make a timer that gives the player 7 damage per second after an interval of 13 seconds, and ends when the player is dead. Any help?
[t]http://images.akamai.steamusercontent.com/ugc/537396299353046554/1C25F80069C8A9E3F6A6EDFFD206029FE56A4622/[/t] Send help. My HUD escaped the screenspace. (I fucked up a Cam3D somewhere, but that's not my problem). I'm currently trying to have something in the Cam3D I'm using face the player constantly, however whenever the player passes over +-180 degrees when aiming it does this crazy nonsense where it spins around. [lua] local aimAng = EyeAngles():Forward() -- We want the forward vector. cam.Start3D() render.SetMaterial(background) render.DrawQuadEasy(muzzlePos, -aimAng, 5, 3, Color(255, 0, 0, 255), 0) cam.End3D() [/lua] I know why it does this roughly, but I cannot remember for the life of me what needs to be done to fix it.
[QUOTE=glarkon;47659960]I need to make a timer that gives the player 7 damage per second after an interval of 13 seconds, and ends when the player is dead. Any help?[/QUOTE] [CODE] local function Give7DamagePerSecondUntilDeath( _p ) if( IsValid( _p ) && _p:IsPlayer() && _p:Alive() ) then timer.Simple( 13, function() timer.Create( _p:EntIndex() .. "::7damage", 1, 0, function() if( IsValid( _p ) && _p:IsPlayer() && _p:Alive() ) then _p:SetHealth( _p:Health() - 7 ); if( _p:Health() < 1 ) then _p:Kill(); end else timer.Destroy( _p:EntIndex() .. "::7damage" ); end end ); end ); end end hook.Add( "PlayerInitialSpawn", "Start7DamageTimer", function( _p ) Give7DamagePerSecondUntilDeath( _p ); end ); hook.Add( "PlayerDeath", "Remove7DamageTimer", function( _p, _, _ ) if( timer.Exists( _p:EntIndex() .. "::7damage" ) ) then timer.Destroy( _p:EntIndex() .. "::7damage" ); end end ); [/CODE] not sure if it works or if it's as you want but maybe :8
so for some reason what im doing doesnt work, and i have no idea why. Im trying to send a request to a php script on my webserver so i can log the playercounts on my server, but for whatever reason the request fails. heres my lua script: [code] rep_delay = 15 --send stats every 15 seconds cur = 0 hook.Add("Tick","report_stats",function() if cur-CurTime()<=0 and SERVER then print("ping") str = GetHostName().." ip: "..GetConVarString("ip").." players: "..#player.GetAll().."/"..game.MaxPlayers().." Date: "..util.DateStamp() print(str) http.Fetch("http://www.serisism.com/serverlist/?input="..str.."&dir=gmod/main&file=log") cur = CurTime()+rep_delay end end) function RequestFail() print("Ping failed!") end [/code] and heres my PHP script, which works fine [code] <?php $input = ""; $file = "default"; $dir = "data"; if (isset($_GET['input'])){ $input = $_GET['input']; } if (isset($_GET['file'])){ $file = $_GET['file']; } if (isset($_GET['dir'])){ $dir = $_GET['dir']; } echo nl2br("input for file is: ".$input."\n "); echo nl2br("file name given: ".$file."\n "); echo nl2br("directory name: ".$dir."\n "); if (!file_exists("data/".$dir)) { mkdir("data/".$dir,0777); echo nl2br("Directory not found! it has been created\n "); } $Open = "data/".$dir."/".$file.".txt"; $Handle = fopen($Open,'a'); echo nl2br("opened file '".$Open."' for output\n "); $Data = $input."\n"; fwrite($Handle,$Data); fclose($Handle); echo "File saved"; ?> [/code] Whenever i do [code] lua_run http.Fetch("http://www.serisism.com/serverlist/?input=testing&dir=test&file=null",nil,function() print("failed") end)[/code] in my console it works, but concatenating a string in lua seems to break it. can anyone tell me if im doing anything wrong? i feel like im just overlooking something very small EDIT: whoever posted "john madden john madden john madden", im coming for you
[QUOTE=AJ10017;47661078]EDIT: whoever posted "john madden john madden john madden", im coming for you[/QUOTE] I uhhh... [IMG]http://i.imgur.com/ur0Vy4X.png[/IMG]
well back on topic i fixed my issue. it was something to do with the strings not being urlencoded when they are recieved. i also removed all spaces in strings sent to the server
Would anyone be able to help me with a simple problem? At the moment, I'm using Combine Control, the model selection for making a new character caps at 15 before being unable to fit anymore models without breaking the character creation derma. I want to replace the model area with a simple button that when you click it, it will make a quick pop-up which is able to fit a lot more models than just 15. [IMG]http://i.gyazo.com/9cf4e6aeaa8f7929fe94c338d130cf41.png[/IMG] This is the vanilla creation screen. I want to replace that area with the models with a button that will create a large rectangle pop-up, that will be able to fit -A LOT- more models than just 15, much like TnB's server. Sorry for stealing the idea, just thought it'd be cool to have. [IMG]http://i.gyazo.com/7b8a0cf33bf97fb0c1d04bed26cbf654.png[/IMG] [IMG]http://i.gyazo.com/23f73a93d7cce9075967e8af6374e8b1.png[/IMG] Update: So, I found a way to make the button and skins, but whenever I try to create the character, it just says invalid model. [IMG]http://i.gyazo.com/771b23bc6204ab0cd9ed2a78aa46d4d3.png[/IMG]
Really depends on what you did to GM:CheckCharacterValidity(). (also use [t] instead of [img])
[QUOTE=Luni;47661771]Really depends on what you did to GM:CheckCharacterValidity(). (also use [t] instead of [img])[/QUOTE] I've configured that correctly both in the sh_file, cl_file, and sv_file, but it still does it so I'm not entirely sure how to proceed.
simple/stupid one...im wanting to start using github as my coding/project management practices are absolutely awful and aren't sustainable at all if i want to do a sizeable project. using garrysmod as an example, if i were to run a local test server for making changes, would there be an easy way to create and commit to a repository directly from the test server folder without having to have all of the server files on the repository, would it be possible or would i have to maintain two local copies? (one purely for making and committing changes and the other for testing them on the server)
[QUOTE=Cushie;47663713]simple/stupid one...im wanting to start using github as my coding/project management practices are absolutely awful and aren't sustainable at all if i want to do a sizeable project. using garrysmod as an example, if i were to run a local test server for making changes, would there be an easy way to create and commit to a repository directly from the test server folder without having to have all of the server files on the repository, would it be possible or would i have to maintain two local copies? (one purely for making and committing changes and the other for testing them on the server)[/QUOTE] You could try using folder junctions/sym links?
[QUOTE=Cushie;47663713]simple/stupid one...im wanting to start using github as my coding/project management practices are absolutely awful and aren't sustainable at all if i want to do a sizeable project. using garrysmod as an example, if i were to run a local test server for making changes, would there be an easy way to create and commit to a repository directly from the test server folder without having to have all of the server files on the repository, would it be possible or would i have to maintain two local copies? (one purely for making and committing changes and the other for testing them on the server)[/QUOTE] You could have a seperate branch.
[QUOTE=mcd1992;47663873]You could have a seperate branch.[/QUOTE] i was planning on having a master/stable branch. maybe im getting it all wrong but in the example above the main issue was just wanting to be able to follow this workflow: 1. make change(s) 2. test on local server 3. commit change(s) rather than 1. make change(s) 2. test on local server 3. move modified files to local github folder 4. commit change(s) [QUOTE=Blasteh;47663766]You could try using folder junctions/sym links?[/QUOTE] crossed my mind but wasn't sure how to put it in practice. should be sorted now, i moved the relevant folders into my github repo and symlinked them back to the original folder.
[QUOTE=Cushie;47663926] 1. make change(s) 2. test on local server 3. commit change(s) [/QUOTE] Can you not just have your github repo in the test server's directory, code in the repo and test your changes on the local server. Then when you're done and the code is tested just push the changes? Making changes in the github repo locally doesn't automatically commit them to github, you have to manually push the changes. Example: The gamemode I'm working on is just cloned in my garrysmod/gamemodes/ folder. I code in it and test my changes on the local server, then when I'm done I commit them. Is that not what you want? I feel like I'm missing a key element. [editline]5th May 2015[/editline] Oh I see, you're making changes directly to the root (garrysmod/) folder. You can always modify your [url=https://help.github.com/articles/ignoring-files/].gitignore[/url] file to not commit vanilla garrysmod code.
[QUOTE=mcd1992;47664214]Can you not just have your github repo in the test server's directory, code in the repo and test your changes on the local server. Then when you're done and the code is tested just push the changes? Making changes in the github repo locally doesn't automatically commit them to github, you have to manually push the changes. Example: The gamemode I'm working on is just cloned in my garrysmod/gamemodes/ folder. I code in it and test my changes on the local server, then when I'm done I commit them. Is that not what you want? I feel like I'm missing a key element.[/QUOTE] it would work fine if it was specifically a gamemode folder, but im making changes to various files across various folders in the structure, and there are a lot of folders surrounding them that i dont want to include. i guess its either/or, i could take the folders out and clone them back in or symlink them.
Anyone know of an easy way to prevent people from picking up / removing cars when there is someone inside? This is for a DarkRP (Yes, I know) server, where this is a rampant issue. Thanks! =)
[QUOTE=Deathbypwnage;47664445]Anyone know of an easy way to prevent people from picking up / removing cars when there is someone inside? This is for a DarkRP (Yes, I know) server, where this is a rampant issue. Thanks! =)[/QUOTE] With physgun? You can just completely disallow it would save for abuse, but [CODE] local function canDoStuffWithCar( _e ) if( _e:GetDriver() && _e:GetDriver():IsPlayer() ) then return false; end return true; end hook.Add( "CanTool", "SomeUniqueHookName999", function( _p, _e, tool ) if( tool = "remover" && _e:IsVehicle() && !canDoStuffWithCar( _e ) ) then return false; end end ); hook.Add( "PhysgunPickup", "SomeUniqueHookName666", function( _p, _e ) if(_e:IsVehicle() && !canDoStuffWithCar( _e ) ) then return false; end end ); [/CODE]
[QUOTE=Busan1;47664556]With physgun? You can just completely disallow it would save for abuse, but [CODE] local function canDoStuffWithCar( _e ) if( _e:GetDriver() && _e:GetDriver():IsPlayer() ) then return false; end return true; end hook.Add( "CanTool", "SomeUniqueHookName999", function( _p, _e, tool ) if( tool = "remover" && _e:IsVehicle() && !canDoStuffWithCar( _e ) ) then return false; end end ); hook.Add( "PhysgunPickup", "SomeUniqueHookName666", function( _p, _e ) if(_e:IsVehicle() && !canDoStuffWithCar( _e ) ) then return false; end end ); [/CODE][/QUOTE] While the code is correct, I would suggest still allowing admins to remove cars.
Is there any way to find get the Vector where the cursor is pointing at? I'm trying to make an RTS system and while I got everything working, I just can't find out how to find the location in the world where my cursor is. There is Vector.ToScreen, but not the reverse.
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/gui/ScreenToVector]gui.ScreenToVector[/url]
[QUOTE=PortalGod;47665110][IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/gui/ScreenToVector"]gui.ScreenToVector[/URL][/QUOTE] I don't get how to use that though, it doesn't seem to work.
Sorry, you need to Log In to post a reply to this thread.