ID:143378
 
Code:
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

You have 1 tab too many in these lines:
        if(usr.muted = 1)
alert("You Are Muted")
if(usr.muted = 0)


What you want is
mob/verb/OOC(t as text)
world<<"<b>[src]:</b> [t]"
if(usr.muted = 1)
alert("You Are Muted")
if(usr.muted = 0)


I think.
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)
//as opposed to
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)
if(usr.muted = 1)
alert("You Are Muted")
if(usr.muted = 0)
world << "\[OOC\][usr]:[t]"
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
> 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
>



bad

mob/var
muted = 0

mob/verb/OOC(t as text)
if(usr.muted)
alert("You Are Muted")
else
world<<"<b>[src]:</b> [t]"

mob/owner/verb
Mute(mob/M in world)
M.muted=1


a little better
In response to Evre
oh kk is that it??? because it works

mob/verb/OOC(t as text)
if(usr.muted==1)
alert("You Are Muted")
if(usr.muted==0)
world << "\[OOC\][usr]:[t]"
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
> 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


mob/owner/verb/Mute( mob/M in world)
M.muted=1

You might want to fix that ;)