ID:177671
 
Need ban code mine won't work this stupid guy King trunks is breaking game rules.
Codesterz wrote:
Need ban code mine won't work this stupid guy King trunks is breaking game rules.

I've seen you ask for 'a <something> code' atleast a dozen times within the last week. You cannot compose a game entirely of other peoples' code, unless you want to end up with ineffecient, uncompatible, code that you can't understand. And since you can't understand it, you can't modify it properly, and so you end up with a static game. If anything goes wrong, you won't know where or why it happened, either.

Its fine to ask for a way to do something, but asking for code is NOT what this forum was designed for. Please take the time to read through the provided material on this site that people have taken many hours to compose for people new to the language, instead of simply asking for 'the code' every single time you need to add to your game.

Alathon\\
In response to Alathon
This was a spur of a moment thing. My ban code didn't work. I had some guy come in breaking game rules swearing and giving me an everyone else a hard time.
Sorry. I'm also pretty new at coding. At have strong points and weak points. My weak points used to be making skills like mining and fishing but I can do that np. My new weak point is save systems, bans, and other GM powers.
In response to Codesterz
Instead of asking on the forums every time you have a problem, try thinking to yourself about what you want to do.

Think exactly -what- you want the game to do, and how you can do it with what you know so far.

Now for a ban system, I presume you want to run a command which will kick that user off of the game, then make sure he doesn't come back.

<ban proc here>
<get rid of that usr>
<add him to a list of banned usrs>
<if they come back>
<get rid of them>
In response to Nathias
var/list/banned = list()

world/New()
..()
var/savefile/s = new("Ban.txt")
s >> banned
world/Del()
..()
var/savefile/s = new("Ban.txt")
s << banned
mob/verb/Ban(mob/M as mob in world)
if(M == src || !M.client)
return
else
banned.Add(M.client.address, M.ckey)
del(M)
mob/Login(mob/M)
if(banned.Find(M.ckey) && !banned.Find(M.client.address))
banned.Add(M.client.address)
del(M)
else if(banned.Find(M.client.address) && !banned.Find(M.ckey))
del(M)
else if(banned.Find(M.client.address) && banned.Find(M.ckey))
del(M)
else
return ..()

Try something like that.
You can use world.SetConfig to write to a pre-made key ban and IP ban file. All you do is delete the offender, and call SetConfig accordingly. For more information, look at the reference.