Player Memos

This commit is contained in:
SoundScopes
2015-03-03 14:04:35 +00:00
parent 84fd6a1a6c
commit e4b1db68b5
3 changed files with 61 additions and 1 deletions
+59 -1
View File
@@ -1,9 +1,10 @@
#define MEMOFILE "data/memo.sav" //where the memos are saved
#define PLAYERMEMOFILE "data/pmemo.sav" //where the player 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 name = "Admin Memo"
set category = "Server"
if(!ENABLE_MEMOS) return
if(!check_rights(0)) return
@@ -50,5 +51,62 @@
F.dir.Remove(ckey)
src << "<b>Removed Memo created by [ckey].</b>"
//switch verb so we don't spam up the verb lists with like, 3 verbs for this feature.
/client/verb/memo_player()
set name = "Player Memo"
set category = "OOC"
if(!ENABLE_MEMOS) return
admin_memo_player_show()
/client/proc/admin_memo_player(task in list("write","show","delete"))
set name = "Player Memo"
set category = "Server"
if(!ENABLE_MEMOS) return
if(!check_rights(0)) return
switch(task)
if("write") admin_memo_player_write()
if("show") admin_memo_player_show()
if("delete") admin_memo_player_delete()
//write a message
/client/proc/admin_memo_player_write()
var/savefile/F = new(PLAYERMEMOFILE)
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)
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 player memo:<br>[memo]")
//show all memos
/client/proc/admin_memo_player_show()
if(ENABLE_MEMOS)
var/savefile/F = new(PLAYERMEMOFILE)
if(F)
for(var/ckey in F.dir)
src << "<center><span class='motd'><b>Player Memo</b><i> by [F[ckey]]</i></span></center>"
//delete your own or somebody else's memo
/client/proc/admin_memo_player_delete()
var/savefile/F = new(PLAYERMEMOFILE)
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)
src << "<b>Removed Memo created by [ckey].</b>"
#undef MEMOFILE
#undef PLAYERMEMOFILE
#undef ENABLE_MEMOS
@@ -31,6 +31,7 @@ var/list/admin_verbs_admin = list(
/client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcomm*/
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
/client/proc/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/
/client/proc/admin_memo_player,
/client/proc/alertlevels,
/client/proc/allow_character_respawn, /* Allows a ghost to respawn */
/client/proc/check_ai_laws, /*shows AI and borg laws*/
+1
View File
@@ -151,6 +151,7 @@
host = key
world.update_status()
admin_memo_player_show()
if(holder)
add_admin_verbs()
admin_memo_show()