Leaderboard
Popular Content
Showing content with the highest reputation on 02/09/19 in all areas
-
Version 1.0.0
1131 downloads
This resource adds a light control menu to toggle the state of various lights in GTA V. Use /lcmenu command to access the menu. Since this is a new feature of RAGEMP, light IDs don't have names/descriptions yet. (Maybe people will document them later, who knows...) You might also want to check the screenshots for a preview of various light states. Installing Download & install the latest NativeUI if you haven't already, this script needs it Drop the lightcontrol folder to your server's client_packages Add require('lightcontrol') to client_packages/index.js All done Q: "But I still have weird lights/fog around the city buildings?" See:4 points -
In this tutorial you'll learn how to disable "vfxfogvolumeinfo.ymt", which causes the annoying ambient lights around the buildings even though there's a blackout. Step 1: Get gta5.meta Find gta5.meta and extract it to your desktop using OpenIV or CodeWalker. It is located in Grand Theft Auto V\common.rpf\data\levels\gta5. Step 2: Removal Now that we have gta5.meta, we're going to open it with our editor of choice. I'll be using Sublime Text 3. After opening the file, search for vfxfogvolumeinfo and select its entry: And remove it, should look like this now: You're all done, save the file and close your editor. Step 3: The RAGEMP Magic Touch Thanks to @ragempdev for telling me about this feature. This is the last and easiest part, now we will go to our server-files/client_packages/dlcpacks folder. If you don't have a dlcpacks folder, create it. Then take the gta5.meta file you just edited and put it in the dlcpacks folder. That's all you have to do. Notes Disabling vfxfogvolumeinfo might cause side effects, I didn't notice any but honestly, I didn't spend a lot of time testing. Downloading an updated gta5.meta for the first time may not apply its changes but it will work properly next time you join the server (after restarting GTA V). "But I never had those?" Your shader quality setting might be on normal. GTA V updates might change the contents of gta5.meta file so always repeat this process after a new GTA V update is released.3 points
-
Introduction Hello, So I have decided I should make this tutorial about how to use CEF alongside RAGEMP to make interactable UI because I have spent some time understanding it from examples without a clear tutorial, I am going to explain how to interact between the CEF browsers and RAGEMP client, and how to send/receive information from and to server. This tutorial is targeting new comers in RAGEMP but who have background in scripting and know how to run and connect their server locally. So the main points will be: 1-What is CEF 2-Sending information from CEF to RAGEMP client (and vice versa) 3-Sending information from RAGEMP to The Server (and vice versa) (I will be using C# Bridge API for working with the serverside scripting) Before we start you are going to need the following to better understand the tutorial: Basic knowledge in HTML, CSS and JavaScript (Optional – Nice to have) Bootstrap and JQuery Let’s start! What is CEF CEF is abbreviation to Chromium Embedded Framework an open source framework that allow the ability to embed HTML webpages into applications. RAGEMP already integrates the CEF so you don’t have to download anything externally to begin using it. CEF and RAGEMP Client So now we are going to learn how to create a browser inside the RAGEMP client and interact with it. I am going to teach by giving example, it is going to be a basic login/register system. First download or or create your own webpage design, If you don't know how to create a webpage just use my sample (Attached to this thread) and follow the tutorial. Start by going to RAGEMP/server-files/client_packages folder and create a new folder name it “Login” then inside the Login folder we’ve just created place the HTML,CSS and JS files that is related to the webpage inside and then create the (clientside) script we will call it “Main.js” that will be the main connecting point between the CEF browser, client and the server. NOTE: In the Login folder you are going to place the webpage files and all dependences such as Bootstrap or JQuery libraries. So to this point you should’ve something similar to this Dependences folder contains the minified JQuery and Bootstrap libraries, Links below: https://getbootstrap.com/docs/3.3/getting-started/ https://code.jquery.com/jquery-3.3.1.min.js/ So I have pre-made this simple page for the sake of this tutorial, I will link download to all of the files that I have used at the bottom of this thread. But you can go with any page design you like. Disclaimer: I am new to web development so it may not look that good but it does the job. Now we need to interact with this page, Inside the Login.html (assuming you already have made/imported a page) find the main components that you want to interact with and give them the ‘id’ attribute, in my case I need the buttons and text input elements, image below for more understanding Also notice how we referenced the “Login.js” script. We are going to use these inside our “Login.js” file, so Open the Login.js file and write the following: (Code is written using JQuery) $('#loginButton').click(() => { mp.trigger('loginInformationToServer', $('#loginUsernameText').val(), $('#loginPasswordText').val()); }); $('#registerButton').click(() => { mp.trigger('registerInformationToServer', $('#registerUsernameText').val(), $('#registerPasswordText').val()); }); So what this basically does is once the loginButton/registerButton is clicked is going to trigger (mp.trigger) an event with the given name and pass the values inside the text fields as arguments, that later we are going to catch that in our “Main.js” script. (This point is where we send information from CEF Browser to RAGEMP Client). Now that we have send the information and they are waiting to be caught, But before we do that we are going to show the browser window when a player connect to our server. Open “Main.js” and use mp.browsers.new(‘package://path’); In our case: we have the html page inside our Login folder. var loginBrowser = mp.browsers.new('package://Login/Login.html'); Now at this point when the player connects to our server this will show him our page that we’ve just made, it is still not functional yet until we catch the information that we’ve sent before. Let’s catch them now, inside the “Main.js” add the following: mp.events.add('loginInformationToServer', (username, password) => { mp.events.callRemote('OnPlayerLoginAttempt', username, password); }); mp.events.add('registerInformationToServer', (username, password) => { mp.events.callRemote('OnPlayerRegisterAttempt', username, password); }); I am not going to go into much details here on the syntax but what we are doing is catching the 'loginInformationToServer' and 'registerInformationToServer' events (like you’d do in any other client event in ragemp) and sending them directly to the server to verify the information passed. But before we forget go back to the client_packages folder and create or open the file ‘index.js’ and place require('./Login/Main.js'); to let the server know that this file contains JavaScript codes that related to RAGEMP client (mp.events.add, mp.events.callRemote and mp.browsers.new), a complete list found on ragemp wiki https://wiki.rage.mp/index.php?title=Client-side_functions RAGEMP Client and RAGEMP Server Now that we have sent the information from the CEF client to the RAGEMP client, and then to the RAGEMP server via (mp.events.callRemote) we didn’t catch the event on the server yet, so let’s go ahead and do that. It can be done in same ways but different syntax depending on which programming language you are using, I am going to be using C# because I am more familiar with but it can be easily done with JS serverside once you are familiar with scripting in it. So go ahead and inside any resource file that you are using type the following: [RemoteEvent("OnPlayerLoginAttempt")] public void OnPlayerLoginAttempt(Client player, string username, string password) { NAPI.Util.ConsoleOutput($"[Login Attempt] Username {username} | Password: {password}"); if(username == "Max" && password == "123") { player.TriggerEvent("LoginResult", 1); } else player.TriggerEvent("LoginResult", 0); } So The above code catch the event that is triggered when player sends the information to the server so we validate them then send back a response to the client with either success or fail depending on the player data, in ideal case we should check the information from a database but that’s out of the scope for this tutorial so I am just checking if his username is Max and password is 123 then we send information back to the client with result 1 (success) else we send the result of 0 (incorrect username/password) Same thing apply for the register event handle. Now you can notice a pattern here is that whenever we send an event from one place to another we need to catch it, so back to the “Main.js” and let’s handle the response sent from the server, Add the following: mp.events.add('LoginResult', (result) => { if (result == 1) { //Success we destroy the loginBrowser as we don't need it anymore loginBrowser.destroy(); mp.gui.cursor.show(false, false); mp.gui.chat.push("You have successfully logged in."); } else { //Failed we just send a message to the player saying he provided incorrect info //Here you can be creative and handle it visually in your webpage by using the (browser).execute or loginBrowser.execute in our case to execute a js code in your webpage mp.gui.chat.push('Incorrect password or username.'); } }); Similar to what we did when we caught function from CEF we did for catching from server and we checked if the value passed is 1 then the player succeeds in logging in else he fails. Now you can just run your server and connect with your client and you should see the login page appear, enter anything and hit login - it should message Then try using the combinations of Max and 123 and you should see and the window should disappear. Same practice apply to the register I will leave it for you to practice and try to implement that by yourself! Good luck! Summary Important things to remember: - From CEF browser to RAGEMP client => mp.trigger caught by mp.events.add - From RAGEMP client to RAGEMP server (C#) => mp.events.callRemote caught by [RemoteEvent()] flag and a function Now the other way around: - From RAGEMP server (C#) to RAGEMP client => (Client).TriggerEvent caught by mp.events.add - From RAGEMP client to CEF browser => (Browser).execute For more information about the syntax for these you can check the ragemp wiki NOTE: Sometimes you don’t need to send anything to the server, For example a browser that contains information about your server, you just need to contact between CEF and RAGEMP client. NOTE: Similarly if you want to use JavaScript for serverside scripting you can find the equivalent to my functions used and do the same, however everything done in clientside scripts (Main.js) should remain the same for both languages!! The End And here you’ve just completed the tutorial! Thanks for taking your time to read and if you have faced any problems or any question post a comment below and I will do my best to answer it. Also feel free to correct me if there is any suggestions or any syntax/logical errors. Happy coding! Files used in this tutorial: https://www.solidfiles.com/v/nYR8xn43j57jv1 point
-
Version 0.0.0
4190 downloads
I created this phone for a previous GTA MP Mod. I never properly finished it but it has useful features such as: Lockscreen push notifications Home button Custom phone style support Apps that open divs. Phones are stored in phones/phones/[phone-name]/ There is a JSON file that contains the needed info for the phone as well as an image for the phone. This is unfinished1 point -
1 point
-
1 point
-
Sorry to say that: but you are completely wrong. First of all to explain differences: player.position ist only a PROPERTY a property is a value in storage. You DO NOT CALCULATE IT. So only calculation on my solution you have is vector calculation. Colshape solution: You create an entire ENTITY so an Object in world and compare it to the position and delete it. - so as it sounds it IS more calculations (don't want to go in details as I do not know hjow rage.mp / gta V implemented it) Before you do not believe me, I did some performance tests and have let run both solutions 1 mio times. Just to show difference: I think the times, explains why you should use in this case only Vector calculation based on properties. In Fact you want to have events and so on, yes then colshapes should be your solution, but I think more because of it has more confort in such things // edit: I improved a bit the performance and created the colshape upfront and destroy it after all loops - in case for example in the script you want to check multiple times same position. Same for Vector solution. -> In this solution you should consider that you have all the time an entity spawned which takes also storage and performance as it is used for all colshape events. But here the numbers says still the same: //edit2: ofcause you could also write a var on entering and existing a colshape - result will be still the same, but I can not write a performance test out of that, simply because you get only the end of the process as time in your script - but still see the first edit - the time will be like that because most of the time is creating colshape and checking position - which happens also before triggering the event //edit3: What I also do not understand: why are we talking about that, also regarding of complexity for just a position check, my solution is the simplest (I know that is now a subjective opinion - but I can not see that it should be easier to handle a whole colshape instead of simply check two positions against each other)1 point
-
Version 1.9 without sql db
13546 downloads
Hello, it's my old version LSFIVEM gamemode v1.6 Detailed before: https://forum.lsfivem.com/index.php?forums/Новости.20/ Installing 1. Download archive and extract to rage:mp server folder 2. Set config mysql in packages/roleplay/mysql.js 3. Insert SQL from archive to datebase 4. Enjoy, but need do it other registration form (across web) Date Build: 26 december 2017 Good Luck.0 points -
0 points
