ox_inventory icon indicating copy to clipboard operation
ox_inventory copied to clipboard

No notification when someone gets robbed with /steal

Open zZOGZz opened this issue 2 years ago • 6 comments

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.

zZOGZz avatar Apr 06 '22 16:04 zZOGZz

Wouldn't this just cause a lot of spam with item notifications?

LukeWasTakenn avatar Apr 07 '22 19:04 LukeWasTakenn

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?

zZOGZz avatar Apr 07 '22 19:04 zZOGZz

maybe a generic notification 'You've been robbed' and only shows once, rather than per item.

duckysuck avatar Apr 29 '22 16:04 duckysuck

Yes but what about do it?

Gameadictive avatar May 08 '22 23:05 Gameadictive

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) modules/utils/client

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 modules/inventory/server 1 modules/inventory/server 2 modules/inventory/server 3

Shadowz-git avatar Aug 21 '22 14:08 Shadowz-git

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) modules/utils/client

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 modules/inventory/server 1 modules/inventory/server 2 modules/inventory/server 3

Hello, can you make a pr of this please?

zZOGZz avatar Aug 25 '22 23:08 zZOGZz