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]
[QUOTE=Busymonkey;27817453]Please, for the love of god - stop creating threads. Just create one big thread and ask all your questions in that thread.[/QUOTE]
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]
[QUOTE=toaster468;27825549]The console command "banid" already does this.[/QUOTE]
and no it dosnt work i have tryed =/
[editline]3rd February 2011[/editline]
[QUOTE=zzaacckk;27825439][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][/QUOTE]
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
[QUOTE=JonBons;27835774]This should fix it, the concommand was being run on a player.
(Untested)
[code]
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)
[/code][/QUOTE]
Do i place this code in init.lua or cl_init.lua
[QUOTE=BananasRP;27835864]Do i place this code in init.lua or cl_init.lua[/QUOTE]
Do you understand the difference between server and client? If not, I suggest you read up. Init.lua.
[QUOTE=JonBons;27835774]This should fix it, the concommand was being run on a player.
(Untested)
[code]
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)
[/code][/QUOTE]
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.
[QUOTE=Goz3rr;27836285]You shouldn't put it in a random init.lua
Place it in lua/autorun/idban.lua[/QUOTE]
It doesn't matter where the code is added, so long as it is being loaded (in an autorun script or gamemode)
Sorry, you need to Log In to post a reply to this thread.