Jump to content

Nadion

Members
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Nadion's Achievements

Civilian

Civilian (7/54)

2

Reputation

  1. Ele pediu o código dos arquivos que você baixou, sem eles é impossível te ajudar
  2. Acabei alterando e colocando o setElementData no server e ainda sim aparece a mesma coisa: "-" Server: addEventHandler ( "onPlayerJoin", root, function ( ) setElementData ( source, "GRUPO", Civil ) end ) addEventHandler ( "onPlayerLogin", root, function ( _, acc ) local accountName = getAccountName ( acc ) if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "EB" ) ) then setElementData ( source, "GRUPO", EB ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "GARRA" ) ) then setElementData ( source, "GRUPO", GARRA ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "ROTA" ) ) then setElementData ( source, "GRUPO", ROTA ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "PMSP" ) ) then setElementData ( source, "GRUPO", PSMP ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "ROCAM" ) ) then setElementData ( source, "GRUPO", ROCAM ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "PCC" ) ) then setElementData ( source, "GRUPO", PCC ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "CV" ) ) then setElementData ( source, "GRUPO", CV ) end end ) Client: function drawScoreboard() playersShow() count = math.min(#scoreboard,rowsCount) local x = sX/2 - 320 local y = sY/2 - count*20 / 2 local cx, cy = 0,0 if isCursorShowing() then cx, cy = getCursorPosition() cx = cx * sX cy = cy * sY end showCursor(getKeyState("mouse2")) dxDrawRectangle(x,y-52,640,count*22+52,tocolor(0,0,0,150)) dxDrawRecLine(x,y-52,640,count*22+52,tocolor(0,0,0,0)) dxDrawRectangle(x+1,y-22,638,22,tocolor(0,0,0,0)) _dxText(" ",x+150,y-51,sX,sY,255,255,255,255,1,sor,"left","top",true,false,false,false) _dxText(#getElementsByType("player").." / "..maxPlayer,x,y-50,x+632,y-28,255,255,255,255,1,sor,"right","center",true,false,false,false) _dxText("ID",x,y-22,x+35,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Nome",x+40,y-22,sX,y,255,255,255,255,1,"default-bold","left","center",true,false,false,false) _dxText("País",x+178,y-22,x+244,y,255,255,255,255,1,"default-bold","left","center",true,false,false,false) _dxText("Emprego",x+244,y-22,x+310,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Level",x+310,y-22,x+376,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Fac/Corp",x+376,y-22,x+442,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Morreu",x+442,y-22,x+508,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Tempo",x+500,y-22,x+568,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Ping",x+574,y-22,x+640,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) for i=1,count do posY = y+(i-1)*22 if scoreboard[i+rowNow][1] == "player" then if scoreboard[i+rowNow][2] == localPlayer then dxDrawRectangle(x,posY,640,22,tocolor(0,50,0,100)) end if isCursorShowing() and cx > x and cx < x + 640 and cy > posY and cy < posY + 22 then dxDrawRectangle(x,posY,640,22,tocolor(0,0,0,200)) end _dxText(getElementData(scoreboard[i+rowNow][2],"ID")or"?",x,posY,x+35,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) if getElementData(scoreboard[i+rowNow][2],"AFK") then afk="#FF0000AFK- " else afk="" end _dxText(afk.._getPlayerName(scoreboard[i+rowNow][2]),x+40,posY,sX,posY+22,255,255,255,255,1,"default-bold","left","center",false,false,false,true) country = getElementData(scoreboard[i+rowNow][2],"country") or "?" if country == "" then country = "?" end _dxText(string.upper(country),x+204,posY,sX,posY+22,255,255,255,255,1,"default-bold","left","center",true,false,false,false) if country == "?" then country = "World" end if country and fileExists(":admin/client/images/flags/"..country..".png") then dxDrawImage(x+184,posY+2,16,16,":admin/client/images/flags/"..country..".png",0,0,0,tocolor(255,255,255,255)) end _dxText(getElementData(scoreboard[i+rowNow][2],"Emprego")or"-",x+225,posY,x+325,posY+22,255,255,255,255,1,"default-bold","left","center",true,false,false,false) _dxText(getElementData(scoreboard[i+rowNow][2],"Level")or"-",x+310,posY,x+376,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText(getElementData(scoreboard[i+rowNow][2],"GRUPO")or"-",x+376,posY,x+442,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText(getElementData(scoreboard[i+rowNow][2],"deaths")or"-",x+442,posY,x+508,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText(getElementData(scoreboard[i+rowNow][2],"Tempo")or"-",x+500,posY,x+568,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText(getPlayerPing(scoreboard[i+rowNow][2]),x+574,posY,x+640,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) end if scoreboard[i+rowNow][1] == "teamName" then dxDrawRectangle(x,posY,640,22,tocolor(255,255,255,15)) r,g,b = getTeamColor(scoreboard[i+rowNow][2]) _dxText(getTeamName(scoreboard[i+rowNow][2]),x+10,posY,sX,posY+22,r,g,b,255,1,"default-bold","left","center",false,false,false,true) end end if rowsCount < #scoreboard then size = rowsCount*22 _size = size/#scoreboard __size = _size*rowsCount dxDrawRectangle(x+630,y,10,size,tocolor(255,255,255,20)) dxDrawRectangle(x+630,y+rowNow*_size,10,__size,tocolor(0,0,0,255)) end end
  3. Boa noite, tenho uma scoreboard e estou tentando colocar o nome do grupo ACL do jogador para aparecer nela, faço a checagem de um ACL por um, porém ao abrir a sscoreboard aparece apenas "-" no local de que era para aparecer a ACL, o código está no client-side: addEventHandler ( "onPlayerJoin", root, function ( ) setElementData ( source, "GRUPO", "Civil" ) end ) addEventHandler ( "onPlayerLogin", root, function ( _, acc ) local accountName = getAccountName ( acc ) if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "EB" ) ) then setElementData ( source, "GRUPO", "EB" ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "GARRA" ) ) then setElementData ( source, "GRUPO", "GARRA" ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "ROTA" ) ) then setElementData ( source, "GRUPO", "ROTA" ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "PMSP" ) ) then setElementData ( source, "GRUPO", "PSMP" ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "ROCAM" ) ) then setElementData ( source, "GRUPO", "ROCAM" ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "PCC" ) ) then setElementData ( source, "GRUPO", "PCC" ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "CV" ) ) then setElementData ( source, "GRUPO", "CV" ) end end ) scoreboard = {} function playersShow() scoreboard = {} for i,player in ipairs(getElementsByType("player")) do --if not getPlayerTeam(player) then table.insert(scoreboard,{"player",player}) --end end --[[for i,team in ipairs(getElementsByType("team")) do if (tonumber(countPlayersInTeam(team))>=1) then table.insert(scoreboard,{"teamName",team}) for i,playerTeam in ipairs (getPlayersInTeam(team)) do table.insert(scoreboard,{"player",playerTeam}) end end end--]] end rowNow = 0 rowsCount = math.floor(sY/22)-6 function drawScoreboard() playersShow() count = math.min(#scoreboard,rowsCount) local x = sX/2 - 320 local y = sY/2 - count*20 / 2 local cx, cy = 0,0 if isCursorShowing() then cx, cy = getCursorPosition() cx = cx * sX cy = cy * sY end showCursor(getKeyState("mouse2")) dxDrawRectangle(x,y-52,640,count*22+52,tocolor(0,0,0,150)) dxDrawRecLine(x,y-52,640,count*22+52,tocolor(0,0,0,0)) dxDrawRectangle(x+1,y-22,638,22,tocolor(0,0,0,0)) _dxText("************************",x+150,y-51,sX,sY,255,255,255,255,1,sor,"left","top",true,false,false,false) _dxText(#getElementsByType("player").." / "..maxPlayer,x,y-50,x+632,y-28,255,255,255,255,1,sor,"right","center",true,false,false,false) _dxText("ID",x,y-22,x+35,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Nome",x+40,y-22,sX,y,255,255,255,255,1,"default-bold","left","center",true,false,false,false) _dxText("País",x+178,y-22,x+244,y,255,255,255,255,1,"default-bold","left","center",true,false,false,false) _dxText("Emprego",x+244,y-22,x+310,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Level",x+310,y-22,x+376,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Fac/Corp",x+376,y-22,x+442,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Morreu",x+442,y-22,x+508,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Tempo",x+500,y-22,x+568,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText("Ping",x+574,y-22,x+640,y,255,255,255,255,1,"default-bold","center","center",true,false,false,false) for i=1,count do posY = y+(i-1)*22 if scoreboard[i+rowNow][1] == "player" then if scoreboard[i+rowNow][2] == localPlayer then dxDrawRectangle(x,posY,640,22,tocolor(0,50,0,100)) end if isCursorShowing() and cx > x and cx < x + 640 and cy > posY and cy < posY + 22 then dxDrawRectangle(x,posY,640,22,tocolor(0,0,0,200)) end _dxText(getElementData(scoreboard[i+rowNow][2],"ID")or"?",x,posY,x+35,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) if getElementData(scoreboard[i+rowNow][2],"AFK") then afk="#FF0000AFK- " else afk="" end _dxText(afk.._getPlayerName(scoreboard[i+rowNow][2]),x+40,posY,sX,posY+22,255,255,255,255,1,"default-bold","left","center",false,false,false,true) country = getElementData(scoreboard[i+rowNow][2],"country") or "?" if country == "" then country = "?" end _dxText(string.upper(country),x+204,posY,sX,posY+22,255,255,255,255,1,"default-bold","left","center",true,false,false,false) if country == "?" then country = "World" end if country and fileExists(":admin/client/images/flags/"..country..".png") then dxDrawImage(x+184,posY+2,16,16,":admin/client/images/flags/"..country..".png",0,0,0,tocolor(255,255,255,255)) end _dxText(getElementData(scoreboard[i+rowNow][2],"Emprego")or"-",x+225,posY,x+325,posY+22,255,255,255,255,1,"default-bold","left","center",true,false,false,false) _dxText(getElementData(scoreboard[i+rowNow][2],"Level")or"-",x+310,posY,x+376,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText(getElementData(scoreboard[i+rowNow][2],"GRUPO")or"-",x+376,posY,x+442,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText(getElementData(scoreboard[i+rowNow][2],"deaths")or"-",x+442,posY,x+508,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText(getElementData(scoreboard[i+rowNow][2],"Tempo")or"-",x+500,posY,x+568,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) _dxText(getPlayerPing(scoreboard[i+rowNow][2]),x+574,posY,x+640,posY+22,255,255,255,255,1,"default-bold","center","center",true,false,false,false) end if scoreboard[i+rowNow][1] == "teamName" then dxDrawRectangle(x,posY,640,22,tocolor(255,255,255,15)) r,g,b = getTeamColor(scoreboard[i+rowNow][2]) _dxText(getTeamName(scoreboard[i+rowNow][2]),x+10,posY,sX,posY+22,r,g,b,255,1,"default-bold","left","center",false,false,false,true) end end if rowsCount < #scoreboard then size = rowsCount*22 _size = size/#scoreboard __size = _size*rowsCount dxDrawRectangle(x+630,y,10,size,tocolor(255,255,255,20)) dxDrawRectangle(x+630,y+rowNow*_size,10,__size,tocolor(0,0,0,255)) end end
  4. Funcionou certinho cara, creio que era o fato de eu estar esquecendo de passar o usuário como parâmetro mesmo, muito obrigado!!
  5. Tenho 2 scripts, um de animação por binds e outro de assaltos, queria saber como faço para não cancelar a animação do roubo e fazer o jogador continuar fazendo o roubo, para ele não sair do freeze do roubo e pegar o dinheiro fora do local já, tentei com flags e getElementData e nada. Animação function animcruzabraco () if getElementData ( localPlayer, "cruzabracodt" ) == false then setElementData(localPlayer, "cruzabracodt", true) setElementFrozen ( localPlayer, true ) triggerServerEvent("animcruzabraco",localPlayer) else setElementFrozen ( localPlayer, false ) setElementData(localPlayer, "cruzabracodt", false) triggerServerEvent("paraanim",localPlayer) end end bindKey("b", "both", animcruzabraco) Roubo function sistema1(source) if source then if isElementWithinMarker(source, loja1) then local weaponType = getPedWeapon ( source ) if weaponType == 0 then outputChatBox ( "#727272Você está desarmado. #464646Tenha uma arma para assaltar.", source, 255, 255, 255, true ) else outputChatBox(" ", source, 255, 255, 255, true) outputChatBox("#cf3f3fINDFO: #e2e2e2Você está começando a roubar o banco Caixa #727272(Aguarde 4 minutos ou será punido). #e41c1cAs autoridades estão vindo.", source, 255, 255, 255, true) outputChatBox(" ", source, 255, 255, 255, true) setElementVisibleTo( loja1ass, root, true) setElementFrozen( source, true ) setPedAnimation( source, "bomber", "bom_plant_loop", 240000, true, false, false, false ) setMarkerSize(loja1, 0) outputChatBox(" ", source, 255, 255, 255, true) outputChatBox("#cf3f3fINFO: #e41c1cAtenção todas as autoridades. #e2e2e2O banco Caixa está sendo assaltado, compareçam ao local urgentemente!", root, 255, 255, 255, true) outputChatBox(" ", source, 255, 255, 255, true) setTimer(function(source) givePlayerMoney(source, GranaBanco) setElementFrozen( source, false ) setPlayerWantedLevel( source, 6 ) outputChatBox("#cf3f3fINFO: #e41c1cVocê assaltou o banco Caixa e ganhou R$ "..GranaBanco, source, 255, 255, 255, true) end,240000,1,source) setTimer(function(source) setMarkerSize(loja1, 2.5) setElementVisibleTo( loja1ass, root, false) end,1800000,1,source) end end end end addCommandHandler("roubar", sistema1)
  6. Você vai precisar de getPlayerAccount, getAccountName e isObjectInACLGroup
  7. Alguém pode me ajudar a encontrar uma solução?
  8. Eu acabei mudando o código depois, tenta o segundo que tá nesse mesmo post. Se for usar um bindKey precisa passar dentro dela o source, tecla, o estado da tecla e a função, ficando algo como exemplo bindKey ( source, "tecla", "both", função ) Se ainda assim não der, espere o Angelo responder, ele claramente entende melhor de programação em Lua do que eu hahahahaha
  9. Tente algo como al markers = { } addCommandHandler ( "onPlayerLogin", "createmarker", function ( thePlayer ) if markers[thePlayer] and isElementWithinMarker ( thePlayer, markers[thePlayer] ) then return outputChatBox("Já Existe um Marker em Você!", thePlayer, 255, 255, 255, true) end local x,y,z = getElementPosition(thePlayer) markers[thePlayer] = createMarker ( x,y,z, "cylinder", 5, 100, 0, 0, 50 ) attachElements(markers[thePlayer], thePlayer, 0,0,-1) outputChatBox("Criado com Sucesso !", thePlayer, 255, 255, 255, true) end) addEventHandler( "onPlayerQuit", root, function ( ) if markers[source] and isElementWithinMarker ( source, markers[source] ) then destroyElement(markers[source]) markers[source] = nil end end) Errei em uma parte, tente manter o root ficando algo como isso: local markers = { } addCommandHandler ( "onPlayerLogin", root, "createmarker", function ( thePlayer ) if markers[thePlayer] and isElementWithinMarker ( thePlayer, markers[thePlayer] ) then return outputChatBox("Já Existe um Marker em Você!", thePlayer, 255, 255, 255, true) end local x,y,z = getElementPosition(thePlayer) markers[thePlayer] = createMarker ( x,y,z, "cylinder", 5, 100, 0, 0, 50 ) attachElements(markers[thePlayer], thePlayer, 0,0,-1) outputChatBox("Criado com Sucesso !", thePlayer, 255, 255, 255, true) end) addEventHandler( "onPlayerQuit", root, function ( ) if markers[source] and isElementWithinMarker ( source, markers[source] ) then destroyElement(markers[source]) markers[source] = nil end end)
  10. Creio que sim, como não entendo direito da passagem de parâmetros pra funções e Handlers, pode talvez dar um erro por ovcê ter tirado o "createmarker" Você chegou a testar isso?
  11. Coloca um onPlayerJoin se for pra todos ou um onPlayerLogin pra se for só pra usuários registrados
  12. Cara, sou básico em Lua e chego a entender um código até que bem porém não programo em Lua. Pelo que o outro parceiro disse ali, dá pra você criar também um marker ligado ao player e definir nos parâmetros dele as informações dele. Seria algo do tipo ( pode não estar certo e creio que não está, porém a lógica seria essa ? Ou pode usar o createColCircle com a localização do player e usar o attachElements function areaPlayer( source ) local x,y,z = getElementPosition(source) local shape = createColCircle( x, y, z, 2) attachElements( marker, source, 0, 0, 2 ) end
  13. Creio que você vai precisar de createColSphere e getElementPosition
×
×
  • Create New...