- big change, moved data to shared folder
This commit is contained in:
1 parent
fdc28723bc
commit
c7eca0285b
52 files changed
+1117
-1128
No files matched your search
+4
-33
@@ -1,32 +1,3 @@
|
||||
Locations, Recipes = Locations or {}, Recipes or {}
|
||||
Recipes.Whippit = {
|
||||
cracker = {
|
||||
{color = 'blue', item = 'blue_uninflated_balloon'},
|
||||
{color = 'green', item = 'green_uninflated_balloon'},
|
||||
{color = 'orange', item = 'orange_uninflated_balloon'},
|
||||
{color = 'purple', item = 'purple_uninflated_balloon'},
|
||||
{color = 'red', item = 'red_uninflated_balloon'},
|
||||
{color = 'white', item = 'white_uninflated_balloon'},
|
||||
{color = 'yellow', item = 'yellow_uninflated_balloon'}
|
||||
},
|
||||
shop = {
|
||||
blue_uninflated_balloon =5,
|
||||
green_uninflated_balloon =5,
|
||||
orange_uninflated_balloon =5,
|
||||
purple_uninflated_balloon =5,
|
||||
red_uninflated_balloon =5,
|
||||
white_uninflated_balloon =5,
|
||||
yellow_uninflated_balloon =5,
|
||||
cracker =500,
|
||||
whipped_cream_cannister =10
|
||||
}
|
||||
}
|
||||
Locations.Whippit = {
|
||||
{loc =vector4(1695.47, 4872.98, 42.16, 288.86), ped = 'ig_priest' },
|
||||
}
|
||||
|
||||
GlobalState.MDDrugsLocations = Locations
|
||||
GlobalState.MDDrugsRecipes = Recipes
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:buyWhippitItem', function(loc, item,amount)
|
||||
@@ -34,15 +5,15 @@ RegisterServerEvent('md-drugs:server:buyWhippitItem', function(loc, item,amount)
|
||||
|
||||
if timeOut(src, 'md-drugs:server:buyWhippitItem') then return end
|
||||
|
||||
if not checkDistance(src, Locations.Whippit[loc].loc, 3.0, 'md-drugs:server:buyWhippitItem') then
|
||||
if not checkDistance(src, Config.Whippit.Locations.Whippit[loc].loc, 3.0, 'md-drugs:server:buyWhippitItem') then
|
||||
return
|
||||
end
|
||||
|
||||
if not Recipes.Whippit.shop[item] then
|
||||
if not Config.Whippit.Recipes.shop[item] then
|
||||
Bridge.Prints.Warn(Bridge.Language.Locale('Whippit.invalidItemWarn', Bridge.Framework.GetPlayerIdentifier(src), item))
|
||||
return
|
||||
end
|
||||
local price = Recipes.Whippit.shop[item] * amount
|
||||
local price = Config.Whippit.Recipes.shop[item] * amount
|
||||
if not Bridge.Framework.RemoveAccountBalance(src, 'cash', price, 'whippit-shop') then
|
||||
return Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Whippit.notEnoughMoney', price), 'error')
|
||||
end
|
||||
@@ -54,7 +25,7 @@ Bridge.Framework.RegisterUsableItem('cracker', function(source)
|
||||
if not Bridge.Inventory.HasItem(src, 'cracker', 1) then return end
|
||||
if not Bridge.Inventory.HasItem(src, 'whipped_cream_cannister', 1) then return end
|
||||
local balloonItem, balloonColor = nil, nil
|
||||
for _, balloon in pairs(Recipes.Whippit.cracker) do
|
||||
for _, balloon in pairs(Config.Whippit.Recipes.cracker) do
|
||||
if Bridge.Inventory.HasItem(src, balloon.item, 1) then
|
||||
balloonItem = balloon.item
|
||||
balloonColor = 'ate_balloon_' .. balloon.color
|
||||
|
||||
Reference in new issue
Block a user