Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for esx 1.2 #32

Open
toddy617 opened this issue Apr 15, 2020 · 3 comments
Open

Support for esx 1.2 #32

toddy617 opened this issue Apr 15, 2020 · 3 comments

Comments

@toddy617
Copy link

toddy617 commented Apr 15, 2020

maybe someone can add support for esx 1.2 many thanks

@giannistsitsis97
Copy link

i am looking for this too ..

@BartukyGames
Copy link

Replace in esx_thief/main/server.lua:
For Steal ITEMS: Lines 35 to 53
Last Code:
l local label = sourceXPlayer.getInventoryItem(itemName).label
local itemLimit = sourceXPlayer.getInventoryItem(itemName).limit
local sourceItemCount = sourceXPlayer.getInventoryItem(itemName).count
local targetItemCount = targetXPlayer.getInventoryItem(itemName).count

if amount > 0 and targetItemCount >= amount then
	if itemLimit ~= -1 and (sourceItemCount + amount) > itemLimit then
		TriggerClientEvent('esx:showNotification', targetXPlayer.source, _U('ex_inv_lim_target'))
		TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('ex_inv_lim_source'))
	else
		targetXPlayer.removeInventoryItem(itemName, amount)
		sourceXPlayer.addInventoryItem(itemName, amount)

		TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_stole') .. ' ~g~x' .. amount .. ' ' .. label .. ' ~w~' .. _U('from_your_target') )
		TriggerClientEvent('esx:showNotification', targetXPlayer.source, _U('someone_stole') .. ' ~r~x'  .. amount .. ' ' .. label )
	end
else
	TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity'))
end

New Code:

local label = sourceXPlayer.getInventoryItem(itemName).label

if amount > 0 then
	if sourceXPlayer.canCarryItem(itemName, amount) then
		targetXPlayer.removeInventoryItem(itemName, amount)
		sourceXPlayer.addInventoryItem(itemName, amount)
		TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_stole') .. ' ~g~x' .. amount .. ' ' .. label .. ' ~w~' .. _U('from_your_target') )
		TriggerClientEvent('esx:showNotification', targetXPlayer.source, _U('someone_stole') .. ' ~r~x'  .. amount .. ' ' .. label )
	else 
		sourceXPlayer.showNotification("No puedes con tanto peso", sourceXPlayer.name)
	end
else
	TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity'))
end

@BartukyGames
Copy link

Replace in esx_thief/main/server.lua:
For MONEY: Lines 56 to 66
Last Code:

if amount > 0 and targetXPlayer.get('money') >= amount then
	targetXPlayer.removeMoney(amount)
	sourceXPlayer.addMoney(amount)

	TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_stole') .. ' ~g~$' .. amount .. ' ~w~' .. _U('from_your_target') )
	TriggerClientEvent('esx:showNotification', targetXPlayer.source, _U('someone_stole') .. ' ~r~$'  .. amount )
else
	TriggerClientEvent('esx:showNotification', _source, _U('imp_invalid_amount'))
end

New Code:
if amount > 0 and targetXPlayer.getAccount("money").money >= amount then
targetXPlayer.removeMoney(amount)
sourceXPlayer.addMoney(amount)
TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_stole') .. ' g$' .. amount .. ' w' .. _U('from_your_target') )
TriggerClientEvent('esx:showNotification', targetXPlayer.source, _U('someone_stole') .. ' r$' .. amount )
else
TriggerClientEvent('esx:showNotification', _source, _U('imp_invalid_amount'))
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants