Jump to content

Doongogar

Members
  • Posts

    342
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Doongogar

  1. este resource se chama headshot, e ele ja faz parte dos resources originais do proprio mta isso signifca que ele ja vem no seu servidor, ou va na aba resources e o ative ou aperte F8 e escreva "start headshot" caso ja esteja com acl Admin ou Console
  2. Bem, eu achei um codigo que exibe um "shout" na tela de todos os players a principio o script funcionava com setTimer para a mensagem sumir depois de determinado tempo, mais eu gostaria que o anuncio sumisse utilizando o mesmo comando codigo abaixo: function announceScript(player, cmd, ...) for id, players in ipairs(getElementsByType("player")) do local message = table.concat({...}," ") local textChat = textCreateDisplay() local textItem = textCreateTextItem("Teste", 0.5, 0.5, 1.5, 0, 0, 0, 255, 2, "center", "center") textDisplayAddText(textChat, textItem) textDisplayAddObserver(textChat, players) end end addCommandHandler("anuncio", announceScript)
  3. olá eu estava na wiki e me deparei com uma coisa chamada sha256 eu gostaria de saber oque é isto, como se usa, para que se usa link da wiki: https://wiki.multitheftauto.com/wiki/Sha256
  4. vou usar um exemplo de um outro topico meu function robtag ( source ) if isElementWithinMarker (source, PegarTag ) then if aclGetGroup("Pm") and isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(source)), aclGetGroup("Pm")) then aclGroupAddObject (aclGetGroup("Policial"), "user."..getAccountName(getPlayerAccount(source))) aclGroupRemoveObject (aclGetGroup("Pm"), "user."..getAccountName(getPlayerAccount(source))) outputChatBox ("#00FF00Você Entrou Em Patrulha Com Sucesso", source, 255, 255, 255, true) outputChatBox ("Para Sair De Patrulha Digite: #FF0000"..ComandoSair, source, 255, 255, 255, true) end else outputChatBox ('#FF0000Vá Até o Departamento Policial Para Iniciar a Patrulha', source, 255, 255, 255, true) end end addCommandHandler ( "ptr", robtag ) agora, eu gostaria de saber como substituir a permissão de executar o comando, ao invez de ser via ACL, eu queria que a pessoa tivesse acesso ao comando estando possuindo um elementData especifico
  5. olá, eu gostaria de saber como que eu faço para um player so conseguir executar um comando se o player estiver com um elemento especifico
  6. NomeTag = "BOPE" Comando = "/bope" ComandoSair = "/sair" PegarTag = createMarker(2485, -1667, 13.34375 - 1,"cylinder", 2, 255 ,0 ,0 ,255) function robtag ( source ) if isElementWithinMarker (source, PegarTag ) then aclGroupAddObject (aclGetGroup("BOPE"), "user."..getAccountName(getPlayerAccount(source))) outputChatBox ("[Sistema Tag] Agora Você Já Tem Tag Da"..NomeTag, source, 255, 255, 255, true) outputChatBox ("[Sistema Tag] Para Sair Basta Digitar"..ComandoSair, source, 255, 255, 255, true) else outputChatBox ('[Sistema Tag] Voce Tem Que Estar no Lugar Certo Para Pegar a Tag', source, 255, 255, 255, true) end end addCommandHandler ( "bope", robtag ) function robtirartag ( source ) aclGroupRemoveObject (aclGetGroup("BOPE"), "user."..getAccountName(getPlayerAccount(source))) outputChatBox ('[Sistema Tag] Agora Você Não Tem Mais a Tag Da'..NomeTag, source, 255, 255, 255, true) end addCommandHandler ( "sair", robtirartag ) function MSG (source) outputChatBox('[Sistema Tag] Digite /'..Comando..' Para Pegar Tag Do'..NomeTag, source ,255, 255, 255, true) end addEventHandler ("onMarkerHit", PegarTag, MSG) pelo que entendi e assim, bem simples até, obrigado mesmo pela atenção e pelas dicas!
  7. NomeTag = "BOPE" Comando = "/bope" ComandoSair = "/sair" PegarTag = createMarker(2485, -1667, 13.34375 - 1,"cylinder", 2, 255 ,0 ,0 ,255) function robtag ( source ) if isElementWithinMarker (source, PegarTag ) then aclGroupAddObject (aclGetGroup("BOPE"), "user."..getAccountName(getPlayerAccount(source))) outputChatBox ("[Sistema Tag] Agora Você Já Tem Tag Da"..NomeTag, source, 255, 255, 255, true) outputChatBox ("[Sistema Tag] Para Sair Basta Digitar"..ComandoSair, source, 255, 255, 255, true) else outputChatBox ('[Sistema Tag] Voce Tem Que Estar no Lugar Certo Para Pegar a Tag', source, 255, 255, 255, true) end end addCommandHandler ( "bope", robtag ) function robtirartag ( source ) aclGroupRemoveObject (aclGetGroup("BOPE"), "user."..getAccountName(getPlayerAccount(source))) outputChatBox ('[Sistema Tag] Agora Você Não Tem Mais a Tag Da'..NomeTag, source, 255, 255, 255, true) end addCommandHandler ( "sair", robtirartag ) function MSG (source) outputChatBox('[Sistema Tag] Digite /'..Comando..' Para Pegar Tag Do'..NomeTag, source ,255, 255, 255, true) end addEventHandler ("onMarkerHit", PegarTag ,MSG) assim?, retirei também as cores das mensagens para ficar mais legivél, porfaver fale se estiver errado
  8. na verdade a intenção do codigo era exatamente essa e funcionava (o codigo original não é meu) mais eu estava tentando modifica-lo para setar a velocidade no player
  9. bom agora não esta ocorrendo nenhum erro no debug, mais nao está alterando a velocidade ao dar o comando o script ficou desta forma eu executei a alterações que você mencionou e tambem alterei na quarta linha adicionando depois de ped o tipo de elemento: thePlayer, não sei se isso faz sentido mais antes da minha alteração também não estava a funcionar abaixo o codigo como ficou caso queira dar uma olhada: function getElementSpeed(theElement, unit) assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")") local elementType = getElementType(theElement) assert(elementType == "player" or elementType == "ped" or elementType == "thePlayer" or elementType == "object" or elementType == "vehicle" or elementType == "projectile", "Invalid element type @ getElementSpeed (player/ped/thePlayer/object/vehicle/projectile expected, got " .. elementType .. ")") assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)") unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit)) local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456) return (Vector3(getElementVelocity(theElement)) * mult).length end function setElementSpeed(element, unit, speed) local unit = unit or 0 local speed = tonumber(speed) or 0 local acSpeed = getElementSpeed(element, unit) if acSpeed and acSpeed~=0 then local diff = speed/acSpeed if diff ~= diff then return false end local x, y, z = getElementVelocity(element) return setElementVelocity(element, x*diff, y*diff, z*diff) end return false end function velocidade (thePlayer, cmd, arg1) setElementSpeed(thePlayer, "km/h", tonumber(arg1)) end addCommandHandler("velo", velocidade)
  10. feito isso esta a dar outro erro parecido erro abaixo: o codigo ficou assim: function getElementSpeed(theElement, unit) assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")") local elementType = getElementType(theElement) assert(elementType == "player" or elementType == "ped" or elementType == "object" or elementType == "vehicle" or elementType == "projectile", "Invalid element type @ getElementSpeed (player/ped/object/vehicle/projectile expected, got " .. elementType .. ")") assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)") unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit)) local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456) return (Vector3(getElementVelocity(theElement)) * mult).length end function setElementSpeed(element, unit, speed) local unit = unit or 0 local speed = tonumber(speed) or 0 local acSpeed = getElementSpeed(element, unit) if acSpeed and acSpeed~=0 then local diff = speed/acSpeed if diff ~= diff then return false end local x, y, z = getElementVelocity(element) return setElementVelocity(element, x*diff, y*diff, z*diff) end return false end function velocidade (thePlayer, cmd, arg1) setElementSpeed(player "km/h", tonumber(arg1)) end addCommandHandler("velo", velocidade)
  11. olá recentemente achei um script que cria um ped, e o faz executar uma ação gostaria de saber onde se tem uma lista de todas as ações possiveis para esse codigo e eu queria saber tambem como faço para ele executar a ação em loop sem parar codigo abaixo function newPed() local x, y, z = getElementPosition(localPlayer) local ped = createPed(217, x + 1, y, z) if ped then setPedControlState(ped, "fire", true) end end addCommandHandler("ped", newPed)
  12. então tentei fazer um codigo onde quem digita o comando pode se auto setar uma velocidade de 1 á 3 mais o codigo está dando erro ja tentei varias coisas e não está funcionando nada gostaria de uma ajuda codigo e erro que está dando no debug abaixo: function velocidade (player, cmd, arg1) setElementSpeed(player "km/h", tonumber(arg1)) end addCommandHandler("speed", velocidade)
  13. então o codigo abaixo permite que o player sete a si mesmo uma velocidade de 1x á 3x, mas está ocorrendo um erro no debug toda vez que alguem seta velocidade ocorre este erro na imagem abaixo addCommandHandler("speed", function (player, cmd, arg1) setElementSpeed(player, "velocity", tonumber(arg1)) outputChatBox("Velocidade Setada Com Sucesso") end)
  14. o codigo não é meu, não entendo muito bem disso
  15. então achei um script na internet que cria um marker, e quando qualquer um entra nesse marker tem a permissão de digitar um comando e receber uma tag especifica eu gostaria de saber como adaptar este codigo para que uma tag especifica consiga pegar a tag oferecida pela do marker ex: tag que pode executar o comando (apaisana) tag oferecida pelo marker: (policial), isso eu quero para que os policias fora de serviço não usem o painel pm, mais ai eu colocarei o marker dentro da base deles para que possam pegar a tag do painel pm a hora que forem patrulhar codigo abaixo: PegarTag = createMarker(2485, -1667, 13.34375 - 1,"cylinder", 2, 255 ,0 ,0 ,255) function robtag ( source ) if isElementWithinMarker (source, PegarTag ) then aclGroupAddObject (aclGetGroup("BOPE"), "user."..getAccountName(getPlayerAccount(source))) ---- Mude A Acl Em "BOPE" outputChatBox ("#000000[ #ff0000Sistema Tag #000000] #ffffff Agora Você #00ff00Já Tem #ffffffTag Da #ffff00"..NomeTag,source,255,255,255,true) outputChatBox ("#000000[ #ff0000Sistema Tag #000000] #ffffff Para Sair Basta Digitar #00ffff"..ComandoSair,source,255,255,255,true) else outputChatBox ('#000000[ #ff0000Sistema Tag #000000] #ffffff Voce Tem Que Estar no #ff0000Lugar Certo Para Pegar a Tag',source,255,255,255,true) end end addCommandHandler ( "bope", robtag ) function robtirartag ( source ) aclGroupRemoveObject (aclGetGroup("BOPE"), "user."..getAccountName(getPlayerAccount(source))) outputChatBox ('#000000[ #ff0000Sistema Tag #000000] #ffffff Agora Você #00ff00Não Tem Mais #ffffffa Tag Da #ffff00'..NomeTag,source,255,255,255,true) end addCommandHandler ( "sair", robtirartag ) function MSG (source) outputChatBox('#000000[ #ff0000Sistema Tag #000000] #ffffffDigite #00ffff'..Comando..' #ffffffPara Pegar Tag Do #ffff00'..NomeTag,source ,255 ,255 ,255,true) end addEventHandler ("onMarkerHit",PegarTag ,MSG)
  16. muito obrigado, agora eu queria saber outra coisa como faço para o script quando der o comando denovo na mesma pessoa, dar unfreeze nela
  17. eu queria um script que desse freeze em alguem por id, ex : freeeze (id do player) tentei fazer um script so que ao invez de dar freeze via id, ele da freeze somente em mim mesmo codigo infuncional meu abaixo function toggleFreezeStatus(thePlayer, cmd, id) if ( id ) then local playerID = tonumber(id) if ( playerID ) then local targetPlayer = getPlayerID(playerID) if ( targetPlayer ) then setElementFrozen(thePlayer, true) local playerVehicle = getPedOccupiedVehicle(thePlayer) if playerVehicle then local isPlayerVehicleFrozen = isElementFrozen(playerVehicle) setElementFrozen(playerVehicle, not isPlayerVehicleFrozen) end end end end end addCommandHandler("rlkfreeze", toggleFreezeStatus)
  18. então recentemente coloquei esta função no meu servidor para os staff's sem painel P ver a quantia de dinheiro dos players so que eu percebi que essa mensagem aparece para todos gostaria de saber como resolvo codigo abaixo function verMoney(playerSource, commandName, id) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Staff")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("Console")) then for i, v in pairs(getElementsByType("player")) do if getElementData(v, "ID") == tonumber(id) then local dinheiro = getPlayerMoney(v) outputChatBox('O jogador: '..getPlayerName(v)..'#ffffff Tem R$: #00ff00'..dinheiro.. ' #ffffffDe Dinheiro Na Mão !',source, 255, 255, 255, true) end end end end addCommandHandler("rlkver", verMoney
  19. então algum espertinho abusou de comandos de um celular que havia comandos ocultos de puxar dinheiro desde então ele distribuiu dinheiro para todos os jogadores do servidor em torno de 20kk para cada gostaria de um script que setasse o dinheiro para 0 de todos os jogadores, tentei fazer um mais não deu muito certo porque não entendo muito bem, e no caso ele so funcionaria para jogadores online, mais eu ja gostaria de um que setasse o dinheiro dos jogadores que estão tambem offline, não sei se e possivel mais, se não der pode ser um que sete so os dos jogadores online mesmo. script infucional que tentei fazer abaixo function ResetMoneyAllPlayers (playerSource, commandName) for _,player in ipairs(getElementsByType("player")) do setPlayerMoney(targetPlayer, 0) end end addCommandHandler("resetMoneyglobal", ResetMoneyAllPlayers)
  20. esta dando este erro ERROR: marker/script.lua52: attempt to index global 'marker' (a nil value) oque faço para conzertar
×
×
  • Create New...