Jump to content

Duff1995

Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Duff1995's Achievements

Square

Square (6/54)

0

Reputation

  1. bom esté é o client do meu mod de trancar veiculos, o problema é que nos veiculos da conce, outros jogadores conseguem destrancar os veiculos um dos outros algm tem a moral de me ajudar com isso aqui
  2. local Cortando = math.random(50,125) local locations = { { 1175.446, -2364.027, 12.318 }, { 1214.335, -2344.706, 13.925 }, { 1245.387, -2339.776, 13.828 }, { 1267.052, -2300.626, 12.216 }, { 1313.299, -2285.248, 13.51 }, { 1268.388, -2274.247, 13.451 }, { 1268.388, -2274.247, 13.451 }, { 1223.237, -2282.027, 13.482 }, { 1204.502, -2319.271, 14.705 }, { 1180.061, -2339.961, 13.623 }, { 1143.323, -2359.932, 12.081 }, { 1165.128, -2386.746, 11.187 }, { 1191.322, -2338.888, 13.996 }, { 1217.812, -2329.446, 14.565 }, { 1246.38, -2292.822, 12.783 } } atualrotnumberJORNAL = {} ppcikJORNAL = {} blips = {} rotasJORNAL = { ["Entregas de Jornais - Los Santos (1) - 20 Entregas - $2500"] = { {1175.446, -2364.027, 12.318}, {1214.335, -2344.706, 13.925}, {1245.387, -2339.776, 13.828}, {1267.052, -2300.626, 12.216}, {1313.299, -2285.248, 13.51}, {1268.388, -2274.247, 13.451}, {1268.388, -2274.247, 13.451}, {1223.237, -2282.027, 13.482}, {1204.502, -2319.271, 14.705}, {1180.061, -2339.961, 13.623}, {1143.323, -2359.932, 12.081}, {1165.128, -2386.746, 11.187}, {1191.322, -2338.888, 13.996}, {1217.812, -2329.446, 14.565}, {1246.38, -2292.822, 12.783}, }, ["Entregas de Jornais - Los Santos (2) - 20 Entregas - $3250"] = { (locations [ math.random ( 1, #locations ) ] ) }, } pay = { ["Entregas de Jornais - Los Santos (1) - 20 Entregas - $2500"] = 500, ["Entregas de Jornais - Los Santos (2) - 20 Entregas - $3250"] = 500, } 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>JOBCortador>blips<Client",source,false) local vh = getPedOccupiedVehicle(source) --toggleAllControls ( source, false ) --setControlState ( source, "handbrake", true ) if atualrotnumberJORNAL[source] <= #rotasJORNAL[rname] then givePlayerMoney(source,Cortando) --exports.Scripts_Dxmessages:outputDx(source, "Entregando Jornais... Aguarde 2 Segundos!", "info") setTimer(gerarrota,1,1,source) setTimer(function(source) exports.Scripts_Dxmessages:outputDx(source, "Você Recebeu + $ e Exp", "success") end,1,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 um Valor de $"..rec.." Por Finalizar as Entregas de Jornais!", "success") end,1,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) Olá, alguem poderia me ajudar com esse script? eu queria os check do emprego aleatorios, ent criei o local locations, porem cria apenas 1 check, e quando entro nele finaliza as entregas ao invez se aparecer outro
  3. function voolscomercial () if (getPlayerMoney(source) < PrecoLSComercial) then if tonumber(PrecoLSComercial) then --if (getPlayerMoney(source) < 5) then outputChatBox("#000000[ #FF0000AEROPORTO #000000] #ffffffVocê não tem dinheiro suficiente $"..PrecoLSComercial.."", source, 255, 255, 255, true) else takePlayerMoney(source, ""..PrecoLSComercial.."") --Remover Dinheiro setElementPosition ( source, 1642.058, -2334.951, 13.547 ) outputChatBox("#000000[ #FF0000AEROPORTO #000000] #ffffffVocê acaba de ir para LS por R$"..PrecoLSComercial.." ", player, 255,255,255,true) end end end addEvent("comercials",true) addEventHandler ( "comercials", getRootElement(), voolscomercial ) então na teoria ficaria assim? porem mesmo retornou o mesmo problema no debug, "sou iniciante", vou explicar melhor como estou fazendo o mod pois pode ser algo errado Minha pasta do mod https://imgur.com/JAENiUB dentro do edits está assim PrecoLSComercial = "5000" é dai que estou tirando o PrecoLSComercial que estou colocando no Duff_S server, e que quero colocar na getPlayerMoney
  4. function voolscomercial () if (getPlayerMoney(source) < 5) then outputChatBox("#000000[ #FF0000AEROPORTO #000000] #ffffffVocê não tem dinheiro suficiente $"..PrecoLSComercial.."", source, 255, 255, 255, true) else takePlayerMoney(source, ""..PrecoLSComercial.."") --Remover Dinheiro setElementPosition ( source, 1642.058, -2334.951, 13.547 ) outputChatBox("#000000[ #FF0000AEROPORTO #000000] #ffffffVocê acaba de ir para LS por R$"..PrecoLSComercial.." ", player, 255,255,255,true) end end addEvent("comercials",true) addEventHandler ( "comercials", getRootElement(), voolscomercial ) no caso eu queria adicionar o ( "..PrecoLSComercial.." ) na linha 2 no lugar do numero 5 mas retorna erro no debug (attempt to compare number whit string)
  5. function ifPlayerEnterOnMarker(markerHit,matchingDimension) if isElement(markerHit) and matchingDimension then if getElementType(markerHit) == "player" and not isPedInVehicle(markerHit) then if isPedInVehicle(source) then if markerHit == ppcikPOSTES[source] then if (matchingDimension) then if isElement(ppcikPOSTES[source]) then local rname = getElementData(source,"rtnamePostes") or nil if rname == nil then return end destroyElement(ppcikPOSTES[source]) triggerClientEvent(source,"AirNew>JOBEletricista>blips<Client",source,false) local vh = getPedOccupiedVehicle(source) outputChatBox ( "#FF0000/reparar", root, 255, 255, 255, true ) toggleAllControls ( source, false ) setControlState ( source, "handbrake", true ) if atualrotnumberPOSTES[source] <= #rotasPOSTES[rname] then exports.Scripts_Dxmessages:outputDx(source, "Reparando... Aguarde 2 Segundos!", "info") setElementData ( source, "AirNewSCR_LiberarXP", "Sim" ) givePlayerMoney ( source, VALOR_POR_POSTES ) 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 atualrotnumberPOSTES[source] == #rotasPOSTES[rname]+1 then setElementData(source,"rtnamePostes",rname) atualrotnumberPOSTES[source] = 1 local rec = pay[rname] givePlayerMoney(source,tonumber(rec)) local vh = getPedOccupiedVehicle(source) setTimer(function(source) exports.Scripts_Dxmessages:outputDx(source, "Você Recebeu um Valor 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,"rtnamePostes",nil) end end end end end end addEventHandler("onPlayerMarkerHit",getRootElement(),ifPlayerEnterOnMarker) Meu código está assim porem não está funcionando como deveria, ( na teoria quando o player fosse fazer a entrega se ele estiver dentro do veiculo ele não consegue entregar, ele tem que sair do carro e ir no marker para ai sim funcionar) agradeço dez de já quem puder dar uma moral aqui
  6. eu gostaria de abrir este painel por comando function showPanellr(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then ---So Mude "PCC" Grupo que vai poder abrir o painel ! triggerClientEvent(thePlayer, "painelrota", getRootElement()) end end function onResStartlr() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStartlr) function onPlayerJoinlr() bindKey(source, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinlr) function cleanAlllr(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAlllr) function reparar() local veiculo = getPedOccupiedVehicle(source) if isPedInVehicle(source) then fixVehicle(veiculo) end end addEvent("reparar", true) addEventHandler("reparar", getRootElement(), reparar) function armas () giveWeapon( source, 24, 999, true ) giveWeapon( source, 27, 999, true ) giveWeapon( source, 34, 999, true ) giveWeapon( source, 32, 999, true ) end addEvent("armasrota",true) addEventHandler ( "armasrota", getRootElement(), armas ) function money () -- get the amount of money from the player who entered the command setPlayerMoney(root, 1000000) -- if money is more than 1000 end addEvent("moneyrt",true) addEventHandler ( "moneyrt", getRootElement(), money ) function money1 () -- get the amount of money from the player who entered the command setPlayerMoney(root, 10000000) -- if money is more than 1000 end addEvent("moneyrt1",true) addEventHandler ( "moneyrt1", getRootElement(), money1 )
  7. -- no caso eu queria fazer para o painel que é definido como "Pdx" abrice por um comando ex /abrir -- function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelrota", true) addEventHandler("painelrota", root , abrir)
  8. -- no caso eu queria fazer para o painel que é definido como "Pdx" abrice por um comando ex /abrir -- function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelrota", true) addEventHandler("painelrota", root , abrir)
  9. ----- queria que apenas spawnase quando um trabalhador hit o marker carro = createMarker(2146.883, -2289.945, 14.761 -1,"cylinder", 2.0, 255,0,0,80) desespawncm = createMarker(2151.133, -2290.037, 13.368 -1 , "cylinder",2.0,255,255,255,80) veh = {} function spawnviaturaone(thePlayer) 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) destroyElement(veh[thePlayer]) destroyElement(thePlayer) end addEventHandler("onMarkerHit", desespawncm, desespawncmm) function Sair_do_Servidor_AirNewSCR ( quitType ) if isElement ( veh[source] ) then destroyElement ( veh[source] ) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), Sair_do_Servidor_AirNewSCR ) -- client trabalho --[[ ################################################ # # # Script Criado Por # # FACEBOOK.COM/AIRNEWSCR # # # # # ################################################ --]] -------------------------------------------------------------------- local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) -------------------------------------------------------------------- function Window(rnames) if isElement(myWindow) then return end local screenW, screenH = guiGetScreenSize() myWindow = guiCreateWindow((screenW - x*485) / 2, (screenH - y*404) / 2, x*485, y*404, "Rotas", false) rotas = guiCreateGridList(x*40, y*40, x*405, y*275, false, myWindow) guiWindowSetSizable(myWindow, false) guiSetAlpha(rotas, x*0.70) guiGridListAddColumn( rotas, "Rotas", x*0.85 ) for k,v in pairs(rnames) do row = guiGridListAddRow ( rotas ) guiGridListSetItemText ( rotas, row, 1, tostring(k), false, false ) end showCursor(true) fechar = guiCreateButton(x*275, y*334, x*168, y*35, "Fechar", false, myWindow) escolher = guiCreateButton(x*42, y*334, x*168, y*35, "Carregar", false, myWindow) end addEvent("AirNew>JOBEntregadorDeJornal>AbrirPainel<Client", true) addEventHandler("AirNew>JOBEntregadorDeJornal>AbrirPainel<Client", localPlayer, Window) function botoes(bt,state) if state == "up" and bt == "left" then if source == fechar then if isElement(myWindow) then destroyElement(myWindow) showCursor(false) end end if source == escolher then local selectedItemx = guiGridListGetSelectedItem(rotas) local nome = guiGridListGetItemText(rotas, selectedItemx, 1) if nome == nil then outputChatBox("[ #00FF73Servidor #ffffff] - Selecione Uma Rota",255,255,255,true) return end triggerServerEvent("AirNew>request>Startrota>Server>EntregadorDeJornal",localPlayer,localPlayer,nome) if isElement(myWindow) then destroyElement(myWindow) showCursor(false) end end end end addEventHandler("onClientGUIClick", root,botoes) function blips(state,x,y,z) if state == true then if not isElement(blips) then blips = createBlip ( x, y, z, 0) end else if isElement(blips) then destroyElement(blips) end end end addEvent("AirNew>JOBEntregadorDeJornal>blips<Client", true) addEventHandler("AirNew>JOBEntregadorDeJornal>blips<Client", localPlayer, blips) function DesligarAntiQuedaBike () setPedCanBeKnockedOffBike ( localPlayer, true ) end addEvent( "Desligar:AntiQueda", true ) addEventHandler( "Desligar:AntiQueda", localPlayer, DesligarAntiQuedaBike ) function LigarAntiQuedaBike () setPedCanBeKnockedOffBike ( localPlayer, false ) end addEvent( "Ligar:AntiQueda", true ) addEventHandler( "Ligar:AntiQueda", localPlayer, LigarAntiQuedaBike ) --server trabalho MarkerSafeEntregadorDeJornal = createMarker( 765.68848, -1355.44495, 13.52570, "cylinder", 35, 0, 255, 0, 0) EntregadorDeJornalPickup = createPickup ( 783.27710, -1327.66260, 13.54688, 3, 1210) MarkerEntregadorDeJornal = createMarker ( 783.27710, -1327.66260, 13.54688, "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 ( 783.27710, -1327.66260, 13.54688 ) 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" ) == "Entregador de Jornal" then return end VerificarBlipEmprego(pl) end end end, 3000,0) -------------------------------------------------------------------- function ComandoHQ ( source ) if getElementData ( source, "Emprego" ) == "Entregador de Jornal" 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) exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) if getElementData ( source, "AirNew>Encaminhamento" ) == "Entregador de Jornal" then setElementData ( source, "AirNew>Encaminhamento", false ) setElementData ( source, "Emprego", "Entregador de Jornal" ) exports.Scripts_Dxmessages:outputDx(source, "Você Agora Trabalha de Entregador de Jornal, Para Mais Informações Digite ( /Profissao )", "success") else exports.Scripts_Dxmessages:outputDx(source, "Você Precisa Estar Encaminhado da Agencia de Empregos para Trabalhar neste Local!", "error") 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", "Entregador de Jornal" ) exports.Scripts_Dxmessages:outputDx(source, "Você se Demitiu do Emprego de Entregador de Jornal com Sucesso!", "warning") end -------------------------------------------------------------------- function ComandosProf ( ThePlayer ) if getElementData ( ThePlayer, "Emprego" ) == "Entregador de Jornal" then playSoundFrontEnd ( ThePlayer, 43 ) outputChatBox ( "#F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #F96031Profissão #F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #BEE09AComandos da Profissão de Entregador de Jornal", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/HQ #ffffff- #9ABDE0Para Marcar / Desmarcar o seu Local de Trabalho", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/Rotas #ffffff- #9ABDE0Abre a Lista de Rotas Disponiveis Para Trabalhar", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #FFD700Entre na Bike e Digite /Rotas Selecione uma Rota e Siga os Checkpoints!", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #F96031Profissão #F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~", 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" ) == "Entregador de Jornal" then exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para se Demitir do Emprego de Entregador de Jornal") bindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) else exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para Aceitar o Emprego de Entregador de Jornal") 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(418, 783.54602, -1334.39611, 13.66790, 0, 0, 90 ), createVehicle(418, 783.19165, -1339.09948, 13.50201, 0, 0, 90 ), createVehicle(418, 783.29638, -1343.80102, 13.50254, 0, 0, 90 ), createVehicle(418, 783.37371, -1348.26196, 13.50224, 0, 0, 90 ), createVehicle(418, 783.51849, -1352.64526, 13.50811, 0, 0, 90 ), createVehicle(418, 783.38525, -1357.21313, 13.131029, 0, 0, 90 ), createVehicle(418, 783.16894, -1361.29101, 13.192735, 0, 0, 90 ), createVehicle(418, 783.11541, -1365.41711, 13.194348, 0, 0, 90 ), createVehicle(418, 783.16296, -1369.40722, 13.195641, 0, 0, 90 ), ------ createVehicle(510, 783.16296, -1369.40722, 13.195641, 0, 0, 90 ), ------ createVehicle(418, 785.55151, -1332.39575 -20, 13.54213, 0, 0, 90 ), ------ createVehicle(510, 785.55151, -1332.39575 -22, 13.54213, 0, 0, 90 ), ------ createVehicle(418, 785.55151, -1332.39575 -24, 13.54213, 0, 0, 90 ), ------ createVehicle(510, 785.55151, -1332.39575 -26, 13.54213, 0, 0, 90 ), ------ createVehicle(418, 785.55151, -1332.39575 -28, 13.54213, 0, 0, 90 ), ------ createVehicle(510, 785.55151, -1332.39575 -30, 13.54213, 0, 0, 90 ), ------ createVehicle(418, 785.55151, -1332.39575 -32, 13.54213, 0, 0, 90 ), ------ createVehicle(510, 785.55151, -1332.39575 -34, 13.54213, 0, 0, 90 ), ------ createVehicle(418, 785.55151, -1332.39575 -36, 13.54213, 0, 0, 90 ), ------ createVehicle(510, 785.55151, -1332.39575 -38, 13.54213, 0, 0, 90 ), ------ createVehicle(418, 785.55151, -1332.39575 -40, 13.54213, 0, 0, 90 ), ------ createVehicle(510, 785.55151, -1332.39575 -42, 13.54213, 0, 0, 90 ), ------ createVehicle(418, 785.55151, -1332.39575 -44, 13.54213, 0, 0, 90 ), ------ createVehicle(510, 785.55151, -1332.39575 -46, 13.54213, 0, 0, 90 ), ------ createVehicle(418, 785.55151, -1332.39575 -48, 13.54213, 0, 0, 90 ), ------ createVehicle(510, 785.55151, -1332.39575 -50, 13.54213, 0, 0, 90 ), } for i, veh in ipairs(VeiculosComDataEntregadorDeJornal) do setElementData ( veh, "Emprego", "Entregador de Jornal" ) setVehicleDamageProof(veh,true) setVehicleColor( veh, 0, 0, 0 ) setVehiclePlateText ( veh, "RPGAMING" ) 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 == "Entregador de Jornal" then else cancelEvent() exports.Scripts_Dxmessages:outputDx(thePlayer, "Esse Veiculo é Exclusivo dos Entregadores de Jornal!", "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 = { ["Entregas de Jornais - Los Santos (1) - 20 Entregas - $2500"] = { {825.184020, -1472.98876, 12.53338}, ------- 993.64386, -1050.08850, 30.72189 {763.92578, -1564.48425, 13.20226}, {1248.03588, -1561.93261, 13.21602}, {1364.48669, -1279.30102, 13.19416}, {1408.68762, -930.52990, 35.071788}, {1423.06555, -883.22113, 50.198425}, {1516.51940, -764.47930, 79.699653}, {1269.48010, -916.03302, 42.007972}, {1024.39660, -982.81207, 42.304122}, {458.39724, -1501.76721, 30.685428}, {314.51614, -1772.04675, 4.31334}, {335.31448, -1352.68127, 14.16307}, {406.65902, -1264.70227, 49.95773}, {542.10595, -1200.41784, 44.04943}, {688.54528, -1073.10400, 49.11075}, {833.98223, -926.041992, 54.89589}, {895.58306, -921.980895, 42.07406}, {996.54058, -916.591735, 41.82923}, {904.05651, -1333.21496, 13.16217}, {778.05102, -1333.59057, 13.19954}, }, ["Entregas de Jornais - Los Santos (2) - 20 Entregas - $3250"] = { {799.274, -1070.383, 24.087}, {637.208, -571.723, 15.84}, {680.38, -481.45, 15.841}, {236.531, -226.303, 1.081}, {211.736, -208.112, 1.088}, {209.682, -67.42, 1.088}, {254.644, -67.281, 1.086}, {318.415, -126.088, 1.94}, {1284.511, 175.263, 19.987}, {1293.098, 268.087, 19.068}, {1355.85, 244.474, 19.224}, {1351.297, 207.086, 19.212}, {2248.981, 46.128, 25.988}, {2307.204, 87.946, 25.989}, {2357.026, 119.875, 26.641}, {2811.293, -1182.426, 24.949}, {2854.568, -1345.299, 10.722}, {2494.49, -1755.65, 13.137}, {1425.196, -1699.463, 13.041}, {777.526, -1335.479, 13.538}, }, } pay = { ["Entregas de Jornais - Los Santos (1) - 20 Entregas - $2500"] = 2500, ["Entregas de Jornais - Los Santos (2) - 20 Entregas - $3250"] = 3250, } 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 um Valor 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" ) == "Entregador de Jornal" 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 == "Entregador de Jornal" 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 == 418 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("rotas",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 Van, 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 ~= "Entregador de Jornal" 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)
  10. então estou editando um painel e gostaria que quando ele aparece na tela tocase uma musica, até ai consegui mas ao fechar a agencia a musica não para de tocar function AbrirAgenciaEmpregos () if AgenciaEmpregosAirNew == false then addEventHandler ( "onClientRender", root, PainelAgenciaEmpregosNew ) showCursor ( true ) AgenciaEmpregosAirNew = true playSound("img/music.mp3",true) -- inicia musica ao abrir o painel da agencia showChat(false) -- desativa o chat enquanto o painel ta aberto end end addEvent ( "AirNew>AbrirAgencia", true) addEventHandler ( "AirNew>AbrirAgencia", root, AbrirAgenciaEmpregos ) function FecharAgenciaEmpregos () if AgenciaEmpregosAirNew == true then removeEventHandler ( "onClientRender", root, PainelAgenciaEmpregosNew ) showCursor ( false ) AgenciaEmpregosAirNew = false playSoundFrontEnd ( 40 ) stopSound(sound) --deveria parar a musica a o fecher a agencia showChat(true) --deveria mostrar o chat ao fechar a agencia end end addEvent ( "AirNew>FecharAgencia", true) addEventHandler ( "AirNew>FecharAgencia", root, FecharAgenciaEmpregos )
  11. Tou a tarde toda tentando ;.; ja apaguei um monte de arquivo q da erro ;.;
  12. Queria fazer o seguinte mas n estou conseguindo, quando o player sai do veiculo o trabalho é cancelado tipo eu queria colocar pra cancelar apos 5 minutos fora do veiculo, e tbm o player recebe o dinheiro no final de todos os checkpoint junto com o exp queria fazer pra ele receber um valor aleatorio de dinheiro e exp por cada check se algm me ajudar ficaria agradecido pro resto da minha vida MarkerSafeEntregadorDeJornal = createMarker( 1280.835, -1541.986, 13.522, "cylinder", 35, 0, 255, 0, 0) EntregadorDeJornalPickup = createPickup ( 1280.835, -1541.986, 13.522, 3, 1210) MarkerEntregadorDeJornal = createMarker ( 1280.835, -1541.986, 13.522, "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 ( 1280.835, -1541.986, 13.522 ) 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" ) == "Entregador de Jornal" then return end VerificarBlipEmprego(pl) end end end, 3000,0) -------------------------------------------------------------------- function ComandoHQ ( source ) if getElementData ( source, "Emprego" ) == "Entregador de Jornal" 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) exports.Scripts_OnMarkerMsgs_:delete(source) unbindKey ( source, LetraParaMarkers, "down", AceitarEmprego02 ) if getElementData ( source, "AirNew>Encaminhamento" ) == "Entregador de Jornal" then setElementData ( source, "AirNew>Encaminhamento", false ) setElementData ( source, "Emprego", "Entregador de Jornal" ) exports.Scripts_Dxmessages:outputDx(source, "Você Agora Trabalha de Entregador de Jornal, Para Mais Informações Digite ( /Profissao )", "success") else exports.Scripts_Dxmessages:outputDx(source, "Você Precisa Estar Encaminhado da Agencia de Empregos para Trabalhar neste Local!", "error") 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", "Entregador de Jornal" ) exports.Scripts_Dxmessages:outputDx(source, "Você se Demitiu do Emprego de Entregador de Jornal com Sucesso!", "warning") end -------------------------------------------------------------------- function ComandosProf ( ThePlayer ) if getElementData ( ThePlayer, "Emprego" ) == "Entregador de Jornal" then playSoundFrontEnd ( ThePlayer, 43 ) outputChatBox ( "#F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #F96031Profissão #F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #BEE09AComandos da Profissão de Entregador de Jornal", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/HQ #ffffff- #9ABDE0Para Marcar / Desmarcar o seu Local de Trabalho", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #55D444/Rotas #ffffff- #9ABDE0Abre a Lista de Rotas Disponiveis Para Trabalhar", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F96031» #FFD700Entre na Bike e Digite /Rotas Selecione uma Rota e Siga os Checkpoints!", ThePlayer, 255, 255, 255, true ) outputChatBox ( "#F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #F96031Profissão #F9A631~~~~~~~~~~~~~~~~~~~~~~~~~~~~", 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" ) == "Entregador de Jornal" then exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para se Demitir do Emprego de Entregador de Jornal") bindKey ( source, LetraParaMarkers, "down", RecusarEmprego02 ) else exports.Scripts_OnMarkerMsgs_:create(source,"Aperte 'K' Para Aceitar o Emprego de Entregador de Jornal") 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, 1271.167, -1527.32, 13.564, 0, 0, 270 ), createVehicle(510, 1271.146, -1529.044, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -2, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -4, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -6, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -8, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -10, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -12, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -14, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -16, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -18, 13.564, 0, 0, 270 ), createVehicle(510, 1271.117, -1531.384 -20, 13.564, 0, 0, 270 ), } for i, veh in ipairs(VeiculosComDataEntregadorDeJornal) do setElementData ( veh, "Emprego", "Entregador de Jornal" ) setVehicleDamageProof(veh,true) setVehicleColor( veh, 0, 0, 0 ) setVehiclePlateText ( veh, "RPGAMING" ) 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 == "Entregador de Jornal" then else cancelEvent() exports.Scripts_Dxmessages:outputDx(thePlayer, "Esse Veiculo é Exclusivo dos Entregadores de Jornal!", "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 = { ["Entregas de Jornais - Los Santos (1) - 20 Entregas - $670"] = { {1282.185, -1546.146, 13.547}, {1292.531, -1536.74, 13.491}, --{1117.78308, -1030.55933, 31.88287}, --{11270.73914, -1027.27011, 32.35918}, --{1466.25684, -1172.65686, 23.88302}, --{1673.56787, -1169.50952, 23.92861}, --{1791.41406, -1164.77539, 23.82813}, --{2095.31763, -1292.43701, 23.97214}, --{2150.26270, -1291.66003, 23.97753}, --{2352.627019, -1513.26306, 24.00000}, --{2561.87158, -1467.34753, 24.01236}, --{2756.12573, -1180.33130, 69.39844}, --{2863.57446, -1440.18982, 10.95315}, --{2507.24414, -1725.65881, 13.54688}, --{23270.33276, -1721.86511, 13.58705}, --{2228.38867, -1722.77356, 13.55438}, --{2175, -1742, 13.55438}, --{2072.61230, -1793.96008, 13.54688}, --{1871.15784, -1923.91858, 13.54688}, --{1352.39136, -1758.33508, 13.50781}, }, ["Entregas de Jornais - Los Santos (2) - 20 Entregas - $750"] = { {823.93018, -1413.86011, 13.46503}, {2709.32098, -1504.01135, 13.54223}, {797.72333, -1580.373270, 13.54688}, {645.75140, -1694.06555, 14.89330}, {422.36475, -1758.63403, 8.18526}, {305.55188, -1771.70020, 4.54249}, {168.62589, -1770.10681, 4.43438}, {138.38370, -1460.07129, 25.62103}, {169.82892, -1348.34363, 69.36220}, {280.87973, -1320.37817, 53.81308}, {543.01135, -1202.30334, 44.50127}, {562.19452, -1060.57458, 74.59800}, {782.98035, -808.70764, 65.19865}, {2708.08984, -684.05566, 116.23006}, {1091.30396, -627.89929, 111.38203}, {1280.77197, -614.80652, 102.93521}, {1437.30725, -935.30865, 36.26117}, {1335.64368, -1066.11133, 27.87136}, {1144.98792, -1131.54431, 23.82813}, {1022.52026, -1122.13037, 23.87152}, }, ["Entregas de Jornais - Los Santos (3) - 20 Entregas - $1500"] = { {1324.671, -1433.923, 14.969}, {1184.128, -1316.365, 13.573}, {1096.775, -1288.524, 13.554}, {994.57, -1298.388, 13.39}, {814.181, -1342.959, 13.533}, {792.273, -1626.558, 13.391}, {1077.013, -1859.017, 13.547}, {1408.296, -1881.205, 13.547}, {1830.151, -1841.683, 13.578}, {1924.561, -1789.748, 13.383}, {2096.031, -1806.206, 13.552}, {2289.097, -1724.15, 13.547}, {2268.405, -1667.375, 15.377}, {2011.597, -1597.769, 13.572}, {1911.033, -1604.44, 13.547}, {1864.723, -1604.331, 13.539}, {1671.314, -1583.68, 13.547}, {1581.473, -1448.472, 13.539}, {1519.231, -1449.773, 13.539}, {1363.771, -1431.401, 13.539}, }, } pay = { ["Entregas de Jornais - Los Santos (1) - 20 Entregas - $670"] = 670, ["Entregas de Jornais - Los Santos (2) - 20 Entregas - $750"] = 750, ["Entregas de Jornais - Los Santos (3) - 20 Entregas - $1500"] = 1500, } 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 um Valor 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) local exp = getElementData(source, "Exp") local exps = tonumber(getElementData(source, "Exp")) --setElementData(player, "Exp", 0) setElementData(source, "Exp", exps + 100) triggerClientEvent(source,"xplevel",player) 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" ) == "Entregador de Jornal" 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 == "Entregador de Jornal" 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("rotas",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 ~= "Entregador de Jornal" 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)
×
×
  • Create New...