• Prop Hunt Scoreboard Ranks
    11 replies, posted
Anyone know who to make the Prop Hunt (Hide And Seek) Scoreboard Show ranks? If so that would be great to help :)
This isn't a [I]"make me stuff for free"[/I] forum.
[QUOTE=EvacX;43442909]This isn't a [I]"make me stuff for free"[/I] forum.[/QUOTE] I'm asking if anyone can point me in a direction to go :P I use this in my sb_row.lua for my TTT server scoreboard, I was asking to see if this could convert to Prop Hunt somehow. if ply:IsUserGroup("owner") then self.cols[5]:SetText("Owner") self.cols[5]:SetTextColor(Color(0,255,0)) end if ply:IsUserGroup("superadmin") then self.cols[5]:SetText("SuperAdmin") self.cols[5]:SetTextColor(Color(204,102,0)) end if ply:IsUserGroup("coder") then self.cols[5]:SetText("Coder") self.cols[5]:SetTextColor(Color(255,255,255)) end if ply:IsUserGroup("user") then self.cols[5]:SetText("User") self.cols[5]:SetTextColor(Color(255,0,255)) end if ply:IsUserGroup("co-manager") then self.cols[5]:SetText("Co-Manager") self.cols[5]:SetTextColor(Color(255,128,0)) end if ply:IsUserGroup("senior staff") then self.cols[5]:SetText("Senior Staff ") self.cols[5]:SetTextColor(Color(0,127,255)) end if ply:IsUserGroup("moderator") then self.cols[5]:SetText("Moderator") self.cols[5]:SetTextColor(Color(0,0,255)) end if ply:IsUserGroup("admin") then self.cols[5]:SetText("Admin") self.cols[5]:SetTextColor(Color(0,100,255)) end if ply:IsUserGroup("staff manager") then self.cols[5]:SetText("Staff Manager ") self.cols[5]:SetTextColor(Color(255,128,0)) end if ply:IsUserGroup("impeached") then self.cols[5]:SetText("Impeached") self.cols[5]:SetTextColor(Color(0,127,127)) end if ply:IsUserGroup("respected") then self.cols[5]:SetText("Respected") self.cols[5]:SetTextColor(Color(255,0,0)) end
Prop Hunt uses Fretta as a base doesn't it? While this isn't a forum where we make stuff for free, I know fretta isn't well documented anymore and I can give a push in the right direction. Go into gamemodes/fretta, open up cl_scores. This lua file is what sets up the columns for the fretta scoreboard. Scroll down and you'll see various stuff like [code]function GM:AddScoreboardPing( ScoreBoard ) local f = function( ply ) return ply:Ping() end ScoreBoard:AddColumn( "Ping", 50, f, 0.1, nil, 6, 6 ) end [/code] or [code]function GM:AddScoreboardDeaths( ScoreBoard ) local f = function( ply ) return ply:Deaths() end ScoreBoard:AddColumn( "Deaths", 50, f, 0.5, nil, 6, 6 ) end [/code] Basically, grab one of these functions and let's use it as a template, so we get something like: [code]function GM:AddScoreboardRanks( ScoreBoard ) local f = function( ply ) return ply:EV_GetRank() end ScoreBoard:AddColumn( "Rank", 50, f, 0.5, nil, 6, 6 ) end [/code] However, you can see I've done 'ply:EV_GetRank()', which is the way Evolve gets player ranks. You no-doubtably are using ULX, but I've never used that so I can't tell how it gets ranks and what YOU will need to change this to. Now, lastly, scroll down to the end of the cl_scores file, to the CreateScoreboard function and underneath some stuff you'll see; [code] self:AddScoreboardAvatar( ScoreBoard ) // 1 self:AddScoreboardWantsChange( ScoreBoard ) // 2 self:AddScoreboardName( ScoreBoard ) // 3 self:AddScoreboardKills( ScoreBoard ) // 4 self:AddScoreboardDeaths( ScoreBoard ) // 5 self:AddScoreboardPing( ScoreBoard ) // 6 [/code] You'll need to add your AddScoreboardRanks or whatever you've decided to call it here. Deepening on where you place it here, is where it'll show up in-game. So if you want it after the username you would do: [code] self:AddScoreboardAvatar( ScoreBoard ) self:AddScoreboardRanks( ScoreBoard ) self:AddScoreboardWantsChange( ScoreBoard ) // 2 self:AddScoreboardName( ScoreBoard ) // 3 self:AddScoreboardKills( ScoreBoard ) // 4 self:AddScoreboardDeaths( ScoreBoard ) // 5 self:AddScoreboardPing( ScoreBoard ) // 6 [/code] This won't do anything fancy like colours, it'll just be white, but it's a very vague idea on how to get what you want.
Okay, Thanks For The Help, but now it shows in the rank column as False Here is the configured areas with ULX Get function GM:AddScoreboardRanks( ScoreBoard ) local f = function( ply ) return ply:IsUserGroup() end ScoreBoard:AddColumn( "Rank", 50, f, 0.5, nil, 6, 6 ) end self:AddScoreboardAvatar( ScoreBoard ) // 1 self:AddScoreboardWantsChange( ScoreBoard ) // 2 self:AddScoreboardName( ScoreBoard ) // 3 self:AddScoreboardRanks( ScoreBoard ) // 4 self:AddScoreboardKills( ScoreBoard ) // 5 self:AddScoreboardDeaths( ScoreBoard ) // 6 self:AddScoreboardPing( ScoreBoard ) // 7 // Here we sort by these columns (and descending), in this order. You can define up to 4 ScoreBoard:SetSortColumns( { 4, true, 5, false, 3, false } ) end Any ideas how to fix False problem?
[QUOTE=Handsome Matt;43453475]You didn't tell us what the problem is, but you've got a syntax error there with that random end after ScoreBoard:AddColumn( "Rank", 50, f, 0.5, nil, 6, 6 )[/QUOTE] It's part of a bigger function; [code]function GM:CreateScoreboard( ScoreBoard ) // This makes it so that it's behind chat & hides when you're in the menu // Disable this if you want to be able to click on stuff on your scoreboard ScoreBoard:ParentToHUD() ScoreBoard:SetRowHeight( 32 ) ScoreBoard:SetAsBullshitTeam( TEAM_SPECTATOR ) ScoreBoard:SetAsBullshitTeam( TEAM_CONNECTING ) ScoreBoard:SetShowScoreboardHeaders( GAMEMODE.TeamBased ) if ( GAMEMODE.TeamBased ) then ScoreBoard:SetAsBullshitTeam( TEAM_UNASSIGNED ) ScoreBoard:SetHorizontal( true ) end ScoreBoard:SetSkin( GAMEMODE.HudSkin ) self:AddScoreboardAvatar( ScoreBoard ) // 1 self:AddScoreboardWantsChange( ScoreBoard ) // 2 self:AddScoreboardName( ScoreBoard ) // 3 self:AddScoreboardPoints( ScoreBoard ) // 6 Taken from my files and something I did self:AddScoreboardKills( ScoreBoard ) // 4 self:AddScoreboardDeaths( ScoreBoard ) // 5 self:AddScoreboardPing( ScoreBoard ) // 6 // Here we sort by these columns (and descending), in this order. You can define up to 4 ScoreBoard:SetSortColumns( { 4, true, 5, false, 3, false } ) end[/code] I'm not entirely sure why this wouldn't work; can you show us what your screenshot currently looks like?
Here is the screenshot, hope it helps :/ [url]http://steamcommunity.com/sharedfiles/filedetails/?id=213939982[/url]
Ah, right, okay. I've used this method to set up Pointshop points on the scoreboard meaning I know it works, so could the issue be something ULX related? I honestly don't know the admin mod well enough to give much help from here, sorry
Okay, you helped me get this far, just need that last 1% to make the rank show right :)
Instead of adding new lines for each rank just use [code] ply:GetNWString("usergroup") [/code]
[QUOTE=BoowmanTech;43453771]Instead of adding new lines for each rank just use [code] ply:GetNWString("usergroup") [/code][/QUOTE] Thanks Boowman :D Works Great :)
Sorry, you need to Log In to post a reply to this thread.