Wisam Posted December 4, 2012 Share Posted December 4, 2012 Hey I have advanced mute system script and I want to turn it to advanced ban system. Here is the script. function muteOurPlayer(player, command, mutedguy, time, reason) if mutedguy and time and reason then local muted = getPlayerFromName(mutedguy) if muted then if( not isPlayerMuted(muted) ) then setPlayerMuted(muted, true) outputChatBox("#FF0000"..getPlayerName(muted).." has been muted for"..time.."#FF0000 minutes. ("..reason.."#FF0000 )", getRootElement(), 255, 0, 0, true) setElementData(muted, "Muted", 1) setElementData(muted, "MutedTime", time) setElementData(muted, "Reason", reason) -- setTimer(setPlayerMuted(muted, false), time*60*1000, 1) -- setTimer(outputChatBox(mutedguy.." has been unmuted.", getRootElement()), time*60*1000, 1) end end else outputChatBox("MUTE SYNTAX: /mmute ", player) end end addCommandHandler("mmute", muteOurPlayer) function unmuteOurPlayer(player, command, unmutedguy) if unmutedguy then local unmuted = getPlayerFromName(unmutedguy) if unmuted then if isPlayerMuted(unmuted) then setPlayerMuted(unmuted, false) setElementData(unmuted, "Muted", 0) setElementData(unmuted, "MutedTime", 0) removeElementData(unmuted, "Reason") outputChatBox("#ADFF2F"..getPlayerName(unmuted).."#FFFFFF has been unmuted by#ADFF2F "..getPlayerName(player).."#FFFFFF. ", getRootElement(),255, 255, 255, true) end end else outputChatBox("UNMUTE SYNTAX: /unmute ", player) end end addCommandHandler("unmmute", unmuteOurPlayer) function unmuteChecker() players = getElementsByType("player") for i,thePlayer in ipairs(players) do if getElementData(thePlayer, "Muted") == 1 then if getElementData(thePlayer, "MutedTime") == 1 then setPlayerMuted(thePlayer, false) outputChatBox("#ADFF2F"..getPlayerName(thePlayer).."#FFFFFF has been unmuted by server. (#ADFF2FTime Passed#FFFFFF)", getRootElement(),255, 255, 255, true) else oldValue = getElementData(thePlayer, "MutedTime") setElementData(thePlayer, "MutedTime", oldValue-1) end end end end setTimer(unmuteChecker, 60000, 0) function muteList(player, command) players = getElementsByType("player") outputChatBox("List of muted players:", player) outputChatBox("----------------------", player, 255, 255, 255, true) for i,thePlayer in ipairs(players) do if getElementData(thePlayer, "Muted") == 1 then outputChatBox("Name: #ADFF2F"..getPlayerName(thePlayer).."#FFFFFF - Time: #ADFF2F"..getElementData(thePlayer,"MutedTime").."#FFFFFF minutes - Reason: #ADFF2F"..getElementData(thePlayer,"Reason"), player, 255, 255, 255, true) end end end addCommandHandler("mutelist", muteList) I want to replace /mmute with /bban , You can delete (if its advanced ban system) the unban function and the banlist function , because we can see bans in the admin panel. Link to comment
Castillo Posted December 4, 2012 Share Posted December 4, 2012 Oh, so you think you can come here and just ask us to make things for you? you are wrong, we only help you fix and understand your errors here. Here you got all the ban functions: https://wiki.multitheftauto.com/wiki/Ser ... _functions Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now