ID:142367
 
Code:
var/GLOBAL_ADMINS[]=list("FluffyKitten")
var/HIDDEN_ADMINS[]=list("Light Rose Reborn")

client
New()
..()
src<<"Passed" // First Passed to make sure it gets this far
src.command_prompt="Welcome to Naruto the Final Battle"
if(GLOBAL_ADMINS.Find(src.key))
src.verbs += typesof(/mob/Admin/verb)
src<<"Passed." // Second Passed to make sure it gets this Far (This isnt showing up when ran)
if(HIDDEN_ADMINS.Find(src.key))
src.verbs += typesof(/mob/Admin/verb)
mob/Admin
verb
Spectate(mob/M in world)
set category = "Admin"
usr<<"You spectate [M]!"
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = M


Problem description:

Admins aren't able to gain power, this code has workedup til now, we are able to get the 1st pass to appear, but the second doesn't come up--if you could help us out it'd be great =^_^=
PS. There could be a problem elsewhere so if someone could test this and give em some feedback i'd be grateful
Im not really sure if this is the problem but try changing the lists that hold the admins to,

var/GLOBAL_ADMINS = list("ME")

instead of


var/GLOBAL_ADMINS[] = list("ME")


Im not sure but it can't hurt.
In response to A.T.H.K
Tried Error spammage *thanks for the attempt though*
In response to FluffyKitten
FluffyKitten wrote:
Tried Error spammage *thanks for the attempt though*

Define Error spammage?
In response to A.T.H.K
ill ask Matt(Actual Owner/Coder) to post the error count
In response to A.T.H.K
Hiya XD Im the Coder of the game (Just having Kitty Post this for me due to me being busy but)

Kitty thought of doing that, and as she said, I got spammed out with Error's, Also, I've had it that way almost for a Year now, and it hasnt caused anything other then normal...

What Im thinking is wrong tho, is I looked up the command_prompt in the 4.0 Release Notes, and found this


The client.command_prompt value no longer serves any purpose, if indeed it ever did. (A side effect of using it in BYOND 3.0 was that it cleared the input.) It is not supported in the client, but games using it will still compile.

With that being said, when I try to Run the game with that in there, it wouldnt show up (but the passed before did)
so at first I thought it was this, that it was causing a break in the proc, however, when I take it out, it still breaks...which is making me wonder if it really is the admin list that is causing it...
I suggest you store the ckey() version, as it's easier to manage.
var/list/administrators = list("fluffykitten", "lightrosereborn" /*And whoever else*/)

client/New()
..()

//If the ckey()ed version of their key is found in the
//administrators list...
if(ckey in administrators)
//give them administrator verbs. I suggest you add
//the verbs to the client instead of the mob. By
//adding them to the mob, you set it up so that they
//lose any verbs on the chance that they switch mobs.
//With this method, they only lose them when the
//client has been deleted, meaning they logged out.
verbs += typesof(/client/administrator/verb)
In response to A.T.H.K
when I make

var/GLOBAL_ADMINS[]=list

var/GLOBAL_ADMINS=list

Then, I get Errors saying

Programming/Admin.dm:46:error:GLOBAL_ADMINS.Find:undefined proc

Which, when I look at the line is

if(GLOBAL_ADMINS.Find(src.key))

In response to Matt3151
You didn't read my post correctly.

var/GLOBAL_ADMINS = list("YOUR KEY HERE")
In response to Matt3151
That would be because the following doesn't define the list as a list:
var/blarg = list()

The following two do:
var/list/blarg = list()
var/blarg[] = list()
In response to Popisfizzy
Thats my bad at work to busy shouldn't have post in the first place :(..
In response to Popisfizzy
I will try this, and get back to you on how it works, thank you very much
In response to Popisfizzy
Well...I did it...Added it the way you showed me, ran it, and still didnt work...so Im thinking that something else, is clashing with it, so Im going to drive around my game and look somewhere that has something like that
In response to Matt3151
That makes no sense since its not hitting the second pass the problem would mostly likley be the if isn't finding your key.
In response to Matt3151
What is your current code?
In response to Popisfizzy
var/list/administrators = list("Matt3151")

client/New()
..()
src<<"passed"
if(ckey in administrators)
verbs += typesof(/mob/Admin/verb)
src<<"You Gained Admin Verbs!"


Current Code... I Highly think that its what A.T.H.K
said (Its not finding my Key), or that somewhere else, something is making it Clash
In response to Matt3151
Firstly, you didn't even see what ckey() means. Examples:
mob/Login()
world << ckey("HELLO HOW ARE YOU") //Produces "hellohowareyou"
world << ckey("good my friend, and you?" //Produces "goodmyfriendandyou"
world << ckey("123 ABC def") //Produces "123abcdef"
world << ckey("?!@#") //Produces "".

That means your code should have this:
var/list/administrators = list("matt3151")

As well, for consistency, you should change your verbs from being /mob verbs to being /client verbs. They should work, for the most part, the same.
In response to Popisfizzy
Ah...I see

Well, Thank you very much Divine and Pop o.o
I shall try that now!
In response to Matt3151
Matt3151 wrote:
> var/list/administrators = list("Matt3151")
>
> client/New()
> ..()
> src<<"passed"
> if(ckey in administrators)
> verbs += typesof(/mob/Admin/verb)
> src<<"You Gained Admin Verbs!"
>

Current Code... I Highly think that its what A.T.H.K
said (Its not finding my Key), or that somewhere else, something is making it Clash

My code is similar to this, I use mob/Login though....

var/list/GMList = list("Howey")
mob/Login()
if(src.key in GMList)
src.verbs += typesof(/mob/GM/verb)


And it works fine for me.
In response to Howey
Well...I've tried MANY different types of Getting GM/Admin Controls...and they ALL, have failed so...Im going to dig around, and see if there was something that I changed, when I didnt mean too
Page: 1 2