ID:176631
 
How do i make it so that you cant enter if your not in the guild? My code is:
area
mage_guild
Entered(M.client)
if(usr.mageguild == 1)
...()
else
usr << "Only mage guild members can enter!

How would i make it block so you cant get in?
Koolguy900095 wrote:
How do i make it so that you cant enter if your not in the guild? My code is:
area
mage_guild
<font color="red">Enter</font>(M.client)
if(usr.mageguild == 1)
...()
else
usr << "Only mage guild members can enter!

How would i make it block so you cant get in?
In response to Soccerguy13
Ah yes, because Entered checks after the player has entered the area. Enter checks when they first try to.
In response to Soccerguy13
Now it stops both. If the var is 0 it works grat but if its 1 then it doesnt say anything but you cant go in...
Koolguy900095 wrote:
How do i make it so that you cant enter if your not in the guild? My code is:
area
mage_guild
Enter(mob/M)
if(M.mageguild == 1)
...()
else
M << "Only mage guild members can enter!
return 0
How would i make it block so you cant get in?

I had some problems formatting this. DM and code tags seemed to work a little funny, either way, thats what your code should look like.


~Polatrite~
In response to Polatrite
i get a runtime error saying:

runtime error: bad proc
proc name: Enter (/area/mage_guild/Enter)
source file: icon.dm,11
usr: Koolguy900095 (/mob/mage)
src: the mage guild (/area/mage_guild)
call stack:
the mage guild (/area/mage_guild): Enter(Koolguy900095 (/mob/mage))
Koolguy900095 (/client): North()
Never use usr in Enter() or Entered(), it can mess up your game bigtime.

For more info see Dream Tutor: usr Unfriendly
In response to Polatrite
Whoops, Polatrite. :-)

<code>area mage_guild Enter(mob/M) if(M.mageguild == 1) .=..() //Two dots, not three. //You also have to set the return value, not just call the parent. else M << "Only mage guild members can enter!" return 0</code>