Fixed not checking if the target can afford

This commit is contained in:
ElPumpo
2018-12-13 19:17:35 +01:00
parent 4a90d6fac9
commit 500e617f75
7 changed files with 14 additions and 3 deletions
+1
View File
@@ -9,6 +9,7 @@ Locales['br'] = {
['no_play_near'] = 'nenhum jogador nas proximidades',
['realtors'] = 'agente Imobiliário',
['boss_action'] = 'boss Actions',
['client_poor'] = 'your client cannot afford that',
-- Property menu
['property_name'] = 'propriedade',
+1
View File
@@ -9,6 +9,7 @@ Locales['de'] = {
['no_play_near'] = 'kein Spieler in der Nähe',
['realtors'] = 'makler',
['boss_action'] = 'boss Actions',
['client_poor'] = 'your client cannot afford that',
-- Property menu
['property_name'] = 'immobilie',
+1
View File
@@ -9,6 +9,7 @@ Locales['en'] = {
['no_play_near'] = 'no players nearby',
['realtors'] = 'real Estate Agents',
['boss_action'] = 'boss Actions',
['client_poor'] = 'your client cannot afford that',
-- Property menu
['property_name'] = 'property',
+1
View File
@@ -9,6 +9,7 @@ Locales['fi'] = {
['no_play_near'] = 'ei pelaajia lähettyvillä',
['realtors'] = 'Kiinteistövälitys',
['boss_action'] = 'pomo Toiminnot',
['client_poor'] = 'your client cannot afford that',
-- Property menu
['property_name'] = 'kiinteistö',
+1
View File
@@ -9,6 +9,7 @@ Locales['fr'] = {
['no_play_near'] = 'aucun joueur à proximité',
['realtors'] = 'agents Immobilier',
['boss_action'] = 'action Patron',
['client_poor'] = 'your client cannot afford that',
-- Property menu
['property_name'] = 'propriété',
+1
View File
@@ -9,6 +9,7 @@ Locales['sv'] = {
['no_play_near'] = 'det finns inga spelare i närheten!',
['realtors'] = 'mäklare',
['boss_action'] = 'chefmeny',
['client_poor'] = 'din klient har inte råd att betala det',
-- Property menu
['property_name'] = 'fastighet',
+8 -3
View File
@@ -3,7 +3,7 @@ ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
TriggerEvent('esx_phone:registerNumber', 'realestateagent', _U('client'), false, false)
TriggerEvent('esx_society:registerSociety', 'realestateagent', 'Agent immobilier', 'society_realestateagent', 'society_realestateagent', 'society_realestateagent', {type = 'private'})
TriggerEvent('esx_society:registerSociety', 'realestateagent', _U('realtors'), 'society_realestateagent', 'society_realestateagent', 'society_realestateagent', {type = 'private'})
RegisterServerEvent('esx_realestateagentjob:revoke')
AddEventHandler('esx_realestateagentjob:revoke', function(property, owner)
@@ -20,7 +20,12 @@ RegisterServerEvent('esx_realestateagentjob:sell')
AddEventHandler('esx_realestateagentjob:sell', function(target, property, price)
local xPlayer, xTarget = ESX.GetPlayerFromId(source), ESX.GetPlayerFromId(target)
if xPlayer.job.name == 'realestateagent' then
if xPlayer.job.name ~= 'realestateagent' then
print(('esx_realestateagentjob: %s attempted to sell a property!'):format(xPlayer.identifier))
return
end
if xTarget.getMoney() >= price then
xTarget.removeMoney(price)
TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account)
@@ -29,7 +34,7 @@ AddEventHandler('esx_realestateagentjob:sell', function(target, property, price)
TriggerEvent('esx_property:setPropertyOwned', property, price, false, xTarget.identifier)
else
print(('esx_realestateagentjob: %s attempted to sell a property!'):format(xPlayer.identifier))
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('client_poor'))
end
end)