ID:2065592
 
(See the best response by Ter13.)
Code:
Staff
Administrator
proc
AddEventPoints()
var/mob/Player/M = input("Select a player to give event points.", "Give Event Points") as null|anything in PlayersOnline
if(M)
var/X=input("How many event points do you want to add to [M] ?","Event Points") as num
M.EventPoints += X
M << output("<b>You have received [X] event points.", "ChatOutput")
text2file("[time2text(world.realtime)]: [src] added to [M] [X] event points.<br>","StaffLog.html")

mob
var/tmp/Staff/Administrator/Staff

Login()
src.invisibility = 1
winset(src,"MainWindow","pos=200,100;is-maximized=false")
src.loc = locate(15, 32, 2)
client.focus = src
PlayersOnline += src
Staff = new/Staff
src.Staff.AddEventPoints()
..()


Problem description:

I am not that good dealing with Datums yet, so I am kinda of having some troubles. It is giving me a runtime error. -> runtime error: undefined proc or verb /Staff/AddEventPoints().

Much appreciated if someone could enlight a better way to do similar system in a simple way using datums or some nice tips aswell.


Best response
Staff = new/Staff

The problem is that you are initializing a type of Staff(), but AddEventPoints() is defined under /Staff/Administrator.
I can't believe it was this easy, much appreciated. That solved the issue.

One quick question, for example I have the tree Administrator and now for example I will add GameSage.
I would need to do the following to access their respective methods:

var/tmp/Staff/Administrator/Admin
var/tmp/Staff/GameSage/GS
....
....
Admin = new/Staff/Administrator
GS = new/Staff/GameSage


or is there a simpler way to access another trees in the datum without initializing them directly ?