ID:154897
 
Can someone help me with an admin system that has different permissions such as one for GM, Host, TM,Admin, Owner and each permission will have a certain amount of available verbs?

I've tried doing this plenty of times but none of it seemed to work out for me.
What is the point in having all of those?

Set different paths for the verbs such as <code>client/Admin/verb</code>, <code>client/Host/verb</code> and <code>client/Owner/verb</code>. When you add the verbs, add all of the verbs that the player should receive based on their position.
In response to Neimo
i dont understand what u mean exactly. I'm still a little new to the coding thing. Could u maybe give me an example Neimo?
In response to Pkmaster218
Separate paths for each rank(?).

client

Owner/verb

cause_havoc()

Host/verb

mass_kill()

Moderator/verb

spawn_nukes()


Create <code>lists</code> that contain the keys of staff members.

var/list

owner = list("neimo")

moderators = list("a key", "another key", "more keys")


Have a <code>proc</code> that checks the list of staff.

client

proc

check_staff()

if(owners.Find(ckey))

verbs += typesof("/client/Owner/verb", "/client/Host/verb", "/client/Moderator/verb")

else if(ckey == lowertext(world.host))

verbs += typesof("/client/Host/verb")

else if(moderators.Find(ckey))

verbs += typesof("/client/Moderator/verb")


If you do not understand the basics of path trees then you should read over the <code>guide.</code>
In response to Neimo
when using this code im getting a lot of indention errors for some reason
In response to Pkmaster218
Because you're copy/pasting the code. Learn how to code properly instead.
In response to Duelmaster409
no need to be a douche to the guy... if you get indention errors, backspace to the line before, and then just press enter and tab it to where its supposed to be
In response to Leoinpharoh
yeah i tried the tabbing thing it still having problems and ty btw

Where would u put the verb properties in this code exactly

client

Owner/verb

cause_havoc()
In response to Pkmaster218
<code>cause_havoc()</code> would be a verb here, so figure it out.
In response to Neimo
when putting the code on it keeps giving me this error:
owners.Find: undefined var
In response to Pkmaster218
The list name is <code>owner</code>, not <code>owners</code>. My apologies.
In response to Neimo
client

Owner/verb

invisible()
invisibility = !invisibility
if(invisibility) usr << "[usr] turns invisible"
else usr << "[usr] turns visible"

I keep getting indentation errors wit this code, do u think u can help?
In response to Pkmaster218
There aren't any indentation errors with that piece of code.
In response to Neimo
client

Owner/verb

invisible()
invisibility = !invisibility
if(invisibility) usr << "[usr] turns invisible"
else usr << "[usr] turns visible"

Host/verb

mass_kill()

Moderator/verb

spawn_nukes()

var/list

owner = list("Pkmaster218")

moderators = list("a key", "another key", "more keys")

client

proc

check_staff()

if(owner.Find(ckey))

verbs += typesof("/client/Owner/verb", "/client/Host/verb", "/client/Moderator/verb")

else if(ckey == lowertext(world.host))

verbs += typesof("/client/Host/verb")

else if(moderators.Find(ckey))

verbs += typesof("/client/Moderator/verb")


Well heres the whole code that im getting errors wit
In response to Pkmaster218
For the <code>invisibility</code> variables, add <code>usr.</code> because the client doesn't have that variable.
In response to Neimo
can u show me wat u mean?
In response to Pkmaster218
<code>usr.invisibility = blah</code> is how it should be done.
In response to Neimo
That worked but i keep getting indention errors wit this part here on the code

usr.invisibility = !invisibility
if(invisibility) usr << "[usr] turns invisible"
else usr << "[usr] turns visible"
In response to Leoinpharoh
Leoinpharoh wrote:
no need to be a douche to the guy... if you get indention errors, backspace to the line before, and then just press enter and tab it to where its supposed to be

It's the truth Leoinpharoh, besides it's constructive criticism. The kid needs it sadly I must admit.

@pk

Please do us all a favor, and read the guide again and again. I joined late 05 early 06 of BYOND. You can not just jump into BYOND and make a game. If you are going to copy and paste code with out showing us you attempted to do it yourself; I feel you do not deserve are help and are work for free. If you were truly learning the DM language you wouldn't be focusing on GM/admin/owner verbs/etc.. That should be set way on the back burner if your game even requires it. There is many other ways to add stuff to prevent "bad people" from doing stuff in your game. Me personally admin is useless, because you just manual build in functions and just manual add the key if the person has committed an act that is against the rules. None the less I'm done ranting about this. I just need to alleviate myself some stress.
In response to Pkmaster218
Copy paste the whole code again, but before the code put

<dm.> but without the full stop. It will put your code in the
right format for us to see it.
Page: 1 2