ID:141046
 
Code:
var/list/html = list("<",">","font","size","nigger","nigga","http","\\","www.","byond:\\")
mob/var
spam=0
mob/proc
Spam(T as text, var/list/S)
for(var/O in S)
if(findtext(T,S))
src<<"SPAMMAH!"
// src.spam=1
mob/verb/OOC(T as text)
set category = "Commands"
set desc = "Send a message to the world"
if(src.muted == 1 && ismuted==1)
src <<"You are muted"
if(length(T) >= 300)
alert("Message is too long")
else
src.Spam(T, html)
if(src.spam==0)
world << "[usr.organization_name_html]<font color = blue>{[usr.Village]}<font color = red>[usr.name]OOC:<font color = white> [T]"
else
src.spam=0


Problem description:Basicly, it doesn't work. If I activate the src.spam=1 it simply doesn't show a message.Image Hosted by ImageShack.us

PS:What is the difference in using usr and src in this case ? =S
First: if you're going to post a list of bad words on the forum, you really need to censor it. And it should be byond:// instead of byond:\\ but I'd suggest just filtering out :// entirely. Smileys be damned.

Next: This is not how you'd do this. If you want to know if a message is spam, your Spam() proc should RETURN a value to let you know. IE: return 1 if it's spam, return 0 if it's not. Then, you'd do this:

if(Spam(message))
usr << "that was spam"
else
world << message


Anyway, for your problem: you're calling findtext(T,S), but S is a list, not an element in the list.
In response to Garthor
How ?
In response to Cybork
use the 'return' keyword, with a value to represent true/false respectively.
In response to Cybork
mob/proc
Spam(T as text, var/list/S)
for(var/O in S)
// if(findtext(T,S)) // S is not a value on the list, it's the list itself
if(findtext(T,O)) // change S with O..
src<<"SPAMMAH!"
return 1 // if it already found something no need to let it continue looping. returns 1 because it found spam, if it doesn't find anything it returns null by default

// change your ooc verb, like Garthor said:

if(Spam(message,html)) // if the proc returns 1 (see above)
usr << "that was spam"
else // if it didn't return 1, let the message through
world << message