ID:167518
 
If i have admin verbs how do I put all of them under Admin panel?
You do something like this.

mob/admin/verb
admin_verb()
set category = "Admin Commands"


~~> Unknown Person
In response to Unknown Person
Ok i got that, Now how would i go and Add Admin's???
In response to VolksBlade
What i just asked.(I feel when someone make's a new post over the one i have just put without my question being answered or anything i feel i have to repost)
In response to VolksBlade
VolksBlade wrote:
(I feel when someone make's a new post over the one i have just put without my question being answered or anything i feel i have to repost)

Yeah, about that.

Hiead
In response to VolksBlade
mob/admin/verb //a verb
admin_verb() //an admin verb
set category = "Admin Commands" //puts the verb in a tab called "Admin Commands"
mob/proc/Add_Admin(mob/M as mob in world) //a proc to check if they are an admin
if(M.key in Admin)//if their key is in the list of admins
M.verbs += typesof(/mob/admin/verb) //gives them admins verbs
else //if their key isn't in the list of admins
return //stops the proc

var/list/Admin = list("persons key","persons key 2")// the list of admins


Something like that.
In response to KirbyRules
Thank you
In response to VolksBlade
You're welcome. Anything to help a beginner. I was one not too long ago after all.
In response to KirbyRules
KirbyRules wrote:
mob/proc/Add_Admin(mob/M as mob in world)


The "as mob in world" part is redundant for a proc, unless you want to add this proc to the verb list at some point.

   else //if their key isn't in the list of admins
return //stops the proc


This part is also redundant, as the proc already ends anyway.

~~> Unknown Person
In response to KirbyRules
Pooey i put in your code and it says
Admin.dm:3:error:/mob/admin/verb:undefined type path
Admin.dm:3:error:typesof:undefined proc
Admin.dm:2: if :warning: if statement has no effect
Admin.dm:4:error:else :'else' clause without preceding 'if' statemnt
Admin.dm:4:error: :missing expression

mob/proc/Add_Admin(mob/M as mob in world) //a proc to check if they are an admin
if(M.key in Admin)//if their key is in the list of admins
M.verbs += typesof(/mob/admin/verb) //gives them admins verbs
else //if their key isn't in the list of admins
return //stops the proc

var/list/Admin = list("VolksBlade","Itachi69")

most of the problem's are right around these
     M.verbs += typesof(/mob/admin/verb) //gives them admins verbs
else //if their key isn't in the list of admins
return //stops the proc
In response to VolksBlade
I'm not trying to sound mean here but you're not sopposed to copy and paste codes you find in the How-To forums. You're sopposed to learn from them and create your own.
In response to KirbyRules
Here's how i do it
mob
Login()
if(src.key == "keyname")
src.verbs += /mob/verb/verbname

else
..()
In response to Dragon_fire6653
Or, you can make a list with the staff members in it. Then add all types of the admin verbs.

mob/Login()
if(src.key in Staff)//assuming you made a list
src.verbs += typesof(/Admin/verb)
..()

Admin
verb
//continue here


That way all admin verbs are of one type and you can add them all at the same time, to all members in staff list.
In response to Dragon_fire6653
cant you do it like this?

mob
Login()
if(src.key == "keyname")
src.panel += /mob/panel/admin

else
..()

?
In response to VolksBlade
Trust me, it's much easier to just add the names to a list, saves you time, and works perfectly. Then just make all addy verbs like I showed and then add them at login. I find that to be quite effective.
In response to Pyro_dragons
thx
In response to VolksBlade
No problem.