##DanScripting Posted August 4, 2020 Share Posted August 4, 2020 Ao tentar iniciar um script de chat que peguei no Mta Brasil aparece "attempt to concatenate a boolean value", alguem ajuda: (linha 313) --[[ ########################################################################## ## ## ## ## ## Criador: Volklack ## ## ## ## ## ########################################################################## [C] Copyright 2012-2016, Apollo ]] local bw = {"desativado01"} local evento = {"desativado02"} local pw = {"desativado03"} local gw = {"desativado04"} anti_sm = {} local blockc = false function ram() blockc = false return 1 end addEventHandler("onResourceStart", getRootElement(), ram) function rem() removeElementData(getRootElement(), "mutc") removeElementData(getRootElement(), "mutc_m") removeElementData(getRootElement(), "mutc_t") blockc = false return 1 end addEventHandler("onResourceStop", getRootElement(), rem) function scant(msg, msgt) local msgs = string.lower(msg) local sep = scanp(msgs, ' ') local r, g, b = getPlayerNametagColor(source) local z = getPlayerName(source) local x = getPlayerFromName(z) local acc = getAccountName(getPlayerAccount(x)) local hr = getRealTime() local playeraccount = getPlayerAccount (source) if isGuestAccount(playeraccount) then outputChatBox("#FF0000Chat:#FFFFFF Digite /register (nome) (senha) depois /login (nome) (senha) para utilizar o chat.", source, 255, 0, 0, true) cancelEvent() return 1 end if blockc == true then if not isObjectInACLGroup("user."..acc, aclGetGroup("Console")) then outputChatBox("#FF0000Chat:#FFFFFF Conexão perdida com o Chat.", source, 0, 0, 0, true) cancelEvent() return 1 else outputChatBox("#FF0000Chat:#FFFFFF O chat está fechado, porém ele é liberado para demais usuários da administração.", source, 0, 0, 0, true) end end if getElementData(source, "blockic") == 4 then for a, b in ipairs(getElementsByType("player")) do local bcc = getAccountName(getPlayerAccount(b)) if isObjectInACLGroup("user."..bcc, aclGetGroup("Console")) or isObjectInACLGroup("user."..bcc, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user."..bcc, aclGetGroup("Moderator")) then outputChatBox("#FF8000Bloqueado: #FFFFFF "..z.." #FFFFFF(ID:"..IDx(source) .."):#FF8000 "..msg.."", b, 255, 255, 255, true) end end outputChatBox("#FF0000Chat:#FFFFFF O seu chat está bloqueado.", source, 200, 0, 0, true) cancelEvent() return 1 end if getElementData(source, "mutc") == 1 then outputChatBox("#FF0000Chat:#FFFFFF Você está mutado por "..getElementData(source, "mutc_m").." (tempo restante: ".. getElementData(source, "mutc_t") - hr.second.." segs).", source, 0, 0, 0, true) cancelEvent() return 1 end for a, b in pairs(sep) do for c, d in pairs(bw) do if msgt == 0 then if b == d then outputChatBox(getPlayerName(source).. " #FFFFFFFoi mutado por 2 minutos por ofensa.", getRootElement(), 200, 0, 0, true) outputChatBox("#FF0000Chat:#FFFFFF Você foi mutado por 2 minutos por ofensa.", source, 200, 0, 0, true) setElementData(source, "mutc_m", "ofensa") setElementData(source, "mutc_t", 120) setElementData(source, "mutc", 1) setTimer(removeElementData, 120000, 1, source, "mutc") setTimer(removeElementData, 120000, 1, source, "mutc_t") setTimer(removeElementData, 120000, 1, source, "mutc_m") setTimer(outputChatBox, 120000, 1, "#FF0000Chat:#FFFFFF Agora você pode utilizar o chat novamente.", source, 200, 0, 0, true) for a, b in ipairs(getElementsByType("player")) do local bcc = getAccountName(getPlayerAccount(b)) if isObjectInACLGroup("user."..bcc, aclGetGroup("Console")) or isObjectInACLGroup("user."..bcc, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user."..bcc, aclGetGroup("Moderator")) then outputChatBox("#FF8000Ofensa:#FFFFFF "..z.." #FFFFFF(ID:"..IDx(source) .."):#FF8000 "..msg.."", b, 255, 255, 255, true) end end cancelEvent() return 1 end end end end for a, b in pairs(sep) do for c, d in pairs(gw) do if msgt == 0 then if b == d then outputChatBox(getPlayerName(source).. " #FFFFFFFoi mutado por 1 minuto por menssagen obscenas.", getRootElement(), 200, 0, 0, true) outputChatBox("#FF0000Chat:#FFFFFF Você foi mutado por 1 minuto por menssagen obscenas.", source, 200, 0, 0, true) setElementData(source, "mutc_m", "menssagen obscena") setElementData(source, "mutc_t", 60) setElementData(source, "mutc", 1) setTimer(removeElementData, 60000, 1, source, "mutc") setTimer(removeElementData, 60000, 1, source, "mutc_t") setTimer(removeElementData, 60000, 1, source, "mutc_m") setTimer(outputChatBox, 60000, 1, "#FF0000Chat:#FFFFFF Agora você pode utilizar o chat novamente.", source, 200, 0, 0, true) for a, b in ipairs(getElementsByType("player")) do local bcc = getAccountName(getPlayerAccount(b)) if isObjectInACLGroup("user."..bcc, aclGetGroup("Console")) or isObjectInACLGroup("user."..bcc, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user."..bcc, aclGetGroup("Moderator")) then outputChatBox("#FF8000Mensagen obsena:#FFFFFF "..z.." #FFFFFF(ID:"..IDx(source) .."):#FF8000 "..msg.."", b, 255, 255, 255, true) end end cancelEvent() return 1 end end end end for a, b in pairs(sep) do for c, d in pairs(pw) do if msgt == 0 then if b == d then outputChatBox("Você foi mutado por 30 segundos, respeite os jogadores e as regras do servidor.", source, 255) setElementData(source, "mutc_m", "falta de respeito") setElementData(source, "mutc_t", 40) setElementData(source, "mutc", 1) setTimer(removeElementData, 30000, 1, source, "mutc") setTimer(removeElementData, 30000, 1, source, "mutc_t") setTimer(removeElementData, 30000, 1, source, "mutc_m") setTimer(outputChatBox, 30000, 1, "#FF0000Chat:#FFFFFF Agora você pode utilizar o chat novamente.", source, 255) for a, b in ipairs(getElementsByType("player")) do local bcc = getAccountName(getPlayerAccount(b)) if isObjectInACLGroup("user."..bcc, aclGetGroup("Console")) or isObjectInACLGroup("user."..bcc, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user."..bcc, aclGetGroup("Moderator")) then outputChatBox("#FF8000Insulto:#FFFFFF "..z.." #FFFFFF(ID:"..IDx(source) .."):#FF8000 "..msg.."", b, 255, 255, 255, true) end end cancelEvent() return 1 end end end end if isTimer(anti_sm[source]) then outputChatBox("#FF0000Chat:#FFFFFF Espere 1 segundo para falar novamente.", source, 255, 255, 255, true) cancelEvent() return 1 else anti_sm[source] = setTimer(function(source) anti_sm[source] = nil end, 1000, 1, source) end if msgt == 2 then r, g, b = getTeamColor(getPlayerTeam(source)) p = getPlayerName(source) for a, b in ipairs(getElementsByType("player")) do if getPlayerTeam(source) == getPlayerTeam(b) then outputChatBox("#00FF00(GANG)#FFFFFF "..p.."#FFFFFF(ID: "..IDx(source).."):#00FF00 "..msg.."", b, 0, 0, 0, true) end end cancelEvent() return 1 end if isObjectInACLGroup ("user."..acc, aclGetGroup("Console")) and getElementData(x, "AnonAdmin") == false then outputChatBox("#FFFF00* GM "..getPlayerName(source).."#FFFFFF(ID:"..IDx(source) .."): "..msg.."", getRootElement(), r, g, b, true) outputConsole("Chat: (GM) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") outputDebugString("Chat: (GM) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") return 1 end if isObjectInACLGroup ("user."..acc, aclGetGroup("Admin")) and getElementData(x, "AnonAdmin") == false then outputChatBox("* Admin "..getPlayerName(source).."#FFFFFF(ID:"..IDx(source) .."): "..msg.."", getRootElement(), r, g, b, true) outputConsole("Chat: (ADMIN) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") outputDebugString("Chat: (ADMIN) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") return 1 end if isObjectInACLGroup ("user."..acc, aclGetGroup("SuperModerator")) and getElementData(x, "AnonAdmin") == false then outputChatBox("* Smod "..getPlayerName(source).."#FFFFFF(ID:"..IDx(source) .."): "..msg.."", getRootElement(), r, g, b, true) outputConsole("Chat: (SMOD) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") outputDebugString("Chat: (SMOD) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") return 1 end if isObjectInACLGroup ("user."..acc, aclGetGroup("Moderator")) and getElementData(x, "AnonAdmin") == false then outputChatBox("* Mod "..getPlayerName(source).."#FFFFFF(ID:"..IDx(source) .."): "..msg.."", getRootElement(), r, g, b, true) outputConsole("Chat: (MOD) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") outputDebugString("Chat: (MOD) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") return 1 end if isObjectInACLGroup ("user."..acc, aclGetGroup("VIP")) and getElementData(x, "AnonAdmin") == false then outputChatBox("* Vip "..getPlayerName(source).."#FFFFFF(ID:"..IDx(source) .."): "..msg.."", getRootElement(), r, g, b, true) outputConsole("Chat: (VIP) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") outputDebugString("Chat: (VIP) "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") return 1 end -- outputChatBox(""..getPlayerName(source).."#FFFFFF(ID:"..IDx(source) ..")#FFFFFF: Deshawn tae?", getRootElement(), r, g, b, true) outputChatBox(""..getPlayerName(source).."#FFFFFF(ID:"..IDx(source) .."): "..rcc(msg).."", getRootElement(), r, g, b, true) outputConsole("Chat: "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") outputDebugString("Chat: "..getPlayerName(source).."(ID:"..IDx(source) .."): "..msg.."") end addEventHandler("onPlayerChat", getRootElement(), scant) -- function bbc(source) local accName = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then if blockc == true then outputChatBox("#FF8000"..getPlayerName(source).." #ffffffabriu o chat para jogadores.", getRootElement(), 255, 255, 255, true) blockc = false else outputChatBox("#FF8000"..getPlayerName(source).." #fffffffechou o chat para jogadores.", getRootElement(), 255, 255, 255, true) blockc = true end else return outputChatBox("Você não tem permição para este comando.", source, 200, 0, 0) end return 0 end addCommandHandler("fc", bbc) -- function IDx(idi) local idn = get("idDataCaption") or "id" return getElementData(idi, idn) end function scanp(sid, separador) if(#sid == 0) then return {} end if (#separador == 0) then return { sid } end return loadstring("return {\" "..sid:gsub(separador, "\", \"").."\"}") () end function rcc(txt) return type(txt)=='string' and string.gsub(txt, '#%x%x%x%x%x%x', "(#)") or name end 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