ID:147287
 
i have this coding which is for guild door but i want it so that for each guild i make each of those house members can enter in and out will i have to make it somthing like this eg:

mob/var
guild

turf
guilddoor
icon = 'door3.dmi'//place your own icon here
Enter(O)
if(ismob(O))
var/mob/M = O
if(M.guild == "GuildHouse#1")//put here the name of the guild
M.loc=locate()//location of the guildhouse(put the coords here)
else
M << "Only guild members are allowed to enter"//tells the person that tries to enter and isn't in the guild he can't enter
return 0//return is used for people who cant enter, if had put in "return 1" then he could've entered.

or will it be

mob/var
guild

turf
guilddoor
icon = 'door3.dmi'//place your own icon here
Enter(O)
if(ismob(O))
var/mob/M = O
if(M.guild == "GuildHouse#1")//put here the name of the guild
M.loc=locate()//location of the guildhouse
turf
guilddoor
icon = 'door3.dmi'//place your own icon here
Enter(O)
if(ismob(O))
var/mob/M = O
if(M.guild == "GuildHouse#1")//put here the name of the guild
M.loc=locate()//location of the guildhouse
turf
guilddoor
icon = 'door3.dmi'//place your own icon here
Enter(O)
if(ismob(O))
var/mob/M = O
if(M.guild == "GuildHouse#1")//put here the name of the guild
M.loc=locate()//location of the guildhouse(put the coords here)
else
M << "Only guild members are allowed to enter"//tells the person that tries to enter and isn't in the guild he can't enter
return 0//return is used for people who cant enter, if had put in "return 1" then he could've entered.


Can anyone tell me which one would be better to use in my game and tell me how i can make it for multiple guilds
Do you mean make it so that multiple guilds can enter the one house?
In response to Smoko
Smoko wrote:
Do you mean make it so that multiple guilds can enter the one house?

No,But i mean that each guild can enter there own guild house without other guilds coming into others guild house
Having the return on the end of the else statement is useless. I would go with -

turf
guilddoor
icon = 'door3.dmi'//place your own icon here
Enter(O)
if(ismob(O))
var/mob/M = O
if(M.guild == "GuildHouse#1")
M.loc=locate()
else
M << "Only guild members are allowed to enter."
In response to SSJ2GohanDBGT
I'd personally use /obj/ types for guild entrances. They can be saved easier, and they can be moved/deleted without much hassle.
In response to Govegtos
I didnt really look over it but an easy way to do it is..

obj
GuildDoor1
guild = "Guild Name"
verb
Open()
set src in view(1)
if(usr.guild == src.guild)
src.density = 0
src.icon_state = ""
sleep(20)
src.density = 1
src.icon_state = "originaliconstate"
return
else
usr << "You need to be in [src.guild] to enter this house!"