mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 20:15:47 +01:00
Adds new direct mob sound admin verb (#48171)
Adds the "Play Direct Mob Sound" for (b)admins to enjoy. Pick a sound and a mob, and only the chosen mob will hear it. Button also available in the player panel. Happy admins happy life
This commit is contained in:
@@ -105,6 +105,7 @@
|
||||
body += "<A href='?_src_=holder;[HrefToken()];traitor=[REF(M)]'>Traitor panel</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];narrateto=[REF(M)]'>Narrate to</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];subtlemessage=[REF(M)]'>Subtle message</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];playsoundto=[REF(M)]'>Play sound to</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];languagemenu=[REF(M)]'>Language Menu</A>"
|
||||
|
||||
if (M.client)
|
||||
|
||||
@@ -79,7 +79,7 @@ GLOBAL_PROTECT(admin_verbs_admin)
|
||||
)
|
||||
GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/ban_panel, /client/proc/stickybanpanel))
|
||||
GLOBAL_PROTECT(admin_verbs_ban)
|
||||
GLOBAL_LIST_INIT(admin_verbs_sounds, list(/client/proc/play_local_sound, /client/proc/play_sound, /client/proc/set_round_end_sound))
|
||||
GLOBAL_LIST_INIT(admin_verbs_sounds, list(/client/proc/play_local_sound, /client/proc/play_direct_mob_sound, /client/proc/play_sound, /client/proc/set_round_end_sound))
|
||||
GLOBAL_PROTECT(admin_verbs_sounds)
|
||||
GLOBAL_LIST_INIT(admin_verbs_fun, list(
|
||||
/client/proc/cmd_admin_dress,
|
||||
|
||||
@@ -1496,6 +1496,15 @@
|
||||
var/mob/M = locate(href_list["subtlemessage"])
|
||||
usr.client.cmd_admin_subtle_message(M)
|
||||
|
||||
else if(href_list["playsoundto"])
|
||||
if(!check_rights(R_SOUND))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["playsoundto"])
|
||||
var/S = input("", "Select a sound file",) as null|sound
|
||||
if(S)
|
||||
usr.client.play_direct_mob_sound(S, M)
|
||||
|
||||
else if(href_list["individuallog"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
@@ -52,6 +52,21 @@
|
||||
playsound(get_turf(src.mob), S, 50, FALSE, FALSE)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Local Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/play_direct_mob_sound(S as sound, mob/M)
|
||||
set category = "Fun"
|
||||
set name = "Play Direct Mob Sound"
|
||||
if(!check_rights(R_SOUND))
|
||||
return
|
||||
|
||||
if(!M)
|
||||
M = input(usr, "Choose a mob to play the sound to. Only they will hear it.", "Play Mob Sound") as null|anything in sortNames(GLOB.player_list)
|
||||
if(!M || QDELETED(M))
|
||||
return
|
||||
log_admin("[key_name(src)] played a direct mob sound [S] to [M].")
|
||||
message_admins("[key_name_admin(src)] played a direct mob sound [S] to [ADMIN_LOOKUPFLW(M)].")
|
||||
SEND_SOUND(M, S)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Direct Mob Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/play_web_sound()
|
||||
set category = "Fun"
|
||||
set name = "Play Internet Sound"
|
||||
|
||||
Reference in New Issue
Block a user