• TTT scoreboard administration
    46 replies, posted
Hey there, Seen someone trying to sell a similar script on coderhire and as it only took about 5 minutes to code I thought I would post it here for free as the price being charged is about 500% more than it is worth. It is made for ULX but is easily edited to other admin tools Find the following line in your sb_row.lua (gamemodes/terrortown/gamemode/vgui) [CODE]function PANEL:DoRightClick()[/CODE] And right under it add the following (before the end) [CODE] local ply = self.Player if LocalPlayer():IsAdmin() or LocalPlayer():IsSuperAdmin() then surface.PlaySound("buttons/button9.wav") local options = DermaMenu() options:AddOption("Copy Name", function() SetClipboardText(ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/user_edit.png") options:AddOption("Copy SteamID", function() SetClipboardText(ply:SteamID()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png") options:AddSpacer() options:AddOption("Open Profile", function() ply:ShowProfile() surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/world.png") options:AddSpacer() if IsValid(ply) then local adminop,subimg = options:AddSubMenu("Admin") subimg:SetImage("icon16/lorry.png") adminop:AddOption("Slay Next Round", function() RunConsoleCommand("ulx","slaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png") adminop:AddOption("Slay Now", function() RunConsoleCommand("ulx","slay",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cut_red.png") adminop:AddOption("Kick", function() RunConsoleCommand("ulx","kick",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/door_out.png") adminop:AddOption("Ban", function() RunConsoleCommand("ulx","ban",ply:Nick(),120,"You were banned") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/delete.png") adminop:AddSpacer() adminop:AddOption("Mute", function() RunConsoleCommand("ulx","mute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_yellow.png") adminop:AddOption("Gag", function() RunConsoleCommand("ulx","gag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_orange.png") adminop:AddSpacer() adminop:AddOption("Spectate", function() RunConsoleCommand("ulx","spectate",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png") adminop:AddSpacer() options:Open() end end[/CODE] If you need any help don't hesitate to ask. Screenshot: [url]http://cloud-2.steampowered.com/ugc/595884953676336705/D351AB1C58E976FA69221B0B4E83961FA846B0FD/[/url] For the Slay Next Round command to work please install the following script aswell: [url]http://www.zombiemaster.org/smf/index.php?topic=12617.0[/url] EDIT: just to be clear. This is my own script. The one on coderhire is different but similar to this.
Can you post screenshots?
Sure, I will add one now.
its the exact code this is iligal
What are you talking about. If you even look at the images of the script on coderhire it is different...
Thanks for the screenshot
Looks like you have a lot more options too! thanks OP.
[QUOTE=Apozen;41723979]Looks like you have a lot more options too! thanks OP.[/QUOTE] Mine has more options for staff and users, but the scripts are similar. Nice job anyway an.droid, doesn't really bother me
[QUOTE=Aj;41727307]Mine has more options for staff and users, but the scripts are similar. Nice job anyway an.droid, doesn't really bother me[/QUOTE] Ungag user: [code]adminop:AddOption("Ungag", function() RunConsoleCommand("ulx","ungag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_orange.png")[/code] Unmute user: [code]adminop:AddOption("Unmute", function() RunConsoleCommand("ulx","unmute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_orange.png")[/code] Will work on adding pop up boxes to add in ban length and reason
I really couldn't care, if you are trying to prove something you are wasting your time with that aspect of it.
The reason I am doing this is because you post on almost EVERY script on coderhire bashing scripters for having a high price on their script because it wouldn't take them long when you have done the exact same thing here. You even got backlash on your original price for being too high. That is my reason for posting this. That and I am a believer in open source.
Thanks heaps, might put it on mine.
Is there a way to make the id/name/profile available to everyone and the admin menu available to X ranks only? (Not that the script itself isn't a HUGE help and I appreciate it very much, but i'd like it to be useful to normal users too if possible)
[QUOTE=sid ashley;41731461]Is there a way to make the id/name/profile available to everyone and the admin menu available to X ranks only?[/QUOTE] [lua]local ply = self.Player if IsValid(ply) then surface.PlaySound("buttons/button9.wav") local options = DermaMenu() options:AddOption("Copy Name", function() SetClipboardText(ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/user_edit.png") options:AddOption("Copy SteamID", function() SetClipboardText(ply:SteamID()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png") options:AddSpacer() options:AddOption("Open Profile", function() ply:ShowProfile() surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/world.png") options:AddSpacer() if IsValid(ply) && LocalPlayer():IsAdmin() or LocalPlayer():IsSuperAdmin() then local adminop,subimg = options:AddSubMenu("Admin") subimg:SetImage("icon16/lorry.png") adminop:AddOption("Slay Next Round", function() RunConsoleCommand("ulx","slaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png") adminop:AddOption("Slay Now", function() RunConsoleCommand("ulx","slay",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cut_red.png") adminop:AddOption("Kick", function() RunConsoleCommand("ulx","kick",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/door_out.png") adminop:AddOption("Ban", function() RunConsoleCommand("ulx","ban",ply:Nick(),120,"You were banned") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/delete.png") adminop:AddSpacer() adminop:AddOption("Mute", function() RunConsoleCommand("ulx","mute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_yellow.png") adminop:AddOption("Gag", function() RunConsoleCommand("ulx","gag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_orange.png") adminop:AddSpacer() adminop:AddOption("Spectate", function() RunConsoleCommand("ulx","spectate",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png") adminop:AddSpacer() options:Open() end end[/lua]
Where would you get the "slay next round" command from? I've been looking for it and with it, this scoreboard thing would be very helpful!
Here is a script that has it. I will include it in my op [url]http://www.zombiemaster.org/smf/index.php?topic=12617.0[/url]
[QUOTE=an.droid;41723318]Hey there, Seen someone trying to sell a similar script on coderhire and as it only took about 5 minutes to code I thought I would post it here for free as the price being charged is about 500% more than it is worth. It is made for ULX but is easily edited to other admin tools Find the following line in your sb_row.lua (gamemodes/terrortown/gamemode/vgui) [CODE]function PANEL:DoRightClick()[/CODE] And right under it add the following (before the end) [CODE] local ply = self.Player if LocalPlayer():IsAdmin() or LocalPlayer():IsSuperAdmin() then surface.PlaySound("buttons/button9.wav") local options = DermaMenu() options:AddOption("Copy Name", function() SetClipboardText(ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/user_edit.png") options:AddOption("Copy SteamID", function() SetClipboardText(ply:SteamID()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png") options:AddSpacer() options:AddOption("Open Profile", function() ply:ShowProfile() surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/world.png") options:AddSpacer() if IsValid(ply) then local adminop,subimg = options:AddSubMenu("Admin") subimg:SetImage("icon16/lorry.png") adminop:AddOption("Slay Next Round", function() RunConsoleCommand("ulx","slaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png") adminop:AddOption("Slay Now", function() RunConsoleCommand("ulx","slay",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cut_red.png") adminop:AddOption("Kick", function() RunConsoleCommand("ulx","kick",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/door_out.png") adminop:AddOption("Ban", function() RunConsoleCommand("ulx","ban",ply:Nick(),120,"You were banned") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/delete.png") adminop:AddSpacer() adminop:AddOption("Mute", function() RunConsoleCommand("ulx","mute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_yellow.png") adminop:AddOption("Gag", function() RunConsoleCommand("ulx","gag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_orange.png") adminop:AddSpacer() adminop:AddOption("Spectate", function() RunConsoleCommand("ulx","spectate",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png") adminop:AddSpacer() options:Open() end end[/CODE] If you need any help don't hesitate to ask. Screenshot: [url]http://cloud-2.steampowered.com/ugc/595884953676336705/D351AB1C58E976FA69221B0B4E83961FA846B0FD/[/url] For the Slay Next Round command to work please install the following script aswell: [url]http://www.zombiemaster.org/smf/index.php?topic=12617.0[/url] EDIT: just to be clear. This is my own script. The one on coderhire is different but similar to this.[/QUOTE] Wow, I coded something similar to this about 2 weeks ago for a TTT Server. :v:
how would i make it display the rank on the scoreboard like u have?
[QUOTE=ghostpanda;41744009]how would i make it display the rank on the scoreboard like u have?[/QUOTE] [url]http://www.zombiemaster.org/smf/index.php?topic=12370.0[/url]
[QUOTE=smithy285;41744606][url]http://www.zombiemaster.org/smf/index.php?topic=12370.0[/url][/QUOTE] i downloaded both files, now i have the rank section but it says my rank is Guest even though im admin..
[QUOTE=ghostpanda;41745291]i downloaded both files, now i have the rank section but it says my rank is Guest even though im admin..[/QUOTE] You need to set the ranks up with your ranks
[QUOTE=ghostpanda;41745291]i downloaded both files, now i have the rank section but it says my rank is Guest even though im admin..[/QUOTE] What Panda said, open up the sb_row.lua file and take a look at lines 199 - 227, you should be able to work out how to set it up from there. If you need anymore help I would recommend creating your own thread to not derail this thread anymore.
I've tried mounting this feature, but then this happened: [url]http://i.imgur.com/c34xjsi.jpg[/url] Here's line 85 of sb_team.lua: [lua] function PANEL:AddPlayerRow(ply) if ScoreGroup(ply) == self.group and not self.rows[ply] then local row = vgui.Create("TTTScorePlayerRow", self) row:SetPlayer(ply) -- <<< This one self.rows[ply] = row self.rowcount = table.Count(self.rows) -- row:InvalidateLayout() -- must force layout immediately or it takes its sweet time to do so self:PerformLayout() --self:InvalidateLayout() end end[/lua]
Thank you , I have edited few lines (just remove the sound and change spectate to Force Spectator (Using ULX Commands for Trouble in Terrorist Town) ) and added in to my server! [CODE]adminop:AddOption("Force Spectator", function() RunConsoleCommand("ulx","fspec",ply:Nick()) end):SetImage("icon16/zoom.png")[/CODE]
Thanks for this code, It seems to work great on my DarkRP server.
[QUOTE=zerothefallen;41731481][lua]local ply = self.Player if IsValid(ply) then surface.PlaySound("buttons/button9.wav") local options = DermaMenu() options:AddOption("Copy Name", function() SetClipboardText(ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/user_edit.png") options:AddOption("Copy SteamID", function() SetClipboardText(ply:SteamID()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png") options:AddSpacer() options:AddOption("Open Profile", function() ply:ShowProfile() surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/world.png") options:AddSpacer() if IsValid(ply) && LocalPlayer():IsAdmin() or LocalPlayer():IsSuperAdmin() then local adminop,subimg = options:AddSubMenu("Admin") subimg:SetImage("icon16/lorry.png") adminop:AddOption("Slay Next Round", function() RunConsoleCommand("ulx","slaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png") adminop:AddOption("Slay Now", function() RunConsoleCommand("ulx","slay",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cut_red.png") adminop:AddOption("Kick", function() RunConsoleCommand("ulx","kick",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/door_out.png") adminop:AddOption("Ban", function() RunConsoleCommand("ulx","ban",ply:Nick(),120,"You were banned") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/delete.png") adminop:AddSpacer() adminop:AddOption("Mute", function() RunConsoleCommand("ulx","mute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_yellow.png") adminop:AddOption("Gag", function() RunConsoleCommand("ulx","gag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_orange.png") adminop:AddSpacer() adminop:AddOption("Spectate", function() RunConsoleCommand("ulx","spectate",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png") adminop:AddSpacer() options:Open() end end[/lua][/QUOTE] When I use this the menu when your guest comes up in the top left any fix?
[QUOTE=Ejbaker;41866201]When I use this the menu when your guest comes up in the top left any fix?[/QUOTE] I fixed this by allowing any user to use the admin menu. Even though they can see it, they cant run commands, so it's fine. It seems to be because it doesnt have a submenu for users.
Is it possible to replace the set ban time and have a DPanel come up and ask for a time and reason? Could anyone do this?
[QUOTE=DonutGirl;41902536]Is it possible to replace the set ban time and have a DPanel come up and ask for a time and reason? Could anyone do this?[/QUOTE] Yes you can, [CODE] adminop:AddOption("Ban", function() RunConsoleCommand("ulx","ban",ply:Nick(),###,"You were banned") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/delete.png") --Replace ### with the MIN of the ban. [/CODE] EDIT: I'm working on a full ban menu with diffrent times and reasons. Will include it in this post once its done.
I am getting this error: [code] [ERROR] gamemodes/terrortown/gamemode/vgui/sb_row.lua:312: attempt to perform arithmetic on global 'k' (a nil value) 1. LayoutColumns - gamemodes/terrortown/gamemode/vgui/sb_row.lua:312 2. UpdatePlayerData - gamemodes/terrortown/gamemode/vgui/sb_row.lua:268 3. SetPlayer - gamemodes/terrortown/gamemode/vgui/sb_row.lua:170 4. AddPlayerRow - gamemodes/terrortown/gamemode/vgui/sb_team.lua:85 5. UpdateScoreboard - gamemodes/terrortown/gamemode/vgui/sb_main.lua:279 6. Init - gamemodes/terrortown/gamemode/vgui/sb_main.lua:141 7. Create - lua/includes/extensions/client/panel/scriptedpanels.lua:153 8. ScoreboardCreate - gamemodes/terrortown/gamemode/cl_scoreboard.lua:27 9. unknown - gamemodes/terrortown/gamemode/cl_scoreboard.lua:34 [/code] Not sure why because I just copy/pasted your code where you said to: [code] function PANEL:DoRightClick() local ply = self.Player if LocalPlayer():IsAdmin() or LocalPlayer():IsSuperAdmin() then surface.PlaySound("buttons/button9.wav") local options = DermaMenu() options:AddOption("Copy Name", function() SetClipboardText(ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/user_edit.png") options:AddOption("Copy SteamID", function() SetClipboardText(ply:SteamID()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png") options:AddSpacer() options:AddOption("Open Profile", function() ply:ShowProfile() surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/world.png") options:AddSpacer() if IsValid(ply) then local adminop,subimg = options:AddSubMenu("Admin") subimg:SetImage("icon16/lorry.png") adminop:AddOption("Slay Next Round", function() RunConsoleCommand("ulx","slaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png") adminop:AddOption("Slay Now", function() RunConsoleCommand("ulx","slay",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cut_red.png") adminop:AddOption("Kick", function() RunConsoleCommand("ulx","kick",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/door_out.png") adminop:AddOption("Ban", function() RunConsoleCommand("ulx","ban",ply:Nick(),120,"You were banned") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/delete.png") adminop:AddSpacer() adminop:AddOption("Mute", function() RunConsoleCommand("ulx","mute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_yellow.png") adminop:AddOption("Gag", function() RunConsoleCommand("ulx","gag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/asterisk_orange.png") adminop:AddSpacer() adminop:AddOption("Spectate", function() RunConsoleCommand("ulx","spectate",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png") adminop:AddSpacer() options:Open() end end end [/code] Sorry this was not your fault! Fixed it.
Sorry, you need to Log In to post a reply to this thread.