ox_inventory
ox_inventory copied to clipboard
No notification when someone gets robbed with /steal
Is your feature request related to a problem? Please describe.
When you use the exxport exports.ox_inventory:openNearbyInventory()
and you take items from the target, the target doesnt get notified how much items they removed/added, like when you buy an item or use an item etc...
Describe the solution you'd like That should be nice because people always know what they get robbed at the moment and should be more easy to people that have a lot of items.
Wouldn't this just cause a lot of spam with item notifications?
I dont think, because you dont get robbed every minute. But a normal notification should be good also, its just that the person knows that he is being robbed. What do you think?
maybe a generic notification 'You've been robbed' and only shows once, rather than per item.
Yes but what about do it?
Is your feature request related to a problem? Please describe. When you use the exxport
exports.ox_inventory:openNearbyInventory()
and you take items from the target, the target doesnt get notified how much items they removed/added, like when you buy an item or use an item etc...Describe the solution you'd like That should be nice because people always know what they get robbed at the moment and should be more easy to people that have a lot of items.
I did it, when Player(A) steal something from Player(B), Player(B) receive the notification of the item stealed/removed from his inventory.
I created a NetEvent with the notification function in modules/utils/client.lua, called "ox_inventory:itemnotify".
RegisterNetEvent('ox_inventory:itemnotify', Utils.ItemNotify)
After that, in modules/inventory/server.lua , copy and paste this if like in the images, 3 times
if not sameInventory and fromInventory.type == 'otherplayer' then TriggerClientEvent("ox_inventory:itemnotify", fromInventory.id, {fromData.label, fromData.name, shared.locale('removed', fromData.count)}) end
Is your feature request related to a problem? Please describe. When you use the exxport
exports.ox_inventory:openNearbyInventory()
and you take items from the target, the target doesnt get notified how much items they removed/added, like when you buy an item or use an item etc... Describe the solution you'd like That should be nice because people always know what they get robbed at the moment and should be more easy to people that have a lot of items.I did it, when Player(A) steal something from Player(B), Player(B) receive the notification of the item stealed/removed from his inventory. I created a NetEvent with the notification function in modules/utils/client.lua, called "ox_inventory:itemnotify".
RegisterNetEvent('ox_inventory:itemnotify', Utils.ItemNotify)
After that, in modules/inventory/server.lua , copy and paste this if like in the images, 3 times
if not sameInventory and fromInventory.type == 'otherplayer' then TriggerClientEvent("ox_inventory:itemnotify", fromInventory.id, {fromData.label, fromData.name, shared.locale('removed', fromData.count)}) end
![]()
![]()
Hello, can you make a pr of this please?