mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 14:38:50 +00:00
Merge pull request #51 from N-fire/inventorynotify
replace ox_inventory:notify by ox_lib notify
This commit is contained in:
2 files changed
+9
-9
No files matched your search
@@ -20,12 +20,12 @@ exports('bandage', function(data, slot)
|
|||||||
-- The item has been used, so trigger the effects
|
-- The item has been used, so trigger the effects
|
||||||
if data then
|
if data then
|
||||||
SetEntityHealth(playerPed, math.min(maxHealth, math.floor(health + maxHealth / 16)))
|
SetEntityHealth(playerPed, math.min(maxHealth, math.floor(health + maxHealth / 16)))
|
||||||
exports.ox_inventory:notify({text = 'You feel better already'})
|
lib.notify({description = 'You feel better already'})
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
-- Don't use the item
|
-- Don't use the item
|
||||||
exports.ox_inventory:notify({type = 'error', text = 'You don\'t need a bandage right now'})
|
lib.notify({type = 'error', description = 'You don\'t need a bandage right now'})
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
```
|
```
|
||||||
@@ -137,13 +137,13 @@ A modified burger item, which gives you notifications on add and remove argument
|
|||||||
client = {
|
client = {
|
||||||
add = function(total)
|
add = function(total)
|
||||||
if total > 0 then
|
if total > 0 then
|
||||||
exports.ox_inventory:notify({text = 'Nice burger you got there!'})
|
lib.notify({description = 'Nice burger you got there!'})
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
remove = function(total)
|
remove = function(total)
|
||||||
if total < 1 then
|
if total < 1 then
|
||||||
exports.ox_inventory:notify({text = 'You lost all of your burgers!'})
|
lib.notify({description = 'You lost all of your burgers!'})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@@ -181,12 +181,12 @@ exports('bandage', function(data, slot)
|
|||||||
-- The server has verified the item can be used.
|
-- The server has verified the item can be used.
|
||||||
if data then
|
if data then
|
||||||
SetEntityHealth(playerPed, math.min(maxHealth, math.floor(health + maxHealth / 16)))
|
SetEntityHealth(playerPed, math.min(maxHealth, math.floor(health + maxHealth / 16)))
|
||||||
exports.ox_inventory:notify({text = 'You feel better already'})
|
lib.notify({description = 'You feel better already'})
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
-- Don't use the item
|
-- Don't use the item
|
||||||
exports.ox_inventory:notify({type = 'error', text = 'You don\'t need a bandage right now'})
|
lib.notify({type = 'error', description = 'You don\'t need a bandage right now'})
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
```
|
```
|
||||||
@@ -208,7 +208,7 @@ exports('bandage', function(event, item, inventory, slot, data)
|
|||||||
|
|
||||||
-- Check if the player needs to be healed.
|
-- Check if the player needs to be healed.
|
||||||
if health >= maxHealth then
|
if health >= maxHealth then
|
||||||
TriggerClientEvent('ox_inventory:notify', inventory.id, {type = 'error', text = 'You don\'t need a bandage right now'})
|
TriggerClientEvent('ox_lib:notify', inventory.id, {type = 'error', description = 'You don\'t need a bandage right now'})
|
||||||
|
|
||||||
-- Returning 'false' will prevent the item from being used
|
-- Returning 'false' will prevent the item from being used
|
||||||
return false
|
return false
|
||||||
@@ -219,12 +219,12 @@ exports('bandage', function(event, item, inventory, slot, data)
|
|||||||
|
|
||||||
-- Player has finished using the item.
|
-- Player has finished using the item.
|
||||||
if event == 'usedItem' then
|
if event == 'usedItem' then
|
||||||
return TriggerClientEvent('ox_inventory:notify', inventory.id, {text = 'You feel better already'})
|
return TriggerClientEvent('ox_lib:notify', inventory.id, {description = 'You feel better already'})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Player is attempting to purchase the item.
|
-- Player is attempting to purchase the item.
|
||||||
if event == 'buying' then
|
if event == 'buying' then
|
||||||
return TriggerClientEvent('ox_inventory:notify', inventory.id, {type = 'success', text = 'You bought a bandage'})
|
return TriggerClientEvent('ox_lib:notify', inventory.id, {type = 'success', description = 'You bought a bandage'})
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in new issue
Block a user