ASSMod, BanPlayer

I am making a warning system, so far, so good.
The only problem is that I cant get it to run ASS_BanPlayer
Because I am using ASS_BanPlayer(ply, ply:UniqueID(), 1440, “Warnings Exceeded: 1 day”)
it thinks the player is trying to ban him/herself
How can I specify console? BTW, Using CONSOLE instead of ply at the first argument didnt work either.

isnt assmod broke?

Use Player:Ban.

Don’t use RunConsoleCommand, cause that will be run on the client. :>

he doesn’t want to use Source’s shitty ban system

[lua]function ASS_ConsoleBanPlayer( UNIQUEID, TIME, REASON )

TIME = tonumber(TIME) or 0
if (#REASON == 0) then REASON = "Banned" end
local TO_BAN = ASS_FindPlayer(UNIQUEID)

if (!TO_BAN) then
	print("Player not found!")
	return
end
TO_BAN:SetUnBanTime( nil )
if (TIME > 0) then		
	TO_BAN:SetUnBanTime( timeAdd( TIME ) )
	ASS_LogAction( "Console", ASS_ACL_BAN_KICK, "banned " .. ASS_FullNick(TO_BAN) .. " for " .. TIME .. " minutes" )
else
	ASS_LogAction( "Console", ASS_ACL_BAN_KICK, "banned " .. ASS_FullNick(TO_BAN) .. " permanently" )
end
	TO_BAN:SetLevel(ASS_LVL_BANNED)
	ASS_SaveRankings()
if (!ASS_IsLan()) then
	asscmd.ConsoleCommand("banid " .. TIME .. " " .. TO_BAN:UserID() .. "

")
asscmd.ConsoleCommand("writeid
")
else
asscmd.ConsoleCommand("addip " … TIME … " " … TO_BAN:IPAddress() … "
")
asscmd.ConsoleCommand("writeip
")
end
asscmd.ConsoleCommand("kickid " … TO_BAN:UserID() … " “” … REASON … “”
")
end[/lua]

The function I just made should work, please tell me if there’s an error, because I just edited it on the fly.

Fixed with my l33t epic haxars skills

Player.Ban sucks asshole, plus, I made a forum linking addon that uses warnings for players MingeDMing
And players getting warnings from bans
5 warnings = perma

Works using SMF’s database, And is epic so far.

Correct, Source’s ban system fails, when a player connects to see if he is banned it only says
YOU ARE BANNED, HURR, NOT DISPLAYING TIEM :smiley:
And non-perma bans don’t save correctly/get removed on server crash

Thanks for that, trying now.
Also, try and use lua tags instead of code tags
Doesn’t work

OH, And I wanted to use ASS_BanPlayer because BanPlayer is overwritten by easyban, so.

I looked at the latest revision of Assmod, and I don’t see any hook called “WarningsCheck”

Shit sorry, I meant when my plugin calls the ASS_ConsoleBanPlayer thing, on that hook, it comes up as if assmod has that hook.

I just want something that will work with the original ASSMod, i.e:
ASS_BanPlayer
No mods…

Assmod works just fine without any edits last I checked which wasn’t to long ago. It was just the one from garrysmod.org so its not like it was new or anything.

I have a modified assmod so idk if its due to a recent update.

[lua]function ASS_ConsoleBanPlayer( UNIQUEID, TIME, REASON )
local msg
TIME = tonumber(TIME) or 0
if (#REASON == 0) then REASON = “Banned” end
local TO_BAN = ASS_FindPlayer(UNIQUEID)

if (!TO_BAN) then
	print("Player not found!")
	return
end
TO_BAN:SetUnBanTime( nil )
if (TIME > 0) then		
	TO_BAN:SetUnBanTime( timeAdd( TIME ) )
	msg = "Console banned " .. ASS_FullNick(TO_BAN) .. " for " .. TIME .. " minutes." 
else
	msg = "Console banned " .. ASS_FullNick(TO_BAN) .. " permanently!"
end
	for k,v in pairs(player.GetAll()) do
		if v:IsAdmin() then
			v:PrintMessage(HUD_PRINTTALK, msg)
		end
	end
	TO_BAN:SetLevel(ASS_LVL_BANNED)
	ASS_SaveRankings()
if (!ASS_IsLan()) then
	asscmd.ConsoleCommand("banid " .. TIME .. " " .. TO_BAN:UserID() .. "

")
asscmd.ConsoleCommand("writeid
")
else
asscmd.ConsoleCommand("addip " … TIME … " " … TO_BAN:IPAddress() … "
")
asscmd.ConsoleCommand("writeip
")
end
asscmd.ConsoleCommand("kickid " … TO_BAN:UserID() … " “” … REASON … “”
")

end[/lua]

Found out what the problem was, I don’t know any alternative to this, if you don’t want an edited function.

Could someone just give me a way to use the default BanPlayer and use CONSOLE as the ply argument?

bumpadump.

Get an admin mod that isnt 4 years old and not in active development, theres your fix.