Jump to content

Blaack

Members
  • Posts

    194
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Blaack

  1. Off: isso, errei e não tive tempo de editar; desculpe
  2. Escolha um script aleatório para ser baixado por último e setar o download da pessoa como true, este script você colocará a prioridade de download dele em 1, visto que o restante por padrão é 0; E na tela de download coloque -1, para ser o primeiro resource a ser baixado e iniciado.
  3. Pode me especificar o valor de 'Preco" ?
  4. "Ele é client", querido olhe na wiki a função isObjectInACLGroup é somente server-side ;D
  5. markers = { inicio = {352.43173217773, 2540.5510253906, 15.72790145874}, } function isPlayerInACL(player, acl) if isElement(player) and getElementType(player) == "player" and aclGetGroup(acl or "") and not isGuestAccount(getPlayerAccount(player)) then local account = getPlayerAccount(player) return isObjectInACLGroup( "user.".. getAccountName(account), aclGetGroup(acl) ) end return false end function markerInicial (x,y,z,Painel_droga) for i, v in ipairs (markers) do Painel_droga = createMarker (v[1], v[2],v[3], "cylinder", 255, 0, 157, 50) end end ------------------------ function Open_Painel (hitElement) local source = hitElement if getElementType(source) == "player" then if isPlayerInACL(source, "trafico") then -- Quem é thePlayer ? if isPlayerInACL(thePlayer, "trafico") then triggerClientEvent(source, "Abrir_Painel", source) else outputChatBox("Você não faz parte de nenhuma gang!", source) end end end addEventHandler("onMarkerHit", Painel_droga, Open_Painel) --- erro aqui, na hora de verificar o arugmento 2.
  6. local gate = createObject(980, 1810.9000244141, -1891.1999511719, 15.39999961853, 0, 0, 90) local marker = createMarker(1810.9000244141, -1891.1999511719, 9.6000003814697, "cylinder", 8, 0, 0, 0, 0) function moveGate(hitElement) if getElementType( hitElement ) == "player" then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)) , aclGetGroup("BOPE")) then moveObject(gate, 3000, 1810.9000244141, -1891.1999511719, 9.6000003814697) end end end addEventHandler("onMarkerHit", marker, moveGate) function move_back_gate() moveObject(gate, 3000, 1810.9000244141, -1891.1999511719, 15.39999961853) end addEventHandler("onMarkerLeave", marker, move_back_gate)
  7. Possivelmente: MarkerSafeEntregadorDeJornal = createMarker( 1417.9403076172, -1687.3420410156, 13.546875, "cylinder", 35, 0, 255, 0, 0) EntregadorDeJornalPickup = createPickup ( 1412.0852050781, -1699.9636230469, 13.539485931396, 3, 1239) MarkerEntregadorDeJornal = createMarker ( 1412.0852050781, -1699.9636230469, 13.539485931396, "cylinder", 1.2, 255, 255, 255, 0 ) attachElements ( MarkerEntregadorDeJornal, EntregadorDeJornalPickup, 0, 0, -1 ) BlipEntregadorDeJornal = createBlipAttachedTo ( MarkerEntregadorDeJornal, 42 ) setBlipVisibleDistance ( BlipEntregadorDeJornal, 150 ) function CancelarSumirPickup ( player ) cancelEvent() end addEventHandler ( "onPickupHit", EntregadorDeJornalPickup, CancelarSumirPickup ) LetraParaMarkers = "k" cmd1 = "hq" cmd2 = "profissao" local HQEntregadorDeJornalBlip = createBlip ( 1417.9403076172, -1687.3420410156, 13.546875 ) setElementVisibleTo ( HQEntregadorDeJornalBlip, root, false ) -------------------------------------------------------------------- function VerificarBlipEmprego(player) if player then acc = getPlayerAccount ( player ) if isGuestAccount ( acc ) then return end setElementVisibleTo ( HQEntregadorDeJornalBlip, player, false ) end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then if getElementData ( pl, "Emprego" ) == "Jornaleiro" then return end VerificarBlipEmprego(pl) end end end, 3000,0) -------------------------------------------------------------------- function ComandoHQ ( source ) if getElementData ( source, "Emprego" ) == "Jornaleiro" then if isElementVisibleTo ( HQEntregadorDeJornalBlip, source ) then setElementVisibleTo ( HQEntregadorDeJornalBlip, source, false ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Desmarcado do Mapa!", "info") else setElementVisibleTo ( HQEntregadorDeJornalBlip, source, true ) exports.Scripts_Dxmessages:outputDx(source, "Seu Local de Trabalho foi Marcado no Mapa!", "info") end end end addCommandHandler ( cmd1, ComandoHQ ) -------------------------------------------------------------------- function AceitarEmprego02 (source) local level = getElementData(source,"Level") or 0 if tonumber(level) > 4 then exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) setElementData ( source, "Emprego", "Jornaleiro" ) exports.Scripts_Dxmessages:outputDx(source, "Você Agora Trabalha de Jornaleiro, Para Mais Informações Digite ( /Profissao )", "success") end end function RecusarEmprego02 (source) exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) if isElementVisibleTo ( HQEntregadorDeJornalBlip, source ) then setElementVisibleTo ( HQEntregadorDeJornalBlip, source, false ) end removeElementData ( source, "Emprego", "Jornaleiro" ) exports.Scripts_Dxmessages:outputDx(source, "Você se Demitiu do Emprego de Jornaleiro com Sucesso!", "warning") end -------------------------------------------------------------------- function ComandosProf ( ThePlayer ) if getElementData ( ThePlayer, "Emprego" ) == "Jornaleiro" then playSoundFrontEnd ( ThePlayer, 43 ) outputChatBox ( "#DF3A01~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #EFFBEFJORNALEIRO #DF3A01~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#DF3A01» #EFFBEFComandos da Profissão de Jornaleiro:", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#DF3A01» #DF3A01/hq #ffffff- #EFFBEFPara Marcar ou Desmarcar a sede do seu Local de Trabalho", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#DF3A01» #DF3A01/entregarjornais #ffffff- #EFFBEFAbre a Lista de Rotas Disponiveis Para Trabalhar", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#DF3A01» #EFFBEFMonte na Bicicleta e Digite #DF3A01/entregarjornais", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#DF3A01» #EFFBEFSelecione uma rota de entrega e Siga os checkpoints no Mapa (F11)", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#DF3A01» #EFFBEFQuando concluir as entregas você receberá uma #DBA901comissão", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#DF3A01~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #EFFBEFJORNALEIRO #DF3A01~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ThePlayer, 255, 255, 255, true ) end end addCommandHandler(cmd2, ComandosProf ) -------------------------------------------------------------------- function emarker(marker,md) if (md) then if isPedInVehicle ( source ) then return end if marker == MarkerEntregadorDeJornal then if getElementData ( source, "Emprego" ) == "Jornaleiro" then exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para se Demitir do Emprego de Jornaleiro") bindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) else exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para Aceitar o Emprego de Jornaleiro") bindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) end end end end addEventHandler("onPlayerMarkerHit",getRootElement(),emarker) function lmarker(marker,md) if (md) then if marker == MarkerEntregadorDeJornal then exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) unbindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) end end end addEventHandler("onPlayerMarkerLeave",getRootElement(),lmarker) function CriarVeiculosComData () VeiculosComDataEntregadorDeJornal = { createVehicle(510, 1417.8991699219, -1694.3439941406, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +4, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +6, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +2, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +8, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +10, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +12, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +14, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +16, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +18, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +20, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 -2, 13.0, 0, 0, 270 ), createVehicle(510, 1417.8991699219, -1694.3439941406 +22, 13.0, 0, 0, 270 ), } for i, veh in ipairs(VeiculosComDataEntregadorDeJornal) do setElementData ( veh, "Emprego", "Jornaleiro" ) setVehicleDamageProof(veh,true) setVehicleColor( veh, 255, 255, 255 ) setVehiclePlateText ( veh, "BRV" ) addEventHandler("onVehicleStartEnter", veh, VerificarEmprego ) --addEventHandler("onVehicleExit", veh, SairDoVeiculosComData ) local tx, ty, tz = getElementPosition(veh) local rx, ry, rz = getElementRotation(veh) setVehicleRespawnPosition(veh, tx, ty, tz, rx, ry, rz) end end addEventHandler("onResourceStart", resourceRoot, CriarVeiculosComData ) function VerificarEmprego (thePlayer, seat) local Jogador = getElementData(thePlayer, "Emprego" ) if seat == 0 then if Jogador == "Jornaleiro" then else cancelEvent() exports.Scripts_Dxmessages:outputDx(thePlayer, "Esse Veiculo é Exclusivo dos Jornaleiros!", "error") end end end --[[function SairDoVeiculosComData () local veh = source setTimer(function() if getVehicleOccupant(veh) == false then respawnVehicle(veh) end end, 30000, 1) end addEventHandler ( "onPlayerQuit", getRootElement(), SairDoVeiculosComData ) --]] -------------------------------------------------------------------- local rElement = getRootElement() function respawnVehicles(player, seconds) for i, veh in ipairs(VeiculosComDataEntregadorDeJornal) do if isEmpty( veh ) then respawnVehicle ( veh ) end end end setTimer(respawnVehicles, 60000,0) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end -------------------------------------------------------------------- atualrotnumberJORNAL = {} ppcikJORNAL = {} blips = {} rotasJORNAL = { ["Los Santos - Favelas - 20 Entregas - Comissão: $300"] = { {1429.9464111328, -1905.8059082031, 13.773780822754}, {1375.8276367188, -1918.4099121094, 19.122716903687}, {1270.9599609375, -1902.0228271484, 28.374183654785}, {1309.2713623047, -1961.1942138672, 29.166717529297}, {1405.7294921875, -2045.7346191406, 54.065727233887}, {1301.8836669922, -2048.9123535156, 58.464176177979}, {1244.1116943359, -2053.9213867188, 59.876438140869}, {1279.3021240234, -2031.7036132813, 58.958137512207}, {1133.7977294922, -2025.0975341797, 69.000610351563}, {1134.2821044922, -2098.537109375, 71.074172973633}, {1092.1948242188, -2125.5886230469, 67.255599975586}, {1045.2015380859, -2186.7719726563, 40.421051025391}, {1161.7659912109, -2165.134765625, 64.786643981934}, {1188.5417480469, -2331.0920410156, 14.28927230835}, {1229.0968017578, -2203.7377929688, 37.594787597656}, {1347.48828125, -2103.5290527344, 46.227912902832}, {1411.4415283203, -2085.2429199219, 43.614170074463}, {1452.4599609375, -2092.7153320313, 35.114093780518}, {1480.2470703125, -2023.3793945313, 31.805692672729}, {1515.3037109375, -2010.2598876953, 28.44634437561}, }, ["Los Santos - Ganton/Temple - 20 Entregas - Comissão: $200"] = { {2494.3081054688, -1684.810546875, 12.510766983032}, {2512.0192871094, -1689.4036865234, 13.544955253601}, {2511.7531738281, -1651.3133544922, 13.91447353363}, {2409.0688476563, -1671.6916503906, 13.580268859863}, {2362.8149414063, -1646.5299072266, 13.53059387207}, {2389.9978027344, -1717.0043945313, 13.60608291626}, {2504.3889160156, -1788.6654052734, 13.555590629578}, {2609.7587890625, -1849.3317871094, 3.2896952629089}, {2560.2180175781, -1802.0985107422, 1.640625}, {2521.1306152344, -1917.3314208984, 13.589694976807}, {2419.9372558594, -1914.8271484375, 13.546899795532}, {2437.5512695313, -1790.1809082031, 13.554225921631}, {2324.8544921875, -1796.3190917969, 13.546875}, {2155.7231445313, -1700.7188720703, 15.0859375}, {2141.8076171875, -1607.6066894531, 14.187998771667}, {2072.1538085938, -1628.64453125, 13.546875}, {2069.1791992188, -1731.5767822266, 13.87615776062}, {1985.9375, -1718.9539794922, 15.969563484192}, {1961.2664794922, -1562.8210449219, 13.609630584717}, {1863.8009033203, -1599.7763671875, 13.868625640869}, }, ["Los Santos - Richman - 20 Entregas - Comissão: $100"] = { {230.03106689453, -1400.8328857422, 51.590793609619}, {260.44561767578, -1363.5102539063, 53.109375}, {167.86294555664, -1344.1441650391, 69.553092956543}, {290.69464111328, -1331.0395507813, 53.444843292236}, {356.9423828125, -1275.7287597656, 53.829723358154}, {422.85809326172, -1262.6413574219, 51.580940246582}, {633.45733642578, -1119.3950195313, 45.719078063965}, {696.92242431641, -1058.3994140625, 49.402328491211}, {724.82531738281, -994.73333740234, 52.623596191406}, {790.10278320313, -844.86358642578, 60.641288757324}, {832.16638183594, -858.89892578125, 69.921875}, {837.51416015625, -891.27130126953, 68.768898010254}, {930.03179931641, -852.59350585938, 93.500045776367}, {977.28454589844, -826.35040283203, 96.275825500488}, {1029.8919677734, -807.95526123047, 101.8515625}, {1092.6324462891, -798.84069824219, 107.41916656494}, {1107.7619628906, -731.60491943359, 100.61921691895}, {1242.3199462891, -745.32543945313, 94.904930114746}, {1356.48828125, -616.41851806641, 109.1328125}, {1496.6713867188, -697.98297119141, 94.75}, }, } pay = { ["Los Santos - Favelas - 20 Entregas - Comissão: $300"] = 300, ["Los Santos - Ganton/Temple - 20 Entregas - Comissão: $200"] = 200, ["Los Santos - Richman - 20 Entregas - Comissão: $100"] = 100, } function ifPlayerEnterOnMarker(markerHit,matchingDimension) if isPedInVehicle(source) then if markerHit == ppcikJORNAL[source] then if (matchingDimension) then if isElement(ppcikJORNAL[source]) then local rname = getElementData(source,"rtnameJornal") or nil if rname == nil then return end destroyElement(ppcikJORNAL[source]) triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>blips<Client",source,false) local vh = getPedOccupiedVehicle(source) toggleAllControls ( source, false ) setControlState ( source, "handbrake", true ) if atualrotnumberJORNAL[source] <= #rotasJORNAL[rname] then exports.Scripts_Dxmessages:outputDx(source, "Entregando Jornais... Aguarde 2 Segundos!", "info") setTimer(gerarrota,2500,1,source) setTimer(function(source) exports.Scripts_Dxmessages:outputDx(source, "Jornais Entregues, Siga Para o Proximo Checkpoint!", "success") end,2500,1,source) elseif atualrotnumberJORNAL[source] == #rotasJORNAL[rname]+1 then setElementData(source,"rtnameJornal",rname) atualrotnumberJORNAL[source] = 1 local rec = pay[rname] givePlayerMoney(source,tonumber(rec)) local vh = getPedOccupiedVehicle(source) setTimer(function(source) exports.Scripts_Dxmessages:outputDx(source, "Você Recebeu Sua Comissão de $"..rec.." Por Finalizar as Entregas de Jornais!", "success") end,2500,1,source) setTimer(function(source) toggleAllControls ( source, true ) end, 2500,1, source ) setTimer(function(source) setControlState ( source, "handbrake", false ) end, 2500,1, source ) setElementData(source,"rtnameJornal",nil) end end end end end end addEventHandler("onPlayerMarkerHit",getRootElement(),ifPlayerEnterOnMarker) -------------------------------------------------------------------- function VerificarCairBike(player) if player then acc = getPlayerAccount ( player ) if isGuestAccount ( acc ) then return end local rname = getElementData(player,"rtnameJornal") or nil if rname == nil then triggerClientEvent ( "Desligar:AntiQueda", player ) else triggerClientEvent ( "Ligar:AntiQueda", player ) end end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then if getElementData ( pl, "Emprego" ) == "Jornaleiro" then VerificarCairBike(pl) end end end end, 3000,0) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function pickjobJornal(source) if not isElement(source) then return end local im = isPedInVehicle(source) if im == false then return end local job = getElementData(source,"Emprego") or false if job == "Jornaleiro" then local vh = getPedOccupiedVehicle(source) if isElement(vh) then local x,y = getElementPosition(vh) local x1,y1 = getElementPosition(source) local dist = getDistanceBetweenPoints2D(x,y,x1,y1) local isMarkerSafe = isElementWithinMarker(vh,MarkerSafeEntregadorDeJornal) local id = getElementModel(vh) local seat = getPedOccupiedVehicleSeat(source) if dist > 0 then return end if id == 510 then if seat == 0 then if isMarkerSafe == false then return end triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>AbrirPainel<Client",source,rotasJORNAL) end end end end end addCommandHandler("entregarjornais",pickjobJornal) function receivert(source,rotaname) if isElement(ppcikJORNAL[source]) then destroyElement(ppcikJORNAL[source]) end triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>blips<Client",source,false) setElementData(source,"rtnameJornal",rotaname) atualrotnumberJORNAL[source] = 1 gerarrota(source) end addEvent("AirNew>request>Startrota>Server>EntregadorDeJornal", true) addEventHandler("AirNew>request>Startrota>Server>EntregadorDeJornal",getRootElement(), receivert) function gerarrota(source) local rname = getElementData(source,"rtnameJornal") or nil if rname == nil then return end if not isElement(ppcikJORNAL[source]) and isPedInVehicle(source) then local vh = getPedOccupiedVehicle(source) toggleAllControls ( source, true ) setControlState ( source, "handbrake", false ) local id = tonumber(atualrotnumberJORNAL[source]) local x,y,z = rotasJORNAL[rname][id][1],rotasJORNAL[rname][id][2],rotasJORNAL[rname][id][3] ppcikJORNAL[source] = createMarker (x, y,z, "checkpoint", 4, 255, 0, 0, 50,source) triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>blips<Client",source,true,x,y,z) atualrotnumberJORNAL[source] = id+1 end end function sair ( quitType ) if isElement(ppcikJORNAL[source]) then destroyElement(ppcikJORNAL[source]) end end addEventHandler ( "onPlayerQuit", getRootElement(), sair ) function SairDaBike ( thePlayer, seat, jacked ) local rname = getElementData(thePlayer,"rtnameJornal") or nil if rname == nil then return end canceljobtimer (thePlayer) exports.Scripts_Dxmessages:outputDx(thePlayer, "Você Saiu da Bike, Entregas Canceladas!", "warning") end addEventHandler ( "onVehicleExit", getRootElement(), SairDaBike ) function canceljobtimer(source) if isElement(ppcikJORNAL[source]) then destroyElement(ppcikJORNAL[source]) end triggerClientEvent(source,"AirNew>JOBEntregadorDeJornal>blips<Client",source,false) atualrotnumberJORNAL[source] = 1 setElementData(source,"rtnameJornal",nil) end function canceljobdeath() local job = getElementData(source,"Emprego") or false if job ~= "Jornaleiro" then return end local rname = getElementData(source,"rtnameJornal") or nil if rname == nil then return end canceljobtimer(source) exports.Scripts_Dxmessages:outputDx(source, "Você Morreu e Suas Entregas Foram Canceladas!", "warning") end addEventHandler( "onPlayerWasted", getRootElement( ),canceljobdeath) (Linha 59-60)
  8. Pode me mandar seu nome tag (id) ?
  9. Para isso, você teria que ir no seu nametag e fazer uma verificação com o getElementAlpha..
  10. local janela = guiCreateWindow( 434, 304, 280, 123, "Nova Janela", false) local botao = guiCreateButton(50, 150, 120, 60, "click Aqui", false) guiSetVisible(botao, false) guiSetVisible(janela, false) function aparecerbotao() if guiGetVisible(botao) == false and guiGetVisible(janela) == false then guiSetVisible(botao, true) showCursor(true) end end bindKey("j", "down", aparecerbotao) function aparecerjanela() if guiGetVisible(botao) == true and guiGetVisible(janela) == false then guiSetVisible(botao, false) guiSetVisible(janela, true) end end addEventHandler ( "onClientGUIClick", botao, aparecerjanela, false ) Não sou muito bom com gui kk, testa ai (talvez eu tenha errado)
  11. Bom, nesse script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=16502 ele faz a mudança, parece que com shader... baixa e testa ai po
  12. Acho que só tinha um erro kk, testa ai
  13. function morreu(source) setPlayerMoney(source,0) end addEventHandler("onPlayerWasted", getRootElement(), morreu)
  14. function registrar(username, password) local serial = getPlayerSerial(source) local contasbyserial = getAccountsBySerial(serial) if contasbyserial > 3 then return end -- Inserido aqui, se as contas por serial for maior que 3, não executara if not (username == "") then if not (password == "") then local account = getAccount(username, password) if (account == false) then local accountAdded = addAccount(tostring(username), tostring(password)) if (accountAdded) then displayServerMessageLogin(source, "Login: "..username.." | Senha: "..password.."", "confirm") else displayServerMessageLogin(source, "Erro, tente novamente", "warning") end else displayServerMessageLogin(source, "Este nome de usuario ja existe", "warning") end else displayServerMessageLogin(source, "Digite sua senha", "warning") end else displayServerMessageLogin(source, "Digite seu nome de usuario", "warning") end end addEvent("registrar", true) addEventHandler("registrar", getRootElement(), registrar)
  15. https://community.multitheftauto.com/index.php?p=resources&s=details&id=6285 Tem esse ai, use de base
  16. Client-Side local drawDistance = 7 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText(""..getPlayerName(player).. "#FFFFFF ["..ID.."]", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, true, false) CorTag = tocolor(255, 255, 255) if getElementData(player, "Cor", true) then CorTag = tocolor(0, 255, 0) end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function CorTagid () if getElementData(localPlayer, "Cor", true) then setElementData(localPlayer, "Cor", false) else setElementData(localPlayer, "Cor", true) end end bindKey ( "z", "both", CorTagid ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) Server-Side: function Start_Id ( _, acc ) if eventName == "onPlayerLogin" then setElementData ( source, "ID", getAccountID(acc) or "N/A" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffID: #00ff00( "..(getAccountID(acc) or "N/A") .." )", root, 255,255,255,true) elseif eventName == "onPlayerLogout" then removeElementData( source, "ID" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffDeslogou.", root, 255,255,255,true) elseif eventName == "onResourceStart" then for _, player in pairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setElementData( source, "ID", getAccountID(acc) or "N/A" ) end end end end addEventHandler("onResourceStart", resourceRoot, Start_Id) addEventHandler("onPlayerLogout", root, Start_Id) addEventHandler("onPlayerLogin", root, Start_Id) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end --============================================================================================================================-- --=============================-- ----------- ID PLAYER ------------ --=============================-- function getnick(player, command, id, ...) if(id) then local playerID = tonumber(id) if(playerID) then local Player2 = getPlayerID(playerID) if(Player2) then outputChatBox ( "#00ff00✘ #ffffffINFO #00ff00✘➺ #ffffff Nome do Jogador #00ff00" .. getPlayerName(Player2) .."", player, 255,255,255,true) else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff O Jogador(a) de ID: #00ff00( " .. id .. " ) #ffffffNão Foi Encontrado!", player, 255,255,255,true) end else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff ID: #00ff00( " .. id .. " ) #ffffffInválido!", player, 255,255,255,true) end else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffffUse /id #00ff00[#ffffffID#00ff00]", player, 255,255,255,true) end end addCommandHandler("id", getnick) Como eu disse, esse sistema não foi feito por mim!!!!!
  17. Qual o sistema de id que você está usando?
  18. Bom, esse peguei da net e editei se quiser... só fazer o meta.xml Creditos para o Danilin... client-side: local drawDistance = 7 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText(""..getPlayerName(player).. "["..ID.."]", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, false, false) CorTag = tocolor(255, 255, 255) if getElementData(player, "Cor", true) then CorTag = tocolor(0, 255, 0) end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function CorTagid () if getElementData(localPlayer, "Cor", true) then setElementData(localPlayer, "Cor", false) else setElementData(localPlayer, "Cor", true) end end bindKey ( "z", "both", CorTagid ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart)
  19. Tente: local marker = createMarker (2493.1730957031, -910.67498779297, 125.1, "cylinder", 1.0, 255, 69, 0, 60 ) function verificacao() for i, player in ipairs(getElementsByType("player")) do --Verificação de todos os players do servidor if isElementWithinMarker(player, marker) then -- Verifica se algum player está no MK, se si: outputChatBox("Alguém esta no Marker!") end end end setTimer(verificacao, 500, 0)
  20. Bom, eu fiz muito rápido... Teste ai: local markerpegarplaca = createMarker ( 2481.29590, -1674.05322, 13.33985 -0.9, "cylinder", 1.5, 255, 255, 0, 170 ) function pegarplaca ( hitElement ) if getElementType ( hitElement ) == "vehicle" then local Modelo = getElementModel ( hitElement ) local Placa = getVehiclePlateText ( hitElement ) local logs = fileOpen ("dbplacas.txt") print ("Arquivo Aberto") local linhasarquivo = fileGetSize(logs) local arquivo = fileRead(logs, linhasarquivo) print ("Arquivo Lido") fileWrite(logs, arquivo.. "\n Veiculo de modelo ("..Modelo.. ") da placa [" ..Placa.. "] passou em nossa verificação!") print ("Arquivo Reescrito") fileClose(logs) print ("Arquivo Fechado") end end addEventHandler("onMarkerHit", markerpegarplaca, pegarplaca) OBS. Não esqueça de criar oo arquivo "dbplacas.txt", e coloca-lo no meta como file;
  21. Tente: -- ID Carro, Posição X, Y, Z; Rotação RX, RY, RZ local carrosasercriado = { {492,2148.7,-1203.6,23.6,0,0,270}, {402,2148.3999,-1199,23.8,0,0,270}, } veics = {} for i=1 ,#carrosasercriado do veics[i] = createVehicle ( carrosasercriado[i][1], carrosasercriado[i][2], carrosasercriado[i][3], carrosasercriado[i] [4],carrosasercriado[i][5], carrosasercriado[i][6], carrosasercriado[i][7]) setTimer(setElementFrozen,1500,1,veics[i], true) setVehicleDamageProof(veics[i], true) setVehicleColor(veics[i], 255, 255, 255, 255 ) end
×
×
  • Create New...