mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 14:38:50 +00:00
Typo creatingItems.md (#20)
* Typo creatingItems.md * Update creatingItems.md
This commit is contained in:
1 parent
465102205d
commit
fbb38c9873
1 file changed
+5
-5
@@ -187,12 +187,12 @@ This can either be an export (recommended), or added to [items/server.lua](https
|
|||||||
```lua
|
```lua
|
||||||
exports('bandage', function(event, item, inventory, slot, data)
|
exports('bandage', function(event, item, inventory, slot, data)
|
||||||
if event == 'usingItem' then
|
if event == 'usingItem' then
|
||||||
local playerPed = GetPlayerPed(inventory.source)
|
local playerPed = GetPlayerPed(inventory.id)
|
||||||
local maxHealth = GetEntityMaxHealth(playerPed)
|
local maxHealth = GetEntityMaxHealth(playerPed)
|
||||||
local health = GetEntityHealth(playerPed)
|
local health = GetEntityHealth(playerPed)
|
||||||
|
|
||||||
if health >= maxHealth then
|
if health >= maxHealth then
|
||||||
TriggerClientEvent('ox_inventory:notify', inventory.source, {type = 'error', text = 'You don\'t need a bandage right now'})
|
TriggerClientEvent('ox_inventory:notify', inventory.id, {type = 'error', text = '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
|
||||||
@@ -200,10 +200,10 @@ exports('bandage', function(event, item, inventory, slot, data)
|
|||||||
|
|
||||||
return
|
return
|
||||||
elseif event == 'usedItem' then
|
elseif event == 'usedItem' then
|
||||||
return TriggerClientEvent('ox_inventory:notify', inventory.source, {text = 'You feel better already'})
|
return TriggerClientEvent('ox_inventory:notify', inventory.id, {text = 'You feel better already'})
|
||||||
|
|
||||||
elseif event == 'buying' then
|
elseif event == 'buying' then
|
||||||
return TriggerClientEvent('ox_inventory:notify', inventory.source, {type = 'success', text = 'You bought a bandage'})
|
return TriggerClientEvent('ox_inventory:notify', inventory.id, {type = 'success', text = 'You bought a bandage'})
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
```
|
```
|
||||||
@@ -248,4 +248,4 @@ You can also define the number of slots, the maximum weight, blacklist and white
|
|||||||
['testburger'] = true -- No burgers!
|
['testburger'] = true -- No burgers!
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
Reference in new issue
Block a user