Search the Community

Showing results for tags 'Javascript'.



More search options

  • 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 37 results

  1. HankSteiner

    Save Data Client side

    Hey Guys, So i want to create a autologin option in my login-form by saving username and pass in a file by javascript. My Question: is where can i save Data that stays after the User left the Server? i know i can use the Node.js Filesystem Module but before i try i ask the community. my Form: Thanks! Hank
  2. Hi, guys! I have one question. I would like to enable a language Typescript for my client-side. How I can do it? Wiki page don't help me: https://wiki.rage.mp/index.php?title=Using_Typescript (because there is an instruction for setting up vscode, but I want to use this language in my developed) Thanks for the answer!
  3. Доброго времени суток. Хочу представить пример парсинга мастер-листа и получения информации о вашем сервере. Скриншот: Код на PHP: $ip = '91.76.227.40'; // Ip адрес сервера $port = 22005; // Port сервера $ch = curl_init('https://ml.rage.mp/servers'); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); $resp = curl_exec( $ch ); curl_close( $ch ); $resp = json_decode($resp , true); foreach($resp as $val) { if($val['ip'] == $ip and $val['port'] == $port) { echo 'PHP<hr>Id: '.$val['_id']; echo '<br>Название: '.$val['name']; echo '<br>Слотов: '.$val['slots']; echo '<br>Игроков: '.$val['players']; echo '<br>Uptime: '.$val['uptime']; break; } } Код на JavaScript: var ip = '91.76.227.40', // Ip адрес сервера port = 22005; // Port сервера $.getJSON('https://ml.rage.mp/servers', function(data) { $.each(data, function(key, val) { if(ip == val.ip && port == val.port) { document.write('JavaScript<hr>Id: '+val._id); document.write('<br>Название: '+val.name); document.write('<br>Слотов: '+val.slots); document.write('<br>Игроков: '+val.players); document.write('<br>Uptime: '+val.uptime); return false; } }); }); Библиотека JQuery обязательна!
  4. ItzMartriX

    Requesting C# Events in Javascript

    Hello, i downloaded this character creator by @rootcause and its pretty insane but i have the following question: I dont want it by a command like here with "/creator", i need an Event that i can call in C#. for ex. like : SendPlayerToCreator(player); or smth like that Is that possible?
  5. unkaid

    [JS, CEF] Internet Radio

    Version 1.0.1

    85 downloads

    Internet radio over colshapes using CEF. Scope of application: custom clubs, interiors. Default location is the Galileo Observatory (behind the monument). Default radio station - Wacken Radio (DE). Installation: I. Put server files to: server-files\packages\yourGameMode II. Add require('./rStreamColshapes'); to your server's index.js III. Put client files to: client_packages then edit your client's index.js and add require('./rStream'); To change radio stream url, edit index.html here: client_packages\cef\rStream\index.html GitHub
  6. HankSteiner

    Event parameter :S

    ok simple, what am i doing wrong? Yes I am new to JS: Serverside: mp.events.add('testEvent',(para1,para2,para3) => { console.log('para1:'+para1); console.log('para2:'+para2); console.log('para3:'+para3); }); Clientside: mp.events.callRemote('testEvent',1,2,3); Console: para1:[object Object] para2:1 para3:2 thanks for help! Hank edit: discovered https://wiki.rage.mp/index.php?title=Getting_Started_with_Events
  7. Hi guys! Please tell me how to know. Can I start server-side development in C#? And in parallel to develop the client-side in JavaScript language? I want to use 2 languages simultaneously for development. Each side has its own. How can I implement this?
  8. Всем привет! Пожалуйста, подскажите кто знает. Могу ли я начать разработку на стороне сервера на языке C#? И параллельно разрабатывать клиент на языке JavaScript? Я хочу использовать одновременно 2 языка для разработки. На каждой стороне свой. Как я могу это реализовать?
  9. pandov

    Client-side JS does not start

    Hey guys! Originally wrote the code on the client in C#. Unfortunately it does not support some of the features that I need. Therefore, I decided to transfer the client's side to the language of JS. But the problem arose at the very beginning of the journey. I opened the tutorial (https://wiki.rage.mp/index.php?title=Getting_Started_with_Client-side) and did everything as written there. Then I started the server and joined it and I realized that nothing works. Based on the lesson materials, I have to get a chat message. But nothing works. I would like to appeal to the multiplayer community. Can you help me solve this problem?
  10. HelllBladePlay

    [help] unbind default gta keys

    I bind my action to the number buttons. mp.keys.bind(0x31, true, function() { mp.events.callRemote('myAction') }) is it possible to disable the gta weapons selector?
  11. unkaid

    Realtime Weather

    Version 1.0.0

    98 downloads

    Server-sided script, that getting a real weather hourly and sets it in the gta 5 world. HowTo: I. Install getJSON: npm install get-json --save II. Go to https://developer.accuweather.com/ and register as the Developer. III. To get your new API key, create your WeatherAPP here, https://developer.accuweather.com/user/me/apps On the question: "What programming language is your APP written in?" Answer will be: JavaScript. IV. Go to https://www.accuweather.com/ and find your preferred location on the map or by the search field, for example: Moscow, Russia. To set more accurate location to your preferred, click on the nearest point on the map, for me it is Yakimanka, then click on 'Hourly". V. The URL will look like this: https://www.accuweather.com/en/ru/yakimanka/2515350/hourly-weather-forecast/2515350 Well, 2515350 is the Location Key that we will use further. VI. Let's assemble your AccuWeather URL: http://dataservice.accuweather.com/forecasts/v1/hourly/1hour/YOUR_LOCATION_KEY?apikey=YOUR_API_KEY VII. Paste new AccuWeather URL into the script and save it. Warning! The Trial Version of AccuWeather is limited for 50 requests per day. GitHub
  12. unkaid

    [JS] Regional Restrictions

    Version 1.0.0

    26 downloads

    Simple solution to check incoming connections from unwanted countries. I. Install geoip-Lite: npm i geoip-lite II. Edit country_ban list with the specified country codes https://dev.maxmind.com/geoip/legacy/codes/iso3166/ III. Save and put this script to "server-files\packages" and add require('./countryBan'); in index.js
  13. This occurs due to player stamina hitting zero, resulting in hp being lost. Below is the workaround for this in both C# and JavaScript. C# //Subscribe the Tick event Events.Tick += Tick; public void Tick(List<Events.TickNametagData> nametags) { RAGE.Game.Player.RestorePlayerStamina(1.0F); } JavaScript mp.events.add('render', () => { mp.game.player.restoreStamina(100); });
  14. I'm thinking which language should I use to make a server. Which is more supported for RageMP? Which would u recommend to start and why? I have learned both so the knowledge wouldn't be a problem.
  15. SnakeWiz

    [JS] Basic Clothes Menu

    Version 1.0.0

    373 downloads

    Simple cloth menu, you can open it by pressing F2. This script requires NativeUI library, download it from the resources tab. It's my first resource, do not expect too much. https://github.com/Snakewiz/ClothesMenu
  16. BySarG

    Js Resource

    Hi everyone! I have a custom.js on my server-files/bridge/resources/custom folder. My meta.xml look like this: <meta> <info name="custom" type="script" /> <script src="custom.js" /> </meta> My custom.js: console.log("works"); But i cant see the console.log in my console after exectue the file server.exe. My console returns: [N] Starting network... - OK: (IPv4-only) at 127.0.0.1:22005 (node:12532) ExperimentalWarning: The ESM module loader is experimental. [M] Announcing into master server... Loading packages Initializing bridge (0.3.7.0).. This is not a published, standalone application and we are unable to locate the .NET Core SDK. Please make sure that it is installed; see http://microsoft.com/net/core for more details. Initializing Bootstrapper.dll (0.3.7.0).. -> SERVER STARTED AT 17/01/2019 15:03:56 ACLEnabled: True Loaded 451 entries from vehicleData.json Loading resources.. -> Starting custom resource.. custom: loading scripts.. found 1 script(s) -> Resource custom started! -> Starting admin resource.. admin: loading scripts.. found 1 script(s) [M] Connected to master list. admin: compiling scripts.. admin: instantiating Main.AdminScript.. admin: loading server events.. found 2 server event(s) admin: loaded 2 server events(s) admin: loading commands.. found 9 command(s) admin: loaded 9 commands(s) -> Resource admin started! -> Starting welcomemessages resource.. welcomemessages: loading scripts.. found 1 script(s) welcomemessages: compiling scripts.. welcomemessages: instantiating WelcomeMessages.. welcomemessages: loading server events.. found 2 server event(s) welcomemessages: loaded 2 server events(s) -> Resource welcomemessages started! Started! Waiting for connections.. [P] Plugin bridge.dll loaded! Started HTTP server at 22006 port. Any ideas? Thanks!
  17. Hi everyone! In need of a custom script for a Custom NameTag, I found the @hartority script, however, it was an outdated project and it had been made for version 0.2 of RageMP, with some references already removed, well, I bring you today the corrected code. Requirements: RageMP server files. Nothing more! Just have fun. Introduction: This script is a reliable edition of the one produced by @hartority with only a few references to the RageMP library, so all code is credit @hartority. Let's start: 1. Go to "client_packages" folder in "RAGEMP/server-files" directory, usually: 2. Create a JavaScript archive (.js) named "customtag.js", example: 3. Inside the "customtag.js" paste this code: 4. Save "customtag.js" file, and open "index.js" in "C:\RAGEMP\server-files\client_packages" directory and put this: End! Just test it and tell me if something goes wrong Usage example: The original code topic of @hartority: Thanks for all feedbacks, mad thanks @hartority for your commitment if you do not authorize this topic, please let me know
  18. Can you guys add the HAS_PED_BEEN_DAMAGED_BY_WEAPON native as a javascript function like those in Client-side functions? For some reason calling this native (hash 0x2D343D2219CD027A) using mp.game.invoke seems to not work at all. It was supposed to return true/false but instead it just returns the second parameter passed to the invoke() function.
  19. Ребят, хелпаните пожалуйста. Нужно создать таблицу id|Nickname|Убийства|Смерти. Как создать событие, которое бы передавало значение в поле ''Убийства''/''Смерти''? Возможно ли упорядочить игроков в таблице по кол-ву убийств? К примеру, на первом месте игрок с самым большем кол-вом убийств, а на последнем с самым маленьким. Как передать значения ''Убийства''/''Смерти'' в MySQL базу данных? HTML таблицы: <!-- Online players --> <div id="online_players" style="display: none;"> <h1>Online players</h1> <table id="online_players_table"> <thead> <tr> <th class="id">ID</th> <th class="name">Name</th> <th class="kills" id="kills">Kills</th> <th class="death" id="death">death</th> </tr> </thead> <tbody> </tbody> </table> </div> javascript таблицы: let centered = false; // Show players online. document.addEventListener('keydown', function(e) { if ((e.key === 'z' || e.keyCode === 90) && !chatActive) { if (!centered) { $('#online_players').css('top', Math.max(0, (($(window).height() - $('#online_players').outerHeight()) / 2) + $(window).scrollTop()) + 'px'); $('#online_players').css('left', Math.max(0, (($(window).width() - $('#online_players').outerWidth()) / 2) + $(window).scrollLeft()) + 'px'); centered = true; } $('#online_players').css('display', 'block'); } }); function addPlayerInTheTable(id, name, kill, death) { let text = ` <tr id="player-${id}"> <td class="id">${id}</td> <td class="name">${name}</td> <td class="kill" id="kill">fh</td> <td class="death">${death}</td> </tr>`; $("#kill").text(`fedffdxvb`); // (${kills}).text(`1`); let formated = text.replace(/\n/g, '').replace(/"/g, '"'); $('#online_players #online_players_table tbody').append(text);
  20. Hi, here is a simple SQL auth system. Made with UI from @MarkCavalli ! Connection by email / password.. Nothing much to say You can use it if you are beginner or not. Here is github: https://github.com/Protocole63/RageMPAuthSystem Cya PS: if you want to go further in a RP script, see MarkCavalli GM:
  21. Проблема такова, когда игрок садится на скутер, вызывается окно аренды (|Арендовать | Отмена|), после нажатия на кнопку ''Арендовать'' у него должно списаться 100$, но проблема в том, что после того как он садится на этот же скутер еще раз, сумма снятия становится на 100$ больше. То есть 1-й раз снимает 100$, 2-й раз снимает 200$, 3-й раз снимает 300$ и т.д. Как сделать, так чтобы снималась конкретно установленная сумма (100$), и чтобы после нажатия на кнопку ''Арендовать'' при повторной посадке на арендованный скутер окно аренды не вызывалось? HTML окна аренды: <!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="css/style.css" type="text/css"/> <title>Title</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script type="text/javascript" src="js/arenda.js"> </script> </head> <body> <div class="container" id="container"> <form> <h3>Аренда данного транспорта стоит 100$</h3> <input type="button" class="testbutton" id="rent" onclick= "mp.trigger('playerClickRent');" value="Арендовать"/> <input type="button" class="testbutton" id="otmena" name="otmena" onclick = "$('.container').hide()" value="Отмена"/> </form> </div> <script> $("#rent").click(function() { $('#container').fadeOut("slow", function() { }); }); </script> </body> </html> JavaScript, который принимает событие клика по кнопке ''Арендовать'' на Client-Side: function playerEnterVehicleHandler(vehicle, seat) { const vehicleID = vehicle.id; if (vehicleID == 9){ mp.browsers.new('package://freeroam/arenda/arenda.html'); mp.gui.cursor.visible = true; mp.events.add("playerClickRent", () => { mp.events.callRemote("rent");//отправляет данные на сервер }); }; }; mp.events.add("playerEnterVehicle", playerEnterVehicleHandler); JavaScript, который принимает событие клика по кнопке "Арендовать" на Server-Side: mp.events.add('rent', (player) => { console.log(`нажал кнопку Арендовать`); player.outputChatBox(`${player.name}"арендовал скутер"`); if (player.data.customMoney >= 100){ player.data.customMoney -= 100;} else { player.removeFromVehicle() player.outputChatBox("Недостаточно средств")}; });
  22. Проблема такова, когда игрок садится на скутер, вызывается окно аренды (|Арендовать | Отмена|), после нажатия на кнопку ''Арендовать'' у него должно списаться 100$, но проблема в том, что после того как он садится на этот же скутер еще раз, сумма снятия становится на 100$ больше. То есть 1-й раз снимает 100$, 2-й раз снимает 200$, 3-й раз снимает 300$ и т.д. Как сделать, так чтобы снималась конкретно установленная сумма (100$), и чтобы после нажатия на кнопку ''Арендовать'' при повторной посадке на арендованный скутер окно аренды не вызывалось? HTML окна аренды: <!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="css/style.css" type="text/css"/> <title>Title</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script type="text/javascript" src="js/arenda.js"> </script> </head> <body> <div class="container" id="container"> <form> <h3>Аренда данного транспорта стоит 100$</h3> <input type="button" class="testbutton" id="rent" onclick= "mp.trigger('playerClickRent');" value="Арендовать"/> <input type="button" class="testbutton" id="otmena" name="otmena" onclick = "$('.container').hide()" value="Отмена"/> </form> </div> <script> $("#rent").click(function() { $('#container').fadeOut("slow", function() { }); }); </script> </body> </html> JavaScript, который принимает событие клика по кнопке ''Арендовать'' на Client-Side: function playerEnterVehicleHandler(vehicle, seat) { const vehicleID = vehicle.id; if (vehicleID == 9){ mp.browsers.new('package://freeroam/arenda/arenda.html'); mp.gui.cursor.visible = true; mp.events.add("playerClickRent", () => { mp.events.callRemote("rent");//отправляет данные на сервер }); }; }; mp.events.add("playerEnterVehicle", playerEnterVehicleHandler); JavaScript, который принимает событие клика по кнопке "Арендовать" на Server-Side: mp.events.add('rent', (player) => { console.log(`нажал кнопку Арендовать`); player.outputChatBox(`${player.name}"арендовал скутер"`); if (player.data.customMoney >= 100){ player.data.customMoney -= 100;} else { player.removeFromVehicle() player.outputChatBox("Недостаточно средств")}; });
  23. Нужно ввести команду от лица игрока автоматически, во время какого-то ивента. К примеру -Когда игрок вводит команду /arrest 228, чтобы сразу же после этой команды вводилась команда /me надел наручники на преступника. -Или к примеру при нажатии в nativeui на кнопку ''Арендовать'' вводилась автоматически команда /arenda. Можно ли это как-то реализовать? просто инфы на Вики и форуме не нашел.
  24. Зашел на вики и увидел что для JavaScript есть только функции и евенты на Server-side. А для C# есть и для Server-side, и для Client-side. То есть, я правильно понял, что на JS можно написать ТОЛЬКО Server-side, а на C# можно и клиентскую сторону и серверную? И могу ли я совмещать C# и JS?
  25. Hello, I have one suggestion for team RageMP, please create extension for Microsoft Visual Studio Code. When I write scripts, I have to look at api constantly. Please, consider my suggestion