Duff1995 Posted October 5, 2021 Share Posted October 5, 2021 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 Link to comment
Moderators Citizen Posted October 5, 2021 Moderators Share Posted October 5, 2021 Hello @Duff1995, I moved your post in https://forum.multitheftauto.com/forum/127-programação-em-lua/. Please post in this section for your next scripting questions. Best regards, Citizen Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now