ID:165028
 
Alright ty person who helped with my coding problem :)

But I had this problem a while ago on a diffrent game... When a user logs in I have a map selection chart after that it logs you in... Soon after I made a GM code for that game but it did'nt work... I took out the map selection menu and then the GM code worked... Well I want to keep my map selection and I want my GM code... But how exactly can I do this?

var/list/GMs = list("Beatdown_system","Jazzyfizzle") //define and create a global list

client/New() //override client/New() which is called when a player connects
..() //do the default behavior, logging in the player into a mob
if(src.ckey in GMs) //if the player's ckey is found in the list
src.verbs += typesof(/GM/verb)-/GM/verb //add all \
verbs of type /GM/verb to the player's 'verbs' list - look up typesof(). typesof() also returns the base type, so we remove that first, since we don't need it.

GM/verb //these are the actual verbs
Boot(mob/M in world) del M

//etc





That is the GM code Im using please help :)
Bump
In response to Jazzyfizzle
Please put your code in the <DM></DM> tags.

Do not bump unless it has been 24 hours, you waited around an hour.

You should make a proc to check the usrs key on login.

mob/Logi()
CheckM()
pro
CheckGM)
if(sc.key in GS)
src.vrbs += typeso(/GM/verb/)


I have but errors in this code to stop you from copy and pasting since thats what you seemed to have done from the last post.
In response to A.T.H.K
Ummm okay? So you put errors in it =/ yeah I figured that out but ok then =| I will forget GM code for a while -_-
Getting on my nerves anyways lol -_-

Alright thx anyways
In response to Jazzyfizzle
Jazzyfizzle wrote:
Ummm okay? So you put errors in it =/ yeah I figured that out but ok then =| I will forget GM code for a while -_-
Getting on my nerves anyways lol -_-

Alright thx anyways


Heh. Found it. You used ckey. ckey is ALWAYS LOWERCASE. Just put src.key if you don't want the lowercase. It looks like this:

var/list/GMs = list("kinggunnerblast","jayfizzle") //define and create a global list. MUST BE LOWERCASE for ckey

client/New() //override client/New() which is called when a player connects
..() //do the default behavior, logging in the player into a mob
if(src.ckey in GMs) //if the player's ckey is found in the list
src.verbs += typesof(/GM/verb)-/GM/verb //add all \
verbs of type /GM/verb to the player's 'verbs' list - look up typesof(). typesof() also returns the base type, so we remove that first, since we don't need it.


GM/verb //these are the actual verbs
Boot(mob/M in world) del M

//etc
In response to King Gunnerblast
The problem Im having is not so much the code...
Its basicly my other codes this happend with my most recent game as well... My menus in the beggining you know like New Load Save after you do all of that it wont define you as a GM or Admin but when I took the code out then tried the GM and Admin code worked so im not sure how to make both work... =/
In response to Jazzyfizzle
Jazzyfizzle wrote:
The problem Im having is not so much the code...
Its basicly my other codes this happend with my most recent game as well... My menus in the beggining you know like New Load Save after you do all of that it wont define you as a GM or Admin but when I took the code out then tried the GM and Admin code worked so im not sure how to make both work... =/

Try to keep all the Login() scripts in one spot. Sometimes BYOND gets confused on which Login() to run. Seems like you have multiple.
In response to A.T.H.K
A.T.H.K wrote:
Please put your code in the <DM></DM> tags.

Do not bump unless it has been 24 hours, you waited around an hour.

You should make a proc to check the usrs key on login.

> mob/Logi()
> CheckM()
> pro
> CheckGM)
> if(sc.key in GS)
> src.vrbs += typeso(/GM/verb/)
>

I have but errors in this code to stop you from copy and pasting since thats what you seemed to have done from the last post.

Way to go, try actually helping, typos =/= coding errors...
In response to Dark Bahamut
I have put** errors in this code to stop you from copy and pasting since thats what you seemed to have done from the last post.

Seems like your another chump who copy/pastes.
In response to King Gunnerblast
Er, no. You can have how many overrides for a proc as you want, as long as you remember to call ..() (which ATHK forgot to do BTW) in each, it will execute all of them. Of course, you shouldn't have multiple overrides for a proc in a single project itself.
OK.
First, use the <DM> tag.
Second, don't just copy and paste code given to you. Read it and learn it, learn how it works. What you did is just copy some code I gave you, changed a few things with barely skimming it, then expected it to work.
Worse, you created a new topic instead of just replying in the old one.