viniciuss Posted March 22, 2021 Share Posted March 22, 2021 Eu queria deixar esse nome tag com a funçao de quando o staff digitasse um comando o nome dele sumisse junto com a vida e o colete. alguem poderia me ajudar? 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 id = getElementData(source, "ID") or "N/A" 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("Espere 1 segundo para poder digitar novamente!", 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("Console")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F ⌜ #00ff00Dona #ff0000Geral #2F2F2F⌟ #ffffff" .. name .. "#FFFFFF ("..id..") »#ffffff " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Subdono")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F ⌜ #00BFFFSub #ff0000Dono #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin geral")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00FFFFAdministrador #FFFAFAGeral #2F2F2F⌟ " .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ ⌟ #2F2F2F⌜ #FF0040Adminis#FFFFFFtrador #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderador")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #9B30FFModer#FFFFFFador #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00ff00Super#2F2F2F Moderador ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Ajudante")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #7FFFD4Ajud#FFFFFFante #2F2F2F ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("vip")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #FF00FFVIP #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Versatil Drifting")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #2F2F2FVЄƦƧƛƬƖԼ #FF0040ƊƦƖƑƬƖƝƓ ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("tagdovip")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #FFFFFFV҉I҉P#363636-™ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("tdetag")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F⌜ #00BFFF✘ ŦŘØƤΔ ĐΔ €ŞĆØĆƗΔ ✘ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("cvtag")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F⌜ #ff0000✞ ĆØΜΔŇĐØ V€ŘΜ€ŁĦØ ✞ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00BFFFJoga#FFFFFFdor #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF" .. text, root, 255, 255, 255, true) outputServerLog("CHAT: " .. name .. ": " .. text) end end ) Link to comment
Moderators Patrick Posted March 22, 2021 Moderators Share Posted March 22, 2021 Wrong language, moved to Portuguese section. Link to comment
Other Languages Moderators Lord Henry Posted March 23, 2021 Other Languages Moderators Share Posted March 23, 2021 addCommandHandler ("tag", root, function (thePlayer) -- Comando para mostrar/ocultar a nametag é /tag if (hasObjectPermissionTo (thePlayer, "command.mute", false)) then -- Se o jogador que usou o comando for Staff (tem permissão de mutar), então: if (isPlayerNametagShowing (thePlayer)) then -- Se a nametag dele está visível, então: setPlayerNametagShowing (thePlayer, false) -- Oculta a nametag dele. outputChatBox ("Sua nametag agora está #ff6400oculta.", thePlayer, 231, 217, 176, true) else -- Se a nametag dele está invisível, então: setPlayerNametagShowing (thePlayer, true) -- Mostra a nametag dele. outputChatBox ("Sua nametag agora está #00ff00visível.", thePlayer, 231, 217, 176, true) end else -- Se o jogador não tem permissão de mutar, então: outputChatBox ("Acesso negado.", thePlayer, 255, 0, 0) -- Apenas manda essa mensagem no chat dele. end 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