ID:161558
 
I know there are librarys and stuff but i just wanna know

can someone give me a code for them like give verbs, reboot, Ban, Boot, mute and suff like that.

also how do i put more than one key in so i more thsn one person can have the same verbs
mob/GM/verb
Give_GM(mob/M in world)
set category = "GM"
M.verbs += /mob/admin/verb/reboot
M.verbs += /mob/admin/verb/Mute

mob/admin/verb
reboot()
set name = "Reboot World"
set category = "Admin"
world << "World rebooting in 10 seconds."
sleep(100)
world.reboot()
Mute(mob/M in world)
set category = "Admin"
world << "[M] has been muted by [usr]."
M.muted = 1

mob/var
muted = 0

mob/Login()
if(src.key == "Insert key here")
src.verbs += /mob/GM/verb/Give_GM


Just something like that would do..
In response to Howey
thanks

but when you put in

mob/Login()
if(src.key == "Insert key here")


is there anyway to put in more than one key???
In response to Skitz4Evil
Check the reference for lists and in.

For a more direct example:
if(x in list) do stuff
In response to Skitz4Evil
Skitz4Evil wrote:
thanks

but when you put in

mob/Login()
if(src.key == "Insert key here")


is there anyway to put in more than one key???

 mob/Login()
if(src.key == "Insert key here"||src.key == "Insert Other Key here")
In response to Howey
Or use lists, so much easier.

var/list/admins=list("howey","akutabigamma")

mob/Login()
if(ckey in admins)
src<<"You are an admin"


Also, things like mute should never use a boolean variable, you should always use lists.
In response to Howey
Administrative verbs should not be mob verbs, they should be client verbs. If for whatever reason you put something in the game to let you control another player (mind control, for example), WHOOOOOOOOOOOPS! Admin powers!
In response to Akutabi Gamma
Akutabi Gamma wrote:
Also, things like mute should never use a boolean variable, you should always use lists.

Uh. How to say it gently - no. An object variable is much preferable, not necessarily a boolean one, but that would be preferable to a new list per setting as well.

Welcome to object-oriented programming.
In response to Garthor
Indeed. Not to mention things like admin powers (and hell, stuff like Say() verbs as well, pretty much) should be accessible regardless of which mob you're inhabiting.
Oh, and also while on the subject, you shouldn't define new useless atom types like mob/GM to define verbs on. If you need to categorize them by path nodes, then define useless (or not) /datums instead. You'll also get the added benefit of not bloating up your map editor.
In response to CriticalBotch
ok thx guys