ID:139744
 
Code:
mob/proc/GiveMedal(var/medal)
if(medals.Find(medal))
return
else
world.SetMedal(medal,usr)
world.GetMedal(medal,usr)
world << "<font size=1><font color=blue><b>[usr] has earned the medal : [medal]"
medals.Add(medal)
mob
Login()
MedalLoad()
GiveMedal("Hope Is Alive", src)
var
list
medals = list()
mob/proc
MedalSave()
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("Medals/[firstletter]/[src.key].sav")
F["Medals"]<<medals

MedalLoad()
var/firstletter=copytext(src.ckey, 1, 2)
if(fexists("Medals/[firstletter]/[src.key].sav"))
var/savefile/F = new("Players/[firstletter]/[src.key].sav")
F["Medals"]>>medals
else
return

It Should give medal to usr and then add the medal name to list and save it(MedalSave()) then when mob relogs loads the medal list(MedalLoad()) and avoids usr from getting the msg "You Have Got A Medal every time they login
Problem description:The Code isnt doing its job
i have no errors while compileing but in game it gives errors

Oops.. forgot to give it a topic
What is the point of world.GetMedal in the first snippet?
Do you even CALL MedalSave/Load() Save should have been there after the GiveMedal part for sure...
In response to GhostAnime (#1)
can u suggest a code example and i made this so it wont pop up that u have earned this medal etc etc
In response to Taha123 (#2)
Taha123 wrote:
can u suggest a code example and i made this so it wont pop up that u have earned this medal etc etc

guide