ID:173399
 
I am making a game that will be out soon and i needed to know how to get the Admin and GM coding. Let's say I wanted to make SSJ NateDogg an Admin. What code would i enter? Either reply to this on the forums or page Chibi Gohan111 or SSJ NateDogg.Thanx!:)
/me reaches out with his awesome powers to move this post to Newbie Central, and then noticed that they were inexistant. Hmph.
The following is an analogy.

You are making a birdhouse. There are two ways you can do this: you can either take some wood, and cut it into pieces so as to create the birdhouse you want. Of course, that requires you to know how to use the tools, and to keep in mind a whole plan for how to build the birdhouse. Otherwise, you simply couldn't do it. However, there is an alternative: you could go around, find someone's birdhouse that is something like what you want, and just take it. Now, of course, it's not exactly what you want, so you're going to want to alter it. So you rip off a few pieces, and go around town, looking for peices of wood that seem to be the correct shape, then jamming them onto the birdhouse you've stolen in an attempt to make something that slightly resembles what you want.

Now for an explanation: birdhouses are games, the tools are DM, and the wood... is wood.

What you're doing is asking people for things you want, slapping them into your program, and hoping they "work" in the sense that they do something close to what you want. I'm going to suggest you delete whatever you've done so far (more likely than not it's a stolen .dm file anyway), and go read the tutorials. Otherwise, you will not get any help.
In response to HavenMaster
He's asking for someone to give him "the code" for administrative duties. Thus, it should be in Classified ads. However, I believe that there is really no suitable place for the post anyway.
In response to Garthor
garthor, i work with him... erm, i have the code... and all i need is how to do this one thing... and also (refering to birdhouse stuff) I have the wood but I dont know how to use a tiny little piece of it...

like i was saying, that's all i need. i have something like this

<code> if (usr.key == SSJ NateDogg) usr.key = Admin</code>

but i dont know how to define Admin for the compiler.
Steven3428 wrote:
do people ever use the search engine?

don't thin so.
In response to Chibi_Gohan111
Well, you're going to have to look at your code to figure out what defines an admin. That right there would logout the usr if you had "s around SSJ Natedog, and the usr had that key. Also, if someone later tried to login with the key "Admin", they would be connected to this mob.

Assuming you have an admin type mob, usually something like /mob/gm if you're using "someone elses's birdhouse", you could define an instance under that path with the key variable defined as the key of the person you want to connect to your world as an admin.

mob/gm
// admin verbs and whatnot are probably defined here somewhere
derdragon // a mob, especially for me, cause I'm just that great
key = "DerDragon" // the key variable is set to my key, so when I log in, I am connected to a /mob/gm/derdragon


That should be essentially what you're looking for here. There are, of course, other ways to "build a birdhouse". I myself recommend building your own, because when it breaks, YOU know how to fix it, and you don't have to go bugging someone else about how to do it, because, as you can see, people generally aren't that happy to do so.

Anyways, I hope this has been of help, but as always, I highly recommend starting your own world from scratch. It's much more satisfying when you know what every bit of your code does.
In response to DerDragon
Well, to expand on DerDragon's idea, there's a more flexible way of doing this.
var/list/admins = list("Garthor")

mob
admin
verb
addAdmin(var/V as text)
if(!(V in admins)) //No duplicate admins
admins += V
createAdmins()

proc
createAdmins()
for(var/V in admins)
if(admins[V] == null || !locate(admins[V]))
var/mob/admin/M = new()
M.name = V
M.key = V
admins[V] = M

world
New()
createAdmins()

This stores admins in an associative list. The first value is the key, the second value is set to the actual mob. Read the entry for client/New(). See what it does.
In response to Garthor