Files
vgstation13/code/modules/admin/admin_memo.dm
DamianX 85ff9b697a Fixed a bunch of warnings and errors (#26993)
* renamed implant malfunction defines

* refactored domutation

* possibly fix something about whitelists

* fix admin_memo warning

* fixed wrong attackby parameters in click.dm

* remove superfluous return in BSQL

* maybe fix something in mob/add_language

* maybe fix more language stuff

* Added return-type annotation to job_controller

* removed unreachable code from observer.dm

* possibly fix electrocute_act

* fixed bees wow this code never ran, 100% tested

* fixed parrot life

* fixed wolf attack logs

* fix bear life

* removed unreachable slime/show_inv

* fixed human/electrocute_act

* actually just get rid of this shit

* properly add return types

* removed more returns from BSQL

* added get_organ return type

* fixed infrared holder_movement

* fixed type_instances declaration

* fixed unreacheable overlay/New

* possibly fix release_restraints

* remove hopefully final return from BSQL
2020-07-01 09:46:00 -03:00

61 lines
1.7 KiB
Plaintext

#define MEMOFILE "data/memo.sav" //where the memos are saved
#define ENABLE_MEMOS 1 //using a define because screw making a config variable for it. This is more efficient and purty.
//switch verb so we don't spam up the verb lists with like, 3 verbs for this feature.
/client/proc/admin_memo(task in list("write","show","delete"))
set name = "Memo"
set category = "Server"
#if !ENABLE_MEMOS
return
#endif
if(!check_rights(0))
return
switch(task)
if("write")
admin_memo_write()
if("show")
admin_memo_show()
if("delete")
admin_memo_delete()
//write a message
/client/proc/admin_memo_write()
var/savefile/F = new(MEMOFILE)
if(F)
var/memo = input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message
switch(memo)
if(null)
return
if("")
F.dir.Remove(ckey)
to_chat(src, "<b>Memo removed</b>")
return
if( findtext(memo,"<script",1,0) )
return
F[ckey] << "[key] on [time2text(world.realtime,"(DDD) DD MMM hh:mm")]<br>[memo]"
message_admins("[key] set an admin memo:<br>[memo]")
//show all memos
/client/proc/admin_memo_show()
#if ENABLE_MEMOS
var/savefile/F = new(MEMOFILE)
if(F)
for(var/ckey in F.dir)
to_chat(src, "<center><span class='motd'><b>Admin Memo</b><i> by [F[ckey]]</i></span></center>")
#endif
//delete your own or somebody else's memo
/client/proc/admin_memo_delete()
var/savefile/F = new(MEMOFILE)
if(F)
var/ckey
if(check_rights(R_SERVER,0)) //high ranking admins can delete other admin's memos
ckey = input(src,"Whose memo shall we remove?","Remove Memo",null) as null|anything in F.dir
else
ckey = src.ckey
if(ckey)
F.dir.Remove(ckey)
to_chat(src, "<b>Removed Memo created by [ckey].</b>")
#undef MEMOFILE
#undef ENABLE_MEMOS