ID:1725014
 
I'm trying to make it so that logs are saved in a var, and then when you want to access them you can DL them if you're an admin. It doesn't work though, I can't figure out why though.


//getting the logs
mob/gm
verb/tmp
Player_Logs(var/mob/m in players)
var/list/n = list()
for(var/t in m.PLog)
n << t
n = file("[m.ckey]logs.txt")
usr << ftp(n)

//logging player talking
Say(h as text)
set category = "Miscellaneous"
if(length(h)>=750)
usr << "<font color=#95A3B5>Your message is too long."
return
view() << "<font color = [textcolor]>[usr.name] says, \"[html_encode(h)]\""
for(var/mob/m in view())
m.PLog += "([time2text(world.realtime)]) [usr.name]([usr.key]) says, \"[html_encode(h)]\""
var/obj/I = new
I.icon = 'SaySpark.dmi'
I.icon += textcolor
I.pixel_y = 5
src.overlays += I
sleep(30)
src.overlays -= I

When I click the verb it doesn't ask me where to save the file. So I'm guessing that there is no file to save, but why?
mob/gm
verb/tmp
Player_Logs(var/mob/m in players)
if(fexists("[m.ckey]logs.txt"))
fdel("[m.ckey]logs.txt")
PLF = file("[m.ckey]logs.txt")
for(var/t in m.PLog)
PLF << "[t]"
usr << ftp(PLF)

Fixed it!