ID:163154
 
Thats wat im using but i want to add a system that when you click the worldsay HUD if ur muted it doesnt let u say anything but if your not it lets you say stuff


mob/owner/verb
Mute( mob/M in world)
usr.muted=1
src<<"<font color = blue>[M.name] has been muted."

mob/owner/verb
UnMute( mob/M in world)
usr.muted=0
src<<"<font color = blue>[M.name] has been unmuted."




obj
hud
HUD
layer = MOB_LAYER + 1
icon = 'HUD.dmi'
worldsay
icon_state = "worldsay"
Click()
var/t = input("OOC")as null|text
world << "<font color = Red>\[OOC\][usr]:[t]"
New(client/C)
screen_loc = "1,1"
C.screen+=src
Erm, you could either make a global list
 var/list/Muted
add the name to that and then check it upon them talking or you could make a var for the mob that when true stops them from talking:
mob/var/Muted=null
mob/verb/OOC(var/txt as text)
if(src.Muted)
return
world<<"[src] : [txt]"



var/list/Mutes=list()
mob/verb/OOC(var/txt as text)
if(global.Mutes.Find(src.ckey))
return
world<<"[src] : [txt]"


Just figure out for yurself how to do this with clicking on the OOC button (Easy easy)


In response to Lyndonarmitage1
Not realy or i wouldnt have asked for help so can you help me with it pls.
In response to Lyndonarmitage1
Using a global mute list may have its uses, but you shouldn't be consulting it during every say. Instead, the mob or client can carry a simple var that says whether they're muted or not. Of course that var should be a var/tmp so it doesn't save, and should be set when they log in and whenever mute status changes.

Lummox JR
In response to Lummox JR
Hmm i dont get that can u make an example
In response to Chrislee123
Ok, you've done all this wrong, firstly. when you did the mute verbs, it will mute the user instead of the mob.

This should work.
mob/owner/verb
Mute(mob/M as mob in world)
M.muted=1
src<<"<font color = blue>[M.name] has been muted."

mob/owner/verb
UnMute(mob/M as mob in world)
M.muted=0
src<<"<font color = blue>[M.name] has been unmuted."




obj
hud
HUD
layer = MOB_LAYER + 1
icon = 'HUD.dmi'
worldsay
icon_state = "worldsay"
Click()
if(usr.muted)return // if the users muted, then return so it doesnt send.
var/t = input("OOC")as null|text
world << "<font color = Red>\[OOC\][usr]:[t]"
New(client/C)
screen_loc = "1,1"
C.screen+=src


mob/owner/verb
Mute( mob/M in world)
M.muted=1
src<<"<font color = blue>[M.name] has been muted."

mob/owner/verb
UnMute( mob/M in world)
M.muted=0
src<<"<font color = blue>[M.name] has been unmuted."




obj
hud
HUD
layer = MOB_LAYER + 1
icon = 'HUD.dmi'
worldsay
icon_state = "worldsay"
Click()
var/t = input("OOC")as null|text
world << "<font color = Red>\[OOC\][usr]:[t]"
New(client/C)
screen_loc = "1,1"
C.screen+=src

if u need more help u can contact me at [email protected]
In response to Productions
Productions wrote:
mob/owner/verb
Mute( mob/M in world)
M.muted=1
src<<"<font color = blue>[M.name] has been muted."

mob/owner/verb
UnMute( mob/M in world)
M.muted=0
src<<"<font color = blue>[M.name] has been unmuted."




obj
hud
HUD
layer = MOB_LAYER + 1
icon = 'HUD.dmi'
worldsay
icon_state = "worldsay"
Click()
var/t = input("OOC")as null|text
world << "<font color = Red>\[OOC\][usr]:[t]"
New(client/C)
screen_loc = "1,1"
C.screen+=src

if u need more help u can contact me at [email protected]

lmao u just posted what I did except without the if(M.muted)return and without DM tags.
In response to Scizzees
So which ones better?? cause i used urs : D
In response to Chrislee123
also how do i create a HUD that wen clicked u get a certain verb for example who

thats my one so if you can can u use that to show me pls

mob/verb/Who()
var/tmp/C = 0
for(var/mob/M in world)
if(M.client)
C += 1
usr << "<font size=2><b><font color=red>[M.name]: <font color=green>(Key: [M.key])"
usr << "<font size=1>[C] Players Online!"
In response to Chrislee123
Chrislee123 wrote:
also how do i create a HUD that wen clicked u get a certain verb for example who

thats my one so if you can can u use that to show me pls

mob/verb/Who()
> var/tmp/C = 0
> for(var/mob/M in world)
> if(M.client)
> C += 1
> usr << "<font size=2><b><font color=red>[M.name]: <font color=green>(Key: [M.key])"
> usr << "<font size=1>[C] Players Online!"


All you have to do is take out
mob/verb/Who()
and copy and paste the rest under the Obj with
Click()


Example (Just change the icon and icon_state
obj
hp
icon=''
icon_state=""
name="Who"
Click()
var/tmp/C = 0
for(var/mob/M in world)
if(M.client)
C+=1
usr<<"<font size=2><b><font color=red>[M.name]: <font color=green>(Key: [M.key])"
usr << "<font size=1>[C] Players Online!"
In response to Scizzees
kk ty can u use that with every verb?
In response to Chrislee123
I Would suggest using procs >.> IF you're having verbs for them aswell