ID:263369
 
Code:
mob
player
proc
build_sharepoint_list(var/list/l)
var/list/sharepoint_list=new/list()
for(var/obj/Sharepoint/s in l)
sharepoint_list+=s
return sharepoint_list

verb
Manage_Sharepoint(var/obj/Sharepoint/s as obj in build_sharepoint_list(oview(1)))
set src=usr
if(s.adminkey!=usr.key)
showError("You are not this sharepoint's administrator.")
return


Problem description:

Ok, so I have the above code in a file called admin.dm(not sure if that matters) and most of my /mob/player stuff is in another file. For some reason, the verb Manage Sharepoint comes up whenever I right click any object in the game...

Anyone know what I'm doing wrong?
Everyone will have access to this verb, but if you try to use it without being admin it should give the error message. If you want it to be hidden, do something like attach it to an object which is given to the admin at Login()
In response to Magicsofa
I know everyone will have it, that's not an issue with me. What I don't understand is why every object in the game seems to have it. When I right click on a weapon, I get the normal weapon verbs, and Manage Sharepoint.

The weird part is that the other verbs attached I defined for /mob/player like say and whisper don't show up when right clicking objects, so why this one?

By the way, in case you are wondering, admin is not a game administrator, it's an in game skill set.
In response to Neo Skye
It shows up because of the argument you put in:
mob/verb
Test(mob/M as mob) //will show up when right-clicking mobs
Test2(atom/A)/ //will show up when you right click anything


If you do need a certain argument but not want to show the verb popping up, use set popup_menu = 0

- GhostAnime
In response to GhostAnime
Oh, so if it has a single argument passed to it as an atom of some sort, atoms of that type will have that verb when you right click? That makes sense, so when I choose it from the popup for a weapon it will attempt to pass the weapon into the verb.

Awesome, that's exactly what I needed to know. Thanks guys!