Kpds Posted June 18, 2022 Share Posted June 18, 2022 Não estou conseguindo colocar apenas para a ACL "Superior" conseguir mandar anuncio na tela com um Script que peguei na internet alguém ajuda?? Arquivos que contém dentro da pasta, todos os scripts fazem parte do mesmo mod, mas veem em arquivos .lua diferentes. SCR 1 addCommandHandler( global.Comando, function(playerSource, cmd, ...) local text = table.concat({...}, " ") if text then local namePlayer = getPlayerName(playerSource) triggerClientEvent(root, "KKZinho:AnunciarStaff", playerSource, namePlayer, text) end end) SCR 2 global = { ["Duracao"] = 3, -- Duração na tela em segundos. ["Comando"] = "anuncio", -- Comando utilizado. } SCR 3 local screenW,screenH = guiGetScreenSize() local resW,resH = 1366,768 local x,y = (screenW/resW), (screenH/resH) local font = dxCreateFont( "assets/font.ttf", 10 ) local pos_x = x*0 local pos_x2 = x*0 local pos_x3 = x*0 local painelAnuncio = false function drawDx() dxDrawImage(x*20, y*284, x*280, y*200, "assets/main.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(sendMessage, pos_x2, y*329, x*282, y*468, tocolor(255, 255, 255, 255), 1.00, font, "left", "top", false, true, false, false, false) dxDrawText("@"..nameSender.." #ffffffanunciou:", pos_x3, y*298, x*232, y*317, tocolor(255, 255, 255, 255), 1.00, font, "left", "top", false, true, false, true, false) end function animateDraw() local initialTime = getTickCount() local duration = 1500 function animateInitial() local currentTime = getTickCount() local passedTime = currentTime - initialTime if passedTime >= global.Duracao*1000 then removeEventHandler("onClientRender", root, animateInitial) removeEventHandler("onClientRender", root, drawDx) painelAnuncio = false end local progress = passedTime / duration pos_x = interpolateBetween(0, 0, 0, 20, 0, 0, progress, "OutElastic") pos_x2 = interpolateBetween(0, 0, 0, 33, 0, 0, progress, "OutElastic") pos_x3 = interpolateBetween(0, 0, 0, 89, 0, 0, progress, "OutElastic") setTimer( function() pos_x = interpolateBetween(20, 0, 0, 0, 0, 0, progress, "InElastic") pos_x2 = interpolateBetween(33, 0, 0, 0, 0, 0, progress, "InElastic") pos_x3 = interpolateBetween(89, 0, 0, 0, 0, 0, progress, "InElastic") end, global.Duracao*1000, 1) end if not painelAnuncio then addEventHandler("onClientRender", root, animateInitial) addEventHandler("onClientRender", root, drawDx) painelAnuncio = true end end function callAll(senderName, messageSend) if senderName then if messageSend then nameSender = senderName sendMessage = messageSend animateDraw() playSoundFrontEnd(4) end end end addEvent("KKZinho:AnunciarStaff", true) addEventHandler("KKZinho:AnunciarStaff", getRootElement(), callAll) meta <meta> <script src="KakaG.lua" type="shared"/> <script src="KakaC.lua" type="client"/> <script src="KakaS.lua" type="server"/> <file src="assets/main.png"/> <file src="assets/font.ttf"/> </meta> Link to comment
noonbr Posted June 19, 2022 Share Posted June 19, 2022 Dificilmente as pessoas conseguem ajuda com scripts que não são da sua autoria. Ajeite a sua postagem para a formatação Lua nas partes onde há código. 1. Clique no ícone que representa a abertura e fechamento de tag. 2. Coloque a linguagem de programação Lua e cole seu código na parte editável (branca), depois clique em Insert into post. Link to comment
DaeRoNz Posted June 19, 2022 Share Posted June 19, 2022 addCommandHandler( global.Comando, function(playerSource, cmd, ...) local conta = getAccountName(getPlayerAccount(playerSource)) if ( isObjectInACLGroup ( "user.".. conta, aclGetGroup ( "Superior" ) ) ) then local text = table.concat({...}, " ") if text then local namePlayer = getPlayerName(playerSource) triggerClientEvent(root, "KKZinho:AnunciarStaff", playerSource, namePlayer, text) end else return 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