Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- TRASPORTATORI SOLDI
- for perm,mission in pairs(self.cfg.soldi) do -- self.cfg.soldi
- -- Notifica Missione
- local users = vRP.EXT.Group:getUsersByPermission(perm)
- for _, user in pairs(users) do
- if user.spawns > 0 and not user:hasMission() then -- check spawned without mission
- if math.random(1,mission.chance) == 1 then -- chance check
- local mdata = {}
- mdata.name = self.lang.soldi({mission.title})
- mdata.steps = {}
- -- Creazione Missione
- for i=1,mission.steps do
- local step = {
- text = self.lang.soldi({mission.title}).."<br />"..self.lang.reward({mission.reward}),
- onenter = function(user)
- for fullid,amount in pairs(soldi_items) do
- if amount > 0 then -- check if not done
- if user:tryTakeItem(fullid,amount) then
- local reward = mission.items[fullid][3]*amount
- user:giveWallet(reward)
- vRP.EXT.Base.remote._notify(user.source,lang.money.received({reward}))
- todo = todo-1
- soldi_items[fullid] = 0
- if todo == 0 then -- Fine Missione
- user:nextMissionStep()
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement