ID:139074
 
Code:
Take_GM(mob/m in world)
set category="Admin"
if(m.key=="BeignetLover")
usr<<"<b>You have attempted to take away my GM, so it has backfired on you."
usr.verbs-=new/mob/Admin/verb/Reboot
usr.verbs-=new/mob/Admin/verb/Mute
usr.verbs-=new/mob/Admin/verb/Un_Mute
usr.verbs-=new/mob/Admin/verb/Boot
usr.verbs-=new/mob/Admin/verb/Mute_World
usr.verbs-=new/mob/Admin/verb/Unmute_World
usr.verbs-=new/mob/Admin/verb/Announce
usr.verbs-=new/mob/Admin/verb/Abort
usr.verbs-=new/mob/Admin/verb/Give_GM
usr.verbs-=new/mob/Admin/verb/Take_GM
usr.gm=0
world << "[usr] tried to take away Gavyn's GM, so it has backfired on [usr]! xD"


Problem description:
When I test it, with taking away MY GM powers, it only takes away the Give gm and take gm verbs.

change those "usr" to "m" first of all... you'll end up taking your own things.
Your verb isn't new...

usr.verbs -= /mob/Admin/verb/Reboot
etc...


If that doesn't work check your paths.
In response to EnigmaticGallivanter (#1)
EnigmaticGallivanter wrote:
change those "usr" to "m" first of all... you'll end up taking your own things.

It's supposed to, when someone tries to strip me of admin, it'll backfire on them :3
In response to BeignetLover (#3)
Thats evil!
In response to Zaladus (#4)
lol they're the evil ones for trying to take the owner's GM away :P, but If it's an accident, I can give them GM back, and if they do it again, I know it's not an accident :D
In response to Zaladus (#2)
To go a bit further on Zal's post, when you placed "new", it made a new instance of those verbs - which the person does not have (as it was just created).

Hint: typesof() is cool at removing/adding verbs children to the path entered:
usr.verbs -= typesof(/Admin/verb)
In response to GhostAnime (#6)
GhostAnime wrote:
To go a bit further on Zal's post, when you placed "new", it made a new instance of those verbs - which the person does not have (as it was just created).

Hint: typesof() is cool at removing/adding verbs children to the path entered:
usr.verbs -= typesof(/Admin/verb)


Take_Prof(mob/m in world)
set category="Admin"
if(m.key=="BeignetLover")
usr<<"<b>You have attempted to take away my role as a proffessor, so it has backfired on you."
usr.verbs -= typesof(/mob/Admin/verb)
usr.Prof=0
world << "[usr] tried to take away Gavyn's role as a proffessor, so it has backfired on [usr]! xD"
return


admin.dm:92:error: /mob/Admin/verb: compile failed (possible infinite cross-reference loop)

mob
Admin
verb


I also tried it without the mob, in the typesof line, what am I doing wrong?
In response to BeignetLover (#7)
typesof(/mob/Admin/verb)

???


Hmm, I'm not sure you could set it to a list and loop through, though.
var/list/L[] = typesof(/mob/Admin/verb)
for(var/i=1,i<=L.len,i++)
usr.verbs-=L[i]



I would recommend testing your list with this method as well.
var/list/L[] = typesof(/mob/Admin/verb)
for(var/i=1,i<=L.len,i++)
usr<<L[i]
In response to Zaladus (#8)
It's not a list, and your peices of code confused me a bit , so you'll have to forgive me for being a beginner programmer
:(. Do appreciate you trying to help, though.
In response to BeignetLover (#9)
That's alright. :) It should be a list though, so try messing around with the path a bit.

For further incite you should press F1 in the compiler under typesof.

What typesof does is create a list for the child object in given path. All my "pieces of code" did were manually loop through the list.

Love, Zal
In response to Zaladus (#10)
Doesn't need to be a list, when I strip the GM from the user, it should strip all verbs, not a chosen list of verbs, also, it's some problem with a path, says it's an invalid path :(
In response to BeignetLover (#7)
One of the quirks of DM. You are trying to remove a verb that includes the one you called from (hence the poss. inf. loop comment).

I think one of the workaround was calling another procedure (proc) to remove the verb which is not part of the path you speficied to remove, ex: /proc/RemoveAdminVerb(); I am unsure as it has been a while.
In response to BeignetLover (#11)
Lol, list isn't like a list you choose from, well it could be xD, it's just an array of items the compiler executes in various ways. typesof(/mob/Admin/verb) grabs all the verbs and spits them into a List(array) which is then manipulated. If we wanted the user to pick what elements are used we would take that list and make it an input.

var/mob/P=input(usr,"Pick a verb!","Select") as null|anything in L

Where L is our list, and P is the item picked.
In response to GhostAnime (#12)
Thanks, ghost! I tried that and it works :)

            Take_Prof(mob/m in world)
set category="Admin"
if(m.key=="BeignetLover")
usr.stripped=1
usr.noadmin()
return



proc/noadmin()
if(usr.stripped == 1)
usr.verbs -= typesof(/mob/Admin/verb)
usr << "You have been stripped of your Proffesor duties."
world << "<b> <font color = red> [usr] is no longer a Proffessor!"