Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Looking For Developer ONYX Site is unavailable

arqill

Bronze Elite
Joined
Nov 3, 2024
Messages
7
Reaction score
10
Points
156
Location
Belgium
I'm using the Onyx package and I'm getting an error when starting the server. I'm being redirected to a site, but even though the server is started I can't do anything - the ESC and F11 keys don't work and I don't even know what site I'm being redirected to. I need help.

1730633875987.png
 

arqill

Bronze Elite
Joined
Nov 3, 2024
Messages
7
Reaction score
10
Points
156
Location
Belgium
Is there someone who can help me fix this error? I can pay if necessary, but if possible, I would prefer it to be free.
 

ZebuloAlex

Member
Joined
Aug 24, 2024
Messages
9
Reaction score
0
Points
146
Location
swedish
Is there someone who can help me fix this error? I can pay if necessary, but if possible, I would prefer it to be free.
its easy replace in package json


JSON:
{
  "name": "onyx",
  "version": "0.0.1",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev:sound": "parcel serve ./src/cef/sound.html --out-dir client_packages/cef --target browser --port 1237 --global sound",
    "build:cef": "npx cross-env NODE_ENV=production del-cli --force client_packages/cef && parcel build ./src/cef/index.html --out-dir client_packages/cef --target browser --no-source-maps --public-url ./",
    "build:sound": "parcel build ./src/cef/sound.html --out-dir client_packages/cef --target browser --global sound --public-url ./",
    "build:server": "parcel build src/server/index.ts --no-minify --out-dir packages/server --target node",
    "build:client": "npx cross-env NODE_ENV=production parcel build src/client/index.ts --no-minify --out-dir client_packages --target node",
    "dev:server": "parcel watch src/server/index.ts --out-dir packages/server --target node",
    "dev:client": "parcel watch src/client/index.ts --out-dir client_packages --target node",
    "devall": "concurrently \"npm run dev:client\" \"npm run dev:server\" \"npm run dev:cef\" \"npm run dev:sound\"",
    "dev": "concurrently \"npm run dev:client\" \"npm run dev:server\" \"npm run dev:cef\"",
    "buildall": "concurrently \"npm run build:client\" \"npm run build:server\" \"npm run build:cef\" \"npm run build:sound\"",
    "build": "concurrently \"npm run build:client\" \"npm run build:server\" \"npm run build:cef\""
  },
  "author": "XanderWP",
  "license": "ISC",
  "devDependencies": {
    "@types/cors": "^2.8.12",
    "@types/express": "^4.17.7",
    "@types/express-session": "^1.17.3",
    "@types/fs-extra": "^9.0.1",
    "@types/howler": "^2.2.1",
    "@types/ip": "^1.1.0",
    "@types/jquery": "^3.3.37",
    "@types/jsonfile": "^5.0.0",
    "@types/lodash": "^4.14.158",
    "@types/md5": "^2.2.0",
    "@types/msgpack-lite": "^0.1.7",
    "@types/node-fetch": "^2.5.7",
    "@types/nodemailer": "^6.4.0",
    "@types/progressbar": "^1.1.0",
    "@types/react": "^16.9.34",
    "@types/react-color": "^3.0.1",
    "@types/react-copy-to-clipboard": "^4.3.0",
    "@types/react-dom": "^16.9.7",
    "@types/react-select": "^3.0.13",
    "@types/sha256": "^0.2.0",
    "@types/socket.io": "^2.1.13",
    "@types/yt-search": "^2.10.3",
    "concurrently": "^5.2.0",
    "del-cli": "^3.0.1",
    "less": "^3.11.1",
    "parcel": "^1.12.4",
    "parcel-bundler": "^1.12.4",
    "parcel-plugin-obfuscate": "^2.1.1",
    "tslib": "^1.13.0",
    "typescript": "^3.8.3"
  },
  "dependencies": {
    "@babel/core": "^7.24.7",
    "@babel/plugin-proposal-class-properties": "^7.8.3",
    "@babel/plugin-proposal-decorators": "^7.8.3",
    "@babel/plugin-proposal-function-bind": "^7.8.3",
    "@babel/plugin-syntax-dynamic-import": "^7.8.3",
    "@babel/plugin-transform-runtime": "^7.11.0",
    "@babel/preset-env": "^7.9.6",
    "@babel/preset-react": "^7.9.4",
    "@babel/preset-stage-0": "^7.8.3",
    "@babel/register": "^7.9.0",
    "@babel/runtime": "^7.11.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.30",
    "@fortawesome/free-solid-svg-icons": "^5.14.0",
    "@fortawesome/react-fontawesome": "^0.1.11",
    "@iconify/icons-feather": "^1.1.0",
    "@iconify/react": "^1.1.3",
    "@inovua/reactdatagrid-community": "^4.0.16",
    "@inovua/reactdatagrid-enterprise": "^4.0.16",
    "@material-ui/core": "^4.10.2",
    "@material-ui/icons": "^4.9.1",
    "@sandstreamdev/react-swipeable-list": "^0.6.0",
    "@tippyjs/react": "^4.2.0",
    "@types/bluebird": "^3.5.30",
    "@types/node": "^13.13.4",
    "@types/validator": "^13.0.0",
    "assets": "^3.0.1",
    "babel-loader": "^8.1.0",
    "babel-preset-react-app": "^9.1.2",
    "chartist": "^0.11.4",
    "classnames": "^2.3.1",
    "client": "0.0.1",
    "colors": "^1.4.0",
    "copy-to-clipboard": "^3.3.1",
    "cors": "^2.8.5",
    "discord.js": "^12.5.1",
    "express": "^4.17.1",
    "express-session": "^1.17.1",
    "ffmpeg": "0.0.4",
    "fs-extra": "^9.0.1",
    "get-audio-duration": "^2.0.3",
    "howler": "^2.2.1",
    "ip": "^1.1.5",
    "jquery": "^3.5.0",
    "jquery-contextmenu": "^2.9.0",
    "jquery-plugin": "0.0.0-ignored",
    "jquery-ui": "^1.12.1",
    "jqueryui": "^1.11.1",
    "jsonfile": "^6.0.1",
    "lottie-react": "^2.1.0",
    "lucide-react": "^0.454.0",
    "mariadb": "^2.4.0",
    "md5": "^2.3.0",
    "mobx": "^6.3.6",
    "mobx-react": "^7.2.1",
    "mobx-react-lite": "^3.2.2",
    "mysql": "^2.18.1",
    "mysql2": "^3.10.2",
    "node-fetch": "^2.6.1",
    "nodemailer": "^6.4.16",
    "parallax-js": "^3.1.0",
    "play-dl": "^1.9.7",
    "progressbar.js": "^1.1.0",
    "prop-types": "^15.7.2",
    "rc-progress": "^3.1.1",
    "react": "^17.0.1",
    "react-clipboard.js": "^2.0.16",
    "react-color": "^2.18.1",
    "react-contextmenu": "^2.13.0",
    "react-copy-to-clipboard": "^5.0.2",
    "react-data-grid": "^7.0.0-canary.36",
    "react-data-grid-addons": "^7.0.0-alpha.24",
    "react-dom": "^17.0.1",
    "react-draggable": "^4.4.3",
    "react-iframe": "^1.8.0",
    "react-input-range": "^1.3.0",
    "react-player": "^2.6.2",
    "react-select": "^3.1.0",
    "react-signature-pad": "0.0.6",
    "react-tooltip": "^4.2.13",
    "reflect-metadata": "^0.1.13",
    "sass": "^1.64.2",
    "select-shell": "^1.1.3",
    "sequelize": "^5.21.7",
    "sequelize-typescript": "^1.1.0",
    "sha256": "^0.2.0",
    "shared": "^0.2.0",
    "socket.io": "^3.1.0",
    "socket.io-client": "^3.1.0",
    "stream-combiner2": "^1.1.1",
    "text-signature": "^1.1.2",
    "typeorm": "^0.2.45",
    "tzdata": "^1.0.19",
    "web": "0.0.2",
    "youtube-duration": "^1.0.0",
    "youtube-mp3-downloader": "^0.7.11",
    "yt-search": "^2.12.1",
    "ytdl-core": "^4.11.5"
  }
}

replace this src client modules sound ts for more fixes check ileak.pro

Code:
import {user} from "./user";
import {system} from "./system";
import EntityType = RageEnums.EntityType;
import {gui} from "./gui";
import {debug} from "./admin";
import {CustomEvent} from "./custom.event";

const localPlayer = mp.players.local;
const camera = mp.cameras.new("gameplay");

// Removed the line: const browser = mp.browsers.new(`http://package/cef/sound.html`); New buged occored on 5 November 2024

export const getPanEntity = (entity: EntityMp) => {
    return getPan(entity.position, entity);
}

function easeInOutQuart(x: number): number {
    return x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2;
}

if (typeof mp.storage.data.boomboxSound !== "number") mp.storage.data.boomboxSound = 100;

export const getPan = (target_pos: {x: number, y: number, z: number}, entity: EntityMp) => {
    if (!target_pos) return 0;

    if (entity.type === 'vehicle' && mp.players.local.vehicle === entity) {
        return 0;
    }

    let cam_pos = mp.players.local.position;
    let cam_vector = camera.getDirection();
    let target_vector = {x: target_pos.x - cam_pos.x, y: target_pos.y - cam_pos.y, z: target_pos.z - cam_pos.z}
    let dx = target_vector.x * cam_vector.x + target_vector.y * cam_vector.y;
    let dy = Math.sqrt(cam_vector.x * cam_vector.x + cam_vector.y * cam_vector.y) * Math.sqrt(target_vector.x * target_vector.x + target_vector.y * target_vector.y);
    let s = cam_vector.x * (target_pos.y - cam_pos.y) - cam_vector.y * (target_pos.x - cam_pos.x);
    let a = 1;
    if (s > 0) a = -1;
    else if (!s) a = 0;
    let pan = Math.sqrt(1 - (dx / dy) * (dx / dy)) * a;
    if (user.isAdminNow() && debug) gui.drawText3D(`pan: ${pan.toFixed(2)} \n cam_pos x: ${cam_pos.x.toFixed(1)}, y: ${cam_pos.y.toFixed(1)}, z: ${cam_pos.z.toFixed(1)}\n cam_vector x: ${cam_vector.x.toFixed(1)}, y: ${cam_vector.y.toFixed(1)}, z: ${cam_vector.z.toFixed(1)} \n target_vector x: ${target_vector.x.toFixed(1)}, y: ${target_vector.y.toFixed(1)}, z: ${target_vector.z.toFixed(1)}`, target_pos.x, target_pos.y, target_pos.z);
    return Math.sqrt(1 - (dx / dy) * (dx / dy)) * a;
}

export class Sound {
    private _pos: {x: number, y: number, z: number};
    private _url: string;
    private _volume: number;
    private _max_dist: number;
    private _ent: EntityMp;
    startpos = 0
    private started = false
    readonly id: string;
    static list = new Map<string, Sound>()
    static get(id: string){
        return this.list.get(id)
    }
    get pos(){
        let res:  {x: number, y: number, z: number}
        if(this._ent) {
            if(this.exists) res = this._ent.getCoords(true);
        } else res = this._pos
        return res;
    }
    onEndHandles:((err:boolean)=>void)[] = []
    onEnd(): Promise<boolean> {
        return new Promise((resolve) => {
            this.onEndHandles.push(resolve);
        })
    }
    get exists(){
        if(!this._ent) return false;
        const type = this._ent.type;
        const ent:any = this._ent;
        if(type === 'player') return mp.players.exists(ent) && ent.handle;
        if(type === 'vehicle') return mp.vehicles.exists(ent) && ent.handle;
        if(type === 'object') return mp.objects.exists(ent) && ent.handle;
        if(type === 'ped') return mp.peds.exists(ent) && ent.handle;
        return !!ent.handle;
    }
    get pan(){
        if(!this._max_dist) return 0;
        return getPan(this.pos, this._ent);
    }
    get volume(){
        let mult = 1;
        if(this.id.indexOf('box_player_') === 0) mult = (typeof mp.storage.data.boomboxSound === "number" ? mp.storage.data.boomboxSound : 100) / 100;
        if(!this._max_dist) return this._volume * mult;
        if(!this.pos) return 0;
        let x = (system.distanceToPos(mp.players.local.position, this.pos) / this._max_dist);
        let q = 1 - easeInOutQuart(x)

        const inVehicleMultiplier = (this._ent.type === 'vehicle')
            ? mp.players.local.vehicle === this._ent
                ? 1 : 0.5
            : 1;

        return this._volume * q * mult * inVehicleMultiplier;
    }
    set volume(val){
        this._volume = val
    }
    private _paused = false;
    get paused(){
        return this._paused
    }
    set paused(val){
        this._paused = val;
        CustomEvent.triggerCef('sound:setPaused', this.id, val)
    }
    destroy() {
        CustomEvent.triggerCef('sound:stop', this.id)
        Sound.list.delete(this.id);
    }
    constructor(id: string, url: string, volume: number, data: {
        max_dist?: number,
        startpos?: number,
        pos?: {x: number, y: number, z: number},
        entity?: {
            type: EntityType,
            id: number,
        }
    }){
        this.id = id || system.randomStr(6)
        this._url = url;
        this._volume = volume;
        this._max_dist = data.max_dist || 0;
        this._pos = data.pos || null;
        if(data?.entity){
            let ent: EntityMp;
            if(data.entity.type === 'player') ent = mp.players.atRemoteId(data.entity.id);
            else if(data.entity.type === 'vehicle') ent = mp.vehicles.atRemoteId(data.entity.id);
            else if(data.entity.type === 'ped') ent = mp.peds.atRemoteId(data.entity.id);
            else if(data.entity.type === 'object') ent = mp.objects.atRemoteId(data.entity.id);
            if(ent) this._ent = ent;
        }
        Sound.list.set(this.id, this);
        setTimeout(() => {
            this.start()
        }, 10)
    }
    start(){
        this.started = true;
        CustomEvent.triggerCef('sound:play', this.id, this._url, this.startpos, this.volume, this.pan)
    }
}

export const sound = {
    playSound: (id: string, url: string, volume: number) => {
        return new Sound(id, url, volume, {max_dist: 0});
    },
    playSoundEntity: (id: string, ent: EntityMp, url: string, volume: number, max_dist: number) => {
        return new Sound(id, url, volume, {max_dist, entity: {type: ent.type, id: ent.remoteId}});
    },
    playSoundPos: (id: string, pos: {x: number, y: number, z: number}, url: string, volume: number, max_dist: number) => {
        return new Sound(id, url, volume, {max_dist, pos});
    }
}

const updateSoundData = () => {
    if(!user.login) return;
    let res: {id: string, pan: number, volume: number}[] = [];
    Sound.list.forEach(item => {
        res.push({id: item.id, pan: item.pan, volume: item.volume});
    })
    let resStr = JSON.stringify(res);
    if(resStr == dataString) return;
    dataString = resStr;

    CustomEvent.triggerCef('sound:data', res);
}

let dataString: string = JSON.stringify([]);
mp.events.add({
    audioError: (id: string) =>
        Sound.get(id).onEndHandles.map(item => item(true)),
    audioFinish: (id: string) =>
        Sound.get(id).onEndHandles.map(item => item(false)),
})

let frame = 0;
mp.events.add('render', () => {
    frame++;

    if (frame == 2) {
        frame = 0;

        updateSoundData();
    }
});
 
Top