',
- args = { message, time }
- })
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = Config.WebhookText['sv_an'],
- message = message,
- }
- discordWebhook(data)
- end
- end
- end
- end)
-end
-
--------------------------
--- [Advertisement]
-
-if Config.EnableAdvertisementCommand then
- RegisterCommand(Config.AdvertisementCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local length = string.len(Config.AdvertisementCommand)
- local message = rawCommand:sub(length + 1)
- local time = os.date(Config.DateFormat)
- local playerName = Config.ShowIDOnMessageForEveryone and xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]" or xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname
- local playerNameAdmins = xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]"
- local bankMoney = xPlayer.PlayerData.money.bank
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if message:gsub("%s+", "") == "" then return end
-
- if chatsHidden[source] == nil then
- if adsList[source] == nil then
- if bankMoney >= Config.AdvertisementPrice then
- xPlayer.Functions.RemoveMoney('bank', Config.AdvertisementPrice)
- showAll(function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
{0}{2}
{1}
',
- args = { playerName, message, time }
- })
- end)
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = Config.WebhookText['ad'],
- message = message,
- }
- discordWebhook(data)
- end
-
- if Config.ShowIDOnMessage then
- showOnlyForAdmins(function(admins)
- TriggerClientEvent('chat:addMessage', admins, {
- template = '
{0}{2}
{1}
',
- args = { playerNameAdmins, message, time }
- })
- end)
- end
-
- TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['ad_success'], interp(Config.NotificationsText['ad_success'].message, {price = Config.AdvertisementPrice}))
- adsList[source] = {
- time = Config.AdvertisementCooldown * 60,
- pastTime = 0,
- timeLeft = Config.AdvertisementCooldown * 60
- }
-
- while (adsList[source].time > adsList[source].pastTime) do
- Citizen.Wait(1000)
- adsList[source].pastTime = adsList[source].pastTime + 1
- adsList[source].timeLeft = adsList[source].time - adsList[source].pastTime
- end
- adsList[source] = nil
- else
- TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['ad_no_money'], Config.NotificationsText['ad_no_money'].message)
- end
- else
- TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['ad_too_quick'], Config.NotificationsText['ad_too_quick'].message)
- end
- end
- end)
-end
-
--------------------------
--- [Twitch]
-
-if Config.EnableTwitchCommand then
- RegisterCommand(Config.TwitchCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local length = string.len(Config.TwitchCommand)
- local message = rawCommand:sub(length + 1)
- local time = os.date(Config.DateFormat)
- local playerName = Config.ShowIDOnMessageForEveryone and xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]" or xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname
- local playerNameAdmins = xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]"
- local twitch = twitchPermission(source)
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if message:gsub("%s+", "") == "" then return end
-
- if chatsHidden[source] == nil then
- if twitch then
- showAll(function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
{0}{2}
{1}
',
- args = { playerName, message, time }
- })
- end)
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = Config.WebhookText['twitch'],
- message = message,
- }
- discordWebhook(data)
- end
-
- if Config.ShowIDOnMessage then
- showOnlyForAdmins(function(admins)
- TriggerClientEvent('chat:addMessage', admins, {
- template = '
{0}{2}
{1}
',
- args = { playerNameAdmins, message, time }
- })
- end)
- end
- end
- end
- end)
-end
-
-function twitchPermission(id)
- for i, a in ipairs(Config.TwitchList) do
- for x, b in ipairs(GetPlayerIdentifiers(id)) do
- if string.lower(b) == string.lower(a) then
- return true
- end
- end
- end
-end
-
--------------------------
--- [Youtube]
-
-if Config.EnableYoutubeCommand then
- RegisterCommand(Config.YoutubeCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local length = string.len(Config.YoutubeCommand)
- local message = rawCommand:sub(length + 1)
- local time = os.date(Config.DateFormat)
- local playerName = Config.ShowIDOnMessageForEveryone and xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]" or xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname
- local playerNameAdmins = xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]"
- local youtube = youtubePermission(source)
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if message:gsub("%s+", "") == "" then return end
-
- if chatsHidden[source] == nil then
- if youtube then
- showAll(function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
{0}{2}
{1}
',
- args = { playerName, message, time }
- })
- end)
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = Config.WebhookText['youtube'],
- message = message,
- }
- discordWebhook(data)
- end
-
- if Config.ShowIDOnMessage then
- showOnlyForAdmins(function(admins)
- TriggerClientEvent('chat:addMessage', admins, {
- template = '
{0}{2}
{1}
',
- args = { playerNameAdmins, message, time }
- })
- end)
- end
- end
- end
- end)
-end
-
-function youtubePermission(id)
- for i, a in ipairs(Config.YoutubeList) do
- for x, b in ipairs(GetPlayerIdentifiers(id)) do
- if string.lower(b) == string.lower(a) then
- return true
- end
- end
- end
-end
-
--------------------------
--- [Twitter]
-
-if Config.EnableTwitterCommand then
- RegisterCommand(Config.TwitterCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local length = string.len(Config.TwitterCommand)
- local message = rawCommand:sub(length + 1)
- local time = os.date(Config.DateFormat)
- local playerName = Config.ShowIDOnMessageForEveryone and xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]" or xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname
- local playerNameAdmins = xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]"
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
'..Config.TimeOutMessages['muted_message']..'
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if message:gsub("%s+", "") == "" then return end
-
- if chatsHidden[source] == nil then
- showAll(function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
{0}{2}
{1}
',
- args = { playerName, message, time }
- })
- end)
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = Config.WebhookText['twitter'],
- message = message,
- }
- discordWebhook(data)
- end
-
- if Config.ShowIDOnMessage then
- showOnlyForAdmins(function(admins)
- TriggerClientEvent('chat:addMessage', admins, {
- template = '
{0}{2}
{1}
',
- args = { playerNameAdmins, message, time }
- })
- end)
- end
- end
- end)
-end
-
--------------------------
--- [Police]
-
-if Config.EnablePoliceCommand then
- RegisterCommand(Config.PoliceCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local length = string.len(Config.PoliceCommand)
- local message = rawCommand:sub(length + 1)
- local time = os.date(Config.DateFormat)
- local playerName = Config.ShowIDOnMessageForEveryone and xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]" or xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname
- local playerNameAdmins = xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]"
- local job = xPlayer.PlayerData.job.name
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if message:gsub("%s+", "") == "" then return end
-
- if chatsHidden[source] == nil then
- if job == Config.PoliceJobName then
- showAll(function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
{0}{2}
{1}
',
- args = { playerName, message, time }
- })
- end)
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = Config.WebhookText['police'],
- message = message,
- }
- discordWebhook(data)
- end
-
- if Config.ShowIDOnMessage then
- showOnlyForAdmins(function(admins)
- TriggerClientEvent('chat:addMessage', admins, {
- template = '
{0}{2}
{1}
',
- args = { playerNameAdmins, message, time }
- })
- end)
- end
- end
- end
- end)
-end
-
--------------------------
--- [Ambulance]
-
-if Config.EnableAmbulanceCommand then
- RegisterCommand(Config.AmbulanceCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local length = string.len(Config.AmbulanceCommand)
- local message = rawCommand:sub(length + 1)
- local time = os.date(Config.DateFormat)
- local playerName = Config.ShowIDOnMessageForEveryone and xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]" or xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname
- local playerNameAdmins = xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]"
- local job = xPlayer.PlayerData.job.name
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if message:gsub("%s+", "") == "" then return end
-
- if chatsHidden[source] == nil then
- if job == Config.AmbulanceJobName then
- showAll(function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
{0}{2}
{1}
',
- args = { playerName, message, time }
- })
- end)
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = Config.WebhookText['ambulance'],
- message = message,
- }
- discordWebhook(data)
- end
-
- if Config.ShowIDOnMessage then
- showOnlyForAdmins(function(admins)
- TriggerClientEvent('chat:addMessage', admins, {
- template = '
{0}{2}
{1}
',
- args = { playerNameAdmins, message, time }
- })
- end)
- end
- end
- end
- end)
-end
-
--------------------------
--- [Jobs]
-
-if Config.JobChat then
- RegisterCommand(Config.JobCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local length = string.len(Config.JobCommand)
- local message = rawCommand:sub(length + 1)
- local time = os.date(Config.DateFormat)
- local playerName = Config.ShowIDOnMessageForEveryone and xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]" or xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname
- local playerNameAdmin = playerName.." ["..source.."]"
- local job = xPlayer.PlayerData.job
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if message:gsub("%s+", "") == "" then return end
-
- if chatsHidden[source] == nil then
- showForJob(job.name, function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
['..job.label..'] {0}{2}
{1}
',
- args = { playerName, message, time }
- })
- end)
-
- if Config.ShowIDOnMessage then
- showForJobAdmins(job.name, function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
['..job.label..'] {0}{2}
{1}
',
- args = { playerNameAdmin, message, time }
- })
- end)
- end
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = interp(Config.WebhookText['job_chat'], {job = job.label}),
- message = message,
- }
- discordWebhook(data)
- end
- end
- end)
-end
-
--------------------------
--- [Private Messages]
-
-if Config.EnablePM then
- RegisterCommand(Config.PMCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local message = table.concat(args, " ",2)
- local time = os.date(Config.DateFormat)
- local id = tonumber(args[1])
- local playerName = Config.ShowIDOnMessageForEveryone and xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]" or xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]"
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if message:gsub("%s+", "") == "" then return end
-
- if id == source then TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['mute_id_inv'], Config.NotificationsText['mute_id_inv'].message) return end
-
- xTarget = QBCore.Functions.GetPlayer(id)
-
- if xTarget == nil then TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['mute_id_inv'], Config.NotificationsText['mute_id_inv'].message) return end
-
- xTargetName = xTarget.PlayerData.charinfo.firstname.." "..xTarget.PlayerData.charinfo.lastname
-
- if chatsHidden[id] ~= nil then TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['is_muted'], Config.NotificationsText['is_muted'].message) return end
-
- TriggerClientEvent('chat:addMessage', source, {
- template = '
',
- args = { Config.MessageTitle, time }
- })
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = interp(Config.WebhookText['unmuted'], {id = id}),
- message = Config.WebhookText['p_unmuted'],
- }
- discordWebhook(data)
- end
-
- mutedList[id] = nil
-
- end)
-end
-
-function SecondsToClock(seconds)
- local seconds = tonumber(seconds)
-
- if seconds <= 0 then
- return "00";
- else
- local timeString = ""
- hours = string.format("%02.f", math.floor(seconds/3600));
- mins = string.format("%02.f", math.floor(seconds/60 - (hours*60)));
- secs = string.format("%02.f", math.floor(seconds - hours*3600 - mins *60));
-
- timeString = hours..":"..mins..":"..secs..Config.TimeOutMessages['hours']
-
- if hours == "00" then timeString = mins..":"..secs..Config.TimeOutMessages['minutes'] end
- if hours == "00" and mins == "00" then timeString = math.floor(seconds)..Config.TimeOutMessages['seconds'] end
-
- return timeString
- end
-end
-
--------------------------
--- [Anonymous]
-
-if Config.EnableAnonymousCommand then
- RegisterCommand(Config.AnonymousCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local length = string.len(Config.AnonymousCommand)
- local message = rawCommand:sub(length + 1)
- local time = os.date(Config.DateFormat)
- local bankMoney = xPlayer.PlayerData.money.bank
- local playerName = "Anonymous"
- local playerNameAdmins = xPlayer.PlayerData.charinfo.firstname.." "..xPlayer.PlayerData.charinfo.lastname.." ["..source.."]"
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- if chatsHidden[source] == nil then
- if message:gsub("%s+", "") ~= "" then
- if not isAnonymousChatBlacklisted(xPlayer) then
- if anonymousList[source] == nil then
- if bankMoney >= Config.AnonymousPrice then
- xPlayer.Functions.RemoveMoney('bank', Config.AnonymousPrice)
- showOnlyForAnonymous(function(anonymous)
- TriggerClientEvent('chat:addMessage', anonymous, {
- template = '
{0}{2}
{1}
',
- args = { playerName, message, time }
- })
- end)
-
- if Webhook ~= '' then
- local identifierlist = ExtractIdentifiers(xPlayer.PlayerData.source)
- local data = {
- playerid = xPlayer.PlayerData.source,
- identifier = identifierlist.license:gsub("license2:", ""),
- discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
- type = Config.WebhookText['anon'],
- message = message,
- }
- discordWebhook(data)
- end
-
- if Config.ShowIDOnMessage then
- showOnlyForAdminsAnonymous(function(admins)
- TriggerClientEvent('chat:addMessage', admins, {
- template = '
{0}{2}
{1}
',
- args = { playerNameAdmins, message, time }
- })
- end)
- end
-
- TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['an_success'], Config.NotificationsText['an_success'].message)
- anonymousList[source] = {
- time = Config.AdvertisementCooldown * 2,
- pastTime = 0,
- timeLeft = Config.AdvertisementCooldown * 2
- }
-
- while (anonymousList[source].time > anonymousList[source].pastTime) do
- Citizen.Wait(1000)
- anonymousList[source].pastTime = anonymousList[source].pastTime + 1
- anonymousList[source].timeLeft = anonymousList[source].time - anonymousList[source].pastTime
- end
- anonymousList[source] = nil
- else
- TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['an_no_money'], Config.NotificationsText['an_no_money'].message)
- end
- else
- TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['an_too_quick'], Config.NotificationsText['an_too_quick'].message)
- end
- else
- TriggerClientEvent('okokChat:Notification', source, Config.NotificationsText['an_not_allowed'], Config.NotificationsText['an_not_allowed'].message)
- end
- end
- end
- end)
-end
-
--- [DOC]
-
-if Config.EnableDocCommand then
- RegisterCommand(Config.DocCommand, function(source, args, rawCommand)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local time = os.date(Config.DateFormat)
- local playerName = Config.ShowIDOnMessageForEveryone and getName(xPlayer.identifier).." ["..source.."]" or getName(xPlayer.identifier)
- local playerNameAdmin = playerName.." ["..source.."]"
- local length = string.len(Config.DocCommand)
- local message = tonumber(rawCommand:sub(length + 1))
- local number = 1
-
- if mutedList[source] ~= nil then
- TriggerClientEvent('chat:addMessage', source, {
- template = '
'..Config.MessageTitle..'{1}
You are muted for {0}
',
- args = { SecondsToClock(mutedList[source].timeLeft), time }
- })
- return
- end
-
- while number <= message do
- local toShow = number .. '/' ..message
- Wait(1000)
- if chatsHidden[source] == nil then
- showToClosePlayers(xPlayer, function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
['..Config.DocMessageTitle..'] {0}{2}
{1}
',
- args = { playerName, toShow, time }
- })
- end)
-
- end
-
- if Config.ShowIDOnMessage then
- showToClosePlayersAdmins(xPlayer, function(players)
- TriggerClientEvent('chat:addMessage', players, {
- template = '
['..Config.DocMessageTitle..'] {0}{2}
{1}
',
- args = { playerNameAdmin, toShow, time }
- })
- end)
- end
- number = number + 1
- end
- end)
-end
-
-function isAnonymousChatBlacklisted(xPlayer)
- if xPlayer ~= nil then
- for k,v in ipairs(Config.WhatJobsCantSeeAnonymousChat) do
- if xPlayer.PlayerData.job.name == v then
- return true
- end
- end
- end
- return false
-end
-
-function showOnlyForAnonymous(anonymous)
- for k,v in ipairs(onlinePlayers) do
- local xPlayer = QBCore.Functions.GetPlayer(v)
- if xPlayer ~= nil then
- if not Config.ShowIDOnMessage and chatsHidden[xPlayer.PlayerData.source] == nil and not isAnonymousChatBlacklisted(xPlayer) then
- anonymous(v)
- elseif Config.ShowIDOnMessage and chatsHidden[xPlayer.PlayerData.source] == nil and not isAdmin(xPlayer) and not isAnonymousChatBlacklisted(xPlayer) then
- anonymous(v)
- end
- end
- end
-end
-
-function showOnlyForAdminsAnonymous(admins)
- for k,v in ipairs(onlinePlayers) do
- local xPlayer = QBCore.Functions.GetPlayer(v)
- if xPlayer ~= nil then
- if isAdmin(xPlayer) and chatsHidden[xPlayer.PlayerData.source] == nil and not isAnonymousChatBlacklisted(xPlayer) then
- admins(v)
- end
- end
- end
-end
-
--------------------------
--- [Functions]
-
-function isAdmin(xPlayer)
- if xPlayer ~= nil then
- local playerGroup = QBCore.Functions.GetPermission(xPlayer.PlayerData.source)
- if Config.QBPermissionsUpdate then
- for group, value in pairs(playerGroup) do
- if value then
- for k,v in ipairs(Config.StaffGroups) do
- if group == v then
- return true
- end
- end
- end
- end
- else
- for k,v in ipairs(Config.StaffGroups) do
- if playerGroup == v then
- return true
- end
- end
- end
- end
-
- return false
-end
-
-function showOnlyForAdmins(admins)
- for k,v in ipairs(onlinePlayers) do
- local xPlayer = QBCore.Functions.GetPlayer(v)
- if xPlayer ~= nil then
- if isAdmin(xPlayer) and chatsHidden[xPlayer.PlayerData.source] == nil then
- admins(v)
- end
- end
- end
-end
-
-function showAll(players)
- for k,v in ipairs(onlinePlayers) do
- local xPlayer = QBCore.Functions.GetPlayer(v)
- if xPlayer ~= nil then
- if not Config.ShowIDOnMessage and chatsHidden[xPlayer.PlayerData.source] == nil then
- players(v)
- elseif Config.ShowIDOnMessage and chatsHidden[xPlayer.PlayerData.source] == nil and not isAdmin(xPlayer) then
- players(v)
- end
- end
- end
-end
-
-function showToEveryoneNotHidden(players)
- for k,v in ipairs(onlinePlayers) do
- local xPlayer = QBCore.Functions.GetPlayer(v)
- if xPlayer ~= nil then
- if chatsHidden[xPlayer.PlayerData.source] == nil then
- players(v)
- end
- end
- end
-end
-
-function showMuteMessageToEveryone(id, players)
- for k,v in ipairs(onlinePlayers) do
- local xPlayer = QBCore.Functions.GetPlayer(v)
- if xPlayer ~= nil then
- if chatsHidden[xPlayer.PlayerData.source] == nil and id ~= v then
- players(v)
- end
- end
- end
-end
-
-function showForJob(job, players)
- for k,v in ipairs(onlinePlayers) do
- local xPlayer = QBCore.Functions.GetPlayer(v)
- if xPlayer ~= nil then
- if not Config.ShowIDOnMessage and xPlayer.PlayerData.job.name == job and chatsHidden[xPlayer.PlayerData.source] == nil then
- players(v)
- elseif Config.ShowIDOnMessage and not isAdmin(xPlayer) and xPlayer.PlayerData.job.name == job and chatsHidden[xPlayer.PlayerData.source] == nil then
- players(v)
- end
- end
- end
-end
-
-function showForJobAdmins(job, players)
- for k,v in ipairs(onlinePlayers) do
- local xPlayer = QBCore.Functions.GetPlayer(v)
- if xPlayer ~= nil then
- if xPlayer.PlayerData.job.name == job and chatsHidden[xPlayer.PlayerData.source] == nil and isAdmin(xPlayer) then
- players(v)
- end
- end
- end
-end
-
-function showToClosePlayers(xPlayer, admins)
- local ped = GetPlayerPed(xPlayer.PlayerData.source)
- local playerCoords = GetEntityCoords(ped, false)
- for k,v in ipairs(onlinePlayers) do
- local xTarget = QBCore.Functions.GetPlayer(v)
- if xTarget ~= nil then
- if not Config.ShowIDOnMessage and chatsHidden[xTarget.source] == nil then
- local tped = GetPlayerPed(v)
- local targetCoords = GetEntityCoords(tped, false)
- if #(vector3(playerCoords.x, playerCoords.y, playerCoords.z) - vector3(targetCoords.x, targetCoords.y, targetCoords.z)) < Config.Distance then
- admins(v)
- end
- elseif Config.ShowIDOnMessage and not isAdmin(xTarget) and chatsHidden[xTarget.source] == nil then
- local tped = GetPlayerPed(v)
- local targetCoords = GetEntityCoords(tped, false)
- if #(vector3(playerCoords.x, playerCoords.y, playerCoords.z) - vector3(targetCoords.x, targetCoords.y, targetCoords.z)) < Config.Distance then
- admins(v)
- end
- end
- end
- end
-end
-
-function showToClosePlayersAdmins(xPlayer, admins)
- local ped = GetPlayerPed(xPlayer.PlayerData.source)
- local playerCoords = GetEntityCoords(ped, false)
- for k,v in ipairs(onlinePlayers) do
- local xTarget = QBCore.Functions.GetPlayer(v)
- if xTarget ~= nil then
- if chatsHidden[xTarget.source] == nil and isAdmin(xTarget) then
- local tped = GetPlayerPed(v)
- local targetCoords = GetEntityCoords(tped, false)
- if #(vector3(playerCoords.x, playerCoords.y, playerCoords.z) - vector3(targetCoords.x, targetCoords.y, targetCoords.z)) < Config.Distance then
- admins(v)
- end
- end
- end
- end
-end
-
--------------------------- IDENTIFIERS
-
-function ExtractIdentifiers(id)
- local identifiers = {
- steam = "",
- ip = "",
- discord = "",
- license = "",
- xbl = "",
- live = ""
- }
-
- for i = 0, GetNumPlayerIdentifiers(id) - 1 do
- local playerID = GetPlayerIdentifier(id, i)
-
- if string.find(playerID, "steam") then
- identifiers.steam = playerID
- elseif string.find(playerID, "ip") then
- identifiers.ip = playerID
- elseif string.find(playerID, "discord") then
- identifiers.discord = playerID
- elseif string.find(playerID, "license") then
- identifiers.license = playerID
- elseif string.find(playerID, "xbl") then
- identifiers.xbl = playerID
- elseif string.find(playerID, "live") then
- identifiers.live = playerID
- end
- end
-
- return identifiers
-end
-
--------------------------- DISCORD WEBHOOK
-
-function discordWebhook(data)
-
- local information = {
- {
- ["color"] = Config.WebhookColor,
- ["author"] = {
- ["icon_url"] = Config.IconURL,
- ["name"] = Config.ServerName..' - Logs',
- },
- ["title"] = 'CHAT',
- ["description"] = '**Type:** '..data.type..'\n**Message:** '..data.message..'\n\n**ID:** '..data.playerid..'\n**Identifier:** '..data.identifier..'\n**Discord:** '..data.discord,
- ["footer"] = {
- ["text"] = os.date(Config.DateFormat),
- }
- }
- }
-
- PerformHttpRequest(Webhook, function(err, text, headers) end, 'POST', json.encode({username = Config.BotName, embeds = information}), {['Content-Type'] = 'application/json'})
- return
-end
\ No newline at end of file
diff --git a/resources/[standalone]/okokChatV2/web/styles.css b/resources/[standalone]/okokChatV2/web/styles.css
deleted file mode 100644
index 96473f61c..000000000
--- a/resources/[standalone]/okokChatV2/web/styles.css
+++ /dev/null
@@ -1,410 +0,0 @@
-@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');
-@import url('https://use.fontawesome.com/releases/v5.15.4/css/all.css');
-
-* {
- font-family: 'Tajawal', sans-serif;
-}
-
-.chat-window {
- position: absolute;
- top: 2.5%;
- left: 2.055%;
- width: 38%;
- height: 33.3% !important;
- max-width: 27.5%;
- background-color: rgba(0, 0, 0, 0.0) !important;
-}
-
-.msg {
- font-family: 'Tajawal', sans-serif;
- color: #fff;
- font-size: calc(1.8vh);
- filter: url(#svgDropShadowFilter);
- line-height: calc(2.7vh * 1.2);
- margin-bottom: 0.9%;
-}
-
-.chat-messages {
- margin: 0;
- height: 100%;
-}
-
-.chat-message {
- display: block !important;
- padding: 0.6vw;
- padding-top: 0.6vw;
- padding-bottom: 0.7vw;
- border-radius: 0.625rem;
- width: 75.6%;
- overflow: hidden;
- word-break: break-word;
- box-sizing: border-box;
- box-shadow: 0rem 0rem 0.625rem -0.3125rem rgba(0, 0, 0, 1);
- line-height: 1;
-}
-
-.chat-message div {
- line-height: 1 !important;
-}
-
-.message {
- margin-top: 0.9%;
- font-weight: 300;
-}
-
-.time {
- font-size: 0.875rem;
- font-size: calc(1.3vh);
- color: #e1e1e1;
-}
-
-.msg > span > span > b {
- font-family: 'Tajawal', sans-serif;
- font-weight: normal;
- vertical-align: baseline;
- padding-right: 0.6875rem;
- line-height: 1;
- font-size: calc(2.7vh);
-}
-
-.msg > span > span > span {
- vertical-align: baseline;
-}
-
-.msg i:first-of-type {
- font-style: normal;
- color: #fff;
-}
-
-.chat-input {
- font-size: 1.65vh;
- position: absolute;
- top: 37%;
- left: 2.055%;
- width: 38%;
- max-width: 20.8%;
- box-sizing: border-box;
-}
-
-.chat-input > div.input {
- background-color: rgba(27, 29, 32, 0.95);
- border-radius: 0.625rem;
-}
-
-.chat-input .prefix {
- height: 100%;
- vertical-align: middle;
- padding-left: 0.5vh;
- text-transform: uppercase;
- font-weight: bold;
- display: inline-block;
-}
-
-.input {
- align-items: center;
-}
-
-.prefix {
- line-height: 3.80vh !important;
-}
-
-.suggestions {
- margin-top: 0.9%;
- list-style-type: none;
- padding: 0.9%;
- padding-left: 6.54%;
- font-size: calc(1.7vh);
- box-sizing: border-box;
- color: white;
- background-color: rgba(31, 94, 255, 0.9);
- width: 100%;
- border-radius: 0.625rem;
- border: none;
- box-shadow: 0rem 0rem 0.625rem -0.3125rem rgba(0, 0, 0, 1);
-}
-
-.suggestion {
- font-size: calc(1.8vh);
- margin-bottom: 0.03125rem;
-}
-
-textarea {
- resize: none;
- font-size: calc(2vh);
- color: #fff;
- line-height: 1.85vh !important;
- padding-top: 3%;
-}
-
-.multiline {
- margin-left: 0;
- text-indent: 0;
-}
-
-.fas {
- vertical-align: middle;
-}
-
-/* START STAFF */
-
-.staff {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(19, 138, 70, 0.9) 100%);
-}
-
-.fa-shield-alt {
- color: rgba(42, 42, 42, 0.9);
- background-color: #1ebc62;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END STAFF */
-
-/* START ONLY STAFF */
-
-.staffonly {
- background: rgba(42, 42, 42, 0.9);
-}
-
-.fa-eye-slash {
- color: rgba(42, 42, 42, 0.9);
- background-color: #1ebc62;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END ONLY STAFF */
-
-/* START SERVER ANNOUNCEMENT */
-
-.server-msg {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(204, 61, 61, 0.9) 100%);
-}
-
-.fa-exclamation-circle {
- color: rgba(42, 42, 42, 0.9);
- background-color: #cc3d3d;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END SERVER ANNOUNCEMENT */
-
-/* START TWITCH */
-
-.twitch {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(96, 67, 139, 0.9) 100%);
-}
-
-.fa-twitch {
- color: rgba(42, 42, 42, 0.9);
- background-color: #9c70de;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END TWITCH */
-
-/* START YOUTUBE */
-
-.youtube {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(101, 0, 0, 0.9) 100%);
-}
-
-.fa-youtube {
- color: rgba(42, 42, 42, 0.9);
- background-color: #ff0000;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END YOUTUBE */
-
-/* START TWITTER */
-
-.twitter {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(25, 107, 143, 0.9) 100%);
-}
-
-.fa-twitter {
- color: rgba(42, 42, 42, 0.9);
- background-color: #2aa9e0;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END TWITTER */
-
-/* START SYSTEM */
-
-.system {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(134, 84, 23, 0.9) 100%);
-}
-
-.fa-cog {
- color: rgba(42, 42, 42, 0.9);
- background-color: #df7b00;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END SYSTEM */
-
-/* START ADVERTISEMENT */
-
-.advertisement {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(84, 150, 38, 0.9) 100%);
-}
-
-.fa-ad {
- color: rgba(42, 42, 42, 0.9);
- background-color: #81db44;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END ADVERTISEMENT */
-
-/* START POLICE */
-
-.police {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(40, 55, 116, 0.9) 100%);
-}
-
-.fa-bullhorn {
- color: rgba(42, 42, 42, 0.9);
- background-color: #4a6cfd;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END POLICE */
-
-/* START AMBULANCE */
-
-.ambulance {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(152, 113, 22, 0.9) 100%);
-}
-
-.fa-ambulance {
- color: rgba(42, 42, 42, 0.9);
- background-color: #e3a71b;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END AMBULANCE */
-
-/* START OOC */
-
-.ooc {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(125, 125, 125, 0.9) 100%);
-}
-
-.fa-door-open {
- color: rgba(42, 42, 42, 0.9);
- background-color: #ababab;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END OOC */
-
-/* START ME */
-
-.me {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(121, 184, 250, 0.9) 100%);
-}
-
-.me-icon {
- background-color: #79b8fa;
-}
-
-/* END ME */
-
-/* START DO */
-
-.do {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(121, 250, 164, 0.9) 100%);
-}
-
-.do-icon {
- background-color: #79faa4;
-}
-
-/* END DO */
-
-/* START TRY */
-
-.try {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(243, 73, 113, 0.9) 100%);
-}
-
-.try-icon {
- background-color: #f34971;
-}
-
-/* END TRY */
-
-/* START ANONYMOUS */
-
-.anonymous {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(9, 78, 33, 0.9) 100%);
-}
-
-.fa-mask {
- color: rgba(42, 42, 42, 0.9);
- background-color: #2e874d;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END ANONYMOUS */
-
-/* START JOBS */
-
-.jobchat {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(53, 219, 194, 0.9) 100%);
-}
-
-.fa-briefcase {
- color: rgba(42, 42, 42, 0.9);
- background-color: #35dbc2;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END JOBS */
-
-/* START TIMEOUT */
-
-.muted {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(223, 123, 0, 0.9) 100%);
-}
-
-.fa-gavel {
- color: rgba(42, 42, 42, 0.9);
- background-color: #df7b00;
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-/* END TIMEOUT */
-
-/* START PM */
-
-.pm {
- background: linear-gradient(90deg, rgba(42, 42, 42, 0.9) 0%, rgba(113, 81, 156, 0.9) 100%);
-}
-
-.fa-comment {
- color: rgba(42, 42, 42, 0.9);
- padding: 0.3125rem;
- border-radius: 0.3125rem;
-}
-
-.pm-icon {
- background-color: #71519c;
-}
-
-/* END PM */
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/.fxap b/resources/[test]/okokCrafting/.fxap
deleted file mode 100644
index 22e016992..000000000
Binary files a/resources/[test]/okokCrafting/.fxap and /dev/null differ
diff --git a/resources/[test]/okokCrafting/README.md b/resources/[test]/okokCrafting/README.md
deleted file mode 100644
index 7a9927879..000000000
--- a/resources/[test]/okokCrafting/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-Hi, thank you for buying okokCrafting! :)
-
-If you need help contact me on discord: okok#3488
-Discord server: https://discord.gg/okok
-Docs: https://docs.okokscripts.io/
-
--> Installation Guide: https://docs.okokscripts.io/scripts/okokcrafting
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/cl_utils.lua b/resources/[test]/okokCrafting/cl_utils.lua
deleted file mode 100644
index 742c01a6c..000000000
--- a/resources/[test]/okokCrafting/cl_utils.lua
+++ /dev/null
@@ -1,249 +0,0 @@
-QBCore = exports[Config.qbPrefix.."-core"]:GetCoreObject()
-
-RegisterNetEvent(Config.EventPrefix..":notification")
-AddEventHandler(Config.EventPrefix..":notification", function(title, text, time, type)
- exports['okokNotify']:Alert(title, text, time, type)
-end)
-
-RegisterNetEvent(Config.EventPrefix..":openTextUI")
-AddEventHandler(Config.EventPrefix..":openTextUI", function(text)
- exports['qb-core']:DrawText(text, 'left')
-end)
-
-RegisterNetEvent(Config.EventPrefix..":closeTextUI")
-AddEventHandler(Config.EventPrefix..":closeTextUI", function()
- exports['qb-core']:HideText()
-end)
-
-function onOpenMenu()
- -- Executed when the menu is opened
-end
-
-function onCloseMenu()
- -- Executed when the menu is closed
-end
-
-function claimAll(workbench, CraftQueues)
- TriggerServerEvent(Config.EventPrefix..':claimAll', workbench, CraftQueues)
-end
-
-Citizen.CreateThread(function()
- if Config.UseXP then
- if Config.SameLevelForAllTables then
- TriggerEvent('chat:addSuggestion', '/'..Config.SetXPCommand, _L('suggestion_xp').maintext, {
- { name=_L('suggestion_xp').id, help=_L('suggestion_xp').idtext },
- { name=_L('suggestion_xp').xp, help=_L('suggestion_xp').xptext },
- })
-
- TriggerEvent('chat:addSuggestion', '/'..Config.SetLevelCommand, _L('suggestion_level').maintext, {
- { name=_L('suggestion_level').id, help=_L('suggestion_level').idtext },
- { name=_L('suggestion_level').level, help=_L('suggestion_level').leveltext },
- })
- else
- TriggerEvent('chat:addSuggestion', '/'..Config.SetXPCommand, _L('suggestion_xp').maintext, {
- { name=_L('suggestion_xp').id, help=_L('suggestion_xp').idtext },
- { name=_L('suggestion_xp').xp, help=_L('suggestion_xp').xptext },
- { name=_L('suggestion_xp').workbench, help=_L('suggestion_xp').workbenchtext },
- })
-
- TriggerEvent('chat:addSuggestion', '/'..Config.SetLevelCommand, _L('suggestion_level').maintext, {
- { name=_L('suggestion_level').id, help=_L('suggestion_level').idtext },
- { name=_L('suggestion_level').level, help=_L('suggestion_level').leveltext },
- { name=_L('suggestion_level').workbench, help=_L('suggestion_level').workbenchtext },
- })
- end
- end
-end)
-
-Citizen.CreateThread(function()
- while PlayerData == nil do
- PlayerData = QBCore.Functions.GetPlayerData()
- Citizen.Wait(10)
- end
- while PlayerData.job == nil do
- PlayerData.job = QBCore.Functions.GetPlayerData().job
- Citizen.Wait(10)
- end
- while PlayerData.gang == nil do
- PlayerData.gang = QBCore.Functions.GetPlayerData().gang
- Citizen.Wait(10)
- end
- local inZone = false
- local num = 0
- local nearZone = false
- local enteredRange = false
- local inWideRange = false
- local ped = PlayerPedId()
-
- while true do
- Citizen.Wait(0)
- local playerExists = false
-
- if not playerExists then
- if DoesEntityExist(ped) then
- playerExists = true
- else
- ped = PlayerPedId()
- end
- end
- local playerCoords = GetEntityCoords(ped)
-
- nearZone = false
- inZone = false
-
- for k,v in pairs(Config.Crafting) do
- if v.jobs['all'] ~= nil or checkJob(v.jobs) or checkGang(v.jobs) then
- local distance = #(vector3(v.coordinates[1], v.coordinates[2], v.coordinates[3]) - playerCoords)
-
- if distance < Config.CraftRadius then
- if closeWorkbench ~= v.tableID then
- closeWorkbench = v.tableID
- workbenchCoords = v.coordinates
- end
-
- if not gotQueue then
- gotQueue = true
- QBCore.Functions.TriggerCallback(Config.EventPrefix..":getQueue", function(queue, queues)
- CraftQueues = queues
- WorkbenchCraft = queue
- end, v.tableID)
- end
- end
-
- if distance < v.radius + 2 then
- local zDistance = playerCoords.z - v.coordinates[3]
- nearZone = true
- if waitMore and not isCraftOpen then
- waitMore = false
- end
- if not Config.NotInterectableTables then
- if distance < v.radius and zDistance < 3 and zDistance > -3 then
- inZone = true
-
- if IsControlJustReleased(0, Config.Key) and not IsEntityDead(ped) then
- if GetVehiclePedIsUsing(ped) == 0 then
- waitMore = true
- if not isCraftOpen then
- TriggerEvent(Config.EventPrefix..':openWorkbench', k)
- end
- else
- TriggerEvent(Config.EventPrefix..':notification', _L('inside_vehicle').title, _L('inside_vehicle').text, _L('inside_vehicle').time, _L('inside_vehicle').type)
- end
- end
- end
- end
- elseif not waitMore and not inWideRange then
- waitMore = true
- end
- end
- end
-
- if nearZone and not enteredRange then
- enteredRange = true
- inWideRange = true
- elseif not nearZone and enteredRange then
- enteredRange = false
- inWideRange = false
- end
-
- if inZone and not hasEntered then
- if Config.UseOkokTextUI then
- exports['okokTextUI']:Open(_L('textUI').text, _L('textUI').color, _L('textUI').side)
- else
- TriggerEvent(Config.EventPrefix..':openTextUI', _L('textUI').text)
- end
- hasEntered = true
- elseif not inZone and hasEntered then
- if Config.UseOkokTextUI then
- exports['okokTextUI']:Close()
- else
- TriggerEvent(Config.EventPrefix..':closeTextUI')
- end
- hasEntered = false
- end
-
- if waitMore then
- Citizen.Wait(1000)
- end
- end
-end)
-
-Citizen.CreateThread(function()
- while true do
- local canCraft = false
- local queue = CraftQueues[closeWorkbench]
- if CraftQueues[closeWorkbench] ~= nil and closeWorkbench ~= "" and workbenchCoords ~= nil then
- local playerCoords = GetEntityCoords(PlayerPedId())
- local distance = #(vector3(workbenchCoords[1], workbenchCoords[2], workbenchCoords[3]) - playerCoords)
- local zDistance = playerCoords.z - workbenchCoords[3]
-
- if distance < Config.CraftRadius then
- local craftingItemID = 1
- for k,v in ipairs(CraftQueues[closeWorkbench]) do
- if v.time >= 0 and not v.isDone then
- craftingItemID = k
- canCraft = true
- break
- end
- end
- if canCraft then
- if not updateTable then
- updateTable = true
- end
- local craftTime = CraftQueues[closeWorkbench][craftingItemID].time
- CraftQueues[closeWorkbench][craftingItemID].isPending = false
- SendNUIMessage({
- action = "ShowCraftCount",
- time = CraftQueues[closeWorkbench][craftingItemID].time,
- name = CraftQueues[closeWorkbench][craftingItemID].itemName,
- })
-
- if CraftQueues[closeWorkbench][craftingItemID].time <= 0 then
- CraftQueues[closeWorkbench][craftingItemID].time = 0
- CraftQueues[closeWorkbench][craftingItemID].isDone = true
- local randomNum = math.random(1, 100)
- if randomNum <= tonumber(CraftQueues[closeWorkbench][craftingItemID].sucPC) then
- SendNUIMessage({
- action = "CompleteCraftCount",
- name = CraftQueues[closeWorkbench][craftingItemID].itemName,
- })
- else
- CraftQueues[closeWorkbench][craftingItemID].suc = false
- SendNUIMessage({
- action = "FailedCraftCount",
- name = CraftQueues[closeWorkbench][craftingItemID].itemName,
- })
- end
- SendNUIMessage({
- action = "updateCraftingItems",
- queue = CraftQueues[closeWorkbench],
- })
- SendNUIMessage({
- action = "HideCraftCount",
- })
- Citizen.Wait(500)
- else
- SendNUIMessage({
- action = "updateCraftingItems",
- queue = CraftQueues[closeWorkbench],
- })
- CraftQueues[closeWorkbench][craftingItemID].time = craftTime - 1
- Citizen.Wait(1000)
- end
- else
- if updateTable then
- updateTable = false
- QBCore.Functions.TriggerCallback(Config.EventPrefix..":updateQueue", function(cb)
-
- end, CraftQueues)
- end
- Citizen.Wait(2000)
- end
- else
- Citizen.Wait(3000)
- end
- else
- Citizen.Wait(5000)
- end
- end
-end)
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/client.lua b/resources/[test]/okokCrafting/client.lua
deleted file mode 100644
index 780af7b58..000000000
Binary files a/resources/[test]/okokCrafting/client.lua and /dev/null differ
diff --git a/resources/[test]/okokCrafting/config.lua b/resources/[test]/okokCrafting/config.lua
deleted file mode 100644
index b525bc730..000000000
--- a/resources/[test]/okokCrafting/config.lua
+++ /dev/null
@@ -1,595 +0,0 @@
-Config, Locales = {}, {}
-
-Config.Debug = false
-Config.DoubleXP = false
-Config.EventPrefix = 'okokCrafting'
-Config.xpColumnsName = 'xp'
-Config.craftQueryColumnName = 'okokcrafts'
-Config.qbPrefix = 'qb'
-Config.QBCorePrefix = 'QBCore'
-Config.Locale = 'de' -- en / pt / gr / fr / de
-Config.UseOkokTextUI = true
-Config.Key = 38
-Config.HideMinimap = true
-Config.ShowBlips = true
-Config.ShowFloorBlips = true
-Config.ShowAllCrafts = true
-Config.UseXP = false
-Config.SameLevelForAllTables = false
-Config.MaxLevel = 20
-Config.StartXP = 0
-Config.LevelMultiplier = 1.05
-Config.GiveXPOnCraftFailed = true
-Config.SetXPCommand = 'setcraftxp'
-Config.SetLevelCommand = 'setcraftlevel'
-Config.CraftRadius = 5
-Config.MaxCraftsPerWorkbench = 10
-Config.UseCategories = true
-Config.InventoryDirectory = 'qs-inventory/html/images'
-Config.UseOx_inventory = false
-Config.NotInterectableTables = false
-
-Config.AdminGroups = {
- 'god',
- 'admin',
- 'mod'
-}
-
-Config.itemNames = {
- metalscrap = 'Metal Scrap',
- weapon_assaultrifle = 'Assault Rifle',
- iron = 'Iron',
- bandage = 'Bandage',
- firstaid = 'First Aid',
- ['10kgoldchain'] = '10kgoldchain',
- plastic = 'Plastic',
- aluminum = 'Aluminum',
- cash = 'Money',
- -- Zusätzliche Waffenkomponenten
- shortened_gunbarrel = 'Verkuerzter Waffenlauf',
- shaft = 'Schaft',
- trigger_unit = 'Abzugseinheit',
- revolver_barrel = 'Revolverlauf',
- drum_mechanism = 'Trommelmechanismus',
- weapon_handle = 'Griff',
- pistol_barrel = 'Pistolenlauf',
- weapon_sled = 'Schlitten (Upper Slide)',
- gun_handle = 'Griffstueck',
- ceramic_barrel = 'Keramiklauf',
- small_triggersystem = 'Kleines Abzugssystem',
- weapon_batton = 'Waffenlauf Lang',
- --- Zubehör Nahkampfwaffen
- dagger_blade = 'Dolchklinge',
- machete_blade = 'Macheteklinge',
- handle = 'Holzgriff',
- switchblade_mechanism = 'Mechanismus für Springmesser',
- small_blade = 'kleine Klinge',
- axe_head = 'Axtkopf',
- reinforced_handle = 'verstärkter Griff',
- -- Drogenherstellung
- opium_poppy = 'Schlafmohn',
- opium = 'Opium',
- acetic = 'Essiganhydrid',
- injection = 'Spritze',
- codeine_syrup = 'Codein-Sirup',
- campers_fuel = 'Campers Fuel',
- sweets_candies = 'Süßigkeiten',
- ephedrin = 'Ephedrin',
- chemical_set = 'Chemikalien-Set',
- meth_pipe = 'Pipe',
- magic_mushroom = 'Mutterkorn',
- lysergic_acid = 'Lysergsäure',
- blotter_paper = 'Blotterpapier',
- ---- Drogen
- lsd_papers = 'LSD-Papes',
- ready_methpipe = 'Meth Pipe',
- lean = 'Lean',
- heroin_injection = 'Heroin in Spritze',
- -- Ausrüstung
- armor = 'Weste',
- -- Waffen
- weapon_ceramicpistol = 'Ceramic Pistol',
- weapon_navyrevolver = 'Navy Revolver',
- weapon_pistol50 = 'Tropical Eagle',
- weapon_assaultrifle = 'AK 75',
- weapon_dbshotgun = 'Double-barrel Shotgun',
- weapon_microsmg = 'Micro SMG',
- weapon_minismg = 'Mini SMG',
- weapon_bullpuprifle = 'QBX-92-3',
- weapon_marksmanpistol = 'Marksman Pistol',
- weapon_gusenberg = 'Gusenberg Sweeper',
- -- Nahkampfwaffen
- weapon_dagger = 'Dagger',
- weapon_machete = 'Machete',
- weapon_switchblade = 'Switchblade',
- weapon_hatchet = 'Hatchet',
- -- Ressourcen
- gunpowder = 'Schwarzpulver',
- armaid_plant = 'Aramid Fasern',
- steel_ingots = 'Stahlbarren',
- copper = 'Kupfer',
- log = 'Holzscheit',
-
-}
-
-Config.Crafting = {
- {
- coordinates = vector3(-1802.27, 3089.12, 32.84),
- radius = 1,
- showMapBlip = false,
- marker = {type = 20, r = 255, g = 165, b = 0, a = 155, bobUpAndDown = 0, faceCamera = 0, rotate = 1, textureDict = 0, textureName = 0, drawOnEnts = 0},
- showBlipRadius = 50,
- blip = {blipId = 402, blipColor = 7, blipScale = 0.9, blipText = 'Waffenkomponenten'},
- tableName = 'Waffenkomponenten',
- tableID = 'components1',
- crafts = {
- 'shortened_gunbarrel',
- 'shaft',
- 'trigger_unit',
- 'revolver_barrel',
- 'drum_mechanism',
- 'weapon_handle',
- 'pistol_barrel',
- 'weapon_sled',
- 'gun_handle',
- 'ceramic_barrel',
- 'small_triggersystem',
- 'weapon_batton',
- },
- jobs = {['all'] = true},
- },
- {
- coordinates = vector4(3092.46, -4713.06, 15.26, 37.66),
- radius = 2,
- showMapBlip = false,
- marker = {type = 20, r = 0, g = 200, b = 255, a = 150, bobUpAndDown = 0, faceCamera = 0, rotate = 1, textureDict = 0, textureName = 0, drawOnEnts = 0},
- showBlipRadius = 50,
- blip = {blipId = 566, blipColor = 5, blipScale = 0.8, blipText = 'Waffenherstellung'},
- tableName = 'Waffenherstellung',
- tableID = 'weapon_crafting_1',
- crafts = {
- 'weapon_ceramicpistol',
- 'weapon_navyrevolver',
- 'weapon_pistol50',
- 'weapon_assaultrifle',
- 'weapon_dbshotgun',
- 'weapon_microsmg',
- 'weapon_minismg',
- 'weapon_bullpuprifle',
- 'weapon_marksmanpistol',
- 'weapon_gusenberg',
- },
- jobs = {['all'] = true},
- }
-
-}
-
-Config.Crafts = {
- ['shortened_gunbarrel'] = {
- item = 'shortened_gunbarrel',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 2, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['shaft'] = {
- item = 'shaft',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 2, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['trigger_unit'] = {
- item = 'trigger_unit',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 2, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['revolver_barrel'] = {
- item = 'revolver_barrel',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 3, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['drum_mechanism'] = {
- item = 'drum_mechanism',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 3, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['weapon_handle'] = {
- item = 'weapon_handle',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 2, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['pistol_barrel'] = {
- item = 'pistol_barrel',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 2, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['weapon_sled'] = {
- item = 'weapon_sled',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 2, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['gun_handle'] = {
- item = 'gun_handle',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['ceramic_barrel'] = {
- item = 'ceramic_barrel',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 2, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['small_triggersystem'] = {
- item = 'small_triggersystem',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
- ['weapon_batton'] = {
- item = 'weapon_batton',
- amount = 1,
- maxCraft = 5,
- successCraftPercentage = 100,
- isItem = true,
- isDisassemble = false,
- time = 3,
- levelNeeded = 0,
- xpPerCraft = 10,
- recipe = {
- { 'steel_ingots', 2, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenkomponenten',
- },
-
-
--- Neue Crafting-Rezepte für Waffenherstellung
-
- ['weapon_ceramicpistol'] = {
- item = 'weapon_ceramicpistol',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 1,
- xpPerCraft = 20,
- recipe = {
- { 'ceramic_barrel', 1, true, false },
- { 'gun_handle', 1, true, false },
- { 'small_triggersystem', 1, true, false },
- { 'shaft', 1, true, false },
- { 'pistol_barrel', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_navyrevolver'] = {
- item = 'weapon_navyrevolver',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 1,
- xpPerCraft = 20,
- recipe = {
- { 'weapon_handle', 1, true, false },
- { 'revolver_barrel', 1, true, false },
- { 'small_triggersystem', 1, true, false },
- { 'drum_mechanism', 1, true, false },
- { 'shaft', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_pistol50'] = {
- item = 'weapon_pistol50',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 1,
- xpPerCraft = 20,
- recipe = {
- { 'shaft', 1, true, false },
- { 'small_triggersystem', 1, true, false },
- { 'gun_handle', 1, true, false },
- { 'pistol_barrel', 1, true, false },
- { 'weapon_sled', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_assaultrifle'] = {
- item = 'weapon_assaultrifle',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 2,
- xpPerCraft = 30,
- recipe = {
- { 'gun_handle', 1, true, false },
- { 'trigger_unit', 1, true, false },
- { 'weapon_batton', 1, true, false },
- { 'shaft', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_dbshotgun'] = {
- item = 'weapon_dbshotgun',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 2,
- xpPerCraft = 30,
- recipe = {
- { 'shortened_gunbarrel', 2, true, false },
- { 'shaft', 1, true, false },
- { 'trigger_unit', 1, true, false },
- { 'gun_handle', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_microsmg'] = {
- item = 'weapon_microsmg',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 2,
- xpPerCraft = 30,
- recipe = {
- { 'shaft', 1, true, false },
- { 'trigger_unit', 1, true, false },
- { 'gun_handle', 1, true, false },
- { 'pistol_barrel', 1, true, false },
- { 'weapon_sled', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_minismg'] = {
- item = 'weapon_minismg',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 2,
- xpPerCraft = 30,
- recipe = {
- { 'shaft', 1, true, false },
- { 'trigger_unit', 1, true, false },
- { 'gun_handle', 1, true, false },
- { 'pistol_barrel', 1, true, false },
- { 'weapon_sled', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_bullpuprifle'] = {
- item = 'weapon_bullpuprifle',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 3,
- xpPerCraft = 40,
- recipe = {
- { 'gun_handle', 1, true, false },
- { 'trigger_unit', 1, true, false },
- { 'weapon_batton', 1, true, false },
- { 'shaft', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_marksmanpistol'] = {
- item = 'weapon_marksmanpistol',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 1,
- xpPerCraft = 20,
- recipe = {
- { 'shaft', 1, true, false },
- { 'small_triggersystem', 1, true, false },
- { 'gun_handle', 1, true, false },
- { 'pistol_barrel', 1, true, false },
- { 'weapon_sled', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
- ['weapon_gusenberg'] = {
- item = 'weapon_gusenberg',
- amount = 1,
- successCraftPercentage = 100,
- time = 5,
- levelNeeded = 3,
- xpPerCraft = 40,
- recipe = {
- { 'gun_handle', 1, true, false },
- { 'trigger_unit', 1, true, false },
- { 'weapon_batton', 1, true, false },
- { 'shaft', 1, true, false }
- },
- job = { '' },
- data = {},
- category = 'Waffenherstellung',
-},
-
-}
--------------------------- DISCORD LOGS
-
--- To set your Discord Webhook URL go to server.lua, line 3
-
-Config.BotName = 'ServerName' -- Write the desired bot name
-
-Config.ServerName = 'ServerName' -- Write your server's name
-
-Config.IconURL = '' -- Insert your desired image link
-
-Config.DateFormat = '%d/%m/%Y [%X]' -- To change the date format check this website - https://www.lua.org/pil/22.1.html
-
--- To change a webhook color you need to set the decimal value of a color, you can use this website to do that - https://www.mathsisfun.com/hexadecimal-decimal-colors.html
-
-Config.StartCraftWebhookColor = '16127'
-
-Config.CancelWebhookColor = '16776960'
-
-Config.ClaimCraftWebhookColor = '65352'
-
-Config.FailedCraftWebhookColor = '16711680'
-
--------------------------- LOCALES (DON'T TOUCH)
-
-function _L(id)
- if Locales[Config.Locale][id] then
- return Locales[Config.Locale][id]
- else
- print('Locale '..id..' doesn\'t exist')
- end
-end
-
---
diff --git a/resources/[test]/okokCrafting/fxmanifest.lua b/resources/[test]/okokCrafting/fxmanifest.lua
deleted file mode 100644
index 034a67ca3..000000000
--- a/resources/[test]/okokCrafting/fxmanifest.lua
+++ /dev/null
@@ -1,42 +0,0 @@
-fx_version 'cerulean'
-
-game 'gta5'
-
-author 'okok#3488'
-description 'okokCrafting'
-version '1.1.0'
-
-ui_page 'web/ui.html'
-
-files {
- 'web/*.*',
-}
-
-shared_script 'config.lua'
-
-client_scripts {
- 'locales/*.lua',
- 'cl_utils.lua',
- 'client.lua',
-}
-
-server_scripts {
- '@oxmysql/lib/MySQL.lua',
- 'locales/*.lua',
- 'sv_utils.lua',
- 'server.lua'
-}
-
-lua54 'yes'
-
-escrow_ignore {
- 'config.lua',
- 'cl_utils.lua',
- 'sv_utils.lua',
- 'locales/*.lua',
-}
-
-server_exports {
- 'SetLevel'
-}
-dependency '/assetpacks'
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/locales/de.lua b/resources/[test]/okokCrafting/locales/de.lua
deleted file mode 100644
index 0383f3044..000000000
--- a/resources/[test]/okokCrafting/locales/de.lua
+++ /dev/null
@@ -1,133 +0,0 @@
-Locales['de'] = {
-
- -- Notifications
- ['user_xp_set'] = {
- title = 'WERKBANK',
- text = 'Deine Erfahrungspunkte wurden auf ${s1} gesetzt',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set'] = {
- title = 'WERKBANK',
- text = 'Du hast erfolgreich die Erfahrungspunkte von ${s1} zu ${s2} geändert',
- time = 5000,
- type = 'success'
- },
- ['user_xp_set_workbench'] = {
- title = 'WERKBANK',
- text = 'Deine Erfahrungspunkte wurden in der Werkbank ${s2} auf ${s1} gesetzt',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set_workbench'] = {
- title = 'WERKBANK',
- text = 'Du hast erfolgreich die Erfahrungspunkte von ${s1}, in der Werkbank ${s3}, auf ${s2} gesetzt',
- time = 5000,
- type = 'success'
- },
- ['user_level_set'] = {
- title = 'WERKBANK',
- text = 'Dein Level wurde auf ${s1} geändert',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set'] = {
- title = 'WERKBANK',
- text = 'Du hast erfolgreich das Level von ${s1} auf ${s2} geändert',
- time = 5000,
- type = 'success'
- },
- ['user_level_set_workbench'] = {
- title = 'WERKBANK',
- text = 'Dein Level wurde in der Werkbank ${s2} auf ${s1} geändert',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set_workbench'] = {
- title = 'WERKBANK',
- text = 'Du hast erfolgreich das Level von ${s1}, in der Werkbank ${s3}, auf ${s2} geändert',
- time = 5000,
- type = 'success'
- },
- ['admin_level_no_exist'] = {
- title = 'WERKBANK',
- text = 'Dieses Level existiert nicht',
- time = 5000,
- type = 'error'
- },
- ['cant_carry'] = {
- title = 'WERKBANK',
- text = "Du kannst diesen Gegenstand nicht bei dir tragen",
- time = 5000,
- type = 'error'
- },
- ['added_to_queue'] = {
- title = 'WERKBANK',
- text = '${s1} wurde zur Warteschlange hinzugefügt',
- time = 5000,
- type = 'success'
- },
- ['cant_craft'] = {
- title = 'WERKBANK',
- text = "Du kannst ${s1} nicht herstellen",
- time = 5000,
- type = 'error'
- },
- ['inside_vehicle'] = {
- title = 'WERKBANK',
- text = "Du kannst nichts in einem Fahrzeug herstellen",
- time = 5000,
- type = 'error'
- },
- ['queue_limit'] = {
- title = 'WERKBANK',
- text = 'Die Warteschlange ist bereits voll',
- time = 5000,
- type = 'error'
- },
- ['claimed_item'] = {
- title = 'WERKBANK',
- text = 'Du hast ${s1} bekommen',
- time = 5000,
- type = 'success'
- },
- ['claimed_all_items'] = {
- title = 'WERKBANK',
- text = 'Du hast alle Gegenstände bekommen',
- time = 5000,
- type = 'success'
- },
- ['cancel_item'] = {
- title = 'WERKBANK',
- text = 'Du hast die Herstellung von ${s1} abgebrochen',
- time = 5000,
- type = 'error'
- },
-
- -- Chat suggestions
- ['suggestion_xp'] = {
- maintext = 'Ändere das XP eines Spieler',
- id = 'ID',
- idtext = "Ziel ID",
- xp = 'XP',
- xptext = 'XP menge',
- workbench = 'Werkbank',
- workbenchtext = "ID der Werkbank",
- },
- ['suggestion_level'] = {
- maintext = 'Ändere das Level eines Spielers',
- id = 'ID',
- idtext = "Ziel ID",
- level = 'Level',
- leveltext = 'Level',
- workbench = 'Werkbank',
- workbenchtext = "ID der Werkbank",
- },
-
- -- okokTextUI
- ['textUI'] = {
- text = '[E] Werkbank zu öffnen',
- color = 'darkblue',
- side = 'left'
- },
-}
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/locales/en.lua b/resources/[test]/okokCrafting/locales/en.lua
deleted file mode 100644
index d1eb65461..000000000
--- a/resources/[test]/okokCrafting/locales/en.lua
+++ /dev/null
@@ -1,133 +0,0 @@
-Locales['en'] = {
-
- -- Notifications
- ['user_xp_set'] = {
- title = 'CRAFTING',
- text = 'Your XP was set to ${s1}',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set'] = {
- title = 'CRAFTING',
- text = 'You set the XP of ${s1} to ${s2} successfully',
- time = 5000,
- type = 'success'
- },
- ['user_xp_set_workbench'] = {
- title = 'CRAFTING',
- text = 'Your XP was set to ${s1} in ${s2}',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set_workbench'] = {
- title = 'CRAFTING',
- text = 'You set the XP of ${s1} to ${s2} in ${s3} successfully',
- time = 5000,
- type = 'success'
- },
- ['user_level_set'] = {
- title = 'CRAFTING',
- text = 'Your level was set to ${s1}',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set'] = {
- title = 'CRAFTING',
- text = 'You set the level of ${s1} to ${s2} successfully',
- time = 5000,
- type = 'success'
- },
- ['user_level_set_workbench'] = {
- title = 'CRAFTING',
- text = 'Your level was set to ${s1} in ${s2}',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set_workbench'] = {
- title = 'CRAFTING',
- text = 'You set the level of ${s1} to ${s2} in ${s3} successfully',
- time = 5000,
- type = 'success'
- },
- ['admin_level_no_exist'] = {
- title = 'CRAFTING',
- text = 'That level does not exist',
- time = 5000,
- type = 'error'
- },
- ['cant_carry'] = {
- title = 'CRAFTING',
- text = "You can't carry this item",
- time = 5000,
- type = 'error'
- },
- ['added_to_queue'] = {
- title = 'CRAFTING',
- text = '${s1} added to the crafting queue',
- time = 5000,
- type = 'success'
- },
- ['cant_craft'] = {
- title = 'CRAFTING',
- text = "You can't craft ${s1}",
- time = 5000,
- type = 'error'
- },
- ['inside_vehicle'] = {
- title = 'CRAFTING',
- text = "You can't craft inside a vehicle",
- time = 5000,
- type = 'error'
- },
- ['queue_limit'] = {
- title = 'CRAFTING',
- text = 'You have reached the queue limit',
- time = 5000,
- type = 'error'
- },
- ['claimed_item'] = {
- title = 'CRAFTING',
- text = 'You have claimed ${s1}',
- time = 5000,
- type = 'success'
- },
- ['claimed_all_items'] = {
- title = 'CRAFTING',
- text = 'You have claimed all items',
- time = 5000,
- type = 'success'
- },
- ['cancel_item'] = {
- title = 'CRAFTING',
- text = 'You canceled a crafting of ${s1}',
- time = 5000,
- type = 'error'
- },
-
- -- Chat suggestions
- ['suggestion_xp'] = {
- maintext = 'Set a players crafting XP',
- id = 'id',
- idtext = "Target's id",
- xp = 'XP',
- xptext = 'XP amount',
- workbench = 'workbench',
- workbenchtext = "Workbenche's id",
- },
- ['suggestion_level'] = {
- maintext = 'Set a players crafting Level',
- id = 'id',
- idtext = "Target's id",
- level = 'Level',
- leveltext = 'Level',
- workbench = 'workbench',
- workbenchtext = "Workbenche's id",
- },
-
- -- okokTextUI
- ['textUI'] = {
- text = '[E] Open crafting table',
- color = 'darkblue',
- side = 'left'
- },
-}
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/locales/fr.lua b/resources/[test]/okokCrafting/locales/fr.lua
deleted file mode 100644
index d2f39a177..000000000
--- a/resources/[test]/okokCrafting/locales/fr.lua
+++ /dev/null
@@ -1,133 +0,0 @@
-Locales['fr'] = {
-
- -- Notifications
- ['user_xp_set'] = {
- title = 'CRAFTING',
- text = 'Votre XP a été défini sur ${s1}',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set'] = {
- title = 'CRAFTING',
- text = 'Vous avez défini XP de ${s1} sur ${s2} avec succès',
- time = 5000,
- type = 'success'
- },
- ['user_xp_set_workbench'] = {
- title = 'CRAFTING',
- text = 'Votre XP a été défini de ${s1} en ${s2}',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set_workbench'] = {
- title = 'CRAFTING',
- text = 'Vous avez défini XP de ${s1} sur ${s2} en ${s3} avec succès',
- time = 5000,
- type = 'success'
- },
- ['user_level_set'] = {
- title = 'CRAFTING',
- text = 'Votre niveau a été défini sur ${s1}',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set'] = {
- title = 'CRAFTING',
- text = 'Vous avez défini le niveau de ${s1} sur ${s2} avec succès',
- time = 5000,
- type = 'success'
- },
- ['user_level_set_workbench'] = {
- title = 'CRAFTING',
- text = 'Votre niveau a été défini sur ${s1} en ${s2}',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set_workbench'] = {
- title = 'CRAFTING',
- text = 'Vous avez défini le niveau de ${s1} sur ${s2} en ${s3} avec succès',
- time = 5000,
- type = 'success'
- },
- ['admin_level_no_exist'] = {
- title = 'CRAFTING',
- text = 'Ce niveau n\'existe pas',
- time = 5000,
- type = 'error'
- },
- ['cant_carry'] = {
- title = 'CRAFTING',
- text = "Cet objet est trop lourd ! Impossible de le porter",
- time = 5000,
- type = 'error'
- },
- ['added_to_queue'] = {
- title = 'CRAFTING',
- text = '${s1} ajouté à la file de fabrication',
- time = 5000,
- type = 'success'
- },
- ['cant_craft'] = {
- title = 'CRAFTING',
- text = "Vous ne pouvez pas fabriquer ${s1}",
- time = 5000,
- type = 'error'
- },
- ['inside_vehicle'] = {
- title = 'CRAFTING',
- text = "Vous ne pouvez pas fabriquer à l\'intérieur d'un véhicule",
- time = 5000,
- type = 'error'
- },
- ['queue_limit'] = {
- title = 'CRAFTING',
- text = 'Vous avez atteint la limite de la file de fabrication',
- time = 5000,
- type = 'error'
- },
- ['claimed_item'] = {
- title = 'CRAFTING',
- text = 'Vous avez reçu ${s1}',
- time = 5000,
- type = 'success'
- },
- ['claimed_all_items'] = {
- title = 'CRAFTING',
- text = 'Vous avez tout reçu',
- time = 5000,
- type = 'success'
- },
- ['cancel_item'] = {
- title = 'CRAFTING',
- text = 'Vous avez annulé la fabrication de ${s1}',
- time = 5000,
- type = 'error'
- },
-
- -- Chat suggestions
- ['suggestion_xp'] = {
- maintext = 'Définissez un joueur fabriquant de l\'XP',
- id = 'id',
- idtext = "ID de la cible",
- xp = 'XP',
- xptext = 'Montant d\'XP',
- workbench = 'workbench',
- workbenchtext = "ID des établis",
- },
- ['suggestion_level'] = {
- maintext = 'Définissez le niveau de craft des joueurs',
- id = 'id',
- idtext = "ID de la cible",
- level = 'Level',
- leveltext = 'Niveau',
- workbench = 'workbench',
- workbenchtext = "ID des établis",
- },
-
- -- okokTextUI
- ['textUI'] = {
- text = '[E] Ouvrir l\'établi',
- color = 'darkblue',
- side = 'left'
- },
-}
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/locales/gr.lua b/resources/[test]/okokCrafting/locales/gr.lua
deleted file mode 100644
index 64ea4e162..000000000
--- a/resources/[test]/okokCrafting/locales/gr.lua
+++ /dev/null
@@ -1,133 +0,0 @@
-Locales['gr'] = {
-
- -- Notifications
- ['user_xp_set'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Το XP σας ορίστηκε σε ${s1}',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Ρυθμίζετε το XP του ${s1} σε ${s2} με επιτυχία',
- time = 5000,
- type = 'success'
- },
- ['user_xp_set_workbench'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Το XP σας ορίστηκε σε ${s1} σε ${s2}',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set_workbench'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Ρυθμίζετε το XP του ${s1} προς ${s2} σε ${s3} με επιτυχία',
- time = 5000,
- type = 'success'
- },
- ['user_level_set'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Το επίπεδό σας ορίστηκε σε ${s1}',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Ρυθμίσετε το επίπεδο του ${s1} προς ${s2} με επιτυχία',
- time = 5000,
- type = 'success'
- },
- ['user_level_set_workbench'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Το επίπεδό σας ορίστηκε σε ${s1} in ${s2}',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set_workbench'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Ρυθμίσετε το επίπεδο του ${s1} προς ${s2} σε ${s3} με επιτυχία',
- time = 5000,
- type = 'success'
- },
- ['admin_level_no_exist'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Αυτό το επίπεδο δεν υπάρχει',
- time = 5000,
- type = 'error'
- },
- ['cant_carry'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = "Δεν μπορείτε να μεταφέρετε αυτό το αντικείμενο",
- time = 5000,
- type = 'error'
- },
- ['added_to_queue'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = '${s1} προστέθηκε στην ουρά χειροτεχνίας',
- time = 5000,
- type = 'success'
- },
- ['cant_craft'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = "Δεν μπορείς να χειροτεχνήσεις ${s1}",
- time = 5000,
- type = 'error'
- },
- ['inside_vehicle'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = "Δεν μπορείτε να κάνετε χειροτεχνία μέσα σε ένα όχημα",
- time = 5000,
- type = 'error'
- },
- ['queue_limit'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Έχετε φτάσει το όριο της ουράς',
- time = 5000,
- type = 'error'
- },
- ['claimed_item'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Έχετε διεκδικήσει ${s1}',
- time = 5000,
- type = 'success'
- },
- ['claimed_all_items'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Έχετε διεκδικήσει όλα τα στοιχεία',
- time = 5000,
- type = 'success'
- },
- ['cancel_item'] = {
- title = 'ΚΑΤΑΣΚΕΥΗ',
- text = 'Ακυρώσατε μια δημιουργία του ${s1}',
- time = 5000,
- type = 'error'
- },
-
- -- Chat suggestions
- ['suggestion_xp'] = {
- maintext = 'Ρυθμίσετε το επίπεδο του παίκτη',
- id = 'ταυτότητα',
- idtext = "Ταυτότητα στόχου",
- xp = 'XP',
- xptext = 'XP ποσό',
- workbench = 'πάγκος εργασίας',
- workbenchtext = "Ταυτότητα πάγκων εργασίας",
- },
- ['suggestion_level'] = {
- maintext = 'Ρυθμίσετε το επίπεδο του παίκτη',
- id = 'ταυτότητα',
- idtext = "Ταυτότητα στόχου",
- level = 'Επίπεδο',
- leveltext = 'Επίπεδο',
- workbench = 'πάγκος εργασίας',
- workbenchtext = "Ταυτότητα πάγκων εργασίας",
- },
-
- -- okokTextUI
- ['textUI'] = {
- text = '[E] Να ανοίξω το τραπέζι χειροτεχνίας',
- color = 'darkblue',
- side = 'left'
- },
-}
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/locales/pt.lua b/resources/[test]/okokCrafting/locales/pt.lua
deleted file mode 100644
index 1e040783a..000000000
--- a/resources/[test]/okokCrafting/locales/pt.lua
+++ /dev/null
@@ -1,133 +0,0 @@
-Locales['pt'] = {
-
- -- Notifications
- ['user_xp_set'] = {
- title = 'CRAFTING',
- text = 'A tua XP foi alterada para ${s1}',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set'] = {
- title = 'CRAFTING',
- text = 'Alteraste a XP de ${s1} para ${s2} com sucesso',
- time = 5000,
- type = 'success'
- },
- ['user_xp_set_workbench'] = {
- title = 'CRAFTING',
- text = 'A tua XP foi alterada para ${s1} em ${s2}',
- time = 5000,
- type = 'info'
- },
- ['admin_xp_set_workbench'] = {
- title = 'CRAFTING',
- text = 'Alteraste a XP de ${s1} para ${s2} em ${s3} com sucesso',
- time = 5000,
- type = 'success'
- },
- ['user_level_set'] = {
- title = 'CRAFTING',
- text = 'O teu nível foi alterado para ${s1}',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set'] = {
- title = 'CRAFTING',
- text = 'Alteraste o nível de ${s1} em ${s2} com sucesso',
- time = 5000,
- type = 'success'
- },
- ['user_level_set_workbench'] = {
- title = 'CRAFTING',
- text = 'O teu nível foi alterado para ${s1} em ${s2}',
- time = 5000,
- type = 'info'
- },
- ['admin_level_set_workbench'] = {
- title = 'CRAFTING',
- text = 'Alteraste o nível de ${s1} para ${s2} em ${s3} com sucesso',
- time = 5000,
- type = 'success'
- },
- ['admin_level_no_exist'] = {
- title = 'CRAFTING',
- text = 'Esse nível não existe',
- time = 5000,
- type = 'error'
- },
- ['cant_carry'] = {
- title = 'CRAFTING',
- text = "Não tens espaço suficiente para carregar o item",
- time = 5000,
- type = 'error'
- },
- ['added_to_queue'] = {
- title = 'CRAFTING',
- text = '${s1} foi adicionado à queue',
- time = 5000,
- type = 'success'
- },
- ['cant_craft'] = {
- title = 'CRAFTING',
- text = "Não podes craftar ${s1}",
- time = 5000,
- type = 'error'
- },
- ['inside_vehicle'] = {
- title = 'CRAFTING',
- text = "Não podes craftar dentro de um veículo",
- time = 5000,
- type = 'error'
- },
- ['queue_limit'] = {
- title = 'CRAFTING',
- text = 'Atingiste o limite da queue',
- time = 5000,
- type = 'error'
- },
- ['claimed_item'] = {
- title = 'CRAFTING',
- text = 'Resgataste ${s1}',
- time = 5000,
- type = 'success'
- },
- ['claimed_all_items'] = {
- title = 'CRAFTING',
- text = 'Regataste todos os itens',
- time = 5000,
- type = 'success'
- },
- ['cancel_item'] = {
- title = 'CRAFTING',
- text = 'Cancelaste o craft de ${s1}',
- time = 5000,
- type = 'error'
- },
-
- -- Chat suggestions
- ['suggestion_xp'] = {
- maintext = 'Define o XP de craft de um jogador',
- id = 'id',
- idtext = "ID do jogador",
- xp = 'XP',
- xptext = 'Quantidade de XP',
- workbench = 'workbench',
- workbenchtext = "ID da workbench",
- },
- ['suggestion_level'] = {
- maintext = 'Define o nível de craft de um jogador',
- id = 'id',
- idtext = "ID do jogador",
- level = 'Nível',
- leveltext = 'Nível',
- workbench = 'workbench',
- workbenchtext = "ID da workbench",
- },
-
- -- okokTextUI
- ['textUI'] = {
- text = '[E] Abrir crafting table',
- color = 'darkblue',
- side = 'left'
- },
-}
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/okokcrafting.sql b/resources/[test]/okokCrafting/okokcrafting.sql
deleted file mode 100644
index ed47b157f..000000000
--- a/resources/[test]/okokCrafting/okokcrafting.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE players ADD COLUMN xp LONGTEXT NULL;
-ALTER TABLE players ADD COLUMN okokcrafts LONGTEXT NULL;
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/server.lua b/resources/[test]/okokCrafting/server.lua
deleted file mode 100644
index 388234875..000000000
Binary files a/resources/[test]/okokCrafting/server.lua and /dev/null differ
diff --git a/resources/[test]/okokCrafting/sv_utils.lua b/resources/[test]/okokCrafting/sv_utils.lua
deleted file mode 100644
index a9c6adf8b..000000000
--- a/resources/[test]/okokCrafting/sv_utils.lua
+++ /dev/null
@@ -1,590 +0,0 @@
-QBCore = exports[Config.qbPrefix.."-core"]:GetCoreObject()
-
-Webhook = ''
-
-function getMoney(type, xPlayer)
- local moneyCount = 0
- if type == "cash" then
- moneyCount = xPlayer.PlayerData.money.cash
- else
- moneyCount = xPlayer.PlayerData.money.bank
- end
-
- return moneyCount
-end
-
-function addMoney(type, value, xPlayer)
- xPlayer.Functions.AddMoney(type, value)
-end
-
-function removeMoney(type, value, xPlayer)
- xPlayer.Functions.RemoveMoney(type, value)
-end
-
-function addItem(xPlayer, item, amount, data)
- xPlayer.Functions.AddItem(item, tonumber(amount))
-end
-
-function removeItem(xPlayer, item, amount)
- xPlayer.Functions.RemoveItem(item, tonumber(amount))
-end
-
-function canCarryIt(item, amount, xPlayer)
- if Config.UseOx_inventory then
- return exports.ox_inventory:CanCarryItem(xPlayer.PlayerData.source, item, amount)
- end
-
- local totalWeight = QBCore.Player.GetTotalWeight(xPlayer.PlayerData.items)
- local itemInfo = QBCore.Shared.Items[item:lower()]
- if not itemInfo then
- TriggerClientEvent('QBCore:Notify', xPlayer.PlayerData.source, 'This item doesn\'t exits', 'error')
- return
- end
- amount = tonumber(amount)
- if (totalWeight + (itemInfo['weight'] * amount)) <= 120000 then
- return true
- else
- return false
- end
-end
-
-function hasPermission(source)
- local staff = false
- for k,v in ipairs(Config.AdminGroups) do
- if QBCore.Functions.HasPermission(source, v) then
- staff = true
- break
- end
- end
-
- return staff
-end
-
-function MySQLexecute(query, values, func)
- return MySQL.query(query, values, func)
-end
-
-function MySQLfetchAll(query, values, func)
- return MySQL.query(query, values, func)
-end
-
-function giveXP(xPlayer, xp, workbench)
- if Config.SameLevelForAllTables then
- MySQLexecute('UPDATE players SET '..Config.xpColumnsName..' = xp+@xp WHERE citizenid = @identifier', {
- ['@identifier'] = xPlayer.PlayerData.citizenid,
- ['@xp'] = Config.DoubleXP and xp*2 or xp,
- }, function (result)
- TriggerClientEvent(Config.EventPrefix..':updateXP', xPlayer.PlayerData.source)
- end)
- else
- MySQLexecute('UPDATE players SET '..Config.xpColumnsName..' = JSON_SET(xp, @table, JSON_EXTRACT(xp, @table) + @xp) WHERE citizenid = @identifier', {
- ['@identifier'] = xPlayer.PlayerData.citizenid,
- ['@xp'] = Config.DoubleXP and xp*2 or xp,
- ['@table'] = "$."..workbench,
- }, function (result)
- TriggerClientEvent(Config.EventPrefix..':updateXP', xPlayer.PlayerData.source)
- end)
- end
-end
-
-QBCore.Functions.CreateCallback(Config.EventPrefix..":inv2", function(source, cb, item, isMoney)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local itemS = {}
- if isMoney == "false" then
- isMoney = false
- elseif isMoney == "true" then
- isMoney = true
- end
-
- if isMoney then
- local playerMoney = getMoney(item, xPlayer)
- itemS.name = item
- itemS.amount = playerMoney
- else
- itemS = xPlayer.Functions.GetItemByName(item)
- if itemS == nil then
- itemS = {
- name = item,
- amount = 0
- }
- end
- if itemS.count ~= nil then
- itemS.amount = itemS.count
- end
- end
-
- cb(itemS)
-end)
-
-QBCore.Functions.CreateCallback(Config.EventPrefix..":maxCraft", function(source, cb, recipe, maxCraftAmount, isDisassemble, itemC, itmNeeded)
- local _source = source
- local xPlayer = QBCore.Functions.GetPlayer(_source)
- local maxCraft = maxCraftAmount
- local itemAmt = 0
-
- if not isDisassemble then
- for k,v in ipairs(recipe) do
- local item = {}
- local itemCount = 0
-
- if v[4] then
- itemCount = getMoney(v[1], xPlayer)
- else
- item = xPlayer.Functions.GetItemByName(v[1])
- if item == nil then
- item = {
- name = v[1],
- amount = 0
- }
- end
- if item.count ~= nil then
- item.amount = item.count
- end
- itemCount = item.amount
- end
-
- if itemCount > 0 then
- local possibleToCraft = itemCount/tonumber(v[2])
- if possibleToCraft > 0 then
- if maxCraft > possibleToCraft then
- maxCraft = possibleToCraft
- end
- else
- maxCraft = 0
- break
- end
- else
- maxCraft = 0
- break
- end
- end
- else
- local item = xPlayer.Functions.GetItemByName(itemC)
- if item == nil then
- item = {
- name = itemC,
- amount = 0
- }
- end
- if item.count ~= nil then
- item.amount = item.count
- end
- itemAmt = item.amount
-
- if itemAmt > 0 then
- local possibleToCraft = itemAmt/tonumber(itmNeeded)
- if possibleToCraft > 0 then
- if maxCraft > possibleToCraft then
- maxCraft = possibleToCraft
- end
- else
- maxCraft = 0
- end
- else
- maxCraft = 0
- end
- end
-
- cb(math.floor(maxCraft), itemAmt)
-end)
-
-local function normalizeRecipe(recipe)
- local normalized = {}
- for _, item in ipairs(recipe) do
- local normalizedItem = { item[1], tonumber(item[2]), item[3] == "true" or item[3] == true, item[4] == "true" or item[4] == true }
- table.insert(normalized, normalizedItem)
- end
- return normalized
-end
-
-local function compareRecipes(recipe1, recipe2)
- if #recipe1 ~= #recipe2 then
- return false
- end
- for i, item1 in ipairs(recipe1) do
- local item2 = recipe2[i]
- if item1[1] ~= item2[1] and item1[2] <= item2[2] then
- return false
- end
- end
- return true
-end
-
-function craftExistsInWorkbench(workbenchID, itemID, recipe)
- for _, workbench in pairs(Config.Crafting) do
- if workbench.tableID == workbenchID then
- for _, craft in pairs(workbench.crafts) do
- if Config.Crafts[craft] == nil then
- print("Craft "..craft.." does not exist in Config.Crafts")
- return false
- end
- if Config.Crafts[craft].item == itemID then
- local normalizedCraftRecipe = normalizeRecipe(Config.Crafts[craft].recipe)
- local normalizedInputRecipe = normalizeRecipe(recipe)
- if compareRecipes(normalizedCraftRecipe, normalizedInputRecipe) then
- return true
- end
- end
- end
- end
- end
- return false
-end
-
-QBCore.Functions.CreateCallback(Config.EventPrefix..":CanCraftItem", function(source, cb, itemID, recipe, itemName, amount, isItem, workbench, timeCraft, CraftQueues, xp, pc, isDis, itemData)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local canCraft = true
- if not craftExistsInWorkbench(workbench, itemID, recipe) then
- canCraft = false
- end
-
- if not isDis then
- for k,v in pairs(recipe) do
- if v[4] == "false" then
- local item = xPlayer.Functions.GetItemByName(v[1])
- if item == nil then
- item = {
- name = v[1],
- amount = 0
- }
- end
- if item.count ~= nil then
- item.amount = item.count
- end
- if item.amount < v[2] then
- canCraft = false
- end
- else
- local playerMoney = getMoney(v[1], xPlayer)
- if playerMoney < v[2] then
- canCraft = false
- end
- end
- end
- else
- local item = xPlayer.Functions.GetItemByName(itemID)
- if item == nil then
- item = {
- name = itemID,
- amount = 0
- }
- end
- if item.count ~= nil then
- item.amount = item.count
- end
- if tonumber(item.amount) < tonumber(amount) then
- canCraft = false
- end
- end
-
- if canCraft then
- if not isDis then
- for k,v in pairs(recipe) do
- if v[3] == "true" then
- if v[4] == "true" then
- removeMoney(v[1], v[2], xPlayer)
- else
- removeItem(xPlayer, v[1], v[2])
- end
- end
- end
- else
- removeItem(xPlayer, itemID, tonumber(amount))
- end
-
- local queue = CraftQueues
- if queue ~= nil and queue[workbench] ~= nil then
- queue[workbench][#queue[workbench]+1] = {
- item = itemID,
- recipe = recipe,
- amount = amount,
- isItem = isItem,
- time = timeCraft,
- itemName = itemName[itemID],
- isDone = false,
- isPending = true,
- randomID = math.random(100000000, 999999999),
- xp = xp,
- sucPC = pc,
- suc = true,
- isDis = isDis,
- data = itemData
- }
-
- MySQLexecute('UPDATE players SET '..Config.craftQueryColumnName..' = @okokcrafts WHERE citizenid = @identifier', {
- ['@identifier'] = xPlayer.PlayerData.citizenid,
- ['@okokcrafts'] = json.encode(queue),
- }, function (result)
- TriggerClientEvent(Config.EventPrefix..':notification', xPlayer.PlayerData.source, _L('added_to_queue').title, interp(_L('added_to_queue').text, {s1 = itemName[itemID]}), _L('added_to_queue').time, _L('added_to_queue').type)
-
- if Webhook ~= "" then
- data = {
- playerid = xPlayer.PlayerData.source,
- type = "start-craft",
- item = itemName[itemID],
- amount = amount,
- }
-
- discordWebhook(data)
- end
-
- cb(queue)
- end)
- else
- if queue == nil then
- queue = {}
- end
- queue[workbench] = {}
- queue[workbench] = {
- [1] = {
- item = itemID,
- recipe = recipe,
- amount = amount,
- isItem = isItem,
- time = timeCraft,
- itemName = itemName[itemID],
- isDone = false,
- isPending = true,
- randomID = math.random(100000000, 999999999),
- xp = xp,
- sucPC = pc,
- suc = true,
- isDis = isDis,
- data = itemData
- }
- }
-
- MySQLexecute('UPDATE players SET '..Config.craftQueryColumnName..' = @okokcrafts WHERE citizenid = @identifier', {
- ['@identifier'] = xPlayer.PlayerData.citizenid,
- ['@okokcrafts'] = json.encode(queue),
- }, function (result)
- TriggerClientEvent(Config.EventPrefix..':notification', xPlayer.PlayerData.source, _L('added_to_queue').title, interp(_L('added_to_queue').text, {s1 = itemName[itemID]}), _L('added_to_queue').time, _L('added_to_queue').type)
-
- if Webhook ~= "" then
- data = {
- playerid = xPlayer.PlayerData.source,
- type = "start-craft",
- item = itemName[itemID],
- amount = amount,
- }
- discordWebhook(data)
- end
-
- cb(queue)
- end)
- end
- else
- TriggerClientEvent(Config.EventPrefix..':notification', xPlayer.PlayerData.source, _L('cant_craft').title, interp(_L('cant_craft').text, {s1 = itemName[itemID]}), _L('cant_craft').time, _L('cant_craft').type)
- cb(false)
- end
-end)
-
-RegisterServerEvent(Config.EventPrefix..':claimAll')
-AddEventHandler(Config.EventPrefix..':claimAll', function(workbench, AllQueues)
- local xPlayer = QBCore.Functions.GetPlayer(source)
- local gotQueue = false
- local CraftsQueue = {}
-
- MySQLfetchAll('SELECT okokcrafts FROM players WHERE citizenid = @identifier', {
- ['@identifier'] = xPlayer.PlayerData.citizenid,
- }, function (result)
- if result[1] ~= nil then
- local data = json.decode(result[1].okokcrafts)
- if data ~= nil then
- CraftsQueue = data
- gotQueue = true
- end
- end
- end)
-
- while not gotQueue do
- Citizen.Wait(100)
- end
-
- local queue = CraftsQueue[workbench]
- local v = queue[1]
-
- if v ~= nil then
- if v.isDone then
- if v.suc then
- if not v.isDis then
- local canCarry = false
- if v.isItem then
- if canCarryIt(v.item, v.amount, xPlayer) then
- addItem(xPlayer, v.item, v.amount, v.data)
- canCarry = true
- end
- else
- if canCarryIt(v.item, v.amount, xPlayer) then
- addItem(xPlayer, v.item, v.amount)
- canCarry = true
- end
- end
-
- if canCarry then
- if Webhook ~= "" then
- data = {
- playerid = xPlayer.PlayerData.source,
- type = "claim-craft",
- item = v.itemName,
- amount = v.amount,
- }
-
- discordWebhook(data)
- end
-
- if Config.UseXP then
- giveXP(xPlayer, v.xp, workbench)
- end
- TriggerClientEvent(Config.EventPrefix..':removeItemsFromQueue', xPlayer.PlayerData.source, 1, workbench)
- else
- TriggerClientEvent(Config.EventPrefix..':notification', xPlayer.PlayerData.source, _L('cant_carry').title, _L('cant_carry').text, _L('cant_carry').time, _L('cant_carry').type)
- TriggerClientEvent(Config.EventPrefix..':notification', xPlayer.PlayerData.source, _L('claimed_all_items').title, _L('claimed_all_items').text, _L('claimed_all_items').time, _L('claimed_all_items').type)
- TriggerClientEvent(Config.EventPrefix..':resetClaimAllButton', xPlayer.PlayerData.source)
- end
- else
- local canCarry = true
- for k2,v2 in ipairs(v.recipe) do
- if v2[4] == "false" or v2[4] == false then
- if not canCarryIt(v2[1], v2[2], xPlayer) then
- canCarry = false
- end
- end
- end
-
- if canCarry then
- for k2,v2 in ipairs(v.recipe) do
- if v2[4] == "true" or v2[4] == true then
- addMoney(v2[1], v2[2], xPlayer)
- else
- addItem(xPlayer, v2[1], v2[2])
- end
- end
-
- if Webhook ~= "" then
- data = {
- playerid = xPlayer.PlayerData.source,
- type = "claim-craft",
- item = v.itemName,
- amount = v.amount,
- }
-
- discordWebhook(data)
- end
-
-
- if Config.UseXP then
- giveXP(xPlayer, v.xp, workbench)
- end
- TriggerClientEvent(Config.EventPrefix..':removeItemsFromQueue', xPlayer.PlayerData.source, 1, workbench)
- else
- TriggerClientEvent(Config.EventPrefix..':notification', xPlayer.PlayerData.source, _L('cant_carry').title, _L('cant_carry').text, _L('cant_carry').time, _L('cant_carry').type)
- TriggerClientEvent(Config.EventPrefix..':notification', xPlayer.PlayerData.source, _L('claimed_all_items').title, _L('claimed_all_items').text, _L('claimed_all_items').time, _L('claimed_all_items').type)
- TriggerClientEvent(Config.EventPrefix..':resetClaimAllButton', xPlayer.PlayerData.source)
- end
- end
- else
- if Webhook ~= "" then
- data = {
- playerid = xPlayer.PlayerData.source,
- type = "failed-craft",
- item = v.itemName,
- amount = v.amount,
- }
-
- discordWebhook(data)
- end
- if Config.GiveXPOnCraftFailed and Config.UseXP then
- if Config.UseXP then
- giveXP(xPlayer, v.xp, workbench)
- end
- end
- TriggerClientEvent(Config.EventPrefix..':removeItemsFromQueue', xPlayer.PlayerData.source, 1, workbench)
- end
- end
- end
-end)
-
--------------------------- IDENTIFIERS
-
-function ExtractIdentifiers(id)
- local identifiers = {
- steam = "",
- ip = "",
- discord = "",
- license = "",
- xbl = "",
- live = ""
- }
-
- for i = 0, GetNumPlayerIdentifiers(id) - 1 do
- local playerID = GetPlayerIdentifier(id, i)
-
- if string.find(playerID, "steam") then
- identifiers.steam = playerID
- elseif string.find(playerID, "ip") then
- identifiers.ip = playerID
- elseif string.find(playerID, "discord") then
- identifiers.discord = playerID
- elseif string.find(playerID, "license") then
- identifiers.license = playerID
- elseif string.find(playerID, "xbl") then
- identifiers.xbl = playerID
- elseif string.find(playerID, "live") then
- identifiers.live = playerID
- end
- end
-
- return identifiers
-end
-
--------------------------- WEBHOOK
-
-function discordWebhook(data)
- local color = '65352'
- local category = 'default'
- local item = ''
- local amount = ''
- local identifierlist = ExtractIdentifiers(data.playerid)
- local identifier = identifierlist.license:gsub("license2:", "")
- local discord = "<@"..identifierlist.discord:gsub("discord:", "")..">"
-
- if data.type == 'start-craft' then
- color = Config.StartCraftWebhookColor
- category = 'Started a craft'
- item = data.item
- amount = data.amount
- elseif data.type == 'cancel-craft' then
- color = Config.CancelWebhookColor
- category = 'Canceled a craft'
- item = data.item
- amount = data.amount
- elseif data.type == 'claim-craft' then
- color = Config.ClaimCraftWebhookColor
- category = 'Claimed'
- item = data.item
- amount = data.amount
- elseif data.type == 'failed-craft' then
- color = Config.FailedCraftWebhookColor
- category = 'Failed a craft'
- item = data.item
- amount = data.amount
- end
-
- local information = {
- {
- ["color"] = color,
- ["author"] = {
- ["icon_url"] = Config.IconURL,
- ["name"] = Config.ServerName..' - Logs',
- },
- ["title"] = 'CRAFTING',
- ["description"] = '**Action:** '..category..'\n**Item:** '..item..'\n**Amount:** '..amount..'\n\n**ID:** '..data.playerid..'\n**Identifier:** '..identifier..'\n**Discord:** '..discord,
- ["footer"] = {
- ["text"] = os.date(Config.DateFormat),
- }
- }
- }
-
- PerformHttpRequest(Webhook, function(err, text, headers) end, 'POST', json.encode({username = Config.BotName, embeds = information}), {['Content-Type'] = 'application/json'})
-end
\ No newline at end of file
diff --git a/resources/[test]/okokCrafting/web/click.mp3 b/resources/[test]/okokCrafting/web/click.mp3
deleted file mode 100644
index 058e5cd2c..000000000
Binary files a/resources/[test]/okokCrafting/web/click.mp3 and /dev/null differ
diff --git a/resources/[test]/okokCrafting/web/scripts.js b/resources/[test]/okokCrafting/web/scripts.js
deleted file mode 100644
index 5fb637966..000000000
--- a/resources/[test]/okokCrafting/web/scripts.js
+++ /dev/null
@@ -1,998 +0,0 @@
-function addStr(str, index, stringToAdd){
- return str.substring(0, index) + stringToAdd + str.substring(index, str.length);
-}
-
-var isTimerOn = false;
-var lastTime;
-var categories = [];
-var selectedCategory = "general_cat";
-var craft2;
-var job2;
-var gang;
-var craftData;
-var sideCraftMenu;
-var itemClaiming = 0;
-var CraftQueue = [];
-var maxCraft = 10;
-var canCraftItem = true;
-var showAllCrafts = false;
-var canClaimAll = true;
-
-var canClaimItem = true;
-var canOpenSideCraft = true;
-
-let Inventory = '';
-
-window.addEventListener('message', function(event) {
- switch (event.data.action) {
- case 'openCraft':
- selectedCategory = "general_cat";
- canOpenSideCraft = true;
- canClaimItem = true;
- itemClaiming = 0;
- showAllCrafts = event.data.showAllCrafts;
- Inventory = event.data.inventory;
- var queue = event.data.queue;
- craftData = event.data;
- categories = event.data.categories;
- var craft = event.data.craft;
- craft2 = craft;
- var num = craft.length;
- var paragraph = '';
- var row = '