Group digits

This commit is contained in:
ElPumpo
2018-11-10 11:39:21 +01:00
parent cd5f72e28d
commit 9363881047
2 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -275,7 +275,7 @@ function OpenPropertyMenu(property)
{
title = property.label,
align = 'top-left',
elements = elements,
elements = elements
}, function(data, menu)
menu.close()
@@ -387,7 +387,7 @@ function OpenGatewayAvailablePropertiesMenu(property)
for i=1, #gatewayProperties, 1 do
if not PropertyIsOwned(gatewayProperties[i]) then
table.insert(elements, {
label = gatewayProperties[i].label .. ' $' .. gatewayProperties[i].price,
label = gatewayProperties[i].label .. ' $' .. ESX.Math.GroupDigits(gatewayProperties[i].price),
value = gatewayProperties[i].name,
price = gatewayProperties[i].price
})
+5 -4
View File
@@ -24,9 +24,9 @@ function SetPropertyOwned(name, price, rented, owner)
TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true)
if rented then
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for', price))
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for', ESX.Math.GroupDigits(price)))
else
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for', price))
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for', ESX.Math.GroupDigits(price)))
end
end
end)
@@ -155,8 +155,9 @@ RegisterServerEvent('esx_property:rentProperty')
AddEventHandler('esx_property:rentProperty', function(propertyName)
local xPlayer = ESX.GetPlayerFromId(source)
local property = GetProperty(propertyName)
local rent = ESX.Math.Round(property.price / 200)
SetPropertyOwned(propertyName, property.price / 200, true, xPlayer.identifier)
SetPropertyOwned(propertyName, rent, true, xPlayer.identifier)
end)
RegisterServerEvent('esx_property:buyProperty')
@@ -428,7 +429,7 @@ function PayRent(d, h, m)
-- message player if connected
if xPlayer ~= nil then
xPlayer.removeAccountMoney('bank', result[i].price)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', result[i].price))
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', ESX.Math.GroupDigits(result[i].price)))
else -- pay rent either way
MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier',
{