Author Topic: Jailbreak force swap ULX  (Read 2612 times)

0 Members and 1 Guest are viewing this topic.

Offline Aeioyoo

  • Newbie
  • *
  • Posts: 6
  • Karma: -1
Jailbreak force swap ULX
« on: October 25, 2015, 11:55:46 PM »
Where do I set which ULX groups can force swap players teams in the Tab menu in Jailbreak by Excl?

Thanks!
« Last Edit: October 26, 2015, 07:57:43 PM by JamminR »

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Jailbreak force swap ULX
« Reply #1 on: October 25, 2015, 11:59:36 PM »
In the permissions under each group in the groups tab.
Once you get to know me, you'll find you'll have never met me at all.

Offline Aeioyoo

  • Newbie
  • *
  • Posts: 6
  • Karma: -1
Re: Jailbreak force swap ULX
« Reply #2 on: October 26, 2015, 12:01:09 AM »
I looked in the XGUI group tab and cant find it anywhere? Whats it under?

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Jailbreak force swap ULX
« Reply #3 on: October 26, 2015, 01:21:11 PM »
In the permissions under each group in the groups tab.

Excl's Jailbreak does not check for ULX permissions for the tab menu forceswap. It just runs LocalPlayer():IsAdmin(). You could change this to look for a ULX permission, using ULib.ucl.query( player, permission ).

The code you want to change is on line 127 in gamemodes/jailbreak/gamemode/core/cl_scoreboard.lua
« Last Edit: October 26, 2015, 07:57:58 PM by JamminR »
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Jailbreak force swap ULX
« Reply #4 on: October 26, 2015, 07:56:51 PM »
Or you could just have the command run as intended, for admins only, and give those who you trust with admin access the admin group.
Don't just give that out frivolously though. Admin access to a server can kill a server if someone wasn't properly responsible.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Buzzkill

  • Respected Community Member
  • Full Member
  • *****
  • Posts: 176
  • Karma: 59
    • The Hundred Acre Bloodbath
Re: Jailbreak force swap ULX
« Reply #5 on: October 27, 2015, 11:42:44 AM »
Not a true swap, but something to work with anyway...

Code: [Select]
------------------------------ Make Prisoner------------------------------
function ulx.makeprisoner( calling_ply, target_plys )
local affected_plys = {}

for i=1, #target_plys do
local v = target_plys[ i ]

if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
//elseif not v:Alive() then
// ULib.tsayError( calling_ply, v:Nick() .. " is already dead!", true )
elseif v:IsFrozen() then
ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
else
v:KillSilent()
v:SetTeam(TEAM_PRISONER)
v.AllowRespawn = true
v:Spawn();
table.insert( affected_plys, v )
end
end

ulx.fancyLogAdmin( calling_ply, "#A changed the team of #T", affected_plys )
end
local makeprisoner = ulx.command( CATEGORY_NAME, "ulx makeprisoner", ulx.makeprisoner, "!makeprisoner" )
makeprisoner:addParam{ type=ULib.cmds.PlayersArg }
makeprisoner:defaultAccess( ULib.ACCESS_ADMIN )
makeprisoner:help( "Changes the team of the target(s) to prisoner." )

------------------------------ Make Guard ------------------------------
function ulx.makeguard( calling_ply, target_plys )
local affected_plys = {}

for i=1, #target_plys do
local v = target_plys[ i ]

if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
//elseif not v:Alive() then
// ULib.tsayError( calling_ply, v:Nick() .. " is already dead!", true )
elseif v:IsFrozen() then
ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
else
v:KillSilent()
v:SetTeam(TEAM_GUARD)
v.AllowRespawn = true
v:Spawn();
table.insert( affected_plys, v )
end
end

ulx.fancyLogAdmin( calling_ply, "#A changed the team of #T", affected_plys )
end
local makeguard = ulx.command( CATEGORY_NAME, "ulx makeguard", ulx.makeguard, "!makeguard" )
makeguard:addParam{ type=ULib.cmds.PlayersArg }
makeguard:defaultAccess( ULib.ACCESS_ADMIN )
makeguard:help( "Changes the team of the target(s) to prisoner." )

------------------------------ Make Warden ------------------------------
function ulx.makewarden( calling_ply, target_plys )
local affected_plys = {}

for i=1, #target_plys do
local v = target_plys[ i ]

if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
elseif not v:Alive() then
ULib.tsayError( calling_ply, v:Nick() .. " is already dead!", true )
elseif v:IsFrozen() then
ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
else

local warden=JB.TRANSMITTER:GetJBWarden()
if IsValid(warden) then
warden:RemoveWardenStatus();
table.insert( affected_plys, warden )
end

v:KillSilent()
v:SetTeam(TEAM_GUARD)
v.AllowRespawn = true
v:Spawn();
v:AddWardenStatus();
table.insert( affected_plys, v )
end
end

ulx.fancyLogAdmin( calling_ply, "#A forced warden #T", affected_plys )
end
local makewarden = ulx.command( CATEGORY_NAME, "ulx makewarden", ulx.makewarden, "!makewarden" )
makewarden:addParam{ type=ULib.cmds.PlayersArg }
makewarden:defaultAccess( ULib.ACCESS_ADMIN )
makewarden:help( "Force warden of the target(s)." )