Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ESX = nil
- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- -- Todo for this script:
- --
- -- 1. Barf if use does not put in arguments instead of thowing a script error
- -- 2. Make sure the user doesn't invoice/fine themselves
- --
- -- /invoiceid invoices a player for the amount specified.
- RegisterCommand('invoiceid', function(source, args)
- local src = source
- -- Get our fine amount from the parameter inputs
- local amount = tonumber(args[2])
- local playerID = tonumber(args[1])
- local verbose = args[3]
- local xGiver = ESX.GetPlayerFromId(src)
- local xPlayer = ESX.GetPlayerFromId(playerID)
- -- --
- -- Debugging section to print out all values --
- -- --
- if verbose == 'debug' then
- print("Debug amount: " .. amount)
- print("Debug PlayerID: " .. playerID)
- print("Debug src: " .. src)
- end
- -- Let's make sure the person running /fineid is a police officer
- if xGiver.job.name == 'police' then
- if amount ~= nil then
- TriggerClientEvent('mythic_notify:client:SendAlert', src, { type = 'inform', text = 'You have fined ID - [' .. playerID .. '] for $' .. amount .. '.' })
- TriggerClientEvent('mythic_notify:client:SendAlert', playerID, { type = 'inform', text = 'You have been sent a Fine for $' .. amount .. '.'})
- TriggerClientEvent('prp-fineid:Anim', src)
- TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(xPlayer), 'society_police', 'Police Fine', amount)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement