-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #787 from bitpredator/dev
refactor: converted esx_society to bpt_society
- Loading branch information
Showing
75 changed files
with
858 additions
and
891 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
server-data/resources/[bpt_addons]/bpt_bakerjob/server/main.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
server-data/resources/[bpt_addons]/bpt_ballasjob/server/main.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 58 additions & 70 deletions
128
server-data/resources/[bpt_addons]/bpt_fisherman/server/main.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,80 @@ | ||
TriggerEvent( | ||
"esx_society:registerSociety", | ||
"fisherman", | ||
"Fisherman", | ||
"society_fisherman", | ||
"society_fisherman", | ||
"society_fisherman", | ||
{ | ||
type = "public", | ||
} | ||
) | ||
TriggerEvent("bpt_society:registerSociety", "fisherman", "Fisherman", "society_fisherman", "society_fisherman", "society_fisherman", { | ||
type = "public", | ||
}) | ||
|
||
if Config.MaxInService ~= -1 then | ||
TriggerEvent("esx_service:activateService", "fisherman", Config.MaxInService) | ||
TriggerEvent("esx_service:activateService", "fisherman", Config.MaxInService) | ||
end | ||
|
||
ESX.RegisterServerCallback("bpt_fishermanjob:SpawnVehicle", function(source, cb, model, props) | ||
local xPlayer = ESX.GetPlayerFromId(source) | ||
local xPlayer = ESX.GetPlayerFromId(source) | ||
|
||
if xPlayer.job.name ~= "fisherman" then | ||
print(("[^3WARNING^7] Player ^5%s^7 attempted to Exploit Vehicle Spawing!!"):format(source)) | ||
return | ||
end | ||
local SpawnPoint = vector3( | ||
Config.Zones.VehicleSpawnPoint.Pos.x, | ||
Config.Zones.VehicleSpawnPoint.Pos.y, | ||
Config.Zones.VehicleSpawnPoint.Pos.z | ||
) | ||
ESX.OneSync.SpawnVehicle(joaat(model), SpawnPoint, Config.Zones.VehicleSpawnPoint.Heading, props, function() | ||
local vehicle = NetworkGetEntityFromNetworkId() | ||
while GetVehicleNumberPlateText(vehicle) ~= props.plate do | ||
Wait(0) | ||
end | ||
TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1) | ||
end) | ||
cb() | ||
if xPlayer.job.name ~= "fisherman" then | ||
print(("[^3WARNING^7] Player ^5%s^7 attempted to Exploit Vehicle Spawing!!"):format(source)) | ||
return | ||
end | ||
local SpawnPoint = vector3(Config.Zones.VehicleSpawnPoint.Pos.x, Config.Zones.VehicleSpawnPoint.Pos.y, Config.Zones.VehicleSpawnPoint.Pos.z) | ||
ESX.OneSync.SpawnVehicle(joaat(model), SpawnPoint, Config.Zones.VehicleSpawnPoint.Heading, props, function() | ||
local vehicle = NetworkGetEntityFromNetworkId() | ||
while GetVehicleNumberPlateText(vehicle) ~= props.plate do | ||
Wait(0) | ||
end | ||
TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1) | ||
end) | ||
cb() | ||
end) | ||
|
||
RegisterNetEvent("bpt_fishermanjob:getStockItem") | ||
AddEventHandler("bpt_fishermanjob:getStockItem", function(itemName, count) | ||
local xPlayer = ESX.GetPlayerFromId(source) | ||
local xPlayer = ESX.GetPlayerFromId(source) | ||
|
||
if xPlayer.job.name == "fisherman" then | ||
TriggerEvent("bpt_addoninventory:getSharedInventory", "society_fisherman", function(inventory) | ||
local item = inventory.getItem(itemName) | ||
if xPlayer.job.name == "fisherman" then | ||
TriggerEvent("bpt_addoninventory:getSharedInventory", "society_fisherman", function(inventory) | ||
local item = inventory.getItem(itemName) | ||
|
||
-- is there enough in the society? | ||
if count > 0 and item.count >= count then | ||
-- can the player carry the said amount of x item? | ||
if xPlayer.canCarryItem(itemName, count) then | ||
inventory.removeItem(itemName, count) | ||
xPlayer.addInventoryItem(itemName, count) | ||
xPlayer.showNotification(TranslateCap("have_withdrawn", count, item.label)) | ||
else | ||
xPlayer.showNotification(TranslateCap("player_cannot_hold")) | ||
end | ||
else | ||
xPlayer.showNotification(TranslateCap("quantity_invalid")) | ||
end | ||
end) | ||
else | ||
print(("[^3WARNING^7] Player ^5%s^7 attempted ^5bpt_fishermanjob:getStockItem^7 (cheating)"):format(source)) | ||
end | ||
-- is there enough in the society? | ||
if count > 0 and item.count >= count then | ||
-- can the player carry the said amount of x item? | ||
if xPlayer.canCarryItem(itemName, count) then | ||
inventory.removeItem(itemName, count) | ||
xPlayer.addInventoryItem(itemName, count) | ||
xPlayer.showNotification(TranslateCap("have_withdrawn", count, item.label)) | ||
else | ||
xPlayer.showNotification(TranslateCap("player_cannot_hold")) | ||
end | ||
else | ||
xPlayer.showNotification(TranslateCap("quantity_invalid")) | ||
end | ||
end) | ||
else | ||
print(("[^3WARNING^7] Player ^5%s^7 attempted ^5bpt_fishermanjob:getStockItem^7 (cheating)"):format(source)) | ||
end | ||
end) | ||
|
||
ESX.RegisterServerCallback("bpt_fishermanjob:getStockItems", function(_, cb) | ||
TriggerEvent("bpt_addoninventory:getSharedInventory", "society_fisherman", function(inventory) | ||
cb(inventory.items) | ||
end) | ||
TriggerEvent("bpt_addoninventory:getSharedInventory", "society_fisherman", function(inventory) | ||
cb(inventory.items) | ||
end) | ||
end) | ||
|
||
RegisterNetEvent("bpt_fishermanjob:putStockItems") | ||
AddEventHandler("bpt_fishermanjob:putStockItems", function(itemName, count) | ||
local xPlayer = ESX.GetPlayerFromId(source) | ||
local sourceItem = xPlayer.getInventoryItem(itemName) | ||
local xPlayer = ESX.GetPlayerFromId(source) | ||
local sourceItem = xPlayer.getInventoryItem(itemName) | ||
|
||
if xPlayer.job.name == "fisherman" then | ||
TriggerEvent("bpt_addoninventory:getSharedInventory", "society_fisherman", function(inventory) | ||
local item = inventory.getItem(itemName) | ||
if xPlayer.job.name == "fisherman" then | ||
TriggerEvent("bpt_addoninventory:getSharedInventory", "society_fisherman", function(inventory) | ||
local item = inventory.getItem(itemName) | ||
|
||
if sourceItem.count >= count and count > 0 then | ||
xPlayer.removeInventoryItem(itemName, count) | ||
inventory.addItem(itemName, count) | ||
xPlayer.showNotification(TranslateCap("have_deposited", count, item.label)) | ||
else | ||
xPlayer.showNotification(TranslateCap("quantity_invalid")) | ||
end | ||
end) | ||
else | ||
print(("[^3WARNING^7] Player ^5%s^7 attempted ^5bpt_fishermanjob:putStockItems^7 (cheating)"):format(source)) | ||
end | ||
if sourceItem.count >= count and count > 0 then | ||
xPlayer.removeInventoryItem(itemName, count) | ||
inventory.addItem(itemName, count) | ||
xPlayer.showNotification(TranslateCap("have_deposited", count, item.label)) | ||
else | ||
xPlayer.showNotification(TranslateCap("quantity_invalid")) | ||
end | ||
end) | ||
else | ||
print(("[^3WARNING^7] Player ^5%s^7 attempted ^5bpt_fishermanjob:putStockItems^7 (cheating)"):format(source)) | ||
end | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
server-data/resources/[bpt_addons]/bpt_importjob/server/main.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,6 @@ server_scripts({ | |
|
||
dependencies({ | ||
"es_extended", | ||
"esx_society", | ||
"bpt_society", | ||
"bpt_billing", | ||
}) |
Oops, something went wrong.