mob/var
muted = 0
mob/verb/OOC(t as text)
world<<"<b>[src]:</b> [t]"
if(usr.muted = 1)
alert("You Are Muted")
if(usr.muted = 0)
mob/owner/verb
Mute( mob/M in world)
usr.muted=1
Problem description: it says its an invalid expresion
ID:143378
Sep 26 2007, 9:34 am
|
|
Code:
mob/var Problem description: it says its an invalid expresion |
In response to DivineO'peanut
|
|
that didnt work?????
|
In response to DivineO'peanut
|
|
Might also help if you use comparison operators, rather than single equal signs.
if(usr.muted == 1) One equal sign sets the value equal to something, two checks to see if the arguments are equal. The invalid expression error is occurring because you have nothing happening after your second if statement. Add a world << "\[OOC\][usr]:[t]" and see if that helps you out. |
In response to Evre
|
|
LIKE THAT?????
mob/verb/OOC(t as text) |
In response to Chrislee123
|
|
You still aren't fixing your if statements. Two equal signs, not one. But yes, that's closer to what I was saying. Basically DM was complaining because your second if statement was empty so it didn't know what to do with it.
|
Chrislee123 wrote:
Code: > mob/var bad mob/var a little better |
In response to Evre
|
|
oh kk is that it??? because it works
mob/verb/OOC(t as text) |
In response to Chrislee123
|
|
It's not pretty, but it's functional. There are some other posts that show more efficient or readable code in this thread, you may want to look at some of them.
|
In response to Evre
|
|
Learn about boolean variables. Vars that will either return TRUE or FALSE aka 1 and 0, and only those are called boolean variables. To make things easier to read and to save space, you should do them as followed.
if(var) is the same as if(var == 1) and if(!var) is the same as if(var == 0) |
Chrislee123 wrote:
Code: > mob/var Problem description: it says its an invalid expresion mob/owner/verb/Mute( mob/M in world) You might want to fix that ;) |
What you want is
I think.