Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/18/20 in all areas

  1. After i posted the link to THIS thread the 100th time now in Discord, i thought about updating it and give you guys some tips for server-sided modding in RageMP. This way you can add every file which effects the gta world (ymap, ytyp, ydr, ybn, ytd, yft, meta, etc.) First of all we're looking at what you're gonna need: A dlcpack base: I would recommend Dekurwinators because inside the .rpf he tells you where each file belongs. Although you can choose between different dlcpacks prepared for your needs https://dekurwinator-mods.bitrix24.site/dlctemplates/ Your files: For this purpose i made a quick ymap at the spawnpoint http://www.mediafire.com/file/s5s0n4v2rdgao0z/file OpenIV: Is needed to open .rpf files, visualize files like models or collisions and a lot of other stuff http://openiv.com/ Lets get started: After you downloaded everything, you can extract all files. All you need from the dlcbase is the template1 folder with the dlc.rpf file inside. Now you open the dlc.rpf via OpenIV and navigate into dlc.rpf\x64\levels\gta5\props\map_meta.rpf. This is the correct place to paste your ymap in: To paste your files in you have to click on "edit mode" (this prevents you from accidently deleting stuff) and just drop it in. You can delete custom_placement, _manifest and the files within the other folders to have a clean dlcpack (i would recommend not to delete the readme texts to know where each file belongs). Do not rename folders or files within the rpf because the paths inside are set in the content.xml and changes to the structure without the right adjustments crashes your game. Now you extract the files i uploaded for the tutorial (map1.ymap and _manifest.ymf) and drop it in. You can close OpenIV and open your Rage folder. Inside your server folder you navigate to RageMP\server-files\client_packages\game_resources\dlcpacks and paste the template1 folder with the dlc.rpf. This is all you have to do to add custom files to your RageMP Server. Now you just have to start it and look to your left to see the result: FAQ Does this work with 0.3.7 too? - No, to add files to your 0.3.7 server you have to follow Soupiests Tutorial. I have a .xml file, how do i add that? - To add .xml files you have to convert them into .ymap. I would recommend to create maps with Codewalker anyway because you can export your map directly to .ymap. Do i need to affix all files? - No, since version 1.1 affixing the files is no longer required. My game crashes while loading, what to do? - If your game crashes while loading there can be many reasons. First thing i would check is the folder structure of your dlc.rpf and compare it to the content.xml. I did everything as you told but nothing appeared ingame? - If you cant see any changes check if your dlc.rpf is in the right place (RageMP\server-files\client_packages\game_resources\dlcpacks\foldername\dlc.rpf). If you're still facing issues, feel free to describe your problem at #game-modding on the Rage:MP Discord. As i'm not working with Rage anymore, please do not contact me on Discord, thank you.
    3 points
  2. Disclaimer: If you dont know where to start, please go to: So, you got NodeJS and Visual Studio Code running? Good, let's start coding! Step 1: Files RESOURENAME is a placeholder. Name id how you want your Resource should be called, like Roleplay-Gamemode. Open Visual Studio Code in the C:/RAGEMP/server-files/packages folder. Then, create a folder named RESOURENAME (Change that). In that folder, we create a file called index.js. At that point, Visual Studio Code should look like this: Step 2: Making a base In RESOURENAME create a file called commands.js Now head to index.js and type in following: require("./commands.js"); With that statement, we tell our resource that it should load the file called commands.js. You can to that even for folders, like: require("./commands/vehicleCommand.js"); Step 3: Lets code! Javascript is a script language. That means, we don't need much constructers. Lets use that!: We want to make the simplest and most helpfull command: A /vehicle command! How we do that? Well, if you got into javascript, its not complicated. With the power of autocomplete, try to achieve following: mp.events.addCommand("vehicle", (player, vehicle) => { }); So, mp is a const. That means, its a variable that we cant change. events is a property of mp. And addCommand is a method. addCommand has the following usage: mp.events.addCommand(commandName, (player, args) => { }); commandName is self-explaining, player too. But whats args? args are our aguments. That means, we can add howmany we want. Our command above will be executed like this: /vehicle VEHICLEHASH //example: /vehicle Alpha So, got that? Lets move on! Now we want that a vehicle spawns if we use that command, todo so: mp.events.addCommand("vehicle", (player, vehicle) => { mp.vehicles.new(mp.joaat(vehicle), player.position); }); So, like before, mp is our const, vehicles is a property of mp. And new is a method. same for mp.joaat(). mp is our const, and joaat is a method that returns a number. player is a variable, and position a property. position is from type mp.Vector3. Vectors are positions in RAGEMP, and our function mp.vehicles.new has the following usage: mp.vehicles.new(model, position, options?); Whats options? ? If a variable has a ? behind, that means its optional. So you dont need to set that. Lets safe everything, and it should work! If you got questions, look at the Wiki! (https://wiki.rage.mp/index.php?title=Main_Page) Here are some usefull Wiki pages: https://wiki.rage.mp/index.php?title=Getting_Started_with_Commands https://wiki.rage.mp/index.php?title=Getting_Started_with_Client-side https://wiki.rage.mp/index.php?title=Getting_Started_with_Events Stay tuned for Part 3!
    1 point
×
×
  • Create New...