Files
Aurora.3/code/modules/events/ccia_general_notice.dm
Werner 94fe548cf7 Should fix #3841 (#3861)
Makes printing announcments a parameter of .Announce() and changes a few announcements to use that.
Should fix #3841
2017-12-08 23:05:52 +02:00

23 lines
879 B
Plaintext

/datum/event/ccia_general_notice
var/reporttitle = "CCIA Title"
var/reportbody = "CCIA Message"
var/announce = 0
no_fake = 1
/datum/event/ccia_general_notice/start()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
log_debug("CCIA Autoamtic General Notice - Could not establish database connection")
return
var/DBQuery/query = dbcon.NewQuery("SELECT SQL_NO_CACHE title, message FROM ss13_ccia_general_notice_list WHERE deleted_at IS NULL AND automatic = 1 ORDER BY RAND() LIMIT 1;")
query.Execute()
if (query.NextRow())
reporttitle = query.item[1]
reportbody = query.item[2]
reportbody += "\n\n- CCIAAMS, [commstation_name()]"
announce = 1
/datum/event/ccia_general_notice/announce()
if(announce)
command_announcement.Announce("[reportbody]", reporttitle, new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1, do_newscast=1, do_print=1);