ID:144875
 
Code:
//This is how I am doing it.
mob
verb
Say()
set category = "Utilities"
var/txt = input("What would you like to say to everyone in your view?", "View Chat") as null|text
if(usr.PlayerMute)
usr << "<B><font size = 1><font color = red>You have been muted."
return
else
Safe_Guard(view(6),"<b><font size = 1><font color = silver>(View Say) <font color = blue>[usr]: <font color = white>[SGS_Filter_txt(txt)]")


//this is the example on how to use it
mob/verb/Say(msg as text)
set category = "Communication"
Safe_Guard(world,SGS_Filter_txt(msg))


Problem description:
The Problem above is that the filter is preventing any text from coming through. The only reason I did it in that format is so that it could be used with Click() and as a verb. Also I want to be able to have the html for coloring. This is the Safe Guard Suite, by Darkness. Please post only if you know what the problem is. I don't have time for guesses. Thanks

-Diem
any ideas?
mob
verb
Say(text as text)
if(usr.mute == 1)
usr << "You are muted!"
else
veiw(6) << "[usr] says - [text]

im not sure if this will exactly help but now just add your safe guard thingy...this verb is a lil bit easier..
In response to Psycho8187
Little bit easier. More like woefully wrong. Please don't try and help people with your own rashly made snippets of code.
Really. Boolean variables!
// When checking TRUE/FALSE values (1 or 0)
if(var==1) // WRONG
if(var) // Right!

if(var==0) // WRONG
if(!var) // Right!


As for the topic starter ...

  • There is no reason to return, but still have an else statement after that if()
  • Major HTML problems there. You're opening 2 "font" tags, why not combine them? And also, don't put spaces infront and after the "=". Thus, <font color=red size=1>
  • I'd really use something else than Safeguard Suite. To be honest, what you make yourself is probably better, because you know for 100% what's in it and how it works.
  • Also, I just noticed. You really, really don't want to make a var AFTER the verb has been used. Make the var an argument. You'll see why in a mo'
mob/verb/Say()
var/msg=input("What do you wish to say?") as text
world<<"[usr]; [whateverfilter(msg)]"


Now, you know that handy balloon button in DreamSeeker next to your chatbar? It doesn't work. It does nothing. People will go; "wtf, why can't we use it?". It's because you're not using it as an argument which can be passed in a single line from that nifty orange/pink bar. Here's how, though;

mob/verb/Say(msg as text) // See! I'm plainly defining it here!!
world<<"[usr]; [whateverfilter(msg)]


In response to Mysame
No, your right you don't need the variable, but in order to call it using Click() on lets say a HUD. It makes since because for some reason it does not call it unless it's used as a variable.
In response to Diem
Ahh! Didn't know what you meant by that in the first post. Right. My bad ^^;

Though, it could work. =P

<code>.click Saybutton "Hello"</code>


Though, as I said, make your own filter. Much, much more convenient, and you'll learn more from it.
In response to Mysame
Ah, I will, and thanks for the help.