ID:146612
 
I have a guild House problem when my guild works find but when my mate tries to go in he gets only guild members can enter when he has created that guild and when i try it does the same to me here is the codign

turf
guilddoor
icon = 'guilddoor.dmi'//place your own icon here
Enter(O)
if(ismob(O))
var/mob/M = O
if(M.guild == "Hell Fighters")
M.loc=locate(93,41,3)
else
M << "Only guild members are allowed to enter."
turf
guilddoor
icon = 'guilddoor.dmi'//place your own icon here
Enter(O)
if(ismob(O))
var/mob/M = O
if(M.guild == "Z Fighters")
M.loc=locate(36,59,3)
else
M << "Only guild members are allowed to enter."


How can this be fixed
if the guild name uses html then you should write the html name down
not the name that appears
I think thats you'r problem
In response to O-matic
O-matic wrote:
if the guild name uses html then you should write the html name down
not the name that appears
I think thats you'r problem

I did that and i got that error
guildhouse.dm:7:error: "><FONT COLOR=": missing comma ',' or right-paren ')'
guildhouse.dm:7:unknown directive ff0000">H</FONT><FONT COLOR="#ff0e00">e</FONT><FONT COLOR="#ff1c00">l</FONT><FONT COLOR="#ff2a00">l</FONT><FONT COLOR="#ff3700"> </FONT><FONT COLOR="#ff4500">F</FONT><FONT COLOR="#ff5300">i</FONT><FONT COLOR="#ff6100">g</FONT><FONT COLOR="#ff6f00">h</FONT><FONT COLOR="#ff7d00">t</FONT><FONT COLOR="#ff8a00">e</FONT><FONT COLOR="#ff9800">r</FONT><FONT COLOR="#ffa500">s</FONT></FONT>")

guildhouse.dm:8:error: expected expression


on lines 7 and 8 i have

                if(M.guild == "<FONT SIZE="+3"><FONT COLOR="#ff0000">H</FONT><FONT COLOR="#ff0e00">e</FONT><FONT COLOR="#ff1c00">l</FONT><FONT COLOR="#ff2a00">l</FONT><FONT COLOR="#ff3700"> </FONT><FONT COLOR="#ff4500">F</FONT><FONT COLOR="#ff5300">i</FONT><FONT COLOR="#ff6100">g</FONT><FONT COLOR="#ff6f00">h</FONT><FONT COLOR="#ff7d00">t</FONT><FONT COLOR="#ff8a00">e</FONT><FONT COLOR="#ff9800">r</FONT><FONT COLOR="#ffa500">s</FONT></FONT>")
M.loc=locate(93,41,3)
In response to Govegtos
First of all, you're defining the exact same thing twice. Instead of having two definations of the same turf you could do something of the sort.
turf
guild_entrance
var/guild_req
Enter(mob/M)
if(ismob(M) && M.client)
if(ckey(M.guild) == ckey(guild_req))
return ..()
else
M << "You must be in the [guild_req] guild to enter."
return 0


Then you can simply 'edit instance' on the map editor and change the value of 'guild_req' for each different guild.

Second thing you're doing is using quotation marks without escapes in a text string. Without escapes the compiler thinks you've terminated the text string. So, instead of:
<font color="#000000">Blah</font>


You can use:
<font color=\"#000000\">Blah</font>


Or:
<font color=#000000>Blah</font>


Since HTML doesn't actually require enclosing your attributes in quotations.
In response to Nadrew
Where you placed guild_req is that the name of the guild?
In response to Govegtos
Yes, but you edit that var on the map. You right click the turf and then edit instance, find the var and then place the name.
In response to N1ghtW1ng
I see the name and i changed it to ZFighters but when i went into the game to test it i got You must be in the guild to enter.
In response to Nadrew
But you can you can use the '{'-'}' brackets to:
{"<font color="#000000">Blah</font>"}


O-matic
In response to Govegtos
are you sure that you named it exact the same name? it is capital sensitive.

O-matic
In response to O-matic
No it's not, it has ckey() there.
In response to Ol' Yeller
no, I meant the Guild_Req var he edited on the map.

O-matic
In response to O-matic
"if(ckey(M.guild) == ckey(guild_req))"

It's got ckey() around it, so it doesn't matter. As long as it's like:
I like pie
IlIkEPiE
Or osmething
In response to Ol' Yeller
oh, didn't know.

O-matic
In response to O-matic
Is it

http://img55.imageshack.us/img55/2639/images20oq.jpg

The Guild req varable if so what do i put in there or is it the name of the guild

or is it this one

http://img95.imageshack.us/my.php?image=image19wa.png

?
In response to Govegtos
first of all... what has the first image to do with this? >_>

and its pretty simple. Just look for the Guild_req variable, edit it to the guild name. And you're done.
and yes the second image was right, scroll down there untill you find the var.

O-matic
In response to O-matic
Where it says value for guild req i put this if its the name of the guild <font color="#000000">guildname</font>
In response to Govegtos
Ive adjusted the coding but i get this error

guildtest.dm:5:if :warning: if statement has no effect

How can i fix it heres my coding again

turf
guild_entrance
var/guild_req
Enter(mob/M)
if(ismob(M) && M.client)
if(ckey(html_encode(M.guild)) == ckey(html_encode(guild_req)))
return ..()
else
M << "You must be in the [guild_req] guild to enter."
return 0


Can anyone help me fix this please
In response to Govegtos
Look at all your if statements. See something wrong with one?
In response to Ol' Yeller
K,thanks

Now i have fixed it and i want each different guild teleported to a different location on my map file heres my coding

turf
guild_entrance
var/guild_req
Enter(mob/M)
if(ismob(M) && M.client)
if(ckey(html_encode(M.guild)) == ckey(html_encode(guild_req)))
Entered(M).loc=locate(36,59,3)
return ..()
else
M << "You must be in the [guild_req] guild to enter."
return 0


How can i do that?
In response to Govegtos
Govegtos wrote:
Now i have fixed it and i want each different guild teleported to a different location on my map file heres my coding.
How can i do that?

Advertise for a programmer to help you out, instead of getting random strings of people trying to piece your code together for you on a forum? :) That's one way.

~Sinyc.