xxxxxxxxxx
ESX = nil
TriggerEvent("esx:getSharedObject", function(obj) ESX = obj end)
local function GetPlayersWithJob(job)
local xPlayers = {}
for _, source in pairs(ESX.GetPlayers()) do
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer and xPlayer.job.name == job then
table.insert(xPlayers, xPlayer.source)
end
end
return xPlayers
end
RegisterServerEvent('dispatch:svNotify')
AddEventHandler('dispatch:svNotify', function(data)
if data.job then
if (Config.EnableWhitelistedJobs and Config.WhitelistedJobs[data.job] or true) then
local jobPlayers = GetPlayersWithJob(data.job)
if #jobPlayers == 0 then return end
for _, v in pairs(jobPlayers) do
TriggerClientEvent('dispatch:clNotify', v, data)
end
end
else
print("^1[ESX_Dispatch] ^0Error, data.job not defined")
end
end)
xxxxxxxxxx
const Cryptr = require('cryptr');
const cryptr = new Cryptr('ReallySecretKey');
const encryptedString = cryptr.encrypt('Popcorn');
const decryptedString = cryptr.decrypt(encryptedString);
console.log(encryptedString);
xxxxxxxxxx
function encryptString(value) {
let encryptedValue = ''
for (let i = 0; i < value.length; i++) {
const charCode = value.charCodeAt(i)
const encryptedCharCode = charCode ^ 42 // XOR dengan 42 untuk enkripsi
encryptedValue += String.fromCharCode(encryptedCharCode)
}
return encryptedValue
}
function decryptString(encryptedValue) {
let decryptedValue = ''
for (let i = 0; i < encryptedValue.length; i++) {
const encryptedCharCode = encryptedValue.charCodeAt(i)
const decryptedCharCode = encryptedCharCode ^ 42 // XOR dengan 42 untuk dekripsi
decryptedValue += String.fromCharCode(decryptedCharCode)
}
return decryptedValue
}
const originalValue = 'qwerty12'
const encryptedValue = encryptString(originalValue)
console.log('Encrypted Value:', encryptedValue)
const decryptedValue = decryptString(encryptedValue)
console.log('Decrypted Value:', decryptedValue)
xxxxxxxxxx
ESX = nil
TriggerEvent("esx:getSharedObject", function(obj) ESX = obj end)
local function GetPlayersWithJob(job)
local xPlayers = {}
for _, source in pairs(ESX.GetPlayers()) do
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer and xPlayer.job.name == job then
table.insert(xPlayers, xPlayer.source)
end
end
return xPlayers
end
RegisterServerEvent('dispatch:svNotify')
AddEventHandler('dispatch:svNotify', function(data)
if data.job then
if (Config.EnableWhitelistedJobs and Config.WhitelistedJobs[data.job] or true) then
local jobPlayers = GetPlayersWithJob(data.job)
if #jobPlayers == 0 then return end
for _, v in pairs(jobPlayers) do
TriggerClientEvent('dispatch:clNotify', v, data)
end
end
else
print("^1[ESX_Dispatch] ^0Error, data.job not defined")
end
end)
xxxxxxxxxx
function _0x3ff915(_0xcf2b38, _0x46861b, _0x197044, _0x1828b1, _0x1a1204) {
return _0x4f1aa5(_0xcf2b38 - 0x108, _0x46861b - 0x13c, _0x197044, _0x1828b1 - 0x1d7, _0x1828b1 - -0x11a);
}