admin steam ID Banner

Can somone make me a quick Steam ID banner system?

with a console command like: idban [STEAMID] [MINS] [REASON]

If you are intrested add me:

username: Halo2mods

Please, for the love of god - stop creating threads. Just create one big thread and ask all your questions in that thread.

Doesn’t the already made “banid” do this?

[editline]2nd February 2011[/editline]

Also; Please just try and give him some help, there is no rule I see that says asking questions is wrong.

[lua]
function BanPlayer(ply, cmd, args)
if ply:IsAdmin() then ply:ConCommand("banid "…args[1],args[2],args[3]) end
for a,b in pairs(player.GetAll()) do
if b:SteamID() == args[1] then
ply:ConCommand("kickid "…args[1],args[3])
end
end
end
concommand.Add(“idban”,BanPlayer)
[/lua]

-snip-

The console command “banid” already does this.

nvm foudn it

[editline]3rd February 2011[/editline]

and no it dosnt work i have tryed =/

[editline]3rd February 2011[/editline]

This dosnt work.

and it has to be with RCON.

the error it gives is like. “Unable to connect to remote server”

Doesn’t*.

Also, the Unable to connect to remote server… I wonder if that is the lua, or your REMOTE SERVER.

This should fix it, the concommand was being run on a player.
(Untested)
[lua]
function BanPlayer(ply, cmd, args)
if !ply:IsAdmin() then return end
if !args[1] or !args[2] or !args[3] then
ply:ChatPrint(“Missing arguments!”)
return
end

local steamid = args[1]
local time = args[2]
local reason = args[3]
for k, v in pairs(player.GetAll()) do
    if v:SteamID() == steamid then
        RunConsoleCommand("banid", time, v:SteamID())
        v:Kick(reason)
    end
end

end
concommand.Add(“idban”,BanPlayer)
[/lua]
Goes in autorun/server/idban.lua

Do i place this code in init.lua or cl_init.lua

Do you understand the difference between server and client? If not, I suggest you read up. Init.lua.

This code dosnt work.

i placed it in init.lua and typed idban steamID mins reason and it didnt work

[editline]3rd February 2011[/editline]

BTW guys, BanID DOSNT WORK

You shouldn’t put it in a random init.lua

Place it in lua/autorun/idban.lua

I believe banid is for the server, banid2 is the command that admins can use.

It doesn’t matter where the code is added, so long as it is being loaded (in an autorun script or gamemode)