Author Topic: ULX Team Ban Command  (Read 1804 times)

0 Members and 2 Guests are viewing this topic.

Offline lubricantjam

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
ULX Team Ban Command
« on: August 08, 2014, 12:43:27 AM »
How would I go across banning a player from a team for a certain amount of round or forever? I have a command which swaps them to the other team but I cannot suss it out. Could someone please help?

Code: [Select]
// Prisoner //
function ulx.prisoner( calling_ply, target_plys )
for i=1, #target_plys do
for n=#GAMEMODE.GuardQueue,1,-1 do
if GAMEMODE.GuardQueue[n]==target_plys[i] then table.remove( GAMEMODE.GuardQueue, n ) end
end
end

ulx.fancyLogAdmin( calling_ply, "#A has forced #T to Prisoner next round", target_plys )

GAMEMODE:UpdateGuardQueue()
end

local fprisoner = ulx.command( CATEGORY_NAME, "ulx prisoner", ulx.prisoner, "!prisoner" )
fprisoner:addParam{ type=ULib.cmds.PlayersArg }
fprisoner:defaultAccess( ULib.ACCESS_ADMIN )
fprisoner:help( "Forces the target(s) to join the Prisoner team." )

The teams are as followed;

TEAM_PRISONER = Prisoners
TEAM_JAILOR = Guards

I need a command for only guard ban. If they tried to join that team it would display a message like "Sorry, you are banned form this team for X rounds/forever."

If someone could help me out, you would be a life saver. I've tried so many possibilities but they haven't worked as I am not good on LUA.

Thanks,
Lubricant Jam.

Offline bender180

  • Full Member
  • ***
  • Posts: 217
  • Karma: 42
    • Benders Villa
Re: ULX Team Ban Command
« Reply #1 on: August 11, 2014, 02:09:33 PM »
I suggest the use of pdata as it is stored by the server and can be checked and changed on the fly. I would create and example but id need to see the gamemode for a better idea first.
Made community pool and community bowling and for the life of me couldn't tell you why they are popular.
Also made the ttt ulx commands.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Team Ban Command
« Reply #2 on: August 11, 2014, 05:40:53 PM »
May I also suggest different terminology? I saw "ulx team ban" in the topic title and thought, before reading your post, you wanted to ban a team using ULX.
Now that I've read your description, I see you're wanting to prevent team changing, ie, team lock, etc.
ULX team change (lock-out/prevention/disallow)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming