ID:146598
 
Code:
mob/verb/say(msg as text)
if(src.no_talking == 1)
usr << "You are muted."
count_again++
if(count_again == 5)
usr << "You are now spamming and will be banned."
Banned.Add(src.key)
del src


Problem description:Right there where it says Banned.Add(src.key), well, it's not working. I need the person's key added to the Banned list. Why does it refuse to work. Why?

It would help us greatly if you showed us how you initialized the list.
I'd help you, but then I'd be helping a stupid idea.

You are banning someone for typing fast. Stupid.

-Ryan
Here i set this code up for you... also on a note i have it set up to where if it doesnt find a Bannedlist on world creation it creates a blank one... if 1 isnt created(such as you take out that part of the code and dont make load from a save file or something)this code wont work. On another not. im just helping cause im nice you shouldnt ban people for spamming after there muted o.O since nobody else is hearing what there saying.

world/New()
if (!length(Bannedlist)) Bannedlist=list()

mob/var
spamcount = 0
no_talking = 1

var/Bannedlist[]

client/New()
..()
if (Bannedlist.Find(ckey))
src << "You have been banned from this game!"
del src

mob/proc
countagain(mob/M)
spamcount++


mob/verb/say(msg as text)
var/ckey = ckey(src.key,)
if(src.no_talking)
usr << "You are muted."
countagain()
usr << "You currently have tried talking while muted [usr.spamcount] times. If this reaches 5 you will be auto banned."
if(spamcount >= 5)
usr << "You are now spamming and will be banned!"
Bannedlist.Add(ckey)
del src
if(src.no_talking == 0)
world << "[usr]:[msg]"

I also have this set up to where the users key is saved in ckey format. that helps with problems using just key can create later on.
In response to Itachi1
just dont forget not to use ==19if(src.no_talking == 1)
use if(src.no_talking)
In response to TKo38
oops my bad. ill edit that now
That's a very bad idea for the exact same reason Ryne stated, becouse like me I type considerably fast, correct, not always but I try ;).



~C
In response to Ryne Rekab
Actually, I was fixin' on changing it so that if they spam while being muted, causing an error about 20 times, then they would be banned.
In response to SSJ2GohanDBGT
Ok, I initilized the list as follows
var/list/Banned = list("MasterLordLink")
In response to Itachi1
Thank you Itachi.
In response to Itachi1
You're using Find() incorrectly. You should use in stead! </bad pun>