ID:2482393
 
(See the best response by Nadrew.)
Game
parent_type = /mob
var
Online as num

proc
PlayerEnterWorld(mob/M)
Online ++
world << "[M] logged in!"
loc=locate(1,1,1)


PlayerExitWorld(mob/M)
Online --
world << "[M] logged out!"

mob/Login()
var/Game/G
G.PlayerEnterWorld(usr)


Why isn't this working? Its not displaying to the world that this person logged in. Trying out datums and not really sure how to execute procs within one.
Best response
You're not actually creating the datum for one, you'd need to use new() for that. However, in this case you're gonna want this datum to be a global one.

var/Game/game_handler = new()

mob/Login()
game_handler.PlayerEnterWorld(src)
..()