Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CS.addReward = function(player, reward, cb) -- you will get all options from the specified item in "Config.rewards"
- if reward.type == "item" then
- if not player.canCarryItem(reward.name, reward.amount) then
- return CS.send_notify(player.source, Config.Locales["notifications"]["cannot_carry"]) -- The treasure will not be collected because the player cannot carry the item.
- end
- player.addInventoryItem(reward.name, reward.amount)
- elseif reward.type == "money" then
- player.addAccountMoney(reward.account, reward.amount)
- elseif reward.type == "vehicle" then
- player.addVehicle(reward)
- end
- cb() -- Dont touch this, this callback will be triggered after the reward was added successfully, otherwise the treasure will not be collected.
- end
Advertisement
Add Comment
Please, Sign In to add comment