Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Tunnel = module("vrp", "lib/Tunnel")
- local Proxy = module("vrp", "lib/Proxy")
- local Lang = module("vrp", "lib/Lang")
- local cfg = module("vrp_basic_mission", "cfg/missions")
- -- load global and local languages
- local glang = Lang.new(module("vrp", "cfg/lang/"..cfg.lang) or {})
- local lang = Lang.new(module("vrp_basic_mission", "cfg/lang/"..cfg.lang) or {})
- vRP = Proxy.getInterface("vRP")
- vRPclient = Tunnel.getInterface("vRP","vRP_basic_mission")
- ----------------------------- FUNCION AUMENTAR
- aux = 0
- function aumentar(min, max)
- local numero = 0
- if numero <= max then
- numero = min + aux
- end
- aux = aux + 1
- return numero
- end
- ------------------------
- --------------------------------PIZZERIA BUENA----------------------
- Citizen.CreateThread(function()
- Citizen.Wait(100000) -- start
- while true do
- Citizen.Wait(60000)
- for k,v in pairs(cfg.pizzeria) do -- each repair perm def
- -- add missions to users
- local users = vRP.getUsersByPermission({k})
- for l,w in pairs(users) do
- local user_id = w
- local player = vRP.getUserSource({user_id})
- if not vRP.hasMission({player}) then
- if math.random(1,v.chance+1) == 1 then -- chance checkvRPclient.playAnim(player,{false,{{"amb@prop_human_atm@male@exit","exit"}},false})
- -- build mission
- local mdata = {}
- mdata.name = lang.Entregas({v.title})
- mdata.steps = {}
- -- build steps
- for i=1,v.steps do
- local step = {
- text = lang.Ruta({v.title}).."<br />"..lang.reward({v.reward}),
- onenter = function(player, area)
- if vRP.tryGetInventoryItem({user_id,"pizza",1,true}) then
- vRPclient.playAnim(player,{false,{{task="anim@heists@box_carry@","idle"}},false})
- SetTimeout(1000, function()
- vRP.nextMissionStep({player})
- vRPclient.stopAnim(player,{false})
- -- last step
- if i == v.steps then
- vRP.giveMoney({user_id,v.reward})
- vRPclient.notify(player,{glang.money.received({v.reward})})
- end
- end)
- end
- end,
- --position = v.positions[math.random(1,#v.positions)] CAMBIADO EL MATH.RANDOM POR AUMENTAR
- position = v.positions[aumentar(1,#v.positions)]
- }
- table.insert(mdata.steps, step)
- end
- vRP.startMission({player,mdata})
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement