mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
feat(esx_policejob): Reasons For account changes
This commit is contained in:
@@ -43,8 +43,8 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType,
|
||||
|
||||
-- does the target player have enough money?
|
||||
if targetAccount.money >= amount then
|
||||
targetXPlayer.removeAccountMoney(itemName, amount)
|
||||
sourceXPlayer.addAccountMoney (itemName, amount)
|
||||
targetXPlayer.removeAccountMoney(itemName, amount, "Confiscated")
|
||||
sourceXPlayer.addAccountMoney (itemName, amount, "Confiscated")
|
||||
|
||||
sourceXPlayer.showNotification(_U('you_confiscated_account', amount, itemName, targetXPlayer.name))
|
||||
targetXPlayer.showNotification(_U('got_confiscated_account', amount, itemName, sourceXPlayer.name))
|
||||
@@ -320,7 +320,7 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo
|
||||
-- Weapon
|
||||
if type == 1 then
|
||||
if xPlayer.getMoney() >= selectedWeapon.price then
|
||||
xPlayer.removeMoney(selectedWeapon.price)
|
||||
xPlayer.removeMoney(selectedWeapon.price, "Weapon Bought")
|
||||
xPlayer.addWeapon(weaponName, 100)
|
||||
|
||||
cb(true)
|
||||
@@ -336,7 +336,7 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo
|
||||
|
||||
if component then
|
||||
if xPlayer.getMoney() >= price then
|
||||
xPlayer.removeMoney(price)
|
||||
xPlayer.removeMoney(price, "Weapon Component Bought")
|
||||
xPlayer.addWeaponComponent(weaponName, component.name)
|
||||
|
||||
cb(true)
|
||||
@@ -361,7 +361,7 @@ ESX.RegisterServerCallback('esx_policejob:buyJobVehicle', function(source, cb, v
|
||||
cb(false)
|
||||
else
|
||||
if xPlayer.getMoney() >= price then
|
||||
xPlayer.removeMoney(price)
|
||||
xPlayer.removeMoney(price, "Job Vehicle Bought")
|
||||
|
||||
MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (?, ?, ?, ?, ?, ?)', { xPlayer.identifier, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true},
|
||||
function (rowsChanged)
|
||||
|
||||
Reference in New Issue
Block a user