Jump to content

Mute Player Help


Ryan1010

Recommended Posts

I made a script like this;

function mutePlayer ( theplayer )
 
setPlayerMuted ( theplayer, true )
 
outputChatBox ( "You Have Been Muted" , theplayer , 000, 255, 000)
 
end
 
addCommandHandler ( "mute", mutePlayer )
 
 
 
function unmutePlayer ( theplayer )
 
setPlayerMuted ( theplayer, false )
 
outputChatBox ( "You Have Been UnMuted" , theplayer , 255, 000, 000 )
 
end
 
addCommandHandler ( "unmute", unmutePlayer )

When I type the commands like: /mute Player .. then I will get muted and not the Player. What am I doing wrong?

Link to comment
function mutePlayer(player,command,name)
local playerToMute = getPlayerFromName(name)
setPlayerMuted(playerToMute,true)
outputChatBox ("You Have Been Muted",playerToMute,000,255,000)
end
 
addCommandHandler("mute",mutePlayer)
 
function unmutePlayer(player,command,name)
local playerToUnmute = getPlayerFromName(name)
setPlayerMuted (playerToUnmute, false)
outputChatBox("You Have Been UnMuted",playerToUnmute,255,000,000)
end
 
addCommandHandler("unmute",unmutePlayer)

next time have a closer look what arguments you're actually getting.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...