Welcome to nanos GbR

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more!

This message will be removed once you have signed in.


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jones

  • Rank
  1. Jones

    Precision Aiming

    Awesome, I am looking forward to it.
  2. Jones

    Precision Aiming

    I searched the forums, docs and issues and did not find anything pertaining to Precision Aim. Is this available and if not is it something planned for the future?
  3. Jones

    The server does not appear in the list of servers

    In your server config file you have the host set to "" which is the default value. Was the set to 0 to obfuscate the IP in this post, or is that how it is always set? If that is set to "host":"" try putting your server IP there.
  4. Jones

    The server does not appear in the list of servers

    The file path should be relative to the Server.exe. What you have is an absolute file path. Since the image and the server executable exist in the same folder no path is required just the file name and extension. "logo":"u2Gdmx4.png",
  5. Any suggestions on vehicle locking and disabling hijacking will be much appreciated. The game mode I am creating revolves around player classes that balance mobility with firepower. The higher firepower classes will be more dependent on a vehicle and the more mobile classes will have variations of parachute, grapple, wing suit and boost. The problem is I do not want the more mobile classes to be able to hijack vehicles from the lower mobility classes as this would become very unbalanced. I am currently binding the player.networkId to the vehicle as vehicle.ownerId on vehicle creation so that I can check ownership. However there still remains the question as what to do with the player when they do NOT belong in the vehicle or seat. I could just check to see if the player owns the vehicle on the enter vehicle event and move them out of the vehicle, but I did not see anything in the API docs that out kick a player from a vehicle. Does a method exist for this? If not, what are some potential workarounds? I have tried a couple dirty tricks like moving the hijacker to seat 1 but ran into a problem with this when the player gets into seat 1 directly. This resulted in being stuck in the passenger seat. I also tried setting the hijacker to an out of bounds index but that resulted in the hijacker sitting on top of the vehicle with the ability to turn the wheels. I did not test this with two players, only one. What is the behavior of vehicle.SetOccupant when another player is already in the seat? I do not have another test subject available to test this. If it kicks the existing player out then I suppose the easiest way to prevent hijacking would something along the lines of, jcmp.events.Add('PlayerHijackVehicle', (driver, vehicle, hijacker) => { Vehicle.SetOccupant(0, driver); }); Here are some things that would be helpful that I couldn't find turnkey solutions for in the API docs. If anyone has some work around for these it would be appreciated if you shared them. Get the number of functional seats in a vehicle. Kick a player from a vehicle. Disable option to enter if the are no open seats.
  6. Jones

    a little help

    Remove line 12 in file freeroam/events/chat.js https://gitlab.nanos.io/jc3mp-packages/freeroam/blob/master/events/chat.js On line 21 in the spawnMenu.js file you can see the event that is used to toggle those features on and off has a "silent" argument that will suppress the message. https://gitlab.nanos.io/jc3mp-packages/freeroam/blob/master/events/spawnMenu.js That event is fired within the spawnMenu module on line 22 https://gitlab.nanos.io/jc3mp-packages/spawn-menu/blob/master/main.js You could either pass the silent flag in from the spawnMenu module or code the value in the spawnMenu.js within the freeroam module. How you should do this really depends on what you are trying to accomplish.
  7. Jones

    Local Disk Key Value Database

    Instructions on how to implement this to save your freeroam ban list. I tested it on a local server with success. The interface to the key value database resembles the interface to the JavaScript Set object. The freeroam code has only a references to the ‘bans’ property which is a Set object. The has(key) method works exactly the same way as does the add command. With just a few lines of code you can shim the database as the bans Set(). freeroam\events\player.js Line 63: if (freeroam.bans.has(player.client.steamId)) { freeroam\events\chat.js Line 14: if (freeroam.bans.has(player.client.steamId)) { freeroam\commands\admin.js Line 42: freeroam.bans.add(res[0].client.steamId); The “freeroam\main.js” ,”freeroam\ package.json” and “freeroam\commands\admin.js” files are the only files you will have to modify to make your bans permanent. You may want to change the message to the player when they are banned, instructions for that are below. Package.json changes. Add the jc3mp_key_value_store dependency. { "name": "nanos-freeroam", "author": "Aaron 'aaronlad' K.", "jcmp_dependencies": [ "chat", "command-manager", "jc3mp_key_value_store" ] } Main file changes. Call the event to get the key value store service. Get a bucket called bans or ban_list, this will be the name of the database file. Change the Set object to the bucket. const keyValueDataStore = jcmp.events.Call('get_kv_db_service')[0]; const banBucket = keyValueDataStore.getBucket('bans', false); //set to sync so it can be shimmed into the bans Set global.freeroam = { commands: jcmp.events.Call('get_command_manager')[0], chat: jcmp.events.Call('get_chat')[0], config: require('./gm/config'), utils: require('./gm/utility'), colours: require('./vendor/randomColor'), workarounds: require('./gm/_workarounds'), bans: banBucket, //new Set(), THIS IS WHERE YOU SHIM THE DB BUCKET passiveModeBans: new Set(), timeManager: new (require('./gm/timeManager'))(13, 0), groupManager: new (require('./gm/groupManager'))(), poiManager: new (require('./gm/poiManager'))() }; In the admin.js @ line 42 change the add call to take a value with the steamId as the key. The below example adds the record with the value of an object with the player’s name and the reason. If the reason wasn’t provided it appended “reason not given” to the record. freeroam.bans.add(res[0].client.steamId,{name:player.escapedNametagName, reason:(reason.length > 0 ? ` Reason: ${reason}` : 'reason not given')}); If you don’t care about the extra data you can just add an empty object as the lookups for banned players only checks the key and not the value. Not having a value to the KV pair will not break anything. However adding the extra data could be helpful if you wanted to make a simple ban manager to remove a player ban. If you don’t need the extra data then you can change it to; freeroam.bans.add(res[0].client.steamId,{}); In the player.js file @ line 64 the message to the player when they are banned can be updated from freeroam.chat.send(player, 'You are banned from the server until the next server restart. You will get kicked shortly.', freeroam.config.colours.red); To freeroam.chat.send(player, 'You are banned from the server forever. Piss off!', freeroam.config.colours.red); When you shutdown or restart your server your ban list will not be lost and it will auto-magically load on server start. IMPORTANT NOTE: Ensure you have created the “data” directory in the server root directory so that the DB file can be saved. If there isn’t a data directory it will throw an error.
  8. Jones

    Local Disk Key Value Database

    Using this package, it is assumed you have a basic understanding of development with Node JS and basic programming concepts . The jc3mp_key_value_store package is a simple key value database that is written to disk backed by lowdb. It provides access to a service that can manage several sync and async key value stores or ‘buckets’ simultaneously through a single method call. It is ideal for cross session persistence where MySQL, Memcache or Redis is an overkill. Things like score boards or ban list. I have not tested this package at scale. I do believe that if it was integrated into a project using the async methods, it could potentially handle a decent amount of data. Potential Use Cases. 1.Persist player or world metadata, things like kills, deaths, visit counter. 2. Persist your ban list. 3. Dynamically create and save POIs. I use it to save POIs I find while exploring the map. 4. Persistent player made groups / factions. Code and a little documentation for the package can be found at https://github.com/DeathHeadSoup/jc3mp_key_value_store Package integration When you integrate a package with the jc3mp_key_value_store you have to create a directory called data in the server’s root directory. Demo stores a record for every player and increments a visit property on the ‘PlayerCreated’ event. You can then restart the server and when you rejoin the visit counter will be preserved. Demo https://github.com/DeathHeadSoup/jc3mp_key_value_store_demo I just learned Node JS Yesterday and this is my first Node project, so there are probably oddities. I do believe that I have almost 100% of the code covered with unit test. I do not plan on change the API, my goal was to keep it as simple as possible. I am calling it released because the only changes I plan on making will be fixes and additive changes that will not break things with an update. If you find any bugs, plain old stupidity in the code or something is not clear in the documentation you can yell at me in this thread as I will be watching it.
  9. Jones

    Greetings and Salutations

    Hello all My name is Jones. I have been lurking around the forums for a few hours now and have decided I will stick around for a while. I have been looking for a game to mod and have been debating the merits of several games. I decided I will do my tinkering with JC3MP due to use of Node JS and the CEF. I am a back end developer by trade and I have been looking for a reason to hone some JavaScript / front end design skills. I will probably start off by releasing some handy back end services that will allow other packages to proxy the UI, that way they can be reused by the mod community. Kudos to the developers for such a cool mod.