Jump to content

Search the Community

Showing results for tags 'browser'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RAGE Multiplayer
    • Announcements
    • Discussion
    • Suggestions
  • Scripting
    • Scripting
    • Resources
  • Community
    • Support
    • Servers
    • Media Gallery
  • Non-English
    • Русский - Russian
    • Français - French
    • Deutsch - German
    • Espanol - Spanish
    • Română - Romanian
    • Portuguesa - Portuguese
    • Polski - Polish

Categories

  • Scripts
  • Gamemodes
  • Libraries
  • Plugins
  • Maps
  • Tools

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Youtube


Skype


Web


VK

Found 4 results

  1. Kasimir

    Console

    Version 0.3.0

    1453 downloads

    To access the console press F11 ingame. Motivation RAGE console is designed to be a simple and universal logging library with support for client-side, including CEF and server-side. The server-side currently logs all the logs into separate daily files. Installation Installation is extremely simple Copy "packages" folder inside your server "packages" folder, except config.json if you have edited it Copy "client_packages" folder inside your "client_packages" folder Edit your "client_packages" -> index.js to include the rage-console with: require('_rage-console'); (remember to paste this on line 1) Config The config exists inside your 'packages/_rage-console/config.json'. You can freely edit these, if no data is provided it will default to default settings. These options are accepted by the config: zippedArchive: A boolean to define whether or not to gzip archived log files. (default 'false') name: Filename to be used to log to. This filename can include the date placeholder which will include the formatted. (default: 'YYYY-MM-DD') maxSize: Maximum size of the file after which it will rotate. This can be a number of bytes, or units of kb, mb, and gb. If using the units, add 'k', 'm', or 'g' as the suffix. The units need to directly follow the number. (default: '30m') maxFiles: Maximum number of logs to keep. If not set, no logs will be removed. This can be a number of files or number of days. If using days, add 'd' as the suffix. (default: '30d') { "logs": { "name": "YYYY-MM-DD", "maxSize": '30m', "maxFiles": '30d', "zippedArchive": false } } Upgrading Upgrading is extremely simple Copy "packages" folder inside your server "packages" folder Copy "client_packages" folder inside your "client_packages" folder Usage Can be used on server-side or client-side. You do not need to require the file as these are available globally. Writes an info log to the console. console.log('Hey! Log something?'); Writes an info log to the console. console.info('Hey! Log something?'); Writes an warning log to the console. console.warn('Hey! Log something?'); Writes an error log to the console. console.error('Hey! Log something?'); Usage with CEF (Browser) To use with CEF you need to add the following line to your HTML <head> element, put this to the top of all your script files. <script src="package://_rage-console/CEF/debugger.js" crossorigin="anonymous"></script> Build in commands help — provides all the commands available clear — clears all the logs API Enable or disable access to console [client-side] terminal.active = true/false; Add command handler [client-side] terminal.commands.add('pos', { description: 'Gets the position of the player' }, function(...arguments) { return ` X: ${user.position.x.toFixed(2)}, Y: ${user.position.y.toFixed(2)}, Z: ${user.position.z.toFixed(2)} - R: ${user.getHeading(true).toFixed(2)}`; }); Todo Add options to disable and enable server-side log files Add options to custom style the console, mainly due to accessibility Run proper tests and clean the logic Add ability to see which file the log is coming from Add ability to be used with C bridge Bugs/Feedback Bugs should be reported currently in RAGE Discord channel to the username @Porn on private message, I appreciate any bugs being reported. If you have a feature request please do the same as mentioned above. This is currently in BETA and some stuff is still unpolished.
  2. DevMarvin

    EasyCEF

    Version 1.1.0

    119 downloads

    This resource adds a simplified system for creating HTML browsers, as well as other features such as forcing the cursor to display. Requirements RAGE Multiplayer 1.1 and above. Installing Put the folder into 'client_packages' (client_packages/easycef). Add require('easycef') to 'client_packages/index.js'. Clientside API /** * Creates Browser and pushes it into instances array with given parameters. * @param {string} browserName Browser identifier (example: "TestBrowser1"). * @param {string} browserPath Browser Path / starts from client_packages (example: "testcef/index.html"). * @param {bool} forceToCursor Forces the game to display the cursor, even if the player can disable it until the browser is destroyed again. */ mp.game.app.createBrowser(browserName, browserPath, forceToCursor); /** * Destroys Browser and removes it from instances array. * @param {string} browserName Browser identifier (example: "TestBrowser1"). */ mp.game.app.destroyBrowser(browserName); /** * Returns searched browser exists or not. (Available as of version 1.1.0) * @param {string} browserName Browser identifier (example: "TestBrowser1"). * @return {bool} True if exists, otherwise false. */ mp.game.app.browserExists(browserName); /** * Switches browser (destroys old browser and creates new one with same name). * @param {string} browserName Browser identifier (example: "TestBrowser1"). * @param {string} newPath Browser Path / starts from client_packages (example: "testcef/index.html"). * @param {bool} forceToCursor Forces the game to display the cursor, even if the player can disable it until the browser is destroyed again. */ mp.game.app.switchBrowser(browserName, newPath, forceToCursor); /** * Reloads the browser. * @param {string} browserName Browser identifier (example: "TestBrowser1"). * @param {bool} ignoreCache True to ignore cache. */ mp.game.app.reloadBrowser(browserName, ignoreCache); /** * Calls JavaScript code inside the browser. * @param {string} browserName Browser identifier (example: "TestBrowser1"). * @param {string} codeToExecute JavaScript code to be executed in browser. */ mp.game.app.executeClientFunction(browserName, codeToExecute); /** * Set cursor in a specific browser forced or unforced. * @param {string} browserName Browser identifier (example: "TestBrowser1"). * @param {bool} force True to force the cursor to be there. */ mp.game.app.setCursorForced(browserName, force); /** * Returns is the cursor forced in browser * @param {string} browserName Browser identifier (example: "TestBrowser1"). * @return {bool} True if forced, otherwise false. */ mp.game.app.isCursorForcedInBrowser(browserName); /** * Returns is a cursor forced in any browser. * @return {bool} True if any cursor is forced, otherwise false. */ mp.game.app.isAnyCursorForced(); /** * Returns the specified item. * @param {string} browserName Browser identifier (example: "TestBrowser1"). * @return {object} The function will return nothing if browser does not exist. */ mp.game.app.getBrowserObject(browserName); Notes With 'isAnyCursorForced' you can work for example by checking in your cursor keybind function if a cursor is forced in any CEF. For any error messages or questions: Feel free to write me on Discord: мαяνιη.#9554 Not all RAGE browser functions are implemented yet, should be relatively easy to add, maybe an update will come soon There is a 'better cursor' system implemented that automatically shows the cursor if there is a browser that forces it. If you want to disable it and build your own, just set 'isBetterCursorEnabled' in the file to false. If you want you can check my GitHub Repository: https://github.com/sckindvl/easycef
  3. Я пишу свой проект на TS и использую для интерфейсов VueCLI, что мне позволяет делать очень функциональные и реактивные UI. Я настроил там VueRouter для маршрутизации своих страниц. Например что бы показать планшет LSPD, я указываю следующий адрес package://cef/index.html#/faction/lspd/tablet. Если хочу показать страницу авторизации, то - package://cef/index.html#/auth/login. Как вы могли заметить, я работаю только с одним интерфейсом и одним экземпляром браузера, в котором много разных интерфейсов, для различных игровых процессов. Если я хочу показывать какие то интерфейсы, которые будут доступны из любой страницы, например чат и спидометр, то я такие компоненты размещаю в корневом компоненте Vue (App.vue). Что я видел в на форумах и в слитых игровых проектах с исходным кодом... Там обычно все пишется всё на классическом JS без каких либо препроцессоров или фреймворков, в интерфейсах встречает библиотека JQuery, кто-то конечно использовал React, что не может, не радовать. Везде каждый интерфейс в свой папке и нет никакой маршрутизации, поскольку она там не нужна. Если по какой то логике нужно показать другой интерфейс, то в существующем браузере меняю адрес, либо же, например для чата создают отдельный экземпляр и там уже отображают чат. В последних версиях RageMp вовсе сделали для браузера функцию makeAsChat, которая позволяет подменить чат сервера на ваш. Собственно со зависимые вопросы: 1. Правильное решение использовать несколько экземпляров BrowserMp для отображения различных интересов, в своём браузере? 2. Или может быть в действительности достаточно одного браузера, который откроет полноценный сайт с маршрутизацией по страницам и будет показывать нам чат, спидометр, меню игрок и другие вещи? English (interpreter)
  4. Hello, I got a simple question about the CEF. I'm trying to insert variables into the browser but I can't get it to work. Here's my code: var browser = mp.browsers.new("package://test/index.html"); browser.execute(`var playerName = ${mp.players.local.name;}; document.getElementById("name").innerText = playerName;`); After this gets executed my div only says "undefined". Any ideas why? Edit: Stupid mistake.. I just forgot to put quotation marks around the variable like borwser.execute(`var playerName = "${mp.players.local.name}"`);
×
×
  • Create New...