Jump to content

WeeD1

Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by WeeD1

  1. Olá, boa noite Por padrão, quando tem alguma pessoa dentro de um veiculo, se outro jogador apertar F para entrar, ele irá roubar o veiculo. Existe alguma forma de bloquear esse roubo? Não quero que a pessoa fique proibida de entrar no veiculo, no caso ela entraria como passageiro. Até agora não achei nenhuma solução para isso, se algum puder me dar um help, agradeço
  2. Ahh sim, valeu. ajudou demais
  3. Funcionou sim, obrigado Só mais uma dúvida, o destroyElement funciona em client-side? (Não achei no Wiki sobre), pois tentei adicionar ele ao script, e não funcionou. (Sem erro no debugscript) Se não funcionar, tem alguma forma de eu excluir o objeto sendo client-side?
  4. Fiz o teste com client-side, porém ainda sem sucesso, agora o objeto não está mais sendo excluído do mapa O único erro que acusa é esse: WARNING: Blitz/c.lua:2: Bad argument @ 'getElementType' [Expected element at argument 1, got boolean] Minha tentativa: function quandoClicar(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if (button == "left") and (state == "down") and (getElementType(clickedElement) == "object") and (getElementType(localPlayer) == "player") then if (getElementData(localPlayer, "Modo:Blitz")) == true then destroyElement(clickedElement) else outputChatBox("#FFD700[AVISO] Você precisa estar no modo blitz para excluir algum objeto, use /blitz.", 255,255,255, true) end end end addEventHandler("onClientClick", getRootElement(), quandoClicar)
  5. Olá, estou com um problema, o script está acusando Warning quando o objeto clicado não é o correto, como arrumar? WARNING: Blitz/blitz.lua:63: Bad argument @ 'getElementType' [Expected element at argument 1, got nil] function quandoClicar(mouseButton, buttonState, clickedElement, worldPosX, worldPosY, worldPosZ, screenPosX, screenPosY) if (mouseButton == "left") and (buttonState == "down") and (getElementType(clickedElement) == "object") and (getElementType(source) == "player") then if (getElementData(source, "Modo:Blitz")) == true then destroyElement(clickedElement) else outputChatBox("#FFD700[AVISO] Você precisa estar no modo blitz para tirar os cones, use /blitz.", source, 255,255,255, true) end end end addEventHandler("onPlayerClick", getRootElement(), quandoClicar)
  6. Ah sim, entendi. Mas é possível eu fazer algo que após o player digitar o comando ele entre como passageiro de um veiculo? No mesmo modelo desse que você fez
  7. Funcionou perfeitamente, obrigado. Porém agora preciso do sistema ao contrário (para entrar no veiculo como passageiro após digitar o comando). Fiz um teste, porém sem sucesso, onde estou errando? addCommandHandler("teste", function ( player ) setControlState( player, "enter_passenger", true ) end)
  8. Olá, seria possível eu usar o removePedFromVehicle e definir uma posição pré estabelecida nele? Porque normalmente quando a função é executada, o player é expulso do veiculo e fica em cima dele. Eu queria que após executar o removePedFromVehicle, ele fosse expulso para a lateral do veiculo, como se realmente ele tivesse saido pela porta, seria possível isso? Se não for possível, existe algum jeito de eu fazer com que a pessoa seja expulso de veículo de forma mais "realista"? Agradeço
  9. Funcionou perfeitamente, obrigado!
  10. Sim, porém se o player tomar um dano maior que 100, o dano é cancelado. (ele não toma dano) Por exemplo: Cair de um local muito alto A minha intenção não é cancelar o dano do player, mas sim ele tomar o dano normalmente, e após chegar a 1%, ficaria travado e não morreria, mantendo o 1% de vida
  11. Oii, preciso fazer uma verificação na vida do player, em que quando chegar a 1% ele não tome mais dano de nenhuma forma (a vida ficará travado no 1%), fiz uma tentativa no client-side, mas provavelmente estou errando em alguma coisa, alguém poderia me ajudar por favor? function blockDead() if getElementHealth(localPlayer) <= 1 then cancelEvent() end end addEventHandler("onClientPlayerDamage", localPlayer, blockDead)
  12. Entendi, a função é essa: function blips () if getElementData(localPlayer, "blips", true) then setElementData(localPlayer, "blips", false) outputChatBox ("Blips desligado") else setElementData(localPlayer, "blips", true) outputChatBox ("Blips ligado") end end addCommandHandler("blips", blips) Preciso que isso execute no lado client, e que somente a acl "admin" consiga usar o comando /blips. Qual seria a melhor alternativa? Como eu faria isso usando o triggerClientEvent?
  13. Oii, tem alguma forma de eu usar o isObjectInACLGroup no lado client? tipo isso: if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(localPlayer)), aclGetGroup ("Admin")) then Fiz alguns testes e todos deram errado, se alguém poder me ajudar por favor, agradeço.
  14. Oi, estou tentando fazer um anti-afk, porém quero colocar para quem não estiver logado não ser pego pelo sistema. Fiz algumas tentativas, porém não estou conseguindo achar o problema. Quem poder dar um help, agradeço server-side setTimer( function() for _, player in ipairs(getElementsByType("player"))do login = getPlayerAccount ( player ) if isGuestAccount ( login ) then if not isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)), aclGetGroup ("Staff")) then if (getPlayerIdleTime(player) > 60000) then kickPlayer(player, "Você foi expulso por inatividade") end end end end end, 30000, 0)
  15. Sim, eu estava fazendo o login. Fiz o teste novamente com o código que você mandou atualizado, quando o resource é ativado ele funciona normalmente, porém se eu relogar ele para de funcionar (mesmo fazendo o login), ainda não aponta nenhum erro de debugscript, porém não funciona.
  16. Fiz o teste aqui, por comando /anim está funcionando normal. Porém a bindkey ainda não, não apresentou nenhum erro no debugscript 3, como resolver? (Já reloguei do servidor algumas vezes e nada)
  17. Alguém me ajuda pfv? Preciso que o código rode no lado server.Lua, no entanto ele está como client. Já fiz algumas tentativas trocando o "localPlayer" por source, thePlayer, etc. Mas não consegui, o que estou fazendo de errado? function stopAnimation() if getPedAnimation(localPlayer) then setPedAnimation(localPlayer, false) end end addCommandHandler('anim', stopAnimation) bindKey("F3", "down", stopAnimation)
  18. Oi, boa noite. Alguém poderia me ajudar. Preciso de um script que limite o número de 2 contas por serial. E que acls especificas seja liberada pra criar quantas quiser. Alguém sabe onde posso achar esse script ou como fazer? Agradeço desde já. Edit: Pensei também em criar um sistema que pudesse resetar a conta, por exemplo se a pessoa ja tiver criado 2 contas no serial dela, porém ela não se lembra do usuário/senha, nesse caso eu daria um comando para liberar 2 contas novamente pra aquele serial especifico.. Ou há alguma outra forma mais simples disso?
  19. Alguém para me ajudar please? ERROR: Kill\script.Lua:5: Valid wanted levels are between 0 and 6 inclusive function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then givePlayerMoney ( killer, 500 ) setPlayerWantedLevel ( killer, 6 ) end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted )
  20. Olá. alguém para me ajudar por favor? Estou com um problema em um sistema de teleportes, porém não sei como resolver, segue: WARNING: Teleports\teleports.Lua:10: Bad argument @ 'fadeCamera' [Expected element at argument 1] function tele (thePlayer) if getPedOccupiedVehicle(thePlayer) then outputChatBox ("#ff0000Você precisa sair do veículo para usar teleportes.", thePlayer, 255, 255, 255, true) else if getElementInterior(thePlayer) > 0 then outputChatBox ("#ff0000Você precisa sair do interior para usar teleportes.", thePlayer, 255, 255, 255, true) else fadeCamera(thePlayer, false, 0.5) if not isElement (thePlayer) then return end setTimer(fadeCamera, 1000, 1, thePlayer, true) if (commando[thePlayer]) then return end setTimer( function(thePlayer) if not (isElement(thePlayer)) then return end setElementPosition ( thePlayer, 260, -1780, 7 ) end, tempo, 1, thePlayer) commando[thePlayer] = true setTimer( function() commando[thePlayer] = false end, tempo*2, 1) end end end addCommandHandler ( "praia", tele )
  21. Bom, testei aqui e não funcionou comigo. Poderia me dizer onde estou errando? local vZones = { {x = 190, y = -489, z = 980, width = 65, depth = 60, height = 1}, } local z = {} function initvZones() if vZones and #vZones ~= 0 then for _,v in ipairs (vZones) do if v then if v.x and v.y and v.z and v.width and v.depth and v.height then local c = createColCuboid (v.x, v.y, v.z, v.width, v.depth, v.height) if c then z[c] = true for _,thePlayer in ipairs (getElementsByType("vehicle")) do if (getElementDimension (thePlayer) == 100) then if isElementWithinColShape (thePlayer, c) then destroyElement(thePlayer) end end addEventHandler ("onElementDestroy", c, function() if z[source] then z[source] = nil end end) addEventHandler ("onColShapeHit", c, function (h, d) if h and isElement(h) and getElementType (h) == "vehicle" then destroyElement (h) end end) end end end end end end end addEventHandler ("onResourceStart", resourceRoot, initvZones)
  22. Obrigado. E no caso se o elemento for um veículo, no lugar do thePlayer, usaria "Vehicle" ? Desculpa a pergunta, estou aprendendo, dei uma olhada na página de elementos do OnResouceStart e queria ver algo relacionado aos veículos.
  23. Opa gente! Estou com um problema, alguém consegue me ajudar? Seguinte, quero mover o script para funcionar apenas na dimensão 100. Já testei algumas formas e nenhuma funcionou, alguém poderia me ajudar por favor? script server-side local vZones = { {x = 190, y = -489, z = 980, width = 65, depth = 60, height = 1}, } local z = {} function initvZones() if ( getElementDimension ( source ) == 100 ) then --- Tentativa if vZones and #vZones ~= 0 then for _,v in ipairs (vZones) do if v then if v.x and v.y and v.z and v.width and v.depth and v.height then local c = createColCuboid (v.x, v.y, v.z, v.width, v.depth, v.height) if c then z[c] = true for _,v in ipairs (getElementsByType("player")) do if isElementWithinColShape (v, c) then killPed (v) end end addEventHandler ("onElementDestroy", c, function() if z[source] then z[source] = nil end end ) addEventHandler ("onColShapeHit", c, function (h, d) if h and d and isElement(h) and getElementType (h) == "player" then killPed (h) end end ) end end end end end end end addEventHandler ("onResourceStart", resourceRoot, initvZones)
×
×
  • Create New...