Jump to content

LucasMTA

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by LucasMTA

  1. nao consegui usar, so uma duvida esses arquivos de protecao tem que fazer em outra pasta ou posso colocar dentro do meu recurso que eu vou proteger, eu nao entendi muito bem DNL responsa mano, tava quebrando a cuca aqui pensando em algo
  2. Fiquei interessado, tem que criar tabelas para armazenamento, ou somente setElementData
  3. Assim vai esta ativa a funcao
  4. sim mano mesmo assim o braco do personagem fica dobrado como tive-se carregando ainda o objeto
  5. eu realmente nao entendo algumas coisas .-. porque a animação nao quer ser cancelada local ferro = {} addEvent("givePlayerferro",true) addEventHandler("givePlayerferro",getRootElement(),function(playerSource) if not isElement(ferro[playerSource]) then ferro[playerSource] = createObject(16304,0,0,0) setElementCollisionsEnabled(ferro[playerSource], false) exports.bone_attach:attachElementToBone(ferro[playerSource],playerSource,12,0,0.2,0.1,0,-90,65) setElementData(playerSource,"ferro",ferro[playerSource]) setPedAnimation(playerSource, "CARRY", "crry_prtial", 0, true, false, true, true) end end) addEvent("takePlayerferro",true) addEventHandler("takePlayerferro",getRootElement(),function(playerSource) if isElement(ferro[playerSource]) then exports.bone_attach:detachElementFromBone(ferro[playerSource]) destroyElement(ferro[playerSource]) ferro[playerSource] = false setPedAnimation(playerSource,false) toggleControl(playerSource,"fire", true) toggleControl(playerSource,"sprint", true) toggleControl(playerSource,"crouch", true) toggleControl(playerSource,"jump", true) setPedAnimation(playerSource,false) end end)
  6. Como voce sabe que nao esta definido voce nem viu meu codigo mano. Como assim nao tenho humildade, nao entendi nada mais deboa, nao desmereci seu codigo nao jovem, apenas estou tentando entender source / thePlayer
  7. Mais eu usei sorce e nao tive nenhum problema e nem erros, agora eu alterei para the player e esta dando erro Não tem problema eu usar source, dentro de funcoes thePlayer
  8. Já consegui pode fechar o topico se quiser metodo que eu usei setTimer(setElementData , 5000, 1, source, "skin->gang", true)
  9. Atualmente estou usando isso, mais esta dando erro ! setTimer(function() setElementData(source, "skin->gang", true) outputChatBox("agora voce pode pegar novamente a skin", source,255,255,255,true) end, 10000, 1) Estou tentando fazer com que o elemento seja verdadeiro daqui a 10000 = 10 segundos Erro: Expected element at argument 1, got nil
  10. Isso é bom também, mais oque eu estava tentando dizer é que eu defini uma data para o ped setElementData(ped, 'ped->gangNPC', true) Então se no caso estiver true , o painel abra .... foi oque eu fiz no código a seguir, estou aprendendo de pouco em pouco e espero um dia nao ter muita dificuldade em data e tabelas function openGang (button, state, xx, yy, xxx, yyy, zzz, clickedElement) if button == "left" and state == "down" and clickedElement and getElementData(clickedElement, 'ped->gangNPC') == true then if getElementType (clickedElement) == "ped" then addEventHandler ("onClientRender", root, gangPanel) setElementData (localPlayer, "character->inJobPanel", true) showChat (false) Panel = 1 end end end addEventHandler ("onClientClick", root, openGang) Dessa forma da pra fazer em futuras atualizações um sistema onde o player fize-se as compras do painel , defini-se para false e em um determinado tempo volta-se a se tornar true Achei util , oque voce acha
  11. Estou tentando fazer com que o painel, abra para jogadores é claro mais ao clicar no ped Eu consegui fazer com que ele abri-se no ped, so nao estou conseguindo colocar em todos os ped de uma tabela Consegui function openGang (button, state, xx, yy, xxx, yyy, zzz, clickedElement) if button == "left" and state == "down" and clickedElement then if getElementType (clickedElement) == "ped" then addEventHandler ("onClientRender", root, gangPanel) setElementData (localPlayer, "character->inJobPanel", true) showChat (false) Panel = 1 end end end addEventHandler ("onClientClick", root, openGang) Modo que eu usei... obrigado Jonas^
  12. Nao abriu, ele tem que setar o element quando der o click mais nao to conseguindo
  13. local NpcS = { {-2407.79517, -594.04980, 132.64844, 90}, {877.59118652344, -1420.6951904297, 13.478086471558, 90}, {2153.3666992188, -1451.8227539063, 24.5390625, 0}, {2089.4887695313, -1279.0625, 24.502468109131, 0}, {2231.7917480469, -1280.080078125, 24.3671875, 0}, } for i, v in ipairs(NpcS) do local ped = createPed(25, v[1], v[2], v[3], 0, 0, v[4]) setElementFrozen(ped, true) setElementData(ped, 'ped->gangNPC', true) end function openGang(button, state, xx, yy, xxx, yyy, zzz, clickedElement) if clickedElement then if getElementType(clickedElement) == "ped" and getElementModel(clickedElement) == 25 and button == 'left' and state == 'down' and getElementData(localPlayer, 'character->inJobPanel') == false and getElementData(clickedElement, 'ped->gangNPC') == true then addEventHandler('onClientRender', root, GangPanel) setElementData(localPlayer, 'character->inJobPanel', true) showChat(false) Panel = 1 end end end addEventHandler ( "onClientClick", getRootElement(), openGang) nao sei porque nao ta abrindo meu painel
  14. Entendi, pensei que eu tinha que criar outra pasta, mais como tudo vai no server-side da pra colocar no proprio script todo o codigo, obrigado DNL mais uma vez voce me salvando
  15. No caso todo o conteudo então vai no server-side, e se o cara remover a função do meta.xml ele ira para de funcionar O script so ira funcionar se tiver no ip do servidor
  16. Ola eu voltei a esse topico porque realmente me interresa, eu andei olhando o codigo de voces e tentei dessa forma mais nao tive sucesso na verdade eu to é perdidao mais tentei algo vendo os codigos que vcs colocaram --SERVER-SIDE local SERVER_IP = "127.0.0.1" function getServerIp() return SERVER_IP end local _cancelEvent = cancelEvent local function cancelEvent( ... ) return _cancelEvent( ... ) end addEventHandler("onResourceStart",resourceRoot, function() if (SERVER_IP == "192.168.15.9") then --se o ip "SERVER_IP" for igual ao "192.168.15.9" cancelEvent( false ) outputDebugString("RECURSO LIGADO") else cancelEvent( true ) outputDebugString("RECURSO DESLIGADO") end end )
  17. Tem algum jeito de baixar o servidor apartir de uma url ? Eu consegui fazer com que ele baixa-se uma imagem, que foi direto pro cache dele dentro da pasta que está o codigo. Tenho varias duvidas sobre o assunto e queria alguem para tirar elas pra mim Consegui tambem fazer com que ele baixa-se um arquivo .lua .xml .dff .txd Mais ai tem varias duvidas, como ativação dos recursos, se tem como alterar o meta no cache, se tem como ativar o meta so quando o jogador baixar o arquivo etc
  18. kkkk é porque tem DNL pensei que foce , mais mesmo assim eu agradeço meu broder
  19. obrigado danilin agora vou usar % é bem mais pratico, funcionou sim mais com % é bem melhor sem erros futuros eu tinha feito quase do mesmo jeito total = math.random(5000,10000) total1 = total givePlayerMoney(source,20*total1/100) mais nao funcionou
  20. nuss agora que eu vi eu tou colocando o math.random dentro do if gerando ele novamente Eu quero dividir o valor total entre as 4 tabelas feitas em if um simples erro pode causar um oceano kkkk eu fiz o seguinte dinheirototal = math.random(5000,10000) --total total = dinheirototal if 1 then local money = total/4 givePlayerMoney(money) end if 2 then local money = total/4 givePlayerMoney(money) end if 3 then local money = total/4 givePlayerMoney(money) end if 4 then local money = total/4 givePlayerMoney(money) end DNL teria alguma dica pra mim melhorar , como por exemplo % assim ele tem 4 tabelas dividindo o total e cada uma dividi em 4 que sairia na mesma ou estou errado
  21. total = math.random(5000,10000) --vamos dizer que o total seja entre 5000 a 10000 reais total1 = total --o total definido agora passa a ser total1 total2 = total1/4 --agora o total1 passa a ser dividido em 4 e passa a ser total2 if dinheiro1 >= 1 then setTimer(function() local money = math.random(total2) givePlayerMoney(total2) outputChatBox("Dinheiro +$"..total2.."", 255, 255, 255, true) end, 3000, 1) end if dinheiro2 >= 1 then setTimer(function() local money = math.random(total2) givePlayerMoney(total2) outputChatBox("Dinheiro +$"..total2.."", 255, 255, 255, true) end, 3000, 1) end if dinheiro3 >= 1 then setTimer(function() local money = math.random(total2) givePlayerMoney(total2) outputChatBox("Dinheiro +$"..total2.."", 255, 255, 255, true) end, 3000, 1) end if dinheiro4 >= 1 then setTimer(function() local money = math.random(total2) givePlayerMoney(total2) outputChatBox("Dinheiro +$"..total2.."", 255, 255, 255, true) end, 3000, 1) end Estou tentando dividir o valor total entre esses 4 if mais nao estou conseguindo, ele sempre gera um valor aleatorio tambem tentei fazer % mais ele sempre gera um numero diferente entre 5000 a 10000 oque estou fazendo de errado
  22. Comentei no poste do pistoleiro, mais esqueci que já tive interesse nesse assunto. A posição no caso fica definido permanente, quando o jogador pega tal objeto Por exemplo eu tenho uma faca aqui que subistitui a knife no jogo, ela fica torta na mao do jogador, eu usando essas funções ela ficaria definida ou tenho que usar mais funções.
  23. DNL no caso se usar essas funções e definir a rotação do objeto, ele ficara definitivo para o jogador ? Ai se no caso for sim, eu poderia adicionar as funções no próprio resource que substitui o objeto? com engineLoadTXD e engineLoadDFF
  24. Sim jonas é o mesmo botao mais com diferentes Paineis Lord eu fiz dessa forma nao sei porque nao funcionou, mais da forma que voce feiz deu certo .-.
  25. Jonas deu certo dessa forma que eu falei, mais o texto = não funciona , esse texto eu define pra cada panel e define fora do if com um output mais da erro global local lvl = getElementData(localPlayer, "player:level" ) if isCursorOnElement(sx/2 - 115, sy/2 + 165, 155, 23, x, y) then if lvl > 10 and currentPanel == 1 then valor = 1 texto = "teste" elseif lvl > 11 and currentPanel == 2 then valor = 2 texto = "teste" elseif lvl > 12 and currentPanel == 3 then valor = 3 texto = "teste" elseif lvl > 13 and currentPanel == 4 then valor = 4 texto = "teste" elseif lvl > 14 and currentPanel == 4 then valor = 5 texto = "teste" else outputChatBox("Nivel insuficiente para comprar "..texto.."", 255,255,255,true) end erro : attempt to concatenate global "texto" (a nil value)
×
×
  • Create New...