• Flow - Collection of gamemodes and accessories
    536 replies, posted
[QUOTE='[pG]Jailbreak;47077972']what the slash at the end of the url, yeah ive tried that, same error "map load failed: surf_lt_omnific not found or invalid" it's still wanting to load the maps from the maps folder on the server and not the url look man lol i even replaced it with my shit [url]http://originalgoodplayers.com/garrysmod/maps/[/url] and it still doesnt work[/QUOTE] We had this exact problem to (on the bhop gamemode) We simply deleted all the maps, removed all of them from the nominate list, and readded everything... worked fine but took forever
[QUOTE=qTY3;47078121]We had this exact problem to (on the bhop gamemode) We simply deleted all the maps, removed all of them from the nominate list, and readded everything... worked fine but took forever[/QUOTE] what file is the list in? or does it have something to do with the admincp
[QUOTE='[pG]Jailbreak;47078456']what file is the list in? or does it have something to do with the admincp[/QUOTE] 1. Do you even have the map in your own GarrysModDS/garrysmod/maps folder? The server also has to load the map. The error you had very much sounds like an error from the CMapLoader at startup... 2. The server sends this as a HTTP request: sv_downloadurl .. data where data is something like /maps/surf_lt_omnific.bsp.bz2 (meaning your full path has to be [B]fastdl.randomhost.com/garrysmod[/B]/maps/map.bsp.bz2 3. If you're inexperienced with Lua, don't even attempt using pG's gamemodes because they're not intended for straight up usage (also, why not use Flow's gamemodes? They're miles ahead of pG) Please guys, this thread is turning into what I don't want it to be. Keep the quality posts up. Also, if you haven't rated the original post Lua yet, please do so people will know the origin of this whole thread (we'd need at least 20)
[QUOTE=Gravious;47078855] intended for straight up usage (also, why not use Flow's gamemodes? They're miles ahead of pG) Please guys, this thread is turning into what I don't want it to be. Keep the quality posts up.[/QUOTE] i am using flow's gamemode, oh well im sorry for being inexperienced, yes i do have the map in my maps folder.... i've tried both pg's link, gfl's, and mine and all would not let people download the maps. Either way i now realize that this is not the place to expect help from
[QUOTE='[pG]Jailbreak;47079598']i am using flow's gamemode, oh well im sorry for being inexperienced, yes i do have the map in my maps folder.... i've tried both pg's link, gfl's, and mine and all would not let people download the maps. Either way i now realize that this is not the place to expect help from[/QUOTE] I'll have another tutorial on setting up a FastDL, don't worry, I got you covered. Check your console when you're trying to join, does it say anything? Where are you getting the error? If you want help, you'll have to make a proper post, with as much detail as you can provide. That's what I mean with quality posts.
[QUOTE='[pG]Jailbreak;47079598']yes i do have the map in my maps folder.... i've tried both pg's link, gfl's, and mine and all would not let people download the maps.[/QUOTE] Just to be clear is this a client sided error or is this occurring on the server? If it is happening on the server verify that the map file you are trying to load ends with bsp and not bz2. If it ends with bz2 then you will need to extract the file. Can you connect to the server? If not put the map in your gmod client maps directory and then try. If you can provide a lot of detail like screenshots of the errors as well as what your server directory including maps looks like someone could help you more.
Gravious, thank you so much for this release. I played on Surfline constantly when it was up and played a bit on Flow when it changed. Your gamemode is unmatched in quality. So, I have everything running quite well on my server. Bot works, gamemode and leaderboards work. Everything is really smooth. My only issue is that I cannot get the [Flow Network] notification to change to my server name. I changed it from Flow in the core.lua file, but the changes don't reflect on the server. The notification still says Flow Network, but now it isn't the normal blue, it's just an all white message. Any idea why this may be happening? Not getting any lua errors or anything. I also compared between mine and the Bunny Hop core.lua files, no noticeable differences that would cause this. I'll continue to fiddle with it until I get a reply and see if I can get anything out of it.
[QUOTE=Clouds;47083861]Gravious, thank you so much for this release. I played on Surfline constantly when it was up and played a bit on Flow when it changed. Your gamemode is unmatched in quality. So, I have everything running quite well on my server. Bot works, gamemode and leaderboards work. Everything is really smooth. My only issue is that I cannot get the [Flow Network] notification to change to my server name. I changed it from Flow in the core.lua file, but the changes don't reflect on the server. The notification still says Flow Network, but now it isn't the normal blue, it's just an all white message. Any idea why this may be happening? Not getting any lua errors or anything. I also compared between mine and the Bunny Hop core.lua files, no noticeable differences that would cause this. I'll continue to fiddle with it until I get a reply and see if I can get anything out of it.[/QUOTE] All those measures I made were only done last-minute to make life easier on some of you, but I completely forgot applying a part of the changes onto the Skill Surf gamemode. To fix your problem, open up [B]modules/sv_admin.lua[/B], go to Admin:AddNotification() at line 422. Make sure it looks like this: [code] function Admin:AddNotification( szText ) Core:Broadcast( "Print", { _C["ServerName"], szText } ) end [/code] After that, still in the same file, go to Admin.VIPProcess( ply, args, extra ) at line 646. The beginning of the function has to look like this: [code] function Admin.VIPProcess( ply, args, extra ) if not ply.IsVIP or not ply.VIPLevel then return Core:Send( ply, "Print", { _C["ServerName"], Lang:Get( "MiscVIPRequired" ) } ) end ... The rest of the function should remain the same [/code] Really the only change I made is change the fixed string "Flow Network" in there to the variable _C["ServerName"], which is defined in [B]core.lua[/B]. If you've tried changing things in core.lua, just be sure to have the prefixes list (line 37) back to this: [code] _C["Prefixes"] = { ["Surf Timer"] = Color( 52, 73, 94 ), ["General"] = Color( 52, 152, 219 ), ["Admin"] = Color( 76, 60, 231 ), ["Notification"] = Color( 231, 76, 60 ), [_C["ServerName"]] = Color( 46, 204, 113 ), -- Mainly for this part, so it loads _C["ServerName"]'s color ["Radio"] = Color( 230, 126, 34 ), ["VIP"] = Color( 174, 0, 255 ) } [/code] And finally, you can put your server name right at the top of core.lua (line 18): [code] _C["ServerName"] = "My Skill Surf" [/code] --- Thanks for letting me know! I've updated it in the repository, so in the next update it'll be fixed for others.
[QUOTE=Gravious;47085276]All those measures I made were only done last-minute to make life easier on some of you, but I completely forgot applying a part of the changes onto the Skill Surf gamemode. To fix your problem, open up [B]modules/sv_admin.lua[/B], go to Admin:AddNotification() at line 422. Make sure it looks like this: [code] function Admin:AddNotification( szText ) Core:Broadcast( "Print", { _C["ServerName"], szText } ) end [/code] After that, still in the same file, go to Admin.VIPProcess( ply, args, extra ) at line 646. The beginning of the function has to look like this: [code] function Admin.VIPProcess( ply, args, extra ) if not ply.IsVIP or not ply.VIPLevel then return Core:Send( ply, "Print", { _C["ServerName"], Lang:Get( "MiscVIPRequired" ) } ) end ... The rest of the function should remain the same [/code] Really the only change I made is change the fixed string "Flow Network" in there to the variable _C["ServerName"], which is defined in [B]core.lua[/B]. If you've tried changing things in core.lua, just be sure to have the prefixes list (line 37) back to this: [code] _C["Prefixes"] = { ["Surf Timer"] = Color( 52, 73, 94 ), ["General"] = Color( 52, 152, 219 ), ["Admin"] = Color( 76, 60, 231 ), ["Notification"] = Color( 231, 76, 60 ), [_C["ServerName"]] = Color( 46, 204, 113 ), -- Mainly for this part, so it loads _C["ServerName"]'s color ["Radio"] = Color( 230, 126, 34 ), ["VIP"] = Color( 174, 0, 255 ) } [/code] And finally, you can put your server name right at the top of core.lua (line 18): [code] _C["ServerName"] = "My Skill Surf" [/code] --- Thanks for letting me know! I've updated it in the repository, so in the next update it'll be fixed for others.[/QUOTE] Thanks for the prompt reply, Grav! That fixed it 100%. I didn't look in the sv_admin.lua file. The ONLY place I didn't check -_- Ah, well at least it got the issue resolved for anyone else trying to run this mode. Again, thanks so much for the release. This is what will save skill modes on Garry's Mod. Ilya's gm's were taking over and it was sad to see. This is a completely unrelated question to the mode at hand and moreso one of what you had done with sl. How did you remove all the jails on maps? There are many different ways and, since I have 70 plus maps going on this server, what do you think would be the best/fastest way to do it? I'm not trying to turn this in to a help thread, but you ran the best Surf server on the game and I want to continue that. I loved sl/flow and sunk many, many hours in to it.
[QUOTE=Clouds;47086409]Thanks for the prompt reply, Grav! That fixed it 100%. I didn't look in the sv_admin.lua file. The ONLY place I didn't check -_- Ah, well at least it got the issue resolved for anyone else trying to run this mode. Again, thanks so much for the release. This is what will save skill modes on Garry's Mod. Ilya's gm's were taking over and it was sad to see. This is a completely unrelated question to the mode at hand and moreso one of what you had done with sl. How did you remove all the jails on maps? There are many different ways and, since I have 70 plus maps going on this server, what do you think would be the best/fastest way to do it? I'm not trying to turn this in to a help thread, but you ran the best Surf server on the game and I want to continue that. I loved sl/flow and sunk many, many hours in to it.[/QUOTE] I created a "Restart" zone on the last update. I guess you can place those down before the entrance of the jail and so send people back to the start trying to enable the jail. Noob and Duk told me that the function didn't work though. Let me know what happens when you try it.
[QUOTE=Gravious;47086702]I created a "Restart" zone on the last update. I guess you can place those down before the entrance of the jail and so send people back to the start trying to enable the jail. Noob and Duk told me that the function didn't work though. Let me know what happens when you try it.[/QUOTE] I haven't encountered Jails since server update. Sorry for not replying, but I haven't had a reason to try it yet. Surf is working great, though. Just need to add the VIPs to the surf db and things will be perfect. Only issue is that the server is working so well, people are always on. It's tough to find a time to bring it down.
is it possible to make the Flow Bunny Hop gamemode fetch the maps for the mapvote from the server instead of from sv.db? also I thought this stores zones and records via mysql too :/
weird question, but is it possible to make the bot's strafes look robotic again?
[QUOTE=DannyCore;47096710]is it possible to make the Flow Bunny Hop gamemode fetch the maps for the mapvote from the server instead of from sv.db? also I thought this stores zones and records via mysql too :/[/QUOTE] Not by default but it shouldn't be very hard to implement these. On the RTV:LoadData() function (modules/sv_rtv.lua) simply do a file.Find for the "garrysmod/maps" directory. I recommend against this because it's better to have the map list separately so you don't necessarily have to have every map available (it's also easier to manage from the admin panel). Also, to make sure the rest continues to work, you'll have to make quite some alterations to the remainder of the admin panel / voting / map list caching. To get zones on MySQL, check out Core:LoadZones() (in core_data.lua) as well as the updating function Zones:FinishSet( ply, extra ) (in sv_zones.lua) and modify them into SQL:Prepare rather than sql.Query. [QUOTE=rhythm;47097672]weird question, but is it possible to make the bot's strafes look robotic again?[/QUOTE] Did they ever look robotic? They're just an exact playback of what the player does, so I guess you'll have to tell the player to have robotic strafes. You'll have to be a bit more specific if you want to ask me something else.
ye nvm. btw how do you add an owner/admin on pg's 3.1 gm?
[QUOTE=Gravious;47086702]I created a "Restart" zone on the last update. I guess you can place those down before the entrance of the jail and so send people back to the start trying to enable the jail. Noob and Duk told me that the function didn't work though. Let me know what happens when you try it.[/QUOTE] I tested the restart zone on surf_and_destroy and they work 100%! I'm not sure why they weren't working for Noob or Duk. They are fully functional, though. [QUOTE=rhythm;47103936]ye nvm. btw how do you add an owner/admin on pg's 3.1 gm?[/QUOTE] This is a release thread. Reverse engineer the lua yourself and figure out how to hook an admin/owner rank in and create the necessary functions for them to be useful ranks. Gravious said he wasn't going to be walking you through everything. It's not hard to figure out if you try. If you can't do it, don't understand it, or don't want to do it, try to find someone who is willing to help you. If you can't find anyone, find some Lua tutorials and study it. It's the only way to learn. How do you expect to be able to update the gamemode if you don't know Lua?
[QUOTE=rhythm;47103936]ye nvm. btw how do you add an owner/admin on pg's 3.1 gm?[/QUOTE] On the admin.lua file, you can put your own UniqueID in the Admin.List table. Your UniqueID is obtainable by calling ply:UniqueID() or by going [url=https://www.functions-online.com/crc32.html]here[/url] and entering this: gm_STEAM_0:0:YOURSTEAM_gm [QUOTE=Clouds;47104473]I tested the restart zone on surf_and_destroy and they work 100%! I'm not sure why they weren't working for Noob or Duk. They are fully functional, though.[/QUOTE] Awesome! :) [QUOTE=Clouds;47104473]This is a release thread. Reverse engineer the lua yourself and figure out how to hook an admin/owner rank in and create the necessary functions for them to be useful ranks. Gravious said he wasn't going to be walking you through everything. It's not hard to figure out if you try. If you can't do it, don't understand it, or don't want to do it, try to find someone who is willing to help you. If you can't find anyone, find some Lua tutorials and study it. It's the only way to learn. How do you expect to be able to update the gamemode if you don't know Lua?[/QUOTE] Cloud is very correct here, but because it isn't that much effort for me and might help a little, I decided to give you a hint at least ;) --- [QUOTE=Gravious;47079806][B]I'll have another tutorial on setting up a FastDL, don't worry, I got you covered.[/B] Check your console when you're trying to join, does it say anything? Where are you getting the error? If you want help, you'll have to make a proper post, with as much detail as you can provide. That's what I mean with quality posts.[/QUOTE] [url=https://www.youtube.com/watch?v=zZ6iiiQfQis&list=PL574IiNOfsaWHf2xFtsFwL-PHDKx10RAV&index=7]FastDL tutorial and SrcDemo2 tutorial[/url] are now up!
Might want to consider moving to SteamID64 as opposed to UniqueID as there apparently are hash collisions and performance issues (personally untested), as well as people can obtain steamid64 through simple websites instead of having to call a function first/copy and paste other data.
Hello, I was setting up GFL's bhop gm for my server, but you can't place any zones other than a bonus startzone. I know that I'm supposed to try to fix the problem myself, and I attempted to, but it just wont work. So after trying GFL's gm. I also tried to use impulses, but the admin panel wouldn't show up, I also attempted to fix this but it wouldn't budge. I honestly don't want to sound greedy but can you try to shed some light on this problem? :)
[QUOTE=zerf;47111045]Might want to consider moving to SteamID64 as opposed to UniqueID as there apparently are hash collisions and performance issues (personally untested), as well as people can obtain steamid64 through simple websites instead of having to call a function first/copy and paste other data.[/QUOTE] On the latest gamemode (Flow's gamemodes) I'm using ply:SteamID() because the ply:UniqueID() function was causing performance issues upon joining. I'm not going to update this for pG or GFL anymore. The gamemode provides functionality for opening other people's Steam profiles, so there's really no need to directly have it. [QUOTE=yukaa;47111366]Hello, I was setting up GFL's bhop gm for my server, but you can't place any zones other than a bonus startzone. I know that I'm supposed to try to fix the problem myself, and I attempted to, but it just wont work. So after trying GFL's gm. I also tried to use impulses, but the admin panel wouldn't show up, I also attempted to fix this but it wouldn't budge. I honestly don't want to sound greedy but can you try to shed some light on this problem? :)[/QUOTE] Because you asked so nicely, I'll have a look at it for you ;) I'll update this post when I've found some more information about the problem. [B]UPDATE[/B] The admin system on GFL consisted of mainly commands, since I was the only one managing it along with a very few amount of admins. Later, when we started adding more, they wanted a GUI, so I started making it, but I never got around to finishing it. There is still a LOT of functionality available, which can be viewed by typing !admin help. For example, to add a zone, type !admin addrea - look at what ID you want (start zone is 1) - then type !admin addarea 1 - begin walking around - to save, type !admin addarea Short guide on how to set up GFL's admin system 1. Put the gamemode in a new folder called "bhop" 2. Copy the contents of the "Database" folder to your GarrysModDS "data" folder. 3. Go to players/AdminList.txt 4. To get your Unique ID, go in-game, and when you're in game, type this in your console: [i]lua_run for k,v in pairs(player.GetHumans()) do print(v:Name(), v:UniqueID()) end[/i] 5. Add a new line to the AdminList.txt file: {"UID":"YOURUID","Access":16} 6. 16 is owner, 8 is triggers, 4 is areas, 2 is bonuses and 1 is base access. As you can see there's no super admin / admin, just what they can do in the admin panel. Guns won't be added by default, so you'll have to use the Weapon Pack addon and place the "cssweps" folder in your GarrysModDS "addons" folder. Oh, also, if you're going to use GFL's gamemode, go to Admin:LoadAdmins() and remove the second part of the function so that it looks like this again: [code] function Admin:LoadAdmins() local Content = FS:Load( "AdminList.txt", FS.Folders.Players, true ) if Content and Content != "" then local Admins = string.Explode( "\n", Content ) for _, data in pairs( Admins ) do local tab = FS.Deserialize:AdminInfo( data ) Admin.List[ tab.UID ] = tab.Access end end end [/code]
Made a separate post because Facepunch hates editing and I don't want to make my previous post any more confusing than it already is. I updated the Release zip file to v1.02 and improved the original post in general. Fixed the weapon flip bug on Bunny Hop and Surf and added a few text files and fixed some textual errors here and there. I also made new tutorials, this time completely about Bunny Hop itself. Have a look at the [URL=https://www.youtube.com/watch?v=4EPpZz4pBy0]Bunny Hop Tutorial here[/URL]!
-Wrong Thread-
If anyone thinks it's useful, here's the code that I used for the HUD on the bottom right that you can see [URL=https://www.youtube.com/watch?v=vmREZAGx_B8]here[/URL]. I was too late with adding it in yesterdays' release so I'm not going to add it now. It'll be included whenever I update this again. [B]NOTE[/B]: This is by no means required and is only for people that like it! [B]modules/cl_strafe.lua[/B] [CODE] -- HUD module used for my tutorials local StrafeAxis = 0 -- Saves the last eye angle yaw for checking mouse movement local StrafeButtons = nil -- Saves the buttons from SetupMove for displaying local StrafeCounter = 0 -- Holds the amount of strafes local StrafeLast = nil -- Your last strafe key for counting strafes local StrafeDirection = nil -- The direction of your strafes used for displaying local StrafeStill = 0 -- Counter to reset mouse movement local fb, ik, lp, ts = bit.band, input.IsKeyDown, LocalPlayer, _C.Team.Spectator -- This function is used frequently so to reduce lag... local function norm( i ) if i > 180 then i = i - 360 elseif i < -180 then i = i + 360 end return i end -- Custom function to normalize eye angles local StrafeData -- Your Sync value is stored here local KeyADown, KeyDDown -- For displaying on the HUD local MouseLeft, MouseRight --- For displaying on the HUD local ViewGUI = CreateClientConVar( "sl_showgui", "1", true, false ) -- GUI visibility surface.CreateFont( "HUDFont2", { size = 20, weight = 800, font = "Tahoma" } ) function ResetStrafes() StrafeCounter = 0 end -- Resets your stafes (global) function SetSyncData( data ) StrafeData = data end -- Sets your sync data (global) -- Monitors the buttons and angles local function MonitorInput( ply, data ) StrafeButtons = data:GetButtons() local ang = data:GetAngles().y local difference = norm( ang - StrafeAxis ) if difference > 0 then StrafeDirection = -1 StrafeStill = 0 elseif difference < 0 then StrafeDirection = 1 StrafeStill = 0 else if StrafeStill > 20 then StrafeDirection = nil end StrafeStill = StrafeStill + 1 end StrafeAxis = ang end hook.Add( "SetupMove", "MonitorInput", MonitorInput ) -- Monitors your key presses for strafe counting local function StrafeKeyPress( ply, key ) if ply:IsOnGround() then return end local SetLast = true if key == IN_MOVELEFT or key == IN_MOVERIGHT then if StrafeLast != key then StrafeCounter = StrafeCounter + 1 end else SetLast = false end if SetLast then StrafeLast = key end end hook.Add( "KeyPress", "StrafeKeys", StrafeKeyPress ) -- Paints the actual HUD local function HUDPaintB() if not ViewGUI:GetBool() then return end if not IsValid( lp() ) or lp():Team() == ts then return end -- Background local x,y = ScrW() - 250, ScrH() - 145 surface.SetDrawColor( Color(35, 35, 35, 255) ) surface.DrawRect( x, y, 230, 125 ) -- Setting the key colors if StrafeButtons then if fb( StrafeButtons, IN_MOVELEFT ) > 0 then KeyADown = Color( 142, 42, 42, 255 ) else KeyADown = nil end if fb( StrafeButtons, IN_MOVERIGHT ) > 0 then KeyDDown = Color( 142, 42, 42, 255 ) else KeyDDown = nil end end -- Getting the direction for the mouse if StrafeDirection then if StrafeDirection > 0 then MouseLeft, MouseRight = nil, Color( 142, 42, 42, 255 ) elseif StrafeDirection < 0 then MouseLeft, MouseRight = Color( 142, 42, 42, 255 ), nil else MouseLeft, MouseRight = nil, nil end else MouseLeft, MouseRight = nil, nil end -- Box on top surface.SetDrawColor( Color(42, 42, 42, 255) ) surface.DrawRect( x + 5, y + 5, 220, 55 ) draw.SimpleText( "Extra keys:", "HUDTimer", x + 12, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) -- If we have buttons, display them if StrafeButtons then local zx = x + 40 if fb( StrafeButtons, IN_FORWARD ) > 0 then draw.SimpleText( "W", "HUDTimer", zx + 56, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end if fb( StrafeButtons, IN_BACK ) > 0 then draw.SimpleText( "S", "HUDTimer", zx + 76, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end if ik( KEY_SPACE ) or fb( StrafeButtons, IN_JUMP ) > 0 then draw.SimpleText( "Jump", "HUDTimer", zx + 92, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end if fb( StrafeButtons, IN_DUCK ) > 0 then draw.SimpleText( "Duck", "HUDTimer", zx + 136, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end end -- Display the amount of strafes if StrafeCounter then draw.SimpleText( "Strafes: " .. StrafeCounter, "HUDTimer", x + 12, y + 45, Color(255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end -- If we have sync, display the sync if StrafeData then draw.SimpleText( StrafeData, "HUDTimer", x + 216, y + 45, Color(255, 255, 255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER ) end -- Bottom left surface.SetDrawColor( KeyADown or Color(42, 42, 42, 255) ) surface.DrawRect( x + 5, y + 65, 108, 25 ) draw.SimpleText( "A", "HUDFont", x + 58, y + 77, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) -- Bottom right surface.SetDrawColor( KeyDDown or Color(42, 42, 42, 255) ) surface.DrawRect( x + 118, y + 65, 107, 25 ) draw.SimpleText( "D", "HUDFont", x + 172, y + 77, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) -- Bottom left surface.SetDrawColor( MouseLeft or Color(42, 42, 42, 255) ) surface.DrawRect( x + 5, y + 95, 108, 25 ) draw.SimpleText( "Mouse Left", "HUDFont2", x + 58, y + 107, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) -- Bottom right surface.SetDrawColor( MouseRight or Color(42, 42, 42, 255) ) surface.DrawRect( x + 118, y + 95, 107, 25 ) draw.SimpleText( "Mouse Right", "HUDFont2", x + 172, y + 107, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) end hook.Add( "HUDPaint", "PaintB", HUDPaintB ) [/CODE] Short [B]README.txt[/B] Put this file in your modules folder. On send.txt add a new line with: gamemodes\bhop\gamemode\modules\cl_strafe.lua Then on your cl_init.lua top add: include( "modules/cl_strafe.lua" ) Note that in order to reset the strafes, you have go to cl_receive.lua (TransferHandle function) And look for this part [code] elseif szAction == "Timer" then local szType = tostring( varArgs[ 1 ] ) if szType == "Start" then Timer:SetStart( tonumber( varArgs[ 2 ] ) ) elseif szType == "Restart" then if imstnit then imstnit( 1 ) end [/code] And below the "if imstnit then imstnit( 1 ) end" Add this: [code] if ResetStrafes then ResetStrafes() end [/code] and on your cl_timer.lua file you'll have to replace Timer:SetCPSData( data ) with this: [code] function Timer:SetCPSData( data ) SetSyncData( data ) end [/code] You might also want to disable ammo drawing or the displays will overlap ALSO remove this text because it'll take some time to transfer to the client
Hey Gravious, I have a bunch of unwanted maps in the nominate menu and I am unable to locate the way of getting rid of them? I have delelted them from the sv.db but they still appear? Any help?
[QUOTE=Gravious;47132613]If anyone thinks it's useful, here's the code that I used for the HUD on the bottom right that you can see [URL=https://www.youtube.com/watch?v=vmREZAGx_B8]here[/URL]. I was too late with adding it in yesterdays' release so I'm not going to add it now. It'll be included whenever I update this again. [B]modules/cl_strafe.lua[/B] [CODE] -- HUD module used for my tutorials -- README.txt --[[ Put this file in your modules folder. On send.txt add a new line with: gamemodes\bhop\gamemode\modules\cl_strafe.lua Then on your cl_init.lua top add: include( "modules/cl_strafe.lua" ) Note that in order to reset the strafes, you have to put this on cl_receive.lua (TransferHandle function) [ CODE ] elseif szAction == "Timer" then local szType = tostring( varArgs[ 1 ] ) if szType == "Start" then Timer:SetStart( tonumber( varArgs[ 2 ] ) ) elseif szType == "Restart" then ResetStrafes() -- Reset your strafes for the cl_strafe.lua module [ /CODE ] and on your cl_timer.lua file you'll have to replace Timer:SetCPSData( data ) with this: [ CODE ] function Timer:SetCPSData( data ) SetSyncData( data ) end [ /CODE ] You might also want to disable ammo drawing or the displays will overlap ]] local StrafeAxis = 0 -- Saves the last eye angle yaw for checking mouse movement local StrafeButtons = nil -- Saves the buttons from SetupMove for displaying local StrafeCounter = 0 -- Holds the amount of strafes local StrafeLast = nil -- Your last strafe key for counting strafes local StrafeDirection = nil -- The direction of your strafes used for displaying local StrafeStill = 0 -- Counter to reset mouse movement local fb, ik = bit.band, input.IsKeyDown -- This function is used frequently so to reduce lag... local function norm( i ) if i > 180 then i = i - 360 elseif i < -180 then i = i + 360 end return i end -- Custom function to normalize eye angles local StrafeData -- Your Sync value is stored here local KeyADown, KeyDDown -- For displaying on the HUD local MouseLeft, MouseRight --- For displaying on the HUD function ResetStrafes() StrafeCounter = 0 end -- Resets your stafes (global) function SetSyncData( data ) StrafeData = data end -- Sets your sync data (global) -- Monitors the buttons and angles local function MonitorInput( ply, data ) StrafeButtons = data:GetButtons() local ang = data:GetAngles().y local difference = norm( ang - StrafeAxis ) if difference > 0 then StrafeDirection = -1 StrafeStill = 0 elseif difference < 0 then StrafeDirection = 1 StrafeStill = 0 else if StrafeStill > 20 then StrafeDirection = nil end StrafeStill = StrafeStill + 1 end StrafeAxis = ang end hook.Add( "SetupMove", "MonitorInput", MonitorInput ) -- Monitors your key presses for strafe counting local function StrafeKeyPress( ply, key ) if ply:IsOnGround() then return end local SetLast = true if key == IN_MOVELEFT or key == IN_MOVERIGHT then if StrafeLast != key then StrafeCounter = StrafeCounter + 1 end else SetLast = false end if SetLast then StrafeLast = key end end hook.Add( "KeyPress", "StrafeKeys", StrafeKeyPress ) -- Paints the actual HUD local function HUDPaintB() -- Background local x,y = ScrW() - 250, ScrH() - 145 surface.SetDrawColor( Color(35, 35, 35, 255) ) surface.DrawRect( x, y, 230, 125 ) -- Setting the key colors if StrafeButtons then if fb( StrafeButtons, IN_MOVELEFT ) > 0 then KeyADown = Color( 142, 42, 42, 255 ) else KeyADown = nil end if fb( StrafeButtons, IN_MOVERIGHT ) > 0 then KeyDDown = Color( 142, 42, 42, 255 ) else KeyDDown = nil end end -- Getting the direction for the mouse if StrafeDirection then if StrafeDirection > 0 then MouseLeft, MouseRight = nil, Color( 142, 42, 42, 255 ) elseif StrafeDirection < 0 then MouseLeft, MouseRight = Color( 142, 42, 42, 255 ), nil else MouseLeft, MouseRight = nil, nil end else MouseLeft, MouseRight = nil, nil end -- Box on top surface.SetDrawColor( Color(42, 42, 42, 255) ) surface.DrawRect( x + 5, y + 5, 220, 55 ) draw.SimpleText( "Extra keys:", "HUDTimer", x + 12, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) -- If we have buttons, display them if StrafeButtons then local zx = x + 40 if fb( StrafeButtons, IN_FORWARD ) > 0 then draw.SimpleText( "W", "HUDTimer", zx + 56, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end if fb( StrafeButtons, IN_BACK ) > 0 then draw.SimpleText( "S", "HUDTimer", zx + 76, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end if ik( KEY_SPACE ) or fb( StrafeButtons, IN_JUMP ) > 0 then draw.SimpleText( "Jump", "HUDTimer", zx + 92, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end if fb( StrafeButtons, IN_DUCK ) > 0 then draw.SimpleText( "Duck", "HUDTimer", zx + 136, y + 20, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end end -- Display the amount of strafes if StrafeCounter then draw.SimpleText( "Strafes: " .. StrafeCounter, "HUDTimer", x + 12, y + 45, Color(255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end -- If we have sync, display the sync if StrafeData then draw.SimpleText( StrafeData, "HUDTimer", x + 216, y + 45, Color(255, 255, 255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER ) end -- Bottom left surface.SetDrawColor( KeyADown or Color(42, 42, 42, 255) ) surface.DrawRect( x + 5, y + 65, 108, 25 ) draw.SimpleText( "A", "HUDFont", x + 58, y + 77, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) -- Bottom right surface.SetDrawColor( KeyDDown or Color(42, 42, 42, 255) ) surface.DrawRect( x + 118, y + 65, 107, 25 ) draw.SimpleText( "D", "HUDFont", x + 172, y + 77, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) -- Bottom left surface.SetDrawColor( MouseLeft or Color(42, 42, 42, 255) ) surface.DrawRect( x + 5, y + 95, 108, 25 ) draw.SimpleText( "Mouse Left", "HUDFont2", x + 58, y + 107, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) -- Bottom right surface.SetDrawColor( MouseRight or Color(42, 42, 42, 255) ) surface.DrawRect( x + 118, y + 95, 107, 25 ) draw.SimpleText( "Mouse Right", "HUDFont2", x + 172, y + 107, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) end hook.Add( "HUDPaint", "PaintB", HUDPaintB ) [/CODE][/QUOTE] Alright I added that, everything works, but sense I have added it my !admin and !vip commands are not working... I am getting "[ERROR] gamemodes/bhop/gamemode/modules/cl_admin.lua:206: attempt to index global 'Link' (a nil value) 1. unknown - gamemodes/bhop/gamemode/modules/cl_admin.lua:206 2. include - [C]:-1 3. unknown - gamemodes/bhop/gamemode/cl_init.lua:9" No idea how to fix it... Sorry if I sound dumb, its probably super obvious, but I have tried for awhile to fix it and I kinda need the !admin command
[QUOTE=Dreeeaam;47148836]Hey Gravious, I have a bunch of unwanted maps in the nominate menu and I am unable to locate the way of getting rid of them? I have delelted them from the sv.db but they still appear? Any help?[/QUOTE] That should be the clientside caching. I think I explained somewhere, possibly in a video, but if you've deleted them, all you have to do is go to "garrysmod/data/bhop/settings.txt" and increment the number by 1. Your client should notice the server is now running on a different version of the map list, and it'll update the local one. [QUOTE=qTY3;47149935]Alright I added that, everything works, but sense I have added it my !admin and !vip commands are not working... I am getting "[ERROR] gamemodes/bhop/gamemode/modules/cl_admin.lua:206: attempt to index global 'Link' (a nil value) 1. unknown - gamemodes/bhop/gamemode/modules/cl_admin.lua:206 2. include - [C]:-1 3. unknown - gamemodes/bhop/gamemode/cl_init.lua:9" No idea how to fix it... Sorry if I sound dumb, its probably super obvious, but I have tried for awhile to fix it and I kinda need the !admin command[/QUOTE] You don't really have to add that, it's just an extra feature if people want it. And what do you mean with fixing the admin command? I thought all of that worked? If it doesn't work, it's not because of the code though, so don't change anything there. But uhm, cl_receive.lua probably has syntax errors since the Link 'class' can't be found in cl_admin.lua.
[QUOTE=Gravious;47150053]That should be the clientside caching. I think I explained somewhere, possibly in a video, but if you've deleted them, all you have to do is go to "garrysmod/data/bhop/settings.txt" and increment the number by 1. Your client should notice the server is now running on a different version of the map list, and it'll update the local one. You don't really have to add that, it's just an extra feature if people want it. And what do you mean with fixing the admin command? I thought all of that worked? If it doesn't work, it's not because of the code though, so don't change anything there. But uhm, cl_receive.lua probably has syntax errors since the Link 'class' can't be found in cl_admin.lua.[/QUOTE] Yeah everything was working fine, added the extra hud thing, everything on that works just fine but for some reason !admin is not working now :| edit: So I went in the cl_admin, and the error is coming from "net.Receive( Link.Protocol2, ReceiveGrab )" What is wrong there?
[QUOTE=qTY3;47150133]Yeah everything was working fine, added the extra hud thing, everything on that works just fine but for some reason !admin is not working now :| edit: So I went in the cl_admin, and the error is coming from "net.Receive( Link.Protocol2, ReceiveGrab )" What is wrong there?[/QUOTE] Like I just said, cl_admin.lua is working fine, it jsut can't find the 'Link' class, which is created in cl_receive.lua. If it doesn't exist at all, it means you have syntax errors in your cl_receive.lua, not in cl_admin.lua, just like another error, occurring before the one you pasted, says.
hey grav im having an issue with banned players being able to spam chat with their ban reason and being disconnected after joining how would i go about fixing this? [url]http://facepunch.com/showthread.php?t=1451274&p=47141100#post47141100[/url]
[QUOTE='[pG]Jailbreak;47150247']hey grav im having an issue with banned players being able to spam chat with their ban reason and being disconnected after joining how would i go about fixing this? [url]http://facepunch.com/showthread.php?t=1451274&p=47141100#post47141100[/url][/QUOTE] That also happens to us XD We havent banned much people though so its not a huge problem for us :p
Sorry, you need to Log In to post a reply to this thread.