mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-22 04:24:20 +01:00
Merge pull request #6774 from FlattestGuitar/jobban
Adds a jobban checking verb. 🔨
This commit is contained in:
@@ -140,3 +140,43 @@ DEBUG
|
||||
jobban_savebanfile()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/verb/displayjobbans()
|
||||
set category = "OOC"
|
||||
set name = "Display Current Jobbans"
|
||||
set desc = "Displays all of your current jobbans."
|
||||
|
||||
if(!client || !ckey)
|
||||
return
|
||||
if(config.ban_legacy_system)
|
||||
//using the legacy .txt ban system
|
||||
to_chat(src, "The server is using the legacy ban system. Ask an administrator for help!")
|
||||
|
||||
else
|
||||
//using the SQL ban system
|
||||
var/is_actually_banned = FALSE
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100")
|
||||
select_query.Execute()
|
||||
|
||||
while(select_query.NextRow())
|
||||
|
||||
var/bantime = select_query.item[1]
|
||||
var/bantype = select_query.item[2]
|
||||
var/reason = select_query.item[3]
|
||||
var/job = select_query.item[4]
|
||||
var/duration = select_query.item[5]
|
||||
var/expiration = select_query.item[6]
|
||||
var/ackey = select_query.item[7]
|
||||
|
||||
if(bantype == "JOB_PERMABAN")
|
||||
to_chat(src, "<span class='warning'>[bantype]: [job] - REASON: [reason], by [ackey]; [bantime]</span>")
|
||||
else if(bantype == "JOB_TEMPBAN")
|
||||
to_chat(src, "<span class='warning'>[bantype]: [job] - REASON: [reason], by [ackey]; [bantime]; [duration]; expires [expiration]</span>")
|
||||
|
||||
is_actually_banned = TRUE
|
||||
|
||||
if(is_actually_banned)
|
||||
if(config.banappeals)
|
||||
to_chat(src, "<span class='warning'>You can appeal the bans at: [config.banappeals]</span>")
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You have no active jobbans!</span>")
|
||||
|
||||
Reference in New Issue
Block a user