• Print

Author Topic: How to Read From the Ban List  (Read 7241 times)

0 Members and 1 Guest are viewing this topic.

Offline [?B][F.F.M.]General Reidmaster

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
How to Read From the Ban List
« on: January 13, 2015, 08:56:06 pm »
So I am implementing a team ban for a jailbreak server and I have run into an issue, I don't have any clue how to read from a ban list file. What I ended up doing was making a modified version of the ulx.ban command to output to a file called guardban.txt but I have no idea how to read from the file to check if a person should be able to join the Guard team. Any ideas?

Also, if there is an easier way it would be greatly appreciated if you would tell me.

(If you need the code I will upload it, but it really isn't that much different from the ulx.ban command.)
« Last Edit: January 13, 2015, 08:58:07 pm by [?B][F.F.M.]General Reidmaster »

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: How to Read From the Ban List
« Reply #1 on: January 14, 2015, 03:50:08 am »
Hello,
I highly advise against modifing the ulib code, use this function instead to get a list of the bans: ULib.bans, it returns a table.
You then could do something like:

Code: [Select]
if ULib.bans[SteamIDOfPlayer] then
...
end

Cheers,
Avoid

Offline [?B][F.F.M.]General Reidmaster

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: How to Read From the Ban List
« Reply #2 on: January 14, 2015, 08:10:16 am »
Hello,
I highly advise against modifing the ulib code, use this function instead to get a list of the bans: ULib.bans, it returns a table.
You then could do something like:

Code: [Select]
if ULib.bans[SteamIDOfPlayer] then
...
end

Cheers,
Avoid

Cool, thanks!

(Also, to clarify, I didn't actually modify the ulx.ban command. I copied all of the functions necessary to make it work and made a new command ulx.guardban.)

Offline [?B][F.F.M.]General Reidmaster

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: How to Read From the Ban List
« Reply #3 on: January 14, 2015, 11:19:43 am »
So what file is ULib.bans created? Because every time I try and change the name it throws an error;

[ERROR] addons/ulx/lua/ulx/modules/sh/jailbreak2.lua:87: attempt to index field 'guardbans' (a nil value)
  1. call - addons/ulx/lua/ulx/modules/sh/jailbreak2.lua:87
   2. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
    3. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
     4. Run - lua/includes/modules/concommand.lua:69
      5. unknown - addons/ulib/lua/ulib/shared/commands.lua:1310
       6. unknown - lua/includes/modules/concommand.lua:69

Here is what I have so far, but I have a feeling that I am missing something.
Code: Lua
  1. CATEGORY_NAME = "Jailbreak"
  2.  
  3. //Ban Guard
  4. function ulx.guardban( calling_ply, target_ply, minutes, reason )
  5.  
  6.         ULib.guardBan( target_ply, minutes, reason, calling_ply )
  7.  
  8.         local time = "for #i minute(s)"
  9.         if minutes == 0 then time = "permanently" end
  10.         local str = "#A banned #T " .. time
  11.         if reason and reason ~= "" then str = str .. " (#s)" end
  12.         ulx.fancyLogAdmin( calling_ply, str, target_ply, minutes ~= 0 and minutes or reason, reason )
  13. end
  14. local guardban = ulx.command( CATEGORY_NAME, "ulx guardban", ulx.guardban, "!guardban" )
  15. guardban:addParam{ type=ULib.cmds.PlayerArg }
  16. guardban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0, invisible=true }
  17. guardban:defaultAccess( ULib.ACCESS_ADMIN )
  18. guardban:help( "Bans targeted player from the Guard team." )
  19.  
  20. function ULib.guardBan( ply, time, reason, admin )
  21.         if not time or type( time ) ~= "number" then
  22.                 time = 0
  23.         end
  24.  
  25.         ULib.addGuardBan( ply:SteamID(), time, reason, ply:Name(), admin )
  26.  
  27.         -- Load our currently banned users so we don't overwrite them
  28.         if ULib.fileExists( "cfg/banned_user.cfg" ) then
  29.                 ULib.execFile( "cfg/banned_user.cfg" )
  30.         end
  31. end
  32.  
  33. function ULib.addGuardBan( steamid, time, reason, name, admin )
  34.         local strTime = time ~= 0 and string.format( "for %s minute(s)", time ) or "permanently"
  35.         local showReason = string.format( "Banned %s: %s", strTime, reason )
  36.         local GUARD_BANS_FILE = "data/ulib/guardBans.txt"
  37.  
  38.         local players = player.GetAll()
  39.         for i=1, #players do
  40.                 if players[ i ]:SteamID() == steamid then
  41.                         if (players[ i ]:Team() == TEAM_GUARD || players[ i ]:Team() == TEAM_GUARD_DEAD) then
  42.                                 forcechangeteam( admin, players[ i ] )
  43.                         end
  44.                 end
  45.         end
  46.  
  47.         local admin_name
  48.         if admin then
  49.                 admin_name = "(Console)"
  50.                 if admin:IsValid() then
  51.                         admin_name = string.format( "%s(%s)", admin:Name(), admin:SteamID() )
  52.                 end
  53.         end
  54.  
  55.         local t = {}
  56.         if ULib.bans[ steamid ] then
  57.                 t = ULib.bans[ steamid ]
  58.                 t.modified_admin = admin_name
  59.                 t.modified_time = os.time()
  60.         else
  61.                 t.admin = admin_name
  62.         end
  63.         t.time = t.time or os.time()
  64.         if time > 0 then
  65.                 t.unban = ( ( time * 60 ) + os.time() )
  66.         else
  67.                 t.unban = 0
  68.         end
  69.         if reason then
  70.                 t.reason = reason
  71.         end
  72.         if name then
  73.                 t.name = name
  74.         end
  75.         ULib.bans[ steamid ] = t
  76.         ULib.fileWrite( GUARD_BANS_FILE, ULib.makeKeyValues( ULib.bans ) )
  77. end
  78.  
  79. //Unban Guard
  80. function ulx.unguardban( calling_ply, target_ply )
  81.         steamid = target_ply:SteamID()
  82.         if not ULib.isValidSteamID( steamid ) then
  83.                 ULib.tsayError( calling_ply, "Invalid steamid." )
  84.                 return
  85.         end
  86.  
  87.         name = ULib.bans[ steamid ] and ULib.bans[ steamid ].name
  88.  
  89.         ULib.unGuardBan( steamid )
  90.         if name then
  91.                 ulx.fancyLogAdmin( calling_ply, "#A unbanned steamid #s", steamid .. " (" .. name .. ")" )
  92.         else
  93.                 ulx.fancyLogAdmin( calling_ply, "#A unbanned steamid #s", steamid )
  94.         end
  95. end
  96. local unguardban = ulx.command( CATEGORY_NAME, "ulx unguardban", ulx.unguardban )
  97. unguardban:addParam{ type=ULib.cmds.PlayerArg }
  98. unguardban:defaultAccess( ULib.ACCESS_ADMIN )
  99. unguardban:help( "Unbans steamid." )
  100.  
  101. function ULib.unGuardBan( steamid )
  102.         local GUARD_BANS_FILE = "data/ulib/guardbans.txt"
  103.  
  104.         if ULib.fileExists( "cfg/banned_user.cfg" ) then
  105.                 ULib.execFile( "cfg/banned_user.cfg" )
  106.         end
  107.         ULib.queueFunctionCall( game.ConsoleCommand, "removeid " .. steamid .. ";writeid\n" ) -- Execute after done loading bans
  108.  
  109.         ULib.bans[ steamid ] = nil
  110.         ULib.fileWrite( GUARD_BANS_FILE, ULib.makeKeyValues( ULib.bans ) )
  111. end
  112.  
  113. //Refresh Guard Bans
  114. function ULib.refreshGuardBans()
  115.         local GUARD_BANS_FILE = "data/ulib/guardbans.txt"
  116.  
  117.         local err
  118.         if not ULib.fileExists( GUARD_BANS_FILE ) then
  119.                 ULib.bans = {}
  120.         else
  121.                 ULib.bans, err = ULib.parseKeyValues( ULib.fileRead( GUARD_BANS_FILE ) )
  122.         end
  123.  
  124.         if err then
  125.                 Msg( "Bans file was not formatted correctly. Attempting to fix and backing up original\n" )
  126.                 if err then
  127.                         Msg( "Error while reading bans file was: " .. err .. "\n" )
  128.                 end
  129.                 Msg( "Original file was backed up to " .. ULib.backupFile( GUARD_BANS_FILE ) .. "\n" )
  130.                 ULib.bans = {}
  131.         end
  132.  
  133.         local default_bans = ""
  134.         if ULib.fileExists( "cfg/banned_user.cfg" ) then
  135.                 ULib.execFile( "cfg/banned_user.cfg" )
  136.                 ULib.queueFunctionCall( game.ConsoleCommand, "writeid\n" )
  137.                 default_bans = ULib.fileRead( "cfg/banned_user.cfg" )
  138.         end
  139.  
  140.         --default_bans = ULib.makePatternSafe( default_bans )
  141.         default_bans = string.gsub( default_bans, "banid %d+ ", "" )
  142.         default_bans = string.Explode( "\n", default_bans:gsub( "\r", "" ) )
  143.         local ban_set = {}
  144.         for _, v in pairs( default_bans ) do
  145.                 if v ~= "" then
  146.                         ban_set[ v ] = true
  147.                         if not ULib.bans[ v ] then
  148.                                 ULib.bans[ v ] = { unban = 0 }
  149.                         end
  150.                 end
  151.         end
  152.  
  153.         for k, v in pairs( ULib.bans ) do
  154.                 if type( v ) == "table" and type( k ) == "string" then
  155.                         local time = ( v.unban - os.time() ) / 60
  156.                         if time > 0 then
  157.                                 game.ConsoleCommand( string.format( "banid %f %s\n", time, k ) )
  158.                         elseif math.floor( v.unban ) == 0 then -- We floor it because GM10 has floating point errors that might make it be 0.1e-20 or something dumb.
  159.                                 if not ban_set[ k ] then
  160.                                         ULib.bans[ k ] = nil
  161.                                 end
  162.                         else
  163.                                 ULib.bans[ k ] = nil
  164.                         end
  165.                 else
  166.                         Msg( "Warning: Bad ban data is being ignored, key = " .. tostring( k ) .. "\n" )
  167.                         ULib.bans[ k ] = nil
  168.                 end
  169.         end
  170.  
  171.         -- We're queueing this because it will split the load out for VERY large ban files
  172.         ULib.queueFunctionCall( function() ULib.fileWrite( GUARD_BANS_FILE, ULib.makeKeyValues( ULib.bans ) ) end )
  173. end
  174. ULib.pcallError( ULib.refreshBans )
  175.  
  176. function forcechangeteam( calling_ply, target_ply )
  177.         if ulx.getExclusive( target_ply, calling_ply ) then
  178.                 ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true );
  179.         else                   
  180.                 if (target_ply:Team() == TEAM_PRISONER) then
  181.                         result = TEAM_GUARD;
  182.                 elseif (target_ply:Team() == TEAM_PRISONER_DEAD) then
  183.                         result = TEAM_GUARD_DEAD;
  184.                 elseif (target_ply:Team() == TEAM_GUARD) then
  185.                         result = TEAM_PRISONER;
  186.                 elseif (target_ply:Team() == TEAM_GUARD_DEAD) then
  187.                         result = TEAM_PRISONER_DEAD;
  188.                 end
  189.  
  190.                 if (result) then
  191.                         if (result == TEAM_GUARD or result == TEAM_PRISONER) then
  192.                                 target_ply.jb_ForceAlive = true;
  193.                         end
  194.  
  195.                         target_ply:SetTeam(result);
  196.                         target_ply:Spawn();
  197.  
  198.                         GAMEMODE:Notify(calling_ply:Name().." has force-swapped "..target_ply:Name()..".");
  199.                 else
  200.                         GAMEMODE:Notify("Couldn't find a team for "..target_ply:Name()..".", target_ply);
  201.                 end
  202.         end
  203. end
  204.  

-Edit-
Please keep in mind that I only have a rough idea of how ulx/ULib work since they are such large programs.
« Last Edit: January 14, 2015, 11:25:30 am by [?B][F.F.M.]General Reidmaster »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: How to Read From the Ban List
« Reply #4 on: January 14, 2015, 08:38:25 pm »
Your error doesn't match with the code you posted (no call to "guardbans"). Are you sure you were running the latest version of what you had written?
Experiencing God's grace one day at a time.

Offline [?B][F.F.M.]General Reidmaster

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: How to Read From the Ban List
« Reply #5 on: January 15, 2015, 08:12:43 am »
Your error doesn't match with the code you posted (no call to "guardbans"). Are you sure you were running the latest version of what you had written?

The error is when I change the name of ULib.bans to ULib.guardbans.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: How to Read From the Ban List
« Reply #6 on: January 15, 2015, 04:06:48 pm »
Can you explain to us how you're going about renaming it?
Are you just editing the text "ULib.bans" and changing it to "ULib.guardbans"?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline [?B][F.F.M.]General Reidmaster

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: How to Read From the Ban List
« Reply #7 on: January 15, 2015, 07:58:11 pm »
Can you explain to us how you're going about renaming it?
Are you just editing the text "ULib.bans" and changing it to "ULib.guardbans"?

Yeah, that was all I was doing. But I think I figured it out.
"ULib.pcallError( ULib.refreshBans )"
I think that because I forgot to rename the function here that that was causing problems.

Now my only problem is that whenever the lua file is run (whether it be on save or map load) it overwrites the guardbanlist.txt with a blank line for some reason.

Code: Lua
  1. CATEGORY_NAME = "Jailbreak"
  2.  
  3. local GUARD_BANS_FILE = "data/ulib/guardbans.txt"
  4.  
  5. //Ban Guard
  6. function ulx.guardban( calling_ply, target_ply, minutes, reason, should_unguardban )
  7.         if not should_unguardban then
  8.                 if !ULib.guardbans[ target_ply:SteamID() ] then
  9.                         ULib.guardBan( target_ply, minutes, reason, calling_ply )
  10.  
  11.                         local time = "for #i minute(s)"
  12.                         if minutes == 0 then time = "permanently" end
  13.                         local str = "#A banned #T " .. time
  14.                         if reason and reason ~= "" then str = str .. " (#s)" end
  15.                        
  16.                         GAMEMODE:Notify("You have been banned from the Guard team.", target_ply)
  17.                 end
  18.         elseif ULib.guardbans[ target_ply:SteamID() ] then
  19.                 steamid = target_ply:SteamID()
  20.                 if not ULib.isValidSteamID( steamid ) then
  21.                         ULib.tsayError( calling_ply, "Invalid steamid." )
  22.                         return
  23.                 end
  24.  
  25.                 name = ULib.guardbans[ steamid ] and ULib.guardbans[ steamid ].name
  26.  
  27.                 ULib.unGuardBan( steamid )
  28.                
  29.                 GAMEMODE:Notify("You have been unbanned from the Guard team.", target_ply)
  30.         end
  31. end
  32. local guardban = ulx.command( CATEGORY_NAME, "ulx guardban", ulx.guardban, "!guardban" )
  33. guardban:addParam{ type=ULib.cmds.PlayerArg }
  34. guardban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0, invisible=true }
  35. guardban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons, invisible=true }
  36. guardban:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  37. guardban:defaultAccess( ULib.ACCESS_ADMIN )
  38. guardban:help( "Bans targeted player from the Guard team." )
  39. guardban:setOpposite( "ulx unguardban", {_, _, _, _, true}, "!unguardban" )
  40.  
  41. function ULib.guardBan( ply, time, reason, admin )
  42.         if not time or type( time ) ~= "number" then
  43.                 time = 0
  44.         end
  45.  
  46.         ULib.addGuardBan( ply:SteamID(), time, reason, ply:Name(), admin )
  47.  
  48.         -- Load our currently banned users so we don't overwrite them
  49.         if ULib.fileExists( "cfg/guard_banned_user.cfg" ) then
  50.                 ULib.execFile( "cfg/guard_banned_user.cfg" )
  51.         end
  52. end
  53.  
  54. function ULib.addGuardBan( steamid, time, reason, name, admin )
  55.         local strTime = time ~= 0 and string.format( "for %s minute(s)", time ) or "permanently"
  56.         local showReason = string.format( "Banned %s: %s", strTime, reason )
  57.  
  58.         local players = player.GetAll()
  59.         for i=1, #players do
  60.                 if players[ i ]:SteamID() == steamid then
  61.                         if (players[ i ]:Team() == TEAM_GUARD || players[ i ]:Team() == TEAM_GUARD_DEAD) then
  62.                                 forcechangeteam( admin, players[ i ] )
  63.                         end
  64.                 end
  65.         end
  66.  
  67.         local admin_name
  68.         if admin then
  69.                 admin_name = "(Console)"
  70.                 if admin:IsValid() then
  71.                         admin_name = string.format( "%s(%s)", admin:Name(), admin:SteamID() )
  72.                 end
  73.         end
  74.  
  75.         local t = {}
  76.         if ULib.guardbans[ steamid ] then
  77.                 t = ULib.guardbans[ steamid ]
  78.                 t.modified_admin = admin_name
  79.                 t.modified_time = os.time()
  80.         else
  81.                 t.admin = admin_name
  82.         end
  83.         t.time = t.time or os.time()
  84.         if time > 0 then
  85.                 t.unban = ( ( time * 60 ) + os.time() )
  86.         else
  87.                 t.unban = 0
  88.         end
  89.         if reason then
  90.                 t.reason = reason
  91.         end
  92.         if name then
  93.                 t.name = name
  94.         end
  95.         ULib.guardbans[ steamid ] = t
  96.         ULib.fileWrite( GUARD_BANS_FILE, ULib.makeKeyValues( ULib.guardbans ) )
  97. end
  98.  
  99. function ULib.unGuardBan( steamid )
  100.         if ULib.fileExists( "cfg/guard_banned_user.cfg" ) then
  101.                 ULib.execFile( "cfg/guard_banned_user.cfg" )
  102.         end
  103.         ULib.queueFunctionCall( game.ConsoleCommand, "removeid " .. steamid .. ";writeid\n" ) -- Execute after done loading bans
  104.  
  105.         ULib.guardbans[ steamid ] = nil
  106.         ULib.fileWrite( GUARD_BANS_FILE, ULib.makeKeyValues( ULib.guardbans ) )
  107. end
  108.  
  109. //Refresh Guard Bans
  110. function ULib.refreshGuardBans()
  111.         local err
  112.         if not ULib.fileExists( GUARD_BANS_FILE ) then
  113.                 ULib.guardbans = {}
  114.         else
  115.                 ULib.guardbans, err = ULib.parseKeyValues( ULib.fileRead( GUARD_BANS_FILE ) )
  116.         end
  117.  
  118.         if err then
  119.                 Msg( "Bans file was not formatted correctly. Attempting to fix and backing up original\n" )
  120.                 if err then
  121.                         Msg( "Error while reading bans file was: " .. err .. "\n" )
  122.                 end
  123.                 Msg( "Original file was backed up to " .. ULib.backupFile( GUARD_BANS_FILE ) .. "\n" )
  124.                 ULib.guardbans = {}
  125.         end
  126.  
  127.         local default_bans = ""
  128.         if ULib.fileExists( "cfg/guard_banned_user.cfg" ) then
  129.                 ULib.execFile( "cfg/guard_banned_user.cfg" )
  130.                 ULib.queueFunctionCall( game.ConsoleCommand, "writeid\n" )
  131.                 default_bans = ULib.fileRead( "cfg/guard_banned_user.cfg" )
  132.         end
  133.  
  134.         --default_bans = ULib.makePatternSafe( default_bans )
  135.         default_bans = string.gsub( default_bans, "banid %d+ ", "" )
  136.         default_bans = string.Explode( "\n", default_bans:gsub( "\r", "" ) )
  137.         local ban_set = {}
  138.         for _, v in pairs( default_bans ) do
  139.                 if v ~= "" then
  140.                         ban_set[ v ] = true
  141.                         if not ULib.guardbans[ v ] then
  142.                                 ULib.guardbans[ v ] = { unban = 0 }
  143.                         end
  144.                 end
  145.         end
  146.  
  147.         for k, v in pairs( ULib.guardbans ) do
  148.                 if type( v ) == "table" and type( k ) == "string" then
  149.                         local time = ( v.unban - os.time() ) / 60
  150.                         if time > 0 then
  151.                                 //game.ConsoleCommand( string.format( "banid %f %s\n", time, k ) )
  152.                         elseif math.floor( v.unban ) == 0 then -- We floor it because GM10 has floating point errors that might make it be 0.1e-20 or something dumb.
  153.                                 if not ban_set[ k ] then
  154.                                         ULib.guardbans[ k ] = nil
  155.                                 end
  156.                         else
  157.                                 ULib.guardbans[ k ] = nil
  158.                         end
  159.                 else
  160.                         Msg( "Warning: Bad ban data is being ignored, key = " .. tostring( k ) .. "\n" )
  161.                         ULib.guardbans[ k ] = nil
  162.                 end
  163.         end
  164.  
  165.         -- We're queueing this because it will split the load out for VERY large ban files
  166.         ULib.queueFunctionCall( function() ULib.fileWrite( GUARD_BANS_FILE, ULib.makeKeyValues( ULib.guardbans ) ) end )
  167. end
  168. ULib.pcallError( ULib.refreshGuardBans )
  169.  
  170. function forcechangeteam( calling_ply, target_ply )
  171.         if ulx.getExclusive( target_ply, calling_ply ) then
  172.                 ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true );
  173.         else                   
  174.                 if (target_ply:Team() == TEAM_PRISONER) then
  175.                         result = TEAM_GUARD;
  176.                 elseif (target_ply:Team() == TEAM_PRISONER_DEAD) then
  177.                         result = TEAM_GUARD_DEAD;
  178.                 elseif (target_ply:Team() == TEAM_GUARD) then
  179.                         result = TEAM_PRISONER;
  180.                 elseif (target_ply:Team() == TEAM_GUARD_DEAD) then
  181.                         result = TEAM_PRISONER_DEAD;
  182.                 end
  183.  
  184.                 if (result) then
  185.                         if (result == TEAM_GUARD or result == TEAM_PRISONER) then
  186.                                 target_ply.jb_ForceAlive = true;
  187.                         end
  188.  
  189.                         target_ply:SetTeam(result);
  190.                         target_ply:Spawn();
  191.  
  192.                         GAMEMODE:Notify(calling_ply:Name().." has force-swapped "..target_ply:Name()..".");
  193.                 else
  194.                         GAMEMODE:Notify("Couldn't find a team for "..target_ply:Name()..".", target_ply);
  195.                 end
  196.         end
  197. end
  198.  
  199. function ulx.outputguardban(calling_ply)
  200.         t  = ULib.fileRead( GUARD_BANS_FILE )
  201.         p = ULib.parseKeyValues( ULib.fileRead( GUARD_BANS_FILE ) )
  202.        
  203.         calling_ply:PrintMessage(HUD_PRINTCONSOLE, "\nList of Banned Guards:")
  204.         //calling_ply:PrintMessage(HUD_PRINTCONSOLE, t)
  205.         for k, v in pairs(p) do
  206.                 calling_ply:PrintMessage(HUD_PRINTCONSOLE, k)
  207.         end
  208. end
  209. local outputguardban = ulx.command( CATEGORY_NAME, "ulx outputguardban", ulx.outputguardban, "!outputguardban" )
  210. outputguardban:defaultAccess( ULib.ACCESS_ADMIN )
  211.  
  212. function checkBanList(target_ply)
  213.         isNotInTable = true
  214.                
  215.         for k, v in pairs (ULib.guardbans) do
  216.                 if(k == target_ply:SteamID()) then
  217.                         print(k)
  218.                         isNotInTable = false
  219.                 end
  220.         end
  221.        
  222.         print(isNotInTable)
  223.        
  224.         return isNotInTable
  225. end
  226.  
« Last Edit: January 15, 2015, 09:02:49 pm by [?B][F.F.M.]General Reidmaster »

  • Print