Jump to content

Angelo Pereira

Members
  • Posts

    251
  • Joined

  • Last visited

  • Days Won

    7

Angelo Pereira last won the day on April 28 2020

Angelo Pereira had the most liked content!

About Angelo Pereira

  • Birthday 19/10/1998

Details

  • Location
    Brasil - RS

Recent Profile Visitors

1,465 profile views

Angelo Pereira's Achievements

Red-Headed Stepchild

Red-Headed Stepchild (19/54)

116

Reputation

  1. local tempo_bloqueado = 5 --/> 5 Segundos local marker_vip = createMarker ( -2295.298828125, -2641.6328125, 59.416213989258 -1, "cylinder", 45, 0, 0, 0, 0) local bloquear_comando = false function itensvip ( thePlayer ) if isElement(thePlayer) and getElementType(thePlayer) == "player" then --/> Adicionado if isObjectInACLGroup ( "user." ..getAccountName (getPlayerAccount (thePlayer) ), aclGetGroup ("VIP")) then if bloquear_comando == true then --/> AQUI, Você irá Verificar Sua Várivel, então se ela for IGUAL a true, então : return outputChatBox("Este Comando Esta Bloqueado, AGUARDE!", thePlayer, 255, 255, 255, true) --/> Retorna e informa. end bloquear_comando = true setTimer ( function ( ) bloquear_comando = false end, tempo_bloqueado*1000, 1) giveWeapon(thePlayer, 24, 5, true) giveWeapon(thePlayer, 25, 5, true) giveWeapon(thePlayer, 33, 10, true) giveWeapon(thePlayer, 4, 1, true) setElementHealth (thePlayer, 100) setPedArmor(thePlayer, 100) outputChatBox("[SEXTA-FEIRA 13] Você pegou com sucesso seu KitVip!", thePlayer, 255, 215, 0, true) outputChatBox("[SEXTA-FEIRA 13] Armas, Colete e Vida recebidos, obrigado por nos apoiar ^^", thePlayer, 255, 215, 0, true) else outputChatBox("[SEXTA-FEIRA 13] Confira nosso discord para adquirir #FFD700VIP, #64FF64aperte F2!", thePlayer, 100, 255, 100, true) end end end addEventHandler("onMarkerHit", marker_vip, itensvip) addCommandHandler("kitvip", itensvip) Linha 4, e 5 te ajudará a entender. Retirando o return, o script apenas irá informar, e continua lendo o código, utilizando o return, ele vai praticamente pausar onde você o utilizou.
  2. O que o moderador quis dizer é, você postou seu tópico em sessão errada, e então ele moveu para sessão correta. Sobre isto, basta você ter uma PNG de um celular, e então ou desenvolver por meio de DX ou CEGUI. O tutorial que eu sugiro seria começar lendo pelo : Multi Theft Auto: Wiki
  3. Espero que você consiga interpretar a minha correção em base no que você fez. local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) local showdx = false local randomColors = 0 local color = { } --/> Basta uma table. function dxbutton ( ) if showdx == true then if isCursorOnElement ( x*35, y*410, x*105, y*85 ) then color[1] = tocolor(0, 255, 0, 255) else color[1] = tocolor(255, 255, 255, 255) end dxDrawRectangle(x*35, y*410, x*105, y*85, color[1], false) end end function opendx ( ) if showdx == true then removeEventHandler("onClientRender", root, dxbutton) showCursor(false) showdx = false else addEventHandler("onClientRender", root, dxbutton) showCursor(true) showdx = true end end bindKey("z", "down", opendx) ---------------------------------------------------------------------------------------------------------- function isCursorOnElement ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end
  4. Deixar o evento como root neste caso, qualquer marker que o usuário colidir no servidor, abrirá o portão. Então, faça : local gate = createObject (16775, 2532, -1514.5999755859, 27.10000038147, 0, 0, 0) local marker = createMarker (2532, -1514.5999755859, 27.10000038147, "cylinder", 8, 0, 0, 0, 0) function moveGate ( hitElement ) if isElement(hitElement) and getElementType(hitElement) == "player" then local accName = getAccountName ( getPlayerAccount ( hitElement ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "CV" ) ) then moveObject(gate, 1900, 2532, -1.514,5999755859, 18,89999961853) end end end addEventHandler ( "onMarkerHit", marker, moveGate ) function move_back_gate ( hitElement ) if isElement(hitElement) then moveObject (gate, 1900, 2532, -1514.5999755859, 27.10000038147, 0, 0, 0) end end addEventHandler ("onMarkerLeave", marker, move_back_gate)
  5. Não é possível você alterar a origem do evento. Eu fazeria desta forma, sempre trazendo a string. function savePlayerData ( player ) local account = getPlayerAccount(player) local skin = getElementModel(player) local x,y,z = getElementPosition(player) local position = toJSON({x,y,z,getElementRotation(player)}) local interior = getElementInterior(player) local dimension = getElementDimension(player) setAccountData(account, "skin", skin) setAccountData(account, "position", position) setAccountData(account, "interior", interiror) setAccountData(account, "dimension", dimension) end addEventHandler("onPlayerQuit", root, function ( ) savePlayerData ( source ) end) addEventHandler("onResourceStop", resourceRoot, function ( ) for i, players in ipairs ( getElementsByType ("player") ) do savePlayerData ( players ) end end)
  6. # Faça : local carro = createMarker(2146.883, -2289.945, 14.761 -1,"cylinder", 2.0, 255,0,0,80) local desespawncm = createMarker(2151.133, -2290.037, 13.368 -1 , "cylinder",2.0,255,255,255,80) local veh = { } function spawnviaturaone(thePlayer) local job = getElementData(thePlayer,"Emprego") or false --/> ADD if job ~= "Entregador de Jornal" then --/> ADD return outputChatBox("Você Precisa Esta no Emprego Para Pegar Este Veiculo", thePlayer, 255, 255, 255, true) --/> ADD end --/> ADD local vehicle = getPedOccupiedVehicle(thePlayer) if isElementWithinMarker(thePlayer, carro) then if veh[thePlayer] and isElement(veh[thePlayer]) then destroyElement(veh[thePlayer]) veh[thePlayer] = nil else veh[thePlayer] = createVehicle(530, 2153.617, -2287.28, 13.524) warpPedIntoVehicle(thePlayer, veh[thePlayer]) end end end addEventHandler("onMarkerHit", carro, spawnviaturaone ) function desespawncmm( thePlayer ) if veh[thePlayer] and isElement(veh[thePlayer]) then --/> ADD destroyElement(veh[thePlayer]) end --/> ADD end addEventHandler("onMarkerHit", desespawncm, desespawncmm)
  7. O fórum é um local para lhe ajudar em seus códigos, e não um ambiente de pedir scripts prontos. Então anexe, o seu script utilizando <>, e formate em .lua. # Sobre sua dúvida, utilize : Eventos : onPlayerJoin / onPlayerLogin / onPlayerWasted ou onPlayerSpawn Função : setElementModel # Exemplo : function setar_skin ( ) setElementModel ( source, 7 ) outputChatBox ("Você Recebeu a Skin Nº7", source, 255, 255, 255, true ) end addEventHandler("onPlayerJoin", root, setar_skin) addEventHandler("onPlayerLogin", root, setar_skin) addEventHandler("onPlayerSpawn", root, setar_skin)
  8. # Sobre o fórum : 1. Não utilize um título do tópico muito longo, e seja objetivo/específico. [ Exemplo ] Titulo : Proteção por ACL Somente Para STAFF. 2. Então, abaixo disto, você coloque sua dúvida, esclareça o que você quer realmente fazer. [ Exemplo ] Texto : Alguém me ajuda na minha dúvida, como faço para apenas quem tiver numa determinada ACL, pode utilizar o comando. 3. Caso você tenha o script, clique no ícone < > , e cole o seu código lá, e formate em .Lua. # Sobre a sua dúvida : addCommandHandler ( "protecao", function ( thePlayer ) local conta = getAccountName ( getPlayerAccount ( thePlayer ) ) --/> Pegar Usuário do Jogador. if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then --/> Verificar Se Este Usuário Esta na ACL "Admin". outputChatBox("#00ff00Você Tem Permissão!", thePlayer, 255, 255, 255, true) else --/> Se não Tiver, Então fazer : outputChatBox("#ff0000Você Não Tem Permissão a Este Comando!", thePlayer, 255, 255, 255, true) end end) --[[ # MTA WIKI / UTILIZADOS : https://wiki.multitheftauto.com/wiki/AddCommandHandler https://wiki.multitheftauto.com/wiki/isObjectInACLGroup https://wiki.multitheftauto.com/wiki/OutputChatBox --]]
  9. Arrumado, basta testa : function ComecarAAssaltar ( source ) if getElementData(source, "TS:Assaltando") then return end local arma = getPedWeapon ( source ) if arma == 0 or arma == 1 or arma == 2 or arma == 3 or arma == 4 or arma == 5 or arma == 6 or arma == 7 or arma == 8 or arma == 9 or arma == 16 or arma == 17 or arma == 18 or arma == 39 or arma == 41 or arma == 42 or arma == 43 or arma == 10 or arma == 11 or arma == 12 or arma == 14 or arma == 15 or arma == 44 or arma == 45 or arma == 46 or arma == 40 then return end if isObjectInACLGroup ( "user." ..getAccountName (getPlayerAccount(source)), aclGetGroup ( "Assalto" ) ) then for i, Policial in ipairs ( getElementsByType ( "player" ) ) do if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount( Policial ) ), aclGetGroup ( "ComandosPolicia" ) ) then triggerClientEvent(Policial, "TS:MensagemPolicial2", Policial) outputChatBox("EX: "..getPlayerName(source).." Está Assaltando a LOJA.", Policial, 255, 255, 255, true ) end end -- Encerra o LOOP. setElementData(source, "TS:Assaltando", true) setPedAnimation(source, "SHOP", "ROB_Loop", -1, false) setPedAnimation(PedLoja, "SHOP", "SHP_Rob_GiveCash", -1, false) setElementFrozen(source, true) toggleAllControls(source, false) setElementPosition(source, 397.9880065918, -1522.498046875, 32.2734375) setElementRotation(source, -0, 0, 100.156) setElementData(PedLoja, "TS:Assaltando", true) setPedAnimation(source, "SHOP", "ROB_Loop", -1, false) setPedAnimation(source, "SHOP", "ROB_Loop", -1, false) setPedAnimation(source, "SHOP", "ROB_Loop", -1, false) setPedAnimation(source, "SHOP", "ROB_Loop", -1, false) setPedAnimation(source, "SHOP", "ROB_Loop", -1, false) LojaAssaltada(source) setTimer( function ( ) setPedAnimation(source, nil) setPedAnimation(PedLoja, nil) setElementFrozen(source, false) toggleAllControls(source, true) givePlayerMoney(source, DinheiroAdicionado ) --/> Adicionado --local Dinheiro = getPlayerMoney ( source ) --setPlayerMoney (source, Dinheiro + DinheiroAdicionado ) setElementData(source, "TS:Assaltando", false) end, 1*60000, 1) else -- Você Não tem Permissão para ASSALTAR ! end end addEvent("TS:IniciarAssalto2", true) addEventHandler("TS:IniciarAssalto2", root, ComecarAAssaltar)
  10. Você pode utilizar o evento onPlayerChangeNick. Ex: addEventHandler("onPlayerChangeNick", root, function ( oldNick, newNick ) outputChatBox( ""..oldNick.." Mudou o Nome Para "..newNick.."",root, 255, 255, 255, true ) end)
  11. Você vai precisar do lado server-side, utilizar o evento "onPlayerLogin", e enviar um trigger event para o client-side. Ex : -- server-side addEventHandler("onPlayerLogin", root, function ( ) triggerClientEvent ( source, "PainelLogin:RemoverAnimacao", resourceRoot ) end) -- client-side addEvent("PainelLogin:RemoverAnimacao", true) addEventHandler("PainelLogin:RemoverAnimacao", resourceRoot, function ( ) removeEventHandler ( ) end)
  12. Bom, refiz algumas coisas, onde você poder tiras suas dúvidas baseadas no que eu refiz. local mrk = createMarker(-2405.083, -598.298, 131.648, "cylinder", 3.0, 255, 0, 0, 50) -- local do marker local bikes = { } --/> ADD. function msg ( thePlayer, dimension ) if isElement(thePlayer) and getElementType( thePlayer ) == "player" and dimension then --/> ADD. outputChatBox ("#0000FF|ALUGUEL DE BIKES CLASSE ALTA RP|", thePlayer, 255,255,255, true) outputChatBox ("----------------------------------------", thePlayer, 255,255,255, true) outputChatBox ("#0000FF 1 -|BMX| - #008000R$ 150", thePlayer, 255,255,255, true) outputChatBox ("#0000FF 2 -|MOUNTAIN| - #008000R$ 150", thePlayer, 255,255,255, true) outputChatBox ("#0000FF 3 -|CLASSIC| - #008000R$ 150", thePlayer, 255,255,255, true) outputChatBox ("----------------------------------------", thePlayer, 255,255,255, true) outputChatBox ("#0000FF3Digite '/alugar' e o numero da Bike que deseja.", thePlayer, 255,255,255, true) end end addEventHandler ("onMarkerHit", mrk, msg) function alugar_bike ( thePlayer, cmd, id) if not isElementWithinMarker (thePlayer, mrk) then return outputChatBox ("Comando Apenas Funciona no Marker de Aluguel de Bikes.", thePlayer, 255, 255, 255, true) elseif not id then return outputChatBox ("Utilize o Comando : </alugar id>,", thePlayer, 255, 255, 255, true) elseif not tonumber(id) or ( tonumber(id) <= 0 ) or ( tonumber(id) >= 4 ) then return outputChatBox ("Apenas Permitido Numeros de 1 a 3.", thePlayer, 255, 255, 255, true) elseif getPlayerMoney (thePlayer) < 150 then return outputChatBox ("#FF0000Você não tem dinheiro suficiente para alugar uma bicicleta.", thePlayer, 255, 255, 255, true) end if isElement(bikes[thePlayer]) then destroyElement ( bikes[thePlayer] ) bikes[thePlayer] = nil end if tonumber(id) == 1 then outputChatBox ("#FF0000Você Alugou uma BMX.", thePlayer, 255, 255, 255, true) takePlayerMoney ( thePlayer, 150 ) bikes[thePlayer] = createVehicle(481, -2422.081, -609.549, 132.563) elseif tonumber(id) == 2 then outputChatBox ("#FF0000Você Alugou uma MOUNTAIN.", thePlayer, 255, 255, 255, true) takePlayerMoney ( thePlayer, 150 ) bikes[thePlayer] = createVehicle(510, -2422.081, -609.549, 132.563) elseif tonumber(id) == 3 then outputChatBox ("#FF0000Você Alugou uma CLASSIC.", thePlayer, 255, 255, 255, true) takePlayerMoney ( thePlayer, 150 ) bikes[thePlayer] = createVehicle(509, -2422.081, -609.549, 132.563) end end addCommandHandler ("alugar", alugar_bike )
  13. local Spawndt = createMarker(1166.3742675781,-1263.1636962891,15.250455856323 -1,"cylinder", 1.9, 255, 140, 0, 99) local Destroydt = createMarker(1166.2664794922,-1257.7770996094,15.268055915833 -2,"cylinder", 5.0, 128, 0, 0, 99) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end local veh = { } function Spawnvtrdt ( thePlayer ) if isElement( veh[thePlayer] ) then destroyElement ( veh[thePlayer] ) veh[thePlayer] = nil end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "SAMU") ) then veh[thePlayer] = createVehicle(416, 1189.8168945313,-1254.3963623047,15.52241897583, 0,0,180) warpPedIntoVehicle ( thePlayer, veh[thePlayer] ) exports.Scripts_Dxmessages:outputDx(thePlayer, "VEICULO CRIADO COM SUCESSO!", "success") else exports.Scripts_Dxmessages:outputDx(thePlayer, "VOCE NAO É DO SAMU PARA PEGAR ESTE VEICULO!", "error") end end addEventHandler("onMarkerHit", Spawndt, Spawnvtrdt) function Destroydtvtrdt ( thePlayer ) if isElement(thePlayer) and getElementType(thePlayer) == "player" and isElement(veh[thePlayer]) then destroyElement (veh[thePlayer]) veh[thePlayer] = nil exports.Scripts_Dxmessages:outputDx(thePlayer, "VEICULO DESTRUIDO COM SUCESSO!", "success") end end addEventHandler("onMarkerHit", Destroydt, Destroydtvtrdt) function Destroydt ( ) if isElement(veh[source]) then destroyElement (veh[source]) veh[source] = nil end end addEventHandler ("onPlayerQuit", getRootElement(), Destroydt) Teste lá
  14. addCommandHandler("policia", function ( thePlayer ) --/> comando policia. local contador = 0 --/> cria uma variavel para iniciar uma contagem. for i, players in ipairs ( getElementsByType ( "player" ) ) do --/> fazer um loop em todos jogadores no servidor. if getElementData(players, "TrabalhoPolicial") then --/> então, irá verificar cada player, se o elemento é true, então : contador = contador + 1 --/> adicionar +1 na contagem. end end --/> fim do loop. outputChatBox("Existe "..contador.." PM em Serviço.", thePlayer, 255, 255, 255, true) end)
×
×
  • Create New...