Im trying to code it so if the eye client is on a certain mob you get a verb...my code is:
if(usr.client.eye == mob/units/soldiers/Commander/)
Return_to_char()
usr.client.eye = usr
Why doesnt it work? should i make a variable and have it check that instead? Thanks in advance!
-Crio
ID:176337
![]() Jan 23 2003, 12:59 pm
|
|
Indenting is covered in every beginner tutorial. If you don't understand it, go back and read the tutorials again.
It also depends on what else you've put there. Show me the code around that part and I'll be able to correct it for you. |
Use your eyes! Actually take the time to READ my posts, goddamnit!
Crispy wrote: It also depends on what else you've put there. <font color=white>Show me the code around that part</font> and I'll be able to correct it for you. Sheesh. I don't know why I bother. |
mob |
You have to put statements INSIDE procs/verbs. They simply do not work outside of them. Duh.
<code>verb Return_to_char() if(usr.client.eye == mob/units/soldiers/Commander/) usr.client.eye = usr</code> There, now it's indented properly. I haven't fixed the problem you originally posted about - you should have enough brains to work it out from the instructions I gave you in [link] |
it says this in my dream maker:
mob but i dont like posting every bit of my coding |
verb
if(istype(usr.client.eye,/mob/units/soldiers/Commander)) Return_to_char() usr.client.eye = usr This above is incorrect. Why? You have an if above the proc! This is correct: verb Return_to_char() if(istype(usr.client.eye,/mob/units/soldiers/Commander)) usr.client.eye = usr try that. should compile just fine. |
Why does everyone seem to have this problem?
You're trying to compare the client's eye (which is assigned to an atom), to a type path. You can't. They're completely different concepts.
What you want to do is find out whether the eye is set to a certain TYPE of atom:
<code>if(istype(usr.client.eye,/mob/units/soldiers/ Commander))</code>
You also have an indentation problem there.