Garry's Mod

FAdmin to ULX scoreboard help?

Submitted by SuperSayin234, , Thread ID: 50856

Thread Closed
13-10-2017, 03:07 AM
#1
I'm using the tcb premium scoreboard that has functionality with FAdmin when right clicking on a player's name. Although, I don't use FAdmin for DarkRP, I use ULX because it's something I've always stuck to. I know there's a way to do it but I can't figure it out.

Code:
local gag, gag_pnl = Option:AddSubMenu( "Gag" )
gag_pnl:SetIcon( "icon16/sound.png" )

gag:AddOption( "Gag", function() RunConsoleCommand( "_FAdmin", "Voicemute", self.Player:UserID() ) end ):SetIcon( "icon16/sound_delete.png" )
gag:AddOption( "Ungag", function() RunConsoleCommand( "_FAdmin", "UnVoicemute", self.Player:UserID() ) end ):SetIcon( "icon16/sound_add.png" )
This is an example for the current Gag feature when right clicking. I want to know what I would need to remove or add to make it compatible with ULX.
NOTE: changing _FAdmin to ulx and Voicemute and UnVoicemute to gag and ungag don't work as they do not have a target to go to. I'm obviously doing something wrong because I don't have enough experience in LUA to make a change between two administration addons.
What do I do my guys?

RE: FAdmin to ULX scoreboard help?

#2
Please PM me and I will help you as soon as possible.

RE: FAdmin to ULX scoreboard help?

#3
13-10-2017, 03:07 AM
SuperSayin234 Wrote:
I'm using the tcb premium scoreboard that has functionality with FAdmin when right clicking on a player's name. Although, I don't use FAdmin for DarkRP, I use ULX because it's something I've always stuck to. I know there's a way to do it but I can't figure it out.

Code:
local gag, gag_pnl = Option:AddSubMenu( "Gag" )
gag_pnl:SetIcon( "icon16/sound.png" )

gag:AddOption( "Gag", function() RunConsoleCommand( "_FAdmin", "Voicemute", self.Player:UserID() ) end ):SetIcon( "icon16/sound_delete.png" )
gag:AddOption( "Ungag", function() RunConsoleCommand( "_FAdmin", "UnVoicemute", self.Player:UserID() ) end ):SetIcon( "icon16/sound_add.png" )
This is an example for the current Gag feature when right clicking. I want to know what I would need to remove or add to make it compatible with ULX.
NOTE: changing _FAdmin to ulx and Voicemute and UnVoicemute to gag and ungag don't work as they do not have a target to go to. I'm obviously doing something wrong because I don't have enough experience in LUA to make a change between two administration addons.
What do I do my guys?
?

RE: FAdmin to ULX scoreboard help?

OP
This post was last modified: 14-10-2017, 09:18 PM by SuperSayin234
#4
14-10-2017, 02:34 PM
LimeWar Wrote:
?

The scoreboard only supports FAdmin by default, and I'm trying to get it to ULX. The current code for each command was listed and I'm trying to figure out a way to make it into ULX.

I finally fixed my lines of code.
Previously it would look like:
Code:
gag:AddOption( "Gag", function() RunConsoleCommand( "_FAdmin", "Voicemute", self.Player:UserID() ) end ):SetIcon( "icon16/sound_delete.png" )
Although now, I have it fixed to look like:
Code:
gag:AddOption( "Gag", function() if not (IsValid(self.Player) or self.Player:IsValid()) then return end
LocalPlayer():ConCommand("ulx gag \"".. self.Player:Nick() .. "\"" ) end ):SetIcon( "icon16/email_delete.png" )
It took a lot of time but the similar lines can be used on any of the functions. Just make sure to replace all the "gag"s with whatever function you want.

RE: FAdmin to ULX scoreboard help?

#5
Please PM and help with you and this only scoreboard supports FAdmin

Users browsing this thread: 4 Guest(s)