0.0.1
This commit is contained in:
BIN
resources/[creators]/blips_creator/utils/dialogs/cl_dialogs.lua
Normal file
BIN
resources/[creators]/blips_creator/utils/dialogs/cl_dialogs.lua
Normal file
Binary file not shown.
33
resources/[creators]/blips_creator/utils/dialogs/dialogs.js
Normal file
33
resources/[creators]/blips_creator/utils/dialogs/dialogs.js
Normal file
@@ -0,0 +1,33 @@
|
||||
function toggleCursor(enabled) {
|
||||
if (enabled) {
|
||||
$.post(`https://${resName}/enableCursor`, JSON.stringify({}));
|
||||
} else {
|
||||
$.post(`https://${resName}/disableCursor`, JSON.stringify({}));
|
||||
}
|
||||
}
|
||||
|
||||
function loadDialog(dialogName) {
|
||||
var script = document.createElement('script');
|
||||
|
||||
console.log(`../utils/dialogs/${dialogName}/${dialogName}.js`)
|
||||
script.setAttribute('src',`../utils/dialogs/${dialogName}/${dialogName}.js`);
|
||||
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
// Messages received by client
|
||||
window.addEventListener('message', (event) => {
|
||||
let data = event.data;
|
||||
let action = data.action;
|
||||
|
||||
switch(action) {
|
||||
case "loadDialog": {
|
||||
var script = document.createElement('script');
|
||||
script.setAttribute('src',`../utils/dialogs/${data.dialogName}/${data.dialogName}.js`);
|
||||
document.head.appendChild(script);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$.post(`https://${resName}/nuiReady`, JSON.stringify({}));
|
||||
Binary file not shown.
@@ -0,0 +1,62 @@
|
||||
let isDialogActive = false;
|
||||
|
||||
// Messages received by client
|
||||
window.addEventListener('message', (event) => {
|
||||
let data = event.data;
|
||||
let action = data.action;
|
||||
|
||||
if (action != 'showNotAllowedDialog') return;
|
||||
if (isDialogActive) return;
|
||||
|
||||
const div = $(`
|
||||
<div style="background: rgba(25, 25, 25, 0.7); width: 100%; height: 100%; position: absolute; display: flex; align-items: center;"">
|
||||
<div class="container border border-danger rounded py-3" style="background-color: #222; color: white; width: 50%;">
|
||||
<button type="button" class="btn-close btn-close-white float-end"></button>
|
||||
|
||||
<p class="text-center fs-1">You are not allowed to use this menu</p>
|
||||
<p class="text-center fs-3">If you are a server admin, you have to copy paste the following code in your server.cfg</p>
|
||||
<p class="text-center fs-5 text-danger">Server restart required</p>
|
||||
|
||||
<p class="text-center text-white fs-4 mt-5 mb-2"># Only use one of these. If one doesn't work, try another one</p>
|
||||
|
||||
<div class="container text-warning p-2">
|
||||
<hr class="mb-4">
|
||||
|
||||
<p class="not-allowed-steamid font-monospace"></p>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<p class="not-allowed-license font-monospace"></p>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<p class="not-allowed-license2 font-monospace"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
div.find('.btn-close').click(() => {
|
||||
div.remove();
|
||||
toggleCursor(false);
|
||||
|
||||
isDialogActive = false;
|
||||
});
|
||||
|
||||
div.find(".not-allowed-license").text(`
|
||||
add_ace identifier.license:${data.playerIdentifiers["license"]} ${data.acePermission} allow # Add permission to '${data.playerName}' Rockstar license
|
||||
`);
|
||||
|
||||
div.find(".not-allowed-license2").text(`
|
||||
add_ace identifier.license2:${data.playerIdentifiers["license2"]} ${data.acePermission} allow # Add permission to '${data.playerName}' Rockstar license2
|
||||
`);
|
||||
|
||||
div.find(".not-allowed-steamid").text(`
|
||||
add_ace identifier.steam:${data.playerIdentifiers["steam"]} ${data.acePermission} allow # Add permission to '${data.playerName}' Steam account
|
||||
`);
|
||||
|
||||
$("html").append(div);
|
||||
toggleCursor(true);
|
||||
|
||||
isDialogActive = true;
|
||||
})
|
||||
Binary file not shown.
BIN
resources/[creators]/blips_creator/utils/dialogs/sv_dialogs.lua
Normal file
BIN
resources/[creators]/blips_creator/utils/dialogs/sv_dialogs.lua
Normal file
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 538 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 613 KiB |
@@ -0,0 +1,45 @@
|
||||
const path = GetResourcePath(GetCurrentResourceName());
|
||||
const Jimp = require('jimp');
|
||||
|
||||
let originalTexture = null;
|
||||
|
||||
async function beginSpritesReplacement() {
|
||||
try {
|
||||
originalTexture = await Jimp.read(`${path}/utils/miscellaneous/imgs/blips_texturesheet_ng.png`);
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports('beginSpritesReplacement', beginSpritesReplacement);
|
||||
|
||||
async function replaceSprite(imageName, x, y) {
|
||||
try {
|
||||
let newSprite = await Jimp.read(`${path}/_sprites/REPLACEABLE/${imageName}`);
|
||||
newSprite = newSprite.resize(64, 64, Jimp.RESIZE_NEAREST_NEIGHBOR);
|
||||
|
||||
const spriteWidth = newSprite.getWidth();
|
||||
const spriteHeight = newSprite.getHeight();
|
||||
|
||||
const mask = new Jimp(spriteWidth, spriteHeight, 0x00000000);
|
||||
|
||||
originalTexture.mask(mask, x, y);
|
||||
|
||||
originalTexture.blit(newSprite, x, y, 0, 0, spriteWidth, spriteHeight);
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports('replaceSprite', replaceSprite);
|
||||
|
||||
async function endSpritesReplacement() {
|
||||
try {
|
||||
await originalTexture.writeAsync(`${path}/utils/miscellaneous/imgs/blips_texturesheet_ng_custom.png`);
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports('endSpritesReplacement', endSpritesReplacement);
|
||||
BIN
resources/[creators]/blips_creator/utils/warnings/sv_escrow.lua
Normal file
BIN
resources/[creators]/blips_creator/utils/warnings/sv_escrow.lua
Normal file
Binary file not shown.
Reference in New Issue
Block a user