Darwin Posted October 15, 2019 Share Posted October 15, 2019 hola tengo un error y es que cuando pongo a un user en el ACL siempre aparecen con el mismo tag y no se le cambia el tag words = {} SQLS3D = { qury = executeSQLQuery } chatTime = {} lastChatMessage = {} addEventHandler("onPlayerChat", getRootElement(), function(text, msgtype, thePlayer) local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) local root = getRootElement() local name = getPlayerName(source) local r,g,b = getPlayerNametagColor(source) local Account1 = getPlayerAccount ( source ) local new = "" local iter = 0 msg = string.gsub(text,"ـ","") for word in msg:gmatch("%S+") do iter = iter + 1 -- for i,swr in ipairs(words) do -- local src = word:lower():gsub("%s","") -- local src = src:gsub("#%x%x%x%x%x%x","") -- local src = src:gsub("%c","") -- local src = src:gsub("%p","") -- local pat = swr:lower():gsub("%s","") -- if src:find(pat) then -- local replaceString = "" -- for x=1,word:gsub("#%x%x%x%x%x%x",""):len() do -- replaceString = replaceString.."*" -- end -- word = word:gsub(word,replaceString) -- end -- end if iter == 1 and word:len() > 0 then word = word:gsub("%a",string.upper,1) end new = new..word.." " end if new ~= "" then msg = new end text = msg if chatTime[source] and chatTime[source] + tonumber(1000) > getTickCount() then cancelEvent() outputChatBox("#ff0000[SPAM] 2EFF00Espere 1 segundo para poder digitar nuevamente!", source, 255, 0, 0) return else chatTime[source] = getTickCount() end lastChatMessage[source] = text local r, g, b = getPlayerNametagColor(source) cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then cancelEvent(true) outputChatBox("#ff0000[Admin]►" .. name ..": #2EFF00" .. text, root, 255, 255, 255, true) outputServerLog("CHAT: #ff0000[Admin]►" .. name ..": #2EFF00" .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Soporte")) then cancelEvent(true) outputChatBox("#000000$$$[#8A2BE2SOP#000000]#FFFFFF " .. name ..": " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderador")) then cancelEvent(true) outputChatBox("#000000[#ff0000Mod#000000]#FFFFFF "..name..": " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Super Moderador")) then cancelEvent(true) outputChatBox("#000000[#ff0000SMod#000000]#FFFFFF "..name..": " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("ProKillers")) then cancelEvent(true) outputChatBox("#01445C[P♛K]#FFFFFF "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Killer")) then cancelEvent(true) outputChatBox("#FFFF00[☯Killer☯]#FFFFFF "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Legendario")) then cancelEvent(true) outputChatBox(" #CCEEFF[LEGENDARIO]#FFFFFF "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Asesino")) then cancelEvent(true) outputChatBox("#3F0CA5[☢ASESINO☢]#FFFFFF "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Elite")) then cancelEvent(true) outputChatBox("#3F0CA5[☢ASESINO☢]#FFFFFF "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Armada")) then cancelEvent(true) outputChatBox("#15133E[☮ARMADA☮]#FFFFFF "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Militar")) then cancelEvent(true) outputChatBox("#017C16[✯MILITAR✯]#FFFFFF "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Policia")) then cancelEvent(true) outputChatBox("#0174FE[✮POLICIA✮]#FFFFFF "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Reclutas")) then cancelEvent(true) outputChatBox("#585858[RECLUTAS]☥#585858 "..name.."#FFFFFF" .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Soporte")) then cancelEvent(true) outputChatBox("#02EFF6[#1E90FFSOP#000000]#02EFF6 "..name.." " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then cancelEvent(true) outputChatBox("#ff0000[VIP]#FFFFFF "..name.."#FFFFFF: " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then cancelEvent(true) outputChatBox("#585858[Everyone]#585858"..name..": "..text, root, 255, 255, 255, true) outputServerLog("CHAT: " .. name .. ": " .. text) end end ) Link to comment
root. Posted October 15, 2019 Share Posted October 15, 2019 Primero que nada debes utilizar el formato de codigo para que podamos entender el codigo que posteas y ayudarte. Además, creo que estás haciendo mal-uso de esta sección. https://forum.multitheftauto.com/forum/167-scripting/ 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