ID:171323
 
hi i need help in coding guild doors in the zeta coding plz help me sum1 i keep bugging it up thankz
Tripodentertainment wrote:
hi i need help in coding guild doors in the zeta coding plz help me sum1 i keep bugging it up thankz

Not sure how the zeta coding is since Ive never viewed it before or even thought about viewing it. But a guild door only gives access to people in the guild. And the people in the guild are usally helled in a list.

So Im guessing you have a way to create your guild. Which makes a list for the guild. So then just use a for list loop and get all the people in the guild and check it with the person that is trying to gain access.

Uhh if you want more info maybe you could provide a .... example of what is getting bugged?
Tripodentertainment wrote:
hi i need help in coding guild doors in the zeta coding plz help me sum1 i keep bugging it up thankz

You'll find very few people are willing to help you when you're writing a rip. You'd be a lot better off abandoning the Zeta code and using what you've learned on your own to start over. If for no other reason, you should do it because the Zeta code is absolute crap and full of bugs.

That said, guild/team doors are a topic that has been covered many times on the forums. Just search and you'll find lots of posts that can help you.

Lummox JR

In response to Green Lime
Green Lime wrote:
Not sure how the zeta coding is since Ive never viewed it before or even thought about viewing it. But a guild door only gives access to people in the guild. And the people in the guild are usally helled in a list.

Hmm, I would have used just a normal
guild = "Uberdog"
variable, not a list.
Would have thought it would be cleaner?
In response to Kholint
I'm guessing players would have a variable, "guild", and it's set to whatever guild they're in? That's good, but not good. What if you wanted to loop all the members in a certain guild? You wouldn't be able to because you'd have to loop through the world, and find whatever players ONLINE. Meaning all offline players are counted as *not* in the guild. Best way to do it is:
var/list/Guilds=list()
mob/var/Guild

Giving a list of guilds; giving the mob a variable "guild".
Guild
var
Namep
list/Members=list()
Owner
//Other variables to declare
New(N,O)
..()
Name=N
Owner=O
Guilds+=src

That's defining your Guild datum, now it gets even more simple.
mob/verb/CreateGuild()
if(!src.Guild)
var/T=html_encode(input("Give your guild a name.")as text)
if(!T)CreateGuild()
var/Guild/G=new(T,src.name)
src.Guild=G

Pretty simple, huh? Now to recruit members.
mob/verb/Recruit(mob/M in view())
if(src.Guild&&src.Guild:Owner=src.name&&M.client&&!M.Guild)
switch(alert(M,"Wanna join [src.Guild:Name]?",,"Yea!","NEVER!"))
if("Yea!")
M.Guild=src.Guild
src.Guild:Memebers+=M

That's basically what you can do when creating such guilds, having it supported by simple variables and lists is the key.
In response to Crashed
You should not be using the : operator anywhere in that code. It was completely avoidable if you'd just given the Guild var the correct type.
var/Guild/Guild

Of course, by standard naming conventions those should be lowercase.
var/guild/guild


Lummox JR
In response to Lummox JR
: has its purposes, and I intend to use them when I'm lazy.
In response to Crashed
Crashed wrote:
: has its purposes, and I intend to use them when I'm lazy.

It does have purposes, but it should never be used to cover something you could just as easily fix by adding a single word to your code. At worst, it could be a crutch in your own code, but you shouldn't go putting it in examples intended for newbies.

Lummox JR