Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/28/18 in Posts

  1. Hey there, I had quite a headache trying to figure this out so I figured I'd make a tutorial to help other people. Tools required OpenIV — http://openiv.com/ ArchiveFix —http://gtaforums.com/topic/871168-affix-fix-your-rpf-archives-and-work-without-openiv/ Initialising ArchiveFix Firstly you'll want to fetch the keys for ArchiveFix (afix) to do so download and unpack the ArchiveFix package. Open Command Prompt and type (replace with where you unpacked ArchiveFix) cd E:\ArchiveFix then open GTA 5 and let it sit on the loading screens, return to your command prompt and enter archivefix.exe fetch this may take some time to fetch the encryption keys, as it depends on your CPU power. Just be patient and let it do its job. After you've successfully acquired all the encryption keys, we can move on. Afixing and using Add-on vehicles We'll start by finding a modification from here: https://www.gta5-mods.com/vehicles/tags/add-on Once you have found your modification of choice (I'll be using this: https://www.gta5-mods.com/vehicles/mazda-rx7-c-west) Inside the archive (/Add-on/) there is a file called readme.txt — inside it references the modification as <item>dlcpacks:\rx7cwest\</item> So we won't append dlc_* to our folder name. Navigate to your ArchiveFix root directory and create a new folder with the name of the modification (rx7cwest) and inside create the following folders: "oldrpf", "newrpf" and "unpack" Move the dlc.rpf from the downloaded mods archive to the newly created "oldrpf" folder. Using OpenIV navigate to the /rx7cwest/ folder inside our ArchiveFix root, making sure you're in EDIT MODE right click the dlc.rpf and 'Save Contents/Export' select the /unpack/ folder we just created. Navigate inside /unpack/ copy all the unpacked folders into /newrpf/. Drag and drop any subsequent *.rpf files inside /newrpf/ onto ArchiveFix.exe Using OpenIV create a new dlc.rpf file inside /newrpf/ and drag all the afixed files from inside /newrpf/ (make sure you don't copy the new dlc.rpf file) into the dlc.rpf inside OpenIV Drag the new dlc.rpf file onto ArchiveFix.exe to encrypt it Create a new folder inside RageMP's /server-files/client_packages/dlcpacks/ called /rx7cwest/ (remember the actual add-on's name dictates the name of this folder) and drag the new dlc.rpf inside. Making use of the new mod Start your server, and connect to it you will download the new /dlcpacks/ files, and then once it reconnects automatically close the game. Reconnect to the server and spawn the new vehicle by typing the hashname (if you're not sure, you can check the setup2.xml file inside dlc.rpf) in this case it is "rx7cwest" Credits nobodyltu Lokote1998 Splak George
    1 point
  2. got the answer finally so you to do this for example : inside "functions.js" --> function myfunc(a,b){ return a*b; } module.exports = { myfunc : myfunc, } inside the other .js file --> tempJS = require('"path to functions.js"/functions.js'); FUNC = tempJS.myfunc; now FUNC is the same as myfunc .. but still , if you guys have a better idea of how to do it , share it plZ ..
    1 point
  3. Well, I was just trying to do the same thing, so here's what I just did. Copy this script in a new file and save it in your package with the name of "player_blips.js". //Initialize a object that will hold all blips of every player //We will use IDs to find out who is the owner of a blip var blips = {}; //Icon show in the minimap for the players const BlipIcon = 1; //A simple circle //Color for the icon const BlipColor = 4; //Light gray /* For a list of blip icons and colors just look at: https://wiki.rage.mp/index.php?title=Blips */ //Called when a player spawns mp.events.add('playerSpawn', (player) => { //Create a new blip for that player //using its ID for reference blips[player.id] = mp.blips.new(BlipIcon, player.position); blips[player.id].name = player.name; blips[player.id].dimension = player.dimension; blips[player.id].colour = BlipColor; }); //When a player have a bad luck of dying... mp.events.add('playerDeath', (player, reason, killer) => { //Destroy the blip of that player if it exists if (blips[player.id]) { blips[player.id].destroy(); } }); //When the player leaves the server... mp.events.add('playerQuit', (player, exitType, reason) => { //Destroy his/her blip if it exists if (blips[player.id]) { blips[player.id].destroy(); } }); //Update blip positions based on the positions of the players function UpdateBlipPositions() { //For every player... mp.players.forEach( (player, id) => { //Check if his/her blip exists and if they are alive... if (blips[player.id] && player.health > 0) { //And update the blip position blips[player.id].position = player.position; //Quick note: The 'player.health > 0' was necessary //because if we dont do that the server just crashes. //Looks like we can't get player position if he/she is dead. } }); } //Calls the update function every second setInterval(function(){ UpdateBlipPositions(); }, 1000); Then, in your main script (like index.js) add the following line in the top: require('./player_blips'); I haven't tested it with more than 1 player, but it should work just fine. If anything nasty happens, just PM me.
    1 point
×
×
  • Create New...