ID:165258
 
I made the game but, i dont know how to make myself Admin.
Plz help.
If you have an admin system, you just add your key at login and the verbs under your key. like this.

mob/Login()
if(src.key == "Flameshady")
src.verbs += /mob/GM/verb/Ban // just an example add the rest of the verbs



- Miran94
In response to Miran94
Thx 8^)
In response to Miran94
WRONG when ppl login everyone will have admin he needs the admin check



mob/Login()
if(src.key=="Your Key")//Change the key to your key. To recieve Owner commands.
src.verbs+=typesof(/mob/GM/verb)
src.verbs+=typesof(/mob/admin/verb)
src.admin=1
if(ban.Find(src.client.address))
src << "You are banned."
del src
if(src.admin)src.verbs+=typesof(/mob/admin/verb)
..()
mob
GM/verb
Reboot(){set category="Admin";Announcement("World will reboot in 10 seconds.");sleep(100);world.Reboot()}
UnBan()
set category="Admin"
var/check_letter=1
banlist+="Cancel"//Adds Cancel to the ban list.
var/T=input("Which address would you like to unban?")in banlist
if(T=="Cancel"){return}
usr<<"You Unbanned [T]."
var/banip
start:
if(copytext(T,check_letter,check_letter+1)=="-")goto unban
else{banip+=copytext(T,check_letter,check_letter+1);check_le tter+=1;goto start}
unban:
ban.Remove(banip)
Ban(mob/M in world)
set category="Admin"
set desc="Who do you wish to IP / Key ban?"
var/list/peoples
if(M.client)peoples+=M
ban+=M.client.address
M<<"You have been ban."
world<<"[usr] Ip / Key ban [M]!"
banlist+="[M.client.address]-[M.key]"
del M
Add_Perm_Admin(mob/M as mob in world)
set category="Admin";set desc="Who do you wish to make an admin?"
if(M.admin==1){usr<<"There already admin.";return}
else
world<<"[M] was blessed with Administrative status by [usr]."
M.verbs+=typesof(/mob/admin/verb)
M.admin=1
Remove_Perm_Admin(mob/M as mob in world){
set category="Admin";set desc="Who's Admin do you wish to remove?";
world<<"[M] was stripped of his Administrative status by [usr].";
M.verbs-=typesof(/mob/admin/verb);
M.admin=0}
Announcement(message as message){set category = "Admin";
world << "<font color=#607B8B><center>--------------------------\
------------------------------\
<font color=#607B8B><center>[usr] is Announcement is...<font color=#607B8B><center>[message]\
<font color=#607B8B><center>--------------------------\
------------------------------"}
admin/verb
Create(O as null|anything in typesof(/obj,/mob)){set category = "Admin";
set desc="Create an Object, Mob, or Turf.";
if(!O)return;var/T = new O(usr.loc);
world.log<<"<font color=#607B8B>[usr] created a [T:name].";
view() << "With afew swift movements from [usr]'s hands, a [T:name] appeared."}
Boot(mob/M in world)
set category = "Admin"
set desc = "Who do you wish to boot? (Note: you can not boot yourself.)"
if(M == usr){usr << "Can't boot yourself."}
else{Announcement("[usr] Booted [M].");world.log<<"<font color=#607B8B>[usr] booted [M] from the game.";M.Logout()}
Edit(obj/O as obj|mob|turf|area in view())
set category = "Admin"
set desc="You can edit a targets variables."
var/variable=input("Which var do you wish to edit.","Var") in O.vars,GH=O.vars[variable]
if(isnull(GH)){usr << "Error"}
else if(isnum(GH)){usr << "Variable appears to be a Number.";default = "Number"}
else if(istext(GH)){usr << "Variable appears to be Text.";default = "Text"}
else if(isicon(GH)){usr << "Variable appears to be a Icon.";GH = "\icon[GH]";default = "icon"}
else if(istype(GH,/atom) || istype(GH,/datum)){usr << "Variable appears to be TYPE.";default = "type"}
else if(istype(GH,/list)){usr << "Variable appears to be LIST.";default = "cancel"}
else if(istype(GH,/client)){usr << "Variable appears to be CLIENT.";default = "cancel"}
else{usr << "Variable appears to be FILE.";default = "file"}
usr << "Variable Contains The Following: [GH]"
switch(input("What Kind of variable?")in list("Text","Number","Icon","File","-= Cancel =-"))
if("-= Cancel =-"){return}
if("Text"){O.vars[variable] = input("Enter new text:","Text",\O.vars[variable]) as text}
if("Number"){O.vars[variable] = input("Enter new number:","Num",\O.vars[variable]) as num}
if("File"){O.vars[variable] = input("Pick file:","File",O.vars[variable]) \as file}
if("Icon"){O.vars[variable] = input("Pick icon:","Icon",O.vars[variable]) \as icon}
Teleport(mob/M in world){set category="Admin";set desc="Who do you wish to teleport to?";usr.loc=M.loc;world.log<<"<font color=#607B8B>[usr] teleported to [M].";view()<<"[usr] appeared in a flash."}
Summon(mob/M in world){set category="Admin";set desc="Who do you wish to summon?";M.loc=usr.loc;world.log<<"<font color=#607B8B>[usr] summoned [M].";view()<<"[usr] summoned [M]."}
Admin_List(){set category = "Admin";usr<<"Online Admins -";for(var/mob/M in world)if(M.admin==1){usr<<"[M]"}}
Announcement(message as message){set category = "Admin";
world << "<font color=#607B8B><center>--------------------------\
------------------------------\
<font color=#607B8B><center>Announcement:<font color=#607B8B><center>[message]\
<font color=#607B8B><center>--------------------------\
------------------------------"}
world
New()
world.log<<"<font color=#607B8B>World started up on: [time2text(world.realtime)]"
..()
Del()
world.log<<"<font color=#607B8B>World shutdown on: [time2text(world.realtime)]"
..()
var/list{Admins=list();ban=list();banlist=list()}
mob/var{admin=0;default}


In response to Evalotion-INC.
Uh, no they won't. Not with Miran's code, at least. There are better ways to do it, but his will work.

Also, put your code in the <dm> tags so we can actually read it.
In response to Evalotion-INC.
Evalotion-INC. wrote:
WRONG when ppl login everyone will have admin he needs the<it> admin check

Pfft, not everybody needs to use that same crappy recycled reused admin code. There is no 'the' admin check.
In response to Kaioken
the guy posted an entire gm system, plus I think he needs anger managment
In response to Kaioken
Kaioken wrote:
Evalotion-INC. wrote:
WRONG when ppl login everyone will have admin he needs the</t> admin check

Pfft, not everybody needs to use that same crappy recycled reused admin code. There is no 'the' admin check.

if(src.key=="Your Key")//Change the key to your key. To recieve Owner commands.
That is the admin check it worx
In response to Popisfizzy
how do i do that?
In response to Evalotion-INC.
Evalotion-INC. wrote:
if(src.key=="Your Key")//Change the key to your key. To recieve Owner commands.
That is the admin check it worx

Uhh... what Miran94 posted also contained a line VERY similar to that one. Please read stuff before you reply to it by copy & pasting random blocks of code.
In response to Jon88
im just giving him the best admin u can get
In response to Evalotion-INC.
Hardly the best way to do it. There are about a billion-and-a-half ways it could be done better.
In response to Evalotion-INC.
use the tags: dm to start and /dm to finish. If you look on the code problems section, when your about to post, it will already be there.
In response to Evalotion-INC.
Just a little side bar...


Why would you have a Add PERM Gm and then a Remove perm gm

I thought the fact it was Permanent meant you cant remove it... >.>

:P
In response to Evalotion-INC.
You haven't even understood my post at all.
Try (I know it's tough) and actually think before replying, alright?

I meant you shouldn't be throwing code around (especially not bad code like that) as it should be used and is 'the best code'/best way to do it (as it's also obviously not). There is obviously not such thing as The Admin Check or The Code, as we all know. -_-
In response to Evalotion-INC.
/*
Its spelled "Evolution"
...And "Inc."
*/


o_o