feat(esx_policejob): Reasons For account changes

This commit is contained in:
Mycroft
2022-09-10 00:50:17 +01:00
parent a321f26e3f
commit 121cd0f1fc
+5 -5
View File
@@ -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)