Skip to content

Commit

Permalink
Merge pull request #705 from bitpredator/dev
Browse files Browse the repository at this point in the history
convert: BasicItem > bpt_basicItem
  • Loading branch information
bitpredator authored May 21, 2024
2 parents f14b433 + adcef54 commit a3066c9
Show file tree
Hide file tree
Showing 13 changed files with 756 additions and 149 deletions.
674 changes: 674 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_basicItem/LICENSE

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_basicItem/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h1 align='center'>bpt_basicItem</a></h1>
<p align='center'><a href='https://discord.gg/ksGfNvDEfq'>Discord</a>

Copyright (C) 2024 bitpredator

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.

ATTENTION:
You are not authorized to change the name of the resource and the resources within it.

If you want to contribute you can open a pull request.

You are not authorized to sell this software (this is free project).

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INSERT INTO `items` (`name`, `label`) VALUES
('idcard', 'Identity Cards'),
('licensecard', 'PPA License'),
('dmvcard', 'License DMV')
;
39 changes: 39 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_basicItem/client/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
local closestDistance, closestPlayer, playerReceiveCard = {}, {}, {}

ESX = exports["es_extended"]:getSharedObject()

RegisterNetEvent("IDCARD:USE")
AddEventHandler("IDCARD:USE", function()
closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestDistance ~= -1 and closestDistance <= 2.0 then
TriggerServerEvent("bpt_idcard:open", GetPlayerServerId(PlayerId()), GetPlayerServerId(closestPlayer))
else
TriggerServerEvent("bpt_idcard:open", GetPlayerServerId(PlayerId()), GetPlayerServerId(PlayerId()))
end
Wait(1)
end)

RegisterNetEvent("DMVCARD:USE")
AddEventHandler("DMVCARD:USE", function()
closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestDistance ~= -1 and closestDistance <= 2.0 then
ESX.ShowNotification((playerReceiveCard):format(GetPlayerName(closestPlayer)))
TriggerServerEvent("bpt_idcard:open", GetPlayerServerId(PlayerId()), GetPlayerServerId(closestPlayer), "driver")
else
TriggerServerEvent("bpt_idcard:open", GetPlayerServerId(PlayerId()), GetPlayerServerId(PlayerId()), "driver")
end
Wait(1)
end)

RegisterNetEvent("WCARD:USE")
AddEventHandler("WCARD:USE", function()
closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestDistance ~= -1 and closestDistance <= 2.0 then
ESX.ShowNotification((playerReceiveCard):format(GetPlayerName(closestPlayer)))
TriggerServerEvent("bpt_idcardidcard:open", GetPlayerServerId(PlayerId()), GetPlayerServerId(closestPlayer),
"weapon")
else
TriggerServerEvent("bpt_idcard:open", GetPlayerServerId(PlayerId()), GetPlayerServerId(PlayerId()), "weapon")
end
Wait(1)
end)
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
fx_version("cerulean")
game("gta5")

name("LItemBasic")
description("fivem resource")
author("LQuatre")
version("1.0.1")
description("fivem basic Item")
author("bitpredator")
version("1.0.0")
lua54("yes")

shared_scripts({
"shared/*.lua",
"@es_extended/imports.lua",
})

client_scripts({
"@es_extended/locale.lua",
"client/*.lua",
"locales/*.lua",
"shared/*.lua",
"config.lua",
})

Expand All @@ -25,7 +22,6 @@ server_scripts({
"@mysql-async/lib/MySQL.lua",
"server/*.lua",
"locales/*.lua",
"shared/*.lua",
"config.lua",
})

Expand Down
16 changes: 16 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_basicItem/server/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ESX = exports["es_extended"]:getSharedObject()

ESX.RegisterUsableItem("idcard", function(source)
local _source = source
TriggerClientEvent("IDCARD:USE", _source)
end)

ESX.RegisterUsableItem("dmvcard", function(source)
local _source = source
TriggerClientEvent("DMVCARD:USE", _source)
end)

ESX.RegisterUsableItem("licensecard", function(source)
local _source = source
TriggerClientEvent("WCARD:USE", _source)
end)
81 changes: 0 additions & 81 deletions server-data/resources/[esx_addons]/BasicItem/client/main.lua

This file was deleted.

39 changes: 0 additions & 39 deletions server-data/resources/[esx_addons]/BasicItem/server/main.lua

This file was deleted.

16 changes: 0 additions & 16 deletions server-data/resources/[esx_addons]/BasicItem/shared/main.lua

This file was deleted.

6 changes: 0 additions & 6 deletions server-data/resources/[esx_addons]/BasicItem/sql.sql

This file was deleted.

0 comments on commit a3066c9

Please sign in to comment.