Jump to content

FelipeX

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by FelipeX

  1. Quando o evento ocorre? tente fazer uma verificação para ver se o element player é player msm... Tente isso addEvent("zoin.onInputPrintVip", true) addEventHandler("zoin.onInputPrintVip", root, function(player) triggerClientEvent(player, "zoin.printPainelVip", player) if player and getElementType(player) == "player" then -- Verifica se o player existe e se ele é playerkkkkk for i, v in ipairs(config["Vips"]) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup(v[1])) then -- essa linha triggerClientEvent(player, "zoin.onInsertTableVips", player, v[1]) end end end end) ou isso, pois dependendo de como a função é chamada não é necessário usar o player como elemento... addEvent("zoin.onInputPrintVip", true) addEventHandler("zoin.onInputPrintVip", root, function() triggerClientEvent(source, "zoin.printPainelVip", source) if source and getElementType(source) == "player" then -- Verifica se o source existe e se ele é sourcekkkkk for i, v in ipairs(config["Vips"]) do if isObjectInACLGroup("user."..getAccountName(getsourceAccount(source)), aclGetGroup(v[1])) then -- essa linha triggerClientEvent(source, "zoin.onInsertTableVips", source, v[1]) end end end end)
  2. Vdd agora que me lembrei que destroy para todos os players, tentei usar o setElementVisibleTo mas não funcionou, não sei se foi por que acabei de executar uma função nele...
  3. Não exatamente o mod do ID, existe um arquivo na pasta 'deathmatch' que se chama internal.db, lá você consegue ver todos os ids/logins/seriais/senhas(criptografadas) e etc, pelo menos no servidor local é possivel alterar tudo por lá, tem que ver se nas hosts também é possivel, mas o mta não autoriza a questão de ver senhas das contas e etc.
  4. Olá boa noite, o createElement não serve examente para o criar o marker, então aqui crei o marker novamente e coloquei a função dnv agora só encerrar o script... local MarkerIniciar = createMarker(1198.36206, -1454.21411, 13.383 -1,"cylinder",1.2,255,255,255,100) -- Cria o marker de iniciar local MarkerFinalizar = createMarker(1197.54395, -1437.23108, 13.383 -1,"cylinder",1.2,255,255,255,100) -- Cria o marker finalizar setElementVisibleTo(MarkerFinalizar, root, false) -- Oculta o marker pra todo mundo local veiculo = {} -- Variavel veiculo function inicio (thePlayer) if thePlayer and isElement(thePlayer) and getElementType(thePlayer) == "player" then -- Verifica o elemento the thePlayer if not getPedOccupiedVehicle (thePlayer) then -- Se o player não estiver em veiculo, então local quantidade = exports["[HS]Inventory_system_2"]:getItem(thePlayer, 'cafe') if quantidade == 14 then -- Verificar a quantidade de pizzas MensagemDX(thePlayer, 'Você não tem pizzas suficientes', 'error') return end if veiculo[thePlayer] and isElement(veiculo[thePlayer]) then -- Se o player estiver com a moto, então destrui-la destroyElement(veiculo[thePlayer]) veiculo[thePlayer] = nil end veiculo[thePlayer] = createVehicle(521, 1194.031, -1454.766, 13.383) -- Cria o veiculo warpPedIntoVehicle(thePlayer, veiculo[thePlayer]) -- Coloca o player dentro do veiculo if veiculo[thePlayer] and isElement(veiculo[thePlayer]) then -- Verifica se há moto if MarkerIniciar and isElement(MarkerIniciar) then -- Verifica se o marker existe destroyElement(MarkerIniciar) -- Destroi o marker de iniciar end setElementVisibleTo(MarkerFinalizar, thePlayer, true) -- Mostra o marker para o player após pegar a moto MensagemDX(thePlayer, 'Vá até o local marcado em seu mapa para fazer sua primeira entrega', 'info') end else -- Se o player tiver no veiculo, então MensagemDX(thePlayer, 'Saia do seu veiculo para pegar outro!', 'info') end end end addEventHandler("onMarkerHit", MarkerIniciar, inicio) -- Adiciona o evento ao ligar o resource function fim (player) if veiculo[player] and isElement(veiculo[player]) then -- Se há moto, então destroyElement(veiculo[player]) -- Destroy a moto setElementVisibleTo(MarkerFinalizar , player, false) -- Oculta o marker de finalizar para o player MarkerIniciar = createMarker(1198.36206, -1454.21411, 13.383 -1,"cylinder", 1.2, 255, 255, 255, 100) -- Cria o marker novamente addEventHandler("onMarkerHit", MarkerIniciar, inicio) -- Adiciona o evento da função ao marker MensagemDX(player, 'Você guardou a moto com sucesso e finalizou seu expediente', 'success') end end addEventHandler("onMarkerHit", MarkerFinalizar, fim) -- Adiciona o evento ao ligar o resource --[[ █▀▀▄ ▀▄▒▄▀ █▀▄▀█ █▀▀▀ █▀▀▀█ █▀▀▀█ █▀▀█ █▀▀█ █▀▀▀ █▀▀▀█ █░▒█ ░▒█░░ █▒█▒█ █▀▀▀ ▀▀▀▄▄ ▀▀▀▄▄ █▄▄█ █░▄▄ █▀▀▀ ▀▀▀▄▄ █▄▄▀ ▄▀▒▀▄ █░░▒█ █▄▄▄ █▄▄▄█ █▄▄▄█ █░▒█ █▄▄█ █▄▄▄ █▄▄▄█ ]]-- function MensagemDX(p, message, type) exports["[HS]Notify_System"]:notify(p, message, type) end Deixa o thanks se deu certo<3
  5. Olá, o meu método salva as armas que ele tem e coloca nele depois dos segundos determinado por você, acho que não é exatamente o que você queria mais pode funcionar... addEventHandler("onPlayerWasted", root, function() for slot = 0, 12 do -- Total de slots possiveis local Armas = getPedWeapon ( source, slot ) -- Pegar arma local Municao = getPedTotalAmmo ( source, slot ) -- Pegar munição if Armas > 0 and Municao > 0 then -- Se tiver armas e munição setTimer(function(source) -- Executar função depois de um determinado tempo giveWeapon(source, Armas, Municao) -- Setar arma end, 5000, 1, source) -- Executar a função depois de 5000 milisegundos ( 5 Segundos ), 1 vez end -- Final da verificação de armas end -- Final do for end) -- Final da função Se funcionou deixa o thanks
  6. Nesta função aparentemente está tudo certo, mostre como você está referindo os elements no lado client no triggerServerEvent.
  7. Nessa situação precisamos ver a variavel ou o elemento name antes desta linha que você definiu na função, se possivel mande a função completa...
  8. Se seu objetivo for colocar na dimensão 5 você inverteu o lugar. Você está colocar no interior 5 ao invez da dimensão... --------------------------------loja ls--------------------------- --- Marker Entrar local Entrarcj = createMarker(1103.2294921875, -1440.1158447266, 15.796875 -1, "cylinder", 1.5, 0 , 255, 255) setElementInterior(Entrarcj, 0) setElementDimension(Entrarcj, 0) local blip = createBlip( 1103.2294921875, -1440.1158447266, 15.796875, 45, 0, 0, 0, 255, myPlayer ) setBlipVisibleDistance(blip, 300) --- Marker Sair local Sair1 = createMarker(227.02728271484, -8.4545259475708, 1002.2109375 -1, "cylinder", 1.5, 0 ,255 ,255) setElementDimension(Sair1, 5) setElementInterior(Sair1, 5) -- Posição De Entra function entrar(hitElement, matchingDimension, interior) if (getElementType(hitElement) == "player") and (matchingDimension) then local vehicle = getPedOccupiedVehicle(hitElement) local playerAccount = getPlayerAccount(hitElement) if (not vehicle) then if (playerAccount) then if (not isGuestAccount(playerAccount)) then setElementPosition(hitElement, 227.02728271484, -8.4545259475708, 1002.2109375) setElementDimension(hitElement, 5) setElementInterior(hitElement, 5) setElementRotation(hitElement, 0, 0, 180) end end end end end addEventHandler("onMarkerHit", Entrarcj, entrar) -- Posição De Sair function sair(hitElement, matchingDimension) setElementPosition(hitElement, 1103.2294921875, -1440.1158447266, 15.796875) setElementDimension(hitElement, 0) setElementInterior(hitElement, 0) setElementRotation(hitElement, 0, 0, 90) end addEventHandler("onMarkerHit", Sair1, sair) ------------------------------------------loja ls------------------------------------------------------ Se deu bom deixar o troféuzinho<3
  9. Tente isso, não testei avise se der certo... function BloquearAssalto(player, seat, jacked) if getPedOccupiedVehicleSeat(player) == 0 then outputChatBox("#FF0000[Aviso]: #FFFFFFVocê não pode roubar veiculos.", player, 255, 255, 255, true) cancelEvent() end end addEventHandler("onVehicleStartEnter", getRootElement(), BloquearAssalto) Se der bom deixar o troféuzinho<3
  10. Basta criar o blip sem definir o limite de distancia para ver, tente: --X, y, z, Id do blip local Blip = createBlip(1275.1, 429, 18.9, 33) Se deu bom deixa o Troféuzinho pow<3
  11. tente algumas alternativas... 1 - Para o erro de UTF-8 use: 2 - Sobre o codigo tente desse modelo ( Não testei ) local LetraParaMarkers = "k" local next = exports.n3xt_inventario -- Vinculado ao invetario n3xt local timerEntregar = {} local MarkerColheita = {} local BlipColheita = {} local MarkerLocaisColheita = { --{x, y, z, true para blip ou false para não}, {1226.1005859375, 398.4169921875, 21.106098175049, true}, {1234.0703125, 414.9501953125, 20.760526657104, false}, {1240.6142578125, 429.1787109375, 19.204351425171, false}, {1247.7998046875, 445.1884765625, 18.851581573486, false}, {1261.6875, 436.865234375, 18.878652572632, false}, {1254.720703125, 420.564453125, 19.131044387817, false}, {1248.970703125, 406.7763671875, 18.996059417725, false}, {1242.2373046875, 392.5908203125, 19.099172592163, false}, {1258.947265625, 387.2275390625, 19.473236083984, false}, {1263.2685546875, 399.974609375, 19.328210830688, false}, {1268.9052734375, 413.3408203125, 19.240316390991, false}, {1275.1494140625, 429.0166015625, 18.900918960571, false}, } addEventHandler("onResourceStart", resourceRoot, function() if getThisResource() == resource then for _,Pos in ipairs(MarkerLocaisColheita) do MarkerColheita[Pos] = createMarker(Pos[1], Pos[2], Pos[3] -1, "cylinder", 1.2, 0, 255, 0, 255) -- Tamanho do marker min para um player poder usar (1.2) if Pos[4] == true then BlipColheita[pos] = createBlip(Pos[1], Pos[2], Pos[3], 42) -- Cria o blip setBlipVisibleDistance(BlipColheita[Pos], 150) -- Mostra quando estiver perto else end end end end) addEventHandler("onMarkerHit", getRootElement(), function(executor) if executor and isElement(executor) and getElementType(executor) == "player" then for _,V in ipairs(MarkerLocaisColheita) do if MarkerColheita[V] == source then if not isGuestAccount(getPlayerAccount(executor)) then message(executor, "Precione K para Colher Laranjas.", "info") bindKey (executor, LetraParaMarkers, "down", colher ) break end end end end end) addEventHandler("onPlayerMarkerLeave", getRootElement(), function(executor) if executor and isElement(executor) and getElementType(executor) == "player" then for _,V in ipairs(MarkerLocaisColheita) do if MarkerColheita[V] == source then if not isGuestAccount(getPlayerAccount(executor)) then unbindKey ( source, LetraParaMarkers, "down", colher ) break end end end end end) function colher (source) unbindKey (source, "K", "down", colher ) setElementFrozen (source, true ) setPedAnimation(source, "GHANDS", "gsign1", 0, true, true, true) setTimer(function() setElementFrozen (source, false ) setPedAnimation(source, "GHANDS", "gsign1", 0, false, false, false) bindKey (source, "K", "down", colher ) unbindKey ( source, LetraParaMarkers, "down", colher ) next:giveItem(source, "Laranja", 1) end, 11300, 1) end function message(player, message, type) triggerClientEvent(player, "N3xT.dxNotification", resourceRoot, message, type) end se deu bom deixa o trofeuzinho<3
×
×
  • Create New...