Tekken Posted October 18, 2014 Posted October 18, 2014 Hi guys i added a mute verification on globalchat but is not working function globalMessage(thePlayer, cmd, ...) if isPlayerMuted ( playersource ) then outputChatBox ("You are muted!", playersource, 255, 128, 22, true) return end local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#DEFF00#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return end if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#DEFF00#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else outputChatBox("#00E6FF#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
Anubhav Posted October 18, 2014 Posted October 18, 2014 function globalMessage(thePlayer, cmd, ...) if isPlayerMuted ( thePlayer ) then outputChatBox ("You are muted!", thePlayer, 255, 128, 22, true) return end local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#DEFF00#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return end if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#DEFF00#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else outputChatBox("#00E6FF#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "x", "down", "chatbox", "global"); end ) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Mr_Moose Posted October 18, 2014 Posted October 18, 2014 Line 2: 'playersource' does not point on the player, 'thePlayer' does that, Anubhav fixed it for you. If it still doesn't work, try '/debugscript 3' which will expose that kind of issues. MTA Community | GitHub | 99Stack Forum
Tekken Posted October 18, 2014 Author Posted October 18, 2014 Works Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
Anubhav Posted October 18, 2014 Posted October 18, 2014 No problem See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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