Another weapon shop for fivem with licenses…
Made this a while ago and thought i’d release it cause i have nothing better to do…
###Requirements
- pNotify (Notifications)
- Essentialmode (for money only, easily changed)
- mysql-async
####Features:
- Buy guns
- Sell guns
- Gun licenses
- Legal and illegal gunshops
####Some info to the people who annoy me:
- I won’t make it compatible with vRP
- I won’t make it couchDB
- I won’t make it using es.2x MySQL
- If you have modified it and it isn’t working correctly don’t even bother contacting me.
####Some event handlers… (server)
AddEventHandler("ws:giveweapons", function(source)
use this to give weapons to people…
e.g. in client
AddEventHandler('playerSpawned', function(spawn)
TriggerServerEvent("ws:giveweapons")
end)
AddEventHandler("ws:deleteweapons", function()
Use this to remove all the users weapons from the database
####client
AddEventHandler("ws:removeWeapons", function()
Just removes all of the users weapons
####(optional) modification Cops FiveM(check inventory)
MySQL.Async.fetchAll("SELECT * FROM gunshop WHERE identifier = '"..identifier.."'", { ['@username'] = identifier }, function (result)
local strResult = "Weapons of " .. GetPlayerName(target) .. " : "
for _, v in ipairs(result) do
strResult = strResult .. v.weapon_name .. " - lvl "..v.licenselvl..", "
end
local probs = "Weapons of " .. GetPlayerName(target) .. " : "
if strResult == probs then
strResult = GetPlayerName(target).." has no weapons"
end
TriggerClientEvent("pNotify:SendNotification", source, {
text = strResult,
type = "error",
queue = "left",
timeout = 20000,
layout = "centerRight"
})
end)
Github
Download
####Screenshots