ID:292082
 
RPG Starter by Falacy
An Open Source Demo/Game with everything you'll need to get started on your very own BYOND Game!
72 fans · Created Feb 16 2008
mob/var/GM = 0
mob/Login()
if(usr.key == "Key Name")
usr.GM=1
if(usr.GM == 1)
world.SetMedal("GM",usr)
var/medal2 = "GM"
world.GetMedal(medal2,usr)
world<<("<font color = blue><small>[usr] has earned a medal: [medal2]")
world<<("[usr] has logged in")
world.SetMedal("Login",usr)
var/medal = "Login"
world.GetMedal(medal,usr)
world<<("<font color = blue><small>[usr] has earned a medal: [medal]")

world
hub = "YourKey.YourGame" // Example: UndefeatedSaiyans.DragonBallZUltimateLegacy
hub_password = "hub_password"
It will not work. The medall will not save in hub. You need to check "Require authentication for live games" and put a hubpassword and use this "SetMedal(medal, player, hub=world.hub, hub_password=world.hub_password)"
lol you're giving a medal for being GM?
Those calls to GetMedal() do absolutely nothing, except maybe pointlessly delay the game while the hub is contacted.
mob/proc/GiveMedal(var/Medal2Give)
if(!world.GetMedal(Medal2Give,src))
world.SetMedal(Medal2Give,src)
world<<"<font color=blue><small>[src] has earned a medal: [Medal2Give]"

mob/var/GM=0
mob/Login()
if(src.key=="Key Name") src.GM=1
if(src.GM) src.GiveMedal("GM")
world<<"[src] has logged in"
src.GiveMedal("Login")

You don't need to give it the hub or password, it automatically defaults to the world variables.
In response to Falacy (#2)
The part of password is for security but the "Require authentication for live games" you need it checked or the medals won't show on hub.
In response to Gohan Games (#3)
Yes, you have to have a password on your hub. But you don't have to put it in the medal procs.
If anything, putting it there just lowers security.
In response to Gohan Games (#1)
i know that i thought people will know it already....