• [stuck] Rules Section on Flood Gamemode
    11 replies, posted
[B]The error in this thread has been solved.[/B]
Use one of the newer versions. [url=http://www.garrysmod.org/downloads/?a=view&id=104935][img]http://www.garrysmod.org/img/?t=dll&id=104935[/img][/url]
The line positions are mispositioned. If you can provide us with the code we may be able to fix it.
[B]The error in this thread has been solved.[/B]
[QUOTE=Drew876567;27629628][code] self.HelpBackground = vgui.Create("DPanelList") --| self.HelpBackground:EnableVerticalScrollbar(False) --| self.HelpBackground:SetSize((self.ToolPanel:GetWide() - 10), self.ToolPanel:GetTall()) --| self.HelpBackground:SetPos(0, 0) --| self.HelpBackground.Paint = function() local Wide = self.HelpBackground:GetWide() local Height = self.HelpBackground:GetTall() local Title = "Server Rules:" local One = "Prop blocking, prop surfing, and prop pushing is not allowed." local Two = "Sticking or attaching props to the map is not allowed." local Three = "Speak and type in English at all times." local Four = "Chat spam, and microphone spam is not allowed." local Five = "Don't be disrespectful in any way to other players." local Six = "Anyone who discriminates against any player will be banned." local Seven = "No Arguing or causing a commotion with others players." local Eight = "As long as you are alive, you must be fire your weapon(s)." local Nine = "You may create teams up to three players. Each team can only have one boat." local Ten = "Creating alliances or truces with other players is not allowed." local Eleven = "No welding props in the air. It takes away the realism in the game." local Twelve = "You may not hop onto other people’s boats to survive." local Thirteen = "Sharks are allowed every two rounds. Only three props per shark." local Fourteen = "{If you wish to report a player breaking these rules, please visit our website, _______________}" local Fifteen = "Ignoring or disobeying these rules will result in a kick or ban. Moderator and Admin decisions are supreme." surface.SetDrawColor(50, 50, 50, 255) --| surface.DrawRect(0, 0, Wide, self.HelpBackground:GetTall())--| surface.SetTextColor(255, 255, 255, 255) --| surface.SetFont("Trebuchet20") --| local TitleW, TitleH = surface.GetTextSize(Title) surface.SetTextPos(((Wide*.5) - (TitleW*.5)), ((Height*.03) - (TitleH*.5))) --| surface.DrawText(Title) surface.SetFont("Default") --| local OneW, OneH = surface.GetTextSize(One) surface.SetTextPos(((Wide*.5) - (OneW*.5)), ((Height*.09) - (OneH*.5))) surface.DrawText(One) --| surface.SetFont("Default") --| local TwoW, TwoH = surface.GetTextSize(Two) surface.SetTextPos(((Wide*.5) - (TwoW*.5)), ((Height*.12) - (TwoH*.5))) surface.DrawText(Two) --| surface.SetFont("Default") --| local ThreeW, ThreeH = surface.GetTextSize(Three) surface.SetTextPos(((Wide*.5) - (ThreeW*.5)), ((Height*.15) - (ThreeH*.5))) surface.DrawText(Three) --| surface.SetFont("Default") --| local FourW, FourH = surface.GetTextSize(Four) surface.SetTextPos(((Wide*.5) - (FourW*.5)), ((Height*.18) - (FourH*.5))) surface.DrawText(Four) --| surface.SetFont("Default") --| local FiveW, FiveH = surface.GetTextSize(Five) surface.SetTextPos(((Wide*.5) - (FiveW*.5)), ((Height*.21) - (FiveH*.5))) surface.DrawText(Five) --| surface.SetFont("Default") --| local SixW, SixH = surface.GetTextSize(Six) surface.SetTextPos(((Wide*.5) - (SixW*.5)), ((Height*.24) - (SixH*.5))) surface.DrawText(Six) --| surface.SetFont("Default") --| local SevenW, SevenH = surface.GetTextSize(Seven) surface.SetTextPos(((Wide*.5) - (SevenW*.5)), ((Height*.24) - (SevenH*.5))) surface.DrawText(Seven) surface.SetFont("Default") --| local EightW, EightH = surface.GetTextSize(Eight) surface.SetTextPos(((Wide*.5) - (EightW*.5)), ((Height*.24) - (EightH*.5))) surface.DrawText(Eight) surface.SetFont("Default") --| local NineW, NineH = surface.GetTextSize(Nine) surface.SetTextPos(((Wide*.5) - (NineW*.5)), ((Height*.24) - (NineH*.5))) surface.DrawText(Nine) surface.SetFont("Default") --| local TenW, TenH = surface.GetTextSize(Ten) surface.SetTextPos(((Wide*.5) - (TenW*.5)), ((Height*.24) - (TenH*.5))) surface.DrawText(Ten) surface.SetFont("Default") --| local ElevenW, ElevenH = surface.GetTextSize(Eleven) surface.SetTextPos(((Wide*.5) - (ElevenW*.5)), ((Height*.24) - (ElevenH*.5))) surface.DrawText(Eleven) surface.SetFont("Default") --| local TwelveW, TwelveH = surface.GetTextSize(Twelve) surface.SetTextPos(((Wide*.5) - (TwelveW*.5)), ((Height*.24) - (TwelveH*.5))) surface.DrawText(Twelve) surface.SetFont("Default") --| local ThirteenW, ThirteenH = surface.GetTextSize(Thirteen) surface.SetTextPos(((Wide*.5) - (ThirteenW*.5)), ((Height*.24) - (ThirteenH*.5))) surface.DrawText(Thirteen) surface.SetFont("Default") --| local FourteenW, FourteenH = surface.GetTextSize(Fourteen) surface.SetTextPos(((Wide*.5) - (FourteenW*.5)), ((Height*.24) - (FourteenH*.5))) surface.DrawText(Fourteen) surface.SetTextColor(200, 25, 25, 255) surface.SetFont("Default") --| local FifteenW, FifteenH = surface.GetTextSize(Fifteen) surface.SetTextPos(((Wide*.5) - (FifteenW*.5)), ((Height*.27) - (FifteenH*.5))) surface.DrawText(Fifteen) --| surface.SetTextColor(255, 255, 255, 255) end[/code][/QUOTE] hahahaha what the fuck is this?
[QUOTE=deloc;27630214]hahahaha what the fuck is this?[/QUOTE] Not knowing how to use multi-line strings. :v:
Holy fuck that's an ugly piece of shit. I'm going to clean that up just because of how fucking ugly it looks. [editline]24th January 2011[/editline] Ok, untested, but should work. There may be a typo or two. [lua] self.HelpBackground.Rules = { "Prop blocking, prop surfing, and prop pushing is not allowed.", "Sticking or attaching props to the map is not allowed.", "Speak and type in English at all times.", "Chat spam, and microphone spam is not allowed.", "Don't be disrespectful in any way to other players.", "Anyone who discriminates against any player will be banned.", "No Arguing or causing a commotion with others players.", "As long as you are alive, you must be fire your weapon(s).", "You may create teams up to three players. Each team can only have one boat.", "Creating alliances or truces with other players is not allowed.", "No welding props in the air. It takes away the realism in the game.", "You may not hop onto other people’s boats to survive.", "Sharks are allowed every two rounds. Only three props per shark.", "{If you wish to report a player breaking these rules, please visit our website, _______________}", "Ignoring or disobeying these rules will result in a kick or ban. Moderator and Admin decisions are supreme." } self.HelpBackground.Paint = function() surface.SetDrawColor(50, 50, 50, 255) surface.DrawRect(0, 0, Wide, self.HelpBackground:GetTall()) surface.SetTextColor(255, 255, 255, 255) surface.SetFont( "Trebuchet20" ) self.HelpBackground.TW, self.HelpBackground.TH = surface.GetTextSize( "Server Rules:" ) surface.SetTextPos(self.HelpBackground:GetWide()*0.5 - self.HelpBackground.TW*0.5, 30) surface.DrawText( "Server Rules:" ) surface.SetFont( "Default" ) for k, v in pairs( self.HelpBackground.Rules ) do self.HelpBackground.TW, self.HelpBackground.TH = surface.GetTextSize( v ) surface.SetTextPos(self.HelpBackground:GetWide()*0.5 - self.HelpBackground.TW*0.5, 60+(k*25)) surface.DrawText( v ) end end [/lua] Just put it below self.BackgroundHelp:SetPos(0, 0) and get rid of the shitty old self.BackgroundHelp.Paint() function. [editline]24th January 2011[/editline] Oh, and to add more rules, just put it in that table. Don't forget your commas.
[B]The error in this thread has been solved.[/B]
Change self.Rules to self.HelpBackground.Rules.
[B]The error in this thread has been solved.[/B]
Mah bad. :v:
Sorry, you need to Log In to post a reply to this thread.