zRodrigoMM Posted June 21, 2020 Share Posted June 21, 2020 Alguem pode me explicar como posso por um bloqueio nessas funções, para que apenas os grupos que eu mencionar poder reagir. server side: function setPedFortniteAnimation (ped,animation,tiempo,repetir,mover,interrumpible) if (type(animation) ~= "string" or type(tiempo) ~= "number" or type(repetir) ~= "boolean" or type(mover) ~= "boolean" or type(interrumpible) ~= "boolean") then return false end if isElement(ped) then if animation == "baile 1" or animation == "baile 2" or animation == "baile 3" or animation == "baile 4" or animation == "baile 5" or animation == "baile 6" or animation == "baile 7" or animation == "baile 8" or animation == "baile 9" or animation == "baile 10" or animation == "baile 11" or animation == "baile 12" or animation == "baile 13" or animation == "baile 14" or animation == "baile 15" or animation == "baile 16" or animation == "baile 17" or animation == "baile 18" or animation == "baile 19" or animation == "baile 20" or animation == "baile 21" or animation == "baile 22" then for i = 1,6 do triggerClientEvent ( root, "setPedFortniteAnimation", root, ped,animation,tiempo,repetir,mover,interrumpible ) if tiempo > 1 then setTimer(setPedAnimation,tiempo,1,ped,false) setTimer(setPedAnimation,tiempo+100,1,ped,false) end end end end end function howtouse ( player, command, dance ) if isElement(player) then setPedFortniteAnimation(player,"baile "..dance.."",-1,true,false,false,false) end end addCommandHandler ( "dance", howtouse ) --*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-- anim = {} function anim.sexy() setPedFortniteAnimation(source,"baile 1",-1,true,false,false,false) end addEvent("anim.sexy", true) addEventHandler("anim.sexy", root, anim.sexy) function anim.:O() setPedFortniteAnimation(source,"baile 2",-1,true,false,false,false) end addEvent("anim.:O", true) addEventHandler("anim.:O", root, anim.:O) function anim.smile() setPedFortniteAnimation(source,"baile 3",-1,true,false,false,false) end addEvent("anim.smile", true) addEventHandler("anim.smile", root, anim.smile) function anim.chat() setPedFortniteAnimation(source,"baile 4",-1,true,false,false,false) end addEvent("anim.chat", true) addEventHandler("anim.chat", root, anim.chat) function anim.handsup() setPedFortniteAnimation(source,"baile 5",-1,true,false,false,false) end addEvent("anim.handsup", true) addEventHandler("anim.handsup", root, anim.handsup) function anim.smoke() setPedFortniteAnimation(source,"baile 6",-1,true,false,false,false) end addEvent("anim.smoke", true) addEventHandler("anim.smoke", root, anim.smoke) function anim.sentar() setPedFortniteAnimation(source,"baile 7",-1,true,false,false,false) end addEvent("anim.sentar", true) addEventHandler("anim.sentar", root, anim.sentar) function anim.dance() setPedFortniteAnimation(source,"baile 8",-1,true,false,false,false) end addEvent("anim.dance", true) addEventHandler("anim.dance", root, anim.dance) function anim.espere() setPedFortniteAnimation(source,"baile 9",-1,true,false,false,false) end addEvent("anim.espere", true) addEventHandler("anim.espere", root, anim.espere) function anim.espere2() setPedFortniteAnimation(source,"baile 10",-1,true,false,false,false) end addEvent("anim.espere2", true) addEventHandler("anim.espere2", root, anim.espere2) function anim.chat1() setPedFortniteAnimation(source,"baile 11",-1,true,false,false,false) end addEvent("anim.chat1", true) addEventHandler("anim.chat1", root, anim.chat1) function anim.chat2() setPedFortniteAnimation(source,"baile 12",-1,true,false,false,false) end addEvent("anim.chat2", true) addEventHandler("anim.chat2", root, anim.chat2) function anim.chat3() setPedFortniteAnimation(source,"baile 13",-1,true,false,false,false) end addEvent("anim.chat3", true) addEventHandler("anim.chat3", root, anim.chat3) function anim.chat4() setPedFortniteAnimation(source,"baile 14",-1,true,false,false,false) end addEvent("anim.chat4", true) addEventHandler("anim.chat4", root, anim.chat4) function anim.chat5() setPedFortniteAnimation(source,"baile 15",-1,true,false,false,false) end addEvent("anim.chat5", true) addEventHandler("anim.chat5", root, anim.chat5) function anim.chat6() setPedFortniteAnimation(source,"baile 16",-1,true,false,false,false) end addEvent("anim.chat6", true) addEventHandler("anim.chat6", root, anim.chat6) function anim.chat7() setPedFortniteAnimation(source,"baile 17",-1,true,false,false,false) end addEvent("anim.chat7", true) addEventHandler("anim.chat7", root, anim.chat7) function anim.chat8() setPedFortniteAnimation(source,"baile 18",-1,true,false,false,false) end addEvent("anim.chat8", true) addEventHandler("anim.chat8", root, anim.chat8) function anim.chat9() setPedFortniteAnimation(source,"baile 19",-1,true,false,false,false) end addEvent("anim.chat9", true) addEventHandler("anim.chat9", root, anim.chat9) function anim.chat10() setPedFortniteAnimation(source,"baile 20",-1,true,false,false,false) end addEvent("anim.chat10", true) addEventHandler("anim.chat10", root, anim.chat10) function anim.chat11() setPedFortniteAnimation(source,"baile 21",-1,true,false,false,false) end addEvent("anim.chat11", true) addEventHandler("anim.chat11", root, anim.chat11) function anim.chat12() setPedFortniteAnimation(source,"baile 22",-1,true,false,false,false) end addEvent("anim.chat12", true) addEventHandler("anim.chat12", root, anim.chat12) function anim.cancel() setPedAnimation(source) end addEvent("anim.cancel", true) addEventHandler("anim.cancel", root, anim.cancel) cliente side: local customIfp = nil function setPedFortniteAnimation (ped,animation,tiempo,repetir,mover,interrumpible) if (type(animation) ~= "string" or type(tiempo) ~= "number" or type(repetir) ~= "boolean" or type(mover) ~= "boolean" or type(interrumpible) ~= "boolean") then return false end if isElement(ped) then if animation == "baile 1" or animation == "baile 2" or animation == "baile 3" or animation == "baile 4" or animation == "baile 5" or animation == "baile 6" or animation == "baile 7" or animation == "baile 8" or animation == "baile 9" or animation == "baile 10" or animation == "baile 11" or animation == "baile 12" or animation == "baile 13" or animation == "baile 14" or animation == "baile 15" or animation == "baile 16" or animation == "baile 17" or animation == "baile 18" or animation == "baile 19" or animation == "baile 20" or animation == "baile 21" or animation == "baile 22" then for i = 1,3 do setPedAnimation(ped, "Fortnite_"..i.."", animation, tiempo, true, false, false) if tiempo > 1 then setTimer(setPedAnimation,tiempo,1,ped,false) setTimer(setPedAnimation,tiempo+100,1,ped,false) end end end end end addEvent("setPedFortniteAnimation",true) addEventHandler("setPedFortniteAnimation",getRootElement(),setPedFortniteAnimation) addEventHandler("onClientResourceStart", resourceRoot, function ( startedRes ) customIfp = engineLoadIFP ("Fortnite pt1.ifp", "Fortnite_1") customIfp2 = engineLoadIFP ("Fortnite pt2.ifp", "Fortnite_2") customIfp3 = engineLoadIFP ("Fortnite pt3.ifp", "Fortnite_3") if customIfp and customIfp2 and customIfp3 then outputDebugString ("Animaciones de Fortnite cargadas") else outputDebugString ("Las animaciones de Fortnite no fueron cargadas") end end) --*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-- local x, y = guiGetScreenSize () local relposx = x/2 local medX = x/2 local ancho = -3780 local sizeX = ancho/3 local mitSize = sizeX*0.5 local botX = medX-mitSize local relposx = y/2 local medX2 = y/2 local ancho2 = -2160 local sizeX2 = ancho2/3 local mitSize2 = sizeX2*0.5 local botX2 = medX2-mitSize2 animations = {} painel = { [1] = false } function painelanim () local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() dxDrawImage ( botX+sizeX+550, botX2+sizeX2+80, 120, 120,"Arquivos/Imagens/:O.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+550, botX2+sizeX2+80, 120, 120) and 255 or 100 )) dxDrawImage ( botX+sizeX+440, botX2+sizeX2+140, 120, 120,"Arquivos/Imagens/chat.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+440, botX2+sizeX2+140, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+350, botX2+sizeX2+230, 120, 120,"Arquivos/Imagens/smile.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+350, botX2+sizeX2+230, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+360, botX2+sizeX2+350, 120, 120,"Arquivos/Imagens/handsup.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+360, botX2+sizeX2+350, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+440, botX2+sizeX2+450, 120, 120,"Arquivos/Imagens/sentar.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+440, botX2+sizeX2+450, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+550, botX2+sizeX2+490, 120, 120,"Arquivos/Imagens/cancel.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+550, botX2+sizeX2+490, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+665, botX2+sizeX2+150, 120, 120,"Arquivos/Imagens/smoke.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+665, botX2+sizeX2+150, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+760, botX2+sizeX2+230, 120, 120,"Arquivos/Imagens/sexy.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+760, botX2+sizeX2+230, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+750, botX2+sizeX2+350, 120, 120,"Arquivos/Imagens/dance.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+750, botX2+sizeX2+350, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+665, botX2+sizeX2+450, 120, 120,"Arquivos/Imagens/espere.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+665, botX2+sizeX2+450, 120, 120) and 255 or 100) ) dxDrawImage ( botX+sizeX+615, botX2+sizeX2+250, 120, 120,"Arquivos/Imagens/espere2.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+625, botX2+sizeX2+250, 120, 120) and 255 or 100) ) dxDrawImage ( botX+sizeX+475, botX2+sizeX2+250, 120, 120,"Arquivos/Imagens/chat1.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+475, botX2+sizeX2+250, 120, 120) and 255 or 100)) dxDrawImage ( botX+sizeX+485, botX2+sizeX2+365, 100, 100,"Arquivos/Imagens/chat2.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+485, botX2+sizeX2+365, 100, 100) and 255 or 100)) dxDrawImage ( botX+sizeX+635, botX2+sizeX2+365, 100, 100,"Arquivos/Imagens/chat3.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+635, botX2+sizeX2+365, 100, 100) and 255 or 100)) dxDrawImage ( botX+sizeX+885, botX2+sizeX2+253, 70, 70,"Arquivos/Imagens/chat4.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+885, botX2+sizeX2+253, 70, 70) and 255 or 100)) dxDrawImage ( botX+sizeX+960, botX2+sizeX2+253, 70, 70,"Arquivos/Imagens/chat5.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+960, botX2+sizeX2+253, 70, 70) and 255 or 100)) dxDrawImage ( botX+sizeX+1035, botX2+sizeX2+253, 70, 70,"Arquivos/Imagens/chat6.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+1035, botX2+sizeX2+253, 70, 70) and 255 or 100)) dxDrawImage ( botX+sizeX+885, botX2+sizeX2+325, 70, 70,"Arquivos/Imagens/chat7.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+885, botX2+sizeX2+325, 70, 70) and 255 or 100)) dxDrawImage ( botX+sizeX+960, botX2+sizeX2+325, 70, 70,"Arquivos/Imagens/chat8.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+960, botX2+sizeX2+325, 70, 70) and 255 or 100)) dxDrawImage ( botX+sizeX+1035, botX2+sizeX2+325, 70, 70,"Arquivos/Imagens/chat9.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+1035, botX2+sizeX2+350, 70, 70) and 255 or 100)) dxDrawImage ( botX+sizeX+885, botX2+sizeX2+395, 70, 70,"Arquivos/Imagens/chat10.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+885, botX2+sizeX2+395, 70, 70) and 255 or 100)) dxDrawImage ( botX+sizeX+960, botX2+sizeX2+395, 70, 70,"Arquivos/Imagens/chat11.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+960, botX2+sizeX2+395, 70, 70) and 255 or 100)) dxDrawImage ( botX+sizeX+1035, botX2+sizeX2+395, 70, 70,"Arquivos/Imagens/chat12.png", 0, 0, 0, tocolor ( 255, 255, 255, isCursorOnElement(botX+sizeX+1035, botX2+sizeX2+395, 70, 70) and 255 or 100)) end function animations.click (_, estado) if painel[1] == true then if estado == "down" then if isCursorOnElement(botX+sizeX+550, botX2+sizeX2+80, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.:O", localPlayer) elseif isCursorOnElement(botX+sizeX+440, botX2+sizeX2+140, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat", localPlayer) elseif isCursorOnElement(botX+sizeX+665, botX2+sizeX2+150, 120, 120) then playSound("Arquivos/Sons/click.mp3") sound = playSound("Arquivos/Sons/smoke.mp3") setTimer(stopSound, 40000, 1, sound) triggerServerEvent("anim.smoke", localPlayer) elseif isCursorOnElement(botX+sizeX+760, botX2+sizeX2+230, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.sexy", localPlayer) elseif isCursorOnElement(botX+sizeX+750, botX2+sizeX2+350, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.dance", localPlayer) elseif isCursorOnElement(botX+sizeX+665, botX2+sizeX2+450, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.espere", localPlayer) elseif isCursorOnElement(botX+sizeX+440, botX2+sizeX2+450, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.sentar", localPlayer) elseif isCursorOnElement(botX+sizeX+360, botX2+sizeX2+350, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.handsup", localPlayer) elseif isCursorOnElement(botX+sizeX+350, botX2+sizeX2+230, 120, 120) then playSound("Arquivos/Sons/click.mp3") sound = playSound("Arquivos/Sons/BatendoUma.mp3") triggerServerEvent("anim.smile", localPlayer) elseif isCursorOnElement(botX+sizeX+625, botX2+sizeX2+250, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.espere2", localPlayer) elseif isCursorOnElement(botX+sizeX+475, botX2+sizeX2+250, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat1", localPlayer) elseif isCursorOnElement(botX+sizeX+485, botX2+sizeX2+365, 100, 100) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat2", localPlayer) elseif isCursorOnElement(botX+sizeX+635, botX2+sizeX2+365, 100, 100) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat3", localPlayer) elseif isCursorOnElement(botX+sizeX+885, botX2+sizeX2+253, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat4", localPlayer) elseif isCursorOnElement(botX+sizeX+960, botX2+sizeX2+253, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat5", localPlayer) elseif isCursorOnElement(botX+sizeX+1035, botX2+sizeX2+253, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat6", localPlayer) elseif isCursorOnElement(botX+sizeX+885, botX2+sizeX2+325, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat7", localPlayer) elseif isCursorOnElement(botX+sizeX+960, botX2+sizeX2+325, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat8", localPlayer) elseif isCursorOnElement(botX+sizeX+1035, botX2+sizeX2+325, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat9", localPlayer) elseif isCursorOnElement(botX+sizeX+885, botX2+sizeX2+395, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat10", localPlayer) elseif isCursorOnElement(botX+sizeX+960, botX2+sizeX2+395, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat11", localPlayer) elseif isCursorOnElement(botX+sizeX+1035, botX2+sizeX2+395, 70, 70) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.chat12", localPlayer) elseif isCursorOnElement(botX+sizeX+550, botX2+sizeX2+490, 120, 120) then playSound("Arquivos/Sons/click.mp3") triggerServerEvent("anim.cancel", localPlayer) end end end end addEventHandler("onClientClick", root, animations.click ) function abrir () if not painel[1] then addEventHandler("onClientRender", root, painelanim) playSound("Arquivos/Sons/abrir.mp3") else removeEventHandler("onClientRender", root, painelanim) showCursor(false) end painel[1] = not painel[1] showCursor(painel[1]) end bindKey("f3", "both", abrir) function isCursorOnElement(x,y,w,h) if (not isCursorShowing()) then return false end local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end Link to comment
zRodrigoMM Posted June 21, 2020 Author Share Posted June 21, 2020 estou tentando o seguinte mas, está dando erro; function anim.espere2( thePlayer ) local nomeAcc = getAccountName(getPlayerAccount(thePlayer)) if not isObjectInACLGroup("user."..nomeAcc, aclGetGroup("Staff")) then outputChatBox("#ff0000Somente membros com VIP!", thePlayer, 255,255,255, true) else setPedFortniteAnimation(source,"baile 1",-1,true,false,false,false) end end addEvent("anim.espere2", true) addEventHandler("anim.espere2", root, anim.espere2) 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