Libraries

Sign in to follow this  

25 files

  1. Inventory API

    This resource provides an inventory API to server developers.
    This resource will not save anything on its own, it just provides you the functions to make your own inventory system using CEF/NativeUI/commands.
     
    Installing
    Put the files you downloaded in their respective places Read the documentation and examples to set up some items etc. All done  
    Features
    Easy to use (hopefully!) Events Custom attributes for items (see examples)  
    Inventory API
    const invAPI = require("../inventory-api"); /** * Adds an item to the inventory system. * @param {string} key Item identifier, such as "item_medkit". * @param {string} name Item name, such as "Medkit". * @param {string} description Item description, such as "Gives you 10 health". * @param {function} [onUse] Optional - Function that gets called when the item is used. * @return {object} The added item, will be null if there are any mistakes. * @fires itemDefined */ invAPI.addItem(key, name, description, onUse); /** * Returns whether the specified key is a registered or not. * @param {string} key Item identifier, such as "item_medkit". * @return {Boolean} True if registered, false otherwise. */ invAPI.hasItem(key); /** * Returns the specified item. * @param {string} key Item identifier, such as "item_medkit". * @return {object} The item at the specified key, will be undefined if the key isn't registered. */ invAPI.getItem(key); /** * Returns all registered item identifiers. * @return {string[]} An array of registered item identifiers. */ invAPI.getAllItems(); /** * Returns the human readable name of the specified item. * @param {string} key Item identifier, such as "item_medkit". * @return {string} Human readable item name. */ invAPI.getItemName(key); /** * Returns the description of the specified item. * @param {string} key Item identifier, such as "item_medkit". * @return {string} Item's description. */ invAPI.getItemDescription(key);  
    Inventory API Events
    /** * itemDefined * This event is called when an item is added to the system with invAPI.addItem() * @param {string} key Item identifier. * @param {string} name Human readable name of the item. * @param {string} description Description of the item. */ invAPI.on("itemDefined", (key, name, description) => { // Example: console.log(`Item defined, key: ${key} | name: ${name} | description: ${description}`); }); /** * itemAdded * This event is called when a player receives an item. * @param {player} player The player who received the item. * @param {string} key Item identifier. * @param {number} amount Amount the player received. * @param {object} data Item attributes. */ invAPI.on("itemAdded", (player, key, amount, data) => { // Example: console.log(`${player.name} received ${amount}x ${key}.`); }); /** * itemUsed * This event is called when a player uses an item. * @param {player} player The player who used the item. * @param {number} invIdx Index of the item in player's inventory. * @param {string} key Item identifier. * @param {object} data Item attributes. */ invAPI.on("itemUsed", (player, invIdx, key, data) => { // Example: console.log(`${player.name} used ${key}.`); }); /** * itemRemoved * This event is called when an item is removed from a player's inventory. * @param {player} player The player who lost an item. * @param {number} invIdx Index of the item that got removed in player's inventory. * @param {string} key Item identifier. * @param {number} amount Removed item amount. * @param {object} data Item attributes. */ invAPI.on("itemRemoved", (player, invIdx, key, amount, data) => { // Example: console.log(`${player.name} lost ${amount}x ${key}.`); }); /** * itemRemovedCompletely * This event is called when an item is no longer in a player's inventory. * @param {player} player The player who lost an item. * @param {string} key Item identifier. * @param {object} data Item attributes. */ invAPI.on("itemRemovedCompletely", (player, key, data) => { // Example: console.log(`${player.name} no longer has ${key} (${data ? "with data" : "without data"}) in their inventory.`); }); /** * inventoryReplaced * This event is called when a player's inventory array gets changed by player.setInventory() * @param {player} player The player who had an inventory change. * @param {object[]} oldInventory The player's old inventory array. * @param {object[]} newInventory The player's new inventory array. */ invAPI.on("inventoryReplaced", (player, oldInventory, newInventory) => { // Example: console.log(`${player.name} had their inventory replaced. (Old item count: ${oldInventory.length}, new: ${newInventory.length})`); });  
    Player API
    /** * Returns the inventory array of the player. * @return {object[]} An array that holds all items of the player. */ player.getInventory(); /** * Replaces the inventory array of the player with the specified one. * @param {Array} newInventory An array that's going to be the new inventory of the player. * @return {Boolean} True if successful, false otherwise. * @fires inventoryReplaced */ player.setInventory(newInventory); /** * Returns whether the player has the specified item or not. * @param {string} itemKey Item identifier. * @return {Boolean} True if player has the item, false otherwise. */ player.hasItem(itemKey); /** * Same as hasItem but for items with custom attributes. * @param {string} itemKey Item identifier. * @param {object} data An object that has item attributes. * @return {Boolean} True if player has the item, false otherwise. */ player.hasItemWithData(itemKey, data); /** * Gets the item's index in the player's inventory. * @param {string} itemKey Item identifier. * @return {number} Index of the item, -1 if not found. */ player.getItemIndex(itemKey); /** * Same as getItemIndex but for items with custom attributes. * @param {string} itemKey Item identifier. * @param {object} data An object that has item attributes. * @return {number} Index of the item, -1 if not found. */ player.getItemIndexWithData(itemKey, data); /** * Gets how many of the specified item exists in the player's inventory. * @param {string} itemKey Item identifier. * @return {number} Item amount. */ player.getItemAmount(itemKey); /** * Same as getItemAmount but for items with custom attributes. * @param {string} itemKey Item identifier. * @param {object} data An object that has item attributes. * @return {number} Item amount. */ player.getItemAmountWithData(itemKey, data); /** * Gets total amount of items the player has in their inventory. * @return {number} Amount of all items. */ player.getTotalItemAmount(); /** * Gives the specified item to the player. * @param {string} itemKey Item identifier. * @param {number} amount Amount to give. * @param {object} [data] Optional - An object that has item attributes. * @return {Boolean} True if successful, false otherwise. * @fires itemAdded */ player.giveItem(itemKey, amount, data); /** * Uses the item at the specified index of the player's inventory array. * @param {number} itemIdx Index of the item in player's inventory array. * @return {Boolean} True if successful, false otherwise. * @fires itemUsed */ player.useItem(itemIdx); /** * Removes the item at the specified index of the player's inventory array. * @param {number} itemIdx Index of the item in player's inventory array. * @param {number} [amount] Optional - Amount to remove. * @return {Boolean} True if successful, false otherwise. * @fires itemRemoved * @fires itemRemovedCompletely */ player.removeItem(itemIdx, amount);  
    Examples
    Full Test Script (used during development)
    const invAPI = require("../inventory-api"); // Subscribe to some events... invAPI.on("itemDefined", (key, name, description) => { console.log(`Item defined, key: ${key} | name: ${name} | description: ${description}`); }); invAPI.on("itemAdded", (player, key, amount, data) => { console.log(`${player.name} received ${amount}x ${key}.`); }); invAPI.on("itemUsed", (player, invIdx, key, data) => { console.log(`${player.name} used ${key}.`); }); invAPI.on("itemRemoved", (player, invIdx, key, amount, data) => { console.log(`${player.name} lost ${amount}x ${key}.`); }); invAPI.on("itemRemovedCompletely", (player, key, data) => { console.log(`${player.name} no longer has ${key} (${data ? "with data" : "without data"}) in their inventory.`); }); invAPI.on("inventoryReplaced", (player, oldInventory, newInventory) => { console.log(`${player.name} had their inventory replaced. (Old item count: ${oldInventory.length}, new: ${newInventory.length})`); }); // Add some items... invAPI.addItem("item_bodyarmor", "Body Armor", "Refills your armor when used.", (player, inventoryIndex, itemKey, data) => { player.armour = 100; player.outputChatBox("Armor refilled."); player.removeItem(inventoryIndex); }); invAPI.addItem("item_firstaid", "First Aid Kit", "Gives 20 health when used.", (player, inventoryIndex, itemKey, data) => { let amountOfHealth = 20; if (data && data.hasOwnProperty("effectMultiplier")) amountOfHealth = Math.floor(amountOfHealth * data.effectMultiplier); if (player.health + amountOfHealth > 100) { player.outputChatBox("You don't need to use a first aid kit."); return; } player.health += amountOfHealth; player.outputChatBox(`Used a first aid kit for ${amountOfHealth} health.`); player.removeItem(inventoryIndex); }); invAPI.addItem("item_male_hoodie", "Hoodie (Male)", "A hoodie for freemode male model.", (player, inventoryIndex, itemKey, data) => { if (player.model !== mp.joaat("mp_m_freemode_01")) { player.outputChatBox("Can't use this item with your current model."); return; } let texture = 0; if (data && data.hasOwnProperty("texture")) texture = data.texture; player.setClothes(11, 7, texture, 2); player.outputChatBox(`Now wearing: Hoodie with texture variation ${texture}.`); player.removeItem(inventoryIndex); }); invAPI.addItem("item_copoutfit", "Police Outfit", "To protect and to serve."); invAPI.addItem("item_repairkit", "Repair Kit", "Repairs your car."); // Since item_copoutfit and item_repairkit has no onUse defined, you can give them functionality like this invAPI.on("itemUsed", (player, invIdx, key, data) => { switch (key) { case "item_copoutfit": // imaginary function here that applies the police outfit player.outputChatBox("Now wearing the police outfit."); player.removeItem(invIdx); break; case "item_repairkit": const playerVehicle = player.vehicle; if (playerVehicle) { playerVehicle.repair(); player.outputChatBox("Vehicle repaired."); player.removeItem(invIdx); } else { player.outputChatBox("You're not in a vehicle."); } break; } }); // Bunch of inventory commands const fs = require("fs"); const path = require("path"); // Do /saveinventory to save your inventory to a JSON file. (file path will be printed to console) mp.events.addCommand("saveinventory", (player) => { const saveDir = path.join(__dirname, "inventories"); if (!fs.existsSync(saveDir)) fs.mkdirSync(saveDir); const playerPath = path.join(saveDir, `${player.socialClub}.json`); fs.writeFileSync(playerPath, JSON.stringify(player.getInventory(), null, 2)); player.outputChatBox("Inventory saved."); console.log(`Player ${player.name} saved their inventory. (${playerPath})`); }); // Do /loadinventory to load your inventory from a JSON file. mp.events.addCommand("loadinventory", (player) => { const playerPath = path.join(__dirname, "inventories", `${player.socialClub}.json`); if (fs.existsSync(playerPath)) { player.setInventory(JSON.parse(fs.readFileSync(playerPath))); player.outputChatBox("Inventory loaded."); } else { player.outputChatBox("Inventory file not found."); } }); // Do /inventory to list your items in "slot | name | amount" format. mp.events.addCommand("inventory", (player) => { const inventory = player.getInventory(); player.outputChatBox("Your inventory:"); inventory.forEach((item, index) => { player.outputChatBox(`${index} | ${invAPI.getItemName(item.key)} (${item.key}) | ${item.amount}x`); }); }); // Do /giveitem [key] [amount] to give yourself an item. mp.events.addCommand("giveitem", (player, _, itemKey, amount) => { amount = Number(amount); if (player.giveItem(itemKey, amount)) { player.outputChatBox(`Added ${amount}x ${invAPI.getItemName(itemKey)} (${itemKey}) to your inventory.`); } else { player.outputChatBox("Failed to give item."); } }); // Do /useitem [slot] to use an item from your inventory. mp.events.addCommand("useitem", (player, _, itemIndex) => { itemIndex = Number(itemIndex); if (player.useItem(itemIndex)) { player.outputChatBox(`Used item at index ${itemIndex}.`); } else { player.outputChatBox("Failed to use item."); } }); // Do /removeitem [slot] [amount] to remove an item from your inventory. mp.events.addCommand("removeitem", (player, _, itemIndex, amount) => { itemIndex = Number(itemIndex); amount = Number(amount); if (player.removeItem(itemIndex, amount)) { player.outputChatBox(`Removed ${amount} of item at index ${itemIndex}.`); } else { player.outputChatBox("Failed to remove item."); } }); // Custom attribute commands // Do /betterfirstaid to give yourself a first aid kit that gives +50 health instead of the usual 20. mp.events.addCommand("betterfirstaid", (player) => { const giveItemResult = player.giveItem("item_firstaid", 1, { effectMultiplier: 2.5 }); if (giveItemResult) { player.outputChatBox("Received +50 HP first aid kit."); } else { player.outputChatBox("Failed to give item."); } }); // Do /givehoodie [texture] to give yourself a hoodie item with the variation you specified. mp.events.addCommand("givehoodie", (player, _, texture) => { const giveItemResult = player.giveItem("item_male_hoodie", 1, { texture: Number(texture) }); if (giveItemResult) { player.outputChatBox(`Received a male hoodie with texture variation ${texture}.`); } else { player.outputChatBox("Failed to give item."); } }); Source code is available on GitHub in case you don't want to download: https://github.com/root-cause/ragemp-inventory-api

    85 downloads

       (7 reviews)

    1 comment

    Submitted

  2. GTA V: Web Fonts

    Here is the .woff version of the fonts of GTA 5 i could find on their website.

    59 downloads

       (1 review)

    0 comments

    Updated

  3. Weapon Tint Sync

    This resource provides serverside weapon tint API for developers and syncs applied weapon tints.
     
    Installing
    Put the files you downloaded in their respective places Add require('weapontints') to client_packages/index.js All done  
    Serverside API
    PRO TIP: Check RAGEMP Wiki for tints.
    /** * Sets the tint of the player's specified weapon. * @param {Number} weaponHash The weapon hash. * @param {Number} tintIndex The tint index. * @throws {TypeError} If any of the arguments is not a number. */ player.setWeaponTint(weaponHash, tintIndex); /** * Gets the tint of the player's specified weapon. * @param {Number} weaponHash The weapon hash. * @returns {Number} Tint of the specified weapon. * @throws {TypeError} If weaponHash argument is not a number. */ player.getWeaponTint(weaponHash); /** * Returns an object that contains all weapon tints of the player. Key: weapon hash | Value: tint index * @returns {Object} */ player.getAllWeaponTints(); /** * Resets tints of the player's all weapons. */ player.resetAllWeaponTints();  
    Example Commands
    These are the commands I used while testing this script.
    // Example: /settint carbinerifle 3 mp.events.addCommand("settint", (player, _, weapon, tint) => { weapon = mp.joaat(`weapon_${weapon}`); tint = Number(tint); player.setWeaponTint(weapon, tint); }); // Example: /gettint carbinerifle mp.events.addCommand("gettint", (player, _, weapon) => { const weaponHash = mp.joaat(`weapon_${weapon}`); player.outputChatBox(`Tint of ${weapon}: ${player.getWeaponTint(weaponHash)}`); }); mp.events.addCommand("resettints", (player) => { player.resetAllWeaponTints(); });  
    Notes
    If there are any reproducible bugs, feel free to report them. This resource will be obsolete after 0.4's weapon attachment/customization API arrives.

    58 downloads

       (3 reviews)

    1 comment

    Submitted

  4. Weapon Component Sync

    This resource provides serverside weapon component API for developers and syncs applied weapon components.
     
    Installing
    Put the files you downloaded in their respective places Add require('weaponcomponents') to client_packages/index.js All done  
    Serverside API
    PRO TIP: Check RAGEMP Wiki or my weapon data resource for component names/hashes.
    /** * Adds the specified component to the player's specified weapon. * @param {Number} weaponHash The weapon's hash. * @param {Number} componentHash The component's hash. * @throws {TypeError} If any of the arguments is not a number. */ player.giveWeaponComponent(weaponHash, componentHash); /** * Returns whether the player's specified weapon has the specified component or not. * @param {Number} weaponHash The weapon's hash. * @param {Number} componentHash The component's hash. * @returns {Boolean} * @throws {TypeError} If any of the arguments is not a number. */ player.hasWeaponComponent(weaponHash, componentHash); /** * Returns the components of the player's specified weapon. * @param {Number} weaponHash The weapon's hash. * @returns {Number[]} An array of component hashes. * @throws {TypeError} If weaponHash argument is not a number. */ player.getWeaponComponents(weaponHash); /** * Removes the specified component from the player's specified weapon. * @param {Number} weaponHash The weapon's hash. * @param {Number} componentHash The component's hash. * @throws {TypeError} If any of the arguments is not a number. */ player.removeWeaponComponent(weaponHash, componentHash); /** * Removes all components of the player's specified weapon. * @param {Number} weaponHash The weapon's hash. * @throws {TypeError} If weaponHash argument is not a number. */ player.removeAllWeaponComponents(weaponHash); /** * Resets all components of the player's all weapons. */ player.resetAllWeaponComponents();  
    Example Commands
    1) /prosniper and /loudsniper
    Use /prosniper to get a sniper rifle with components and use /loudsniper to remove the suppressor.
    const sniperHash = mp.joaat("weapon_sniperrifle"); // Will give the player a sniper rifle and components (suppressor, advanced scope and luxury finish) mp.events.addCommand("prosniper", (player) => { player.giveWeapon(sniperHash, 9999); player.giveWeaponComponent(sniperHash, mp.joaat("COMPONENT_AT_AR_SUPP_02")); player.giveWeaponComponent(sniperHash, mp.joaat("COMPONENT_AT_SCOPE_MAX")); player.giveWeaponComponent(sniperHash, mp.joaat("COMPONENT_SNIPERRIFLE_VARMOD_LUXE")); }); // Will remove the suppressor from the player's sniper rifle mp.events.addCommand("loudsniper", (player) => { player.removeWeaponComponent(sniperHash, mp.joaat("COMPONENT_AT_AR_SUPP_02")); });  
    2) Test commands
    These are the commands I used while testing this script. 
    // /weapon is taken from freeroam gamemode mp.events.addCommand('weapon', (player, _, weaponName) => { if (weaponName.trim().length > 0) player.giveWeapon(mp.joaat(`weapon_${weaponName}`), 9999); else player.outputChatBox(`<b>Command syntax:</b> /weapon [weapon_name]`); }); // Example: /addcomp carbinerifle COMPONENT_CARBINERIFLE_CLIP_03 mp.events.addCommand("addcomp", (player, _, weapon, compName) => { player.giveWeaponComponent(mp.joaat("weapon_" + weapon), mp.joaat(compName)); }); // Example: /remcomp carbinerifle COMPONENT_CARBINERIFLE_CLIP_03 mp.events.addCommand("remcomp", (player, _, weapon, compName) => { player.removeWeaponComponent(mp.joaat("weapon_" + weapon), mp.joaat(compName)); }); // Example: /remallcomps carbinerifle mp.events.addCommand("remallcomps", (player, _, weapon) => { player.removeAllWeaponComponents(mp.joaat("weapon_" + weapon)); }); // Example: /resetcomps mp.events.addCommand("resetcomps", (player) => { player.resetAllWeaponComponents(); });  
    Notes
    Thanks to @ragempdev and @Jaimuzu for their contributions and help during the tests. If there are any reproducible bugs, feel free to report them. This resource will be obsolete after 0.4's weapon attachment/customization API arrives. JS was a mistake.

    81 downloads

       (6 reviews)

    0 comments

    Updated

  5. Efficient Attachment Sync

    Most of the server developers (ones that don't patiently wait for *something large*, though this resource is powerful enough) use their own server-side object attachments implementation that represents some large JSON with all the object and attachment information. This resource lets you cache "static attachments" in the client-side code so thanks to efficient utilization of the shared data it just uses a small shared variable to do the attachment processing without any need to create server-side objects nor send its data.
     
    For example, if you want to attach a specific object to specific ped bone with spefic bone offset and object rotation, this will only use a ~4-8 byte shared variable keeping it accurate. User-made implementations I have seen before usually take ~100 bytes per an object.
     
    API: Client-side
    mp.attachmentMngr.register(attachmentId, model, bone, offset, rotation) mp.attachmentMngr.addLocal(attachmentId) (synced!) mp.attachmentMngr.removeLocal(attachmentId) (synced!)  
    API: Server-side
    player.addAttachment(attachmentId, remove) player.hasAttachment(attachmentId)  
    Example Resource
    There's an example resource in /client-packages/epic-attachments folder. It lets you toggle attachments (there are like 30 attachments) using a NativeUI-based menu. Thanks to root for his contributions made to the example resource.
     
     
     

    297 downloads

       (7 reviews)

    0 comments

    Updated

  6. Login Window | Only HTML / CSS Design

    This is a Login window, its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    240 downloads

       (3 reviews)

    0 comments

    Updated

  7. Popup Window | Only HTML / CSS Design

    This is a Popup Window, its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    52 downloads

       (0 reviews)

    0 comments

    Updated

  8. Simple ATM | Only HTML / CSS Design

    This is a ATM Menu, its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    203 downloads

       (2 reviews)

    0 comments

    Updated

  9. Death Screen with Loading | Only HTML / CSS Design

    This is a Death-Screen Loading-Screen, its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    226 downloads

       (1 review)

    0 comments

    Updated

  10. Playerinteraction Menu | Only HTML / CSS Design

    This is a Playerinteraction Menu its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    476 downloads

       (2 reviews)

    0 comments

    Updated

  11. Inventory | Only HTML / CSS Design

    This is a Inventory, its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    265 downloads

       (0 reviews)

    0 comments

    Updated

  12. Speedometer | Only HTML / CSS Design

    This is a Speedometer, its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    288 downloads

       (2 reviews)

    0 comments

    Updated

  13. Input Window | Only HTML / CSS Design

    This is a Input Window, its only a design. maked with html and css,
    you must script it on your server.
    there are more windows for more options inside the html
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    74 downloads

       (0 reviews)

    0 comments

    Updated

  14. PayCheck - Popup | Only HTML / CSS Design

    This is a PayCheck - Popup, its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    103 downloads

       (0 reviews)

    0 comments

    Updated

  15. UI | Only HTML / CSS Design

    This is a UI for food, drink, money... its only a design. maked with html and css,
    you must script it on your server.
     
    If your Server has more than 100 registered players, than you must make a link with my rage.mp profile on your website.

    538 downloads

       (0 reviews)

    2 comments

    Updated

  16. cefManager

    A library to easier manage CEF windows.
    Creating a CEF Window
    Function is based on Promise because I need this in my own resources. Promise return a CEF window object.
    cef window name (string)
    url (string)
    parameters to exec (array) - take a look on Executing a function into a CEF Window for parameters
    cefManager.createCef(cef window name, url, parametersToExec).then(cef => {}) cefManager.createCef('hud', 'package://rage/browsers/hud/index.html').then(cef => {}) Executing a function into a CEF Window
    Again function is based on Promise but returns nothing.
    cef window name (string)
    [function name (string), args how much you need(number, string, boolean etc.)]
    cefManager.executeCef(cef window name, [function name, args]).then(() => {}) cefManager.executeCef('hud', ['console.log', mp.players.length]).then(() => {}) Checking if CEF with name exists
    cef window name (string)
    cefManager.existsCef(cef window name) const exists = cefManager.existsCef('hud') Get CEF window object
    cef window name (string)
    cefManager.getCef(cef window name) const cef = cefManager.getCef('hud') Get CEF window current URL
    cef window name (string)
    cefManager.getCurrentCefURL(cef window name) const url = cefManager.getCurrentCefURL('hud') Get CEF window URL which was set in creating CEF window
    cef window name (string)
    cefManager.getCefURL(cef window name) const url = cefManager.getCefURL('hud') Reload CEF window
    Again Promise
    cef window name (string)
    ignore cache (boolean) - true to ignore cache (Browser::reload)
    cefManager.reloadCef(cef window name, ignore cache) cefManager.reloadCef('hud', true).then(() => {})  
     
    ps. no support from me for this library, if something works bad fix it.

    64 downloads

       (0 reviews)

    0 comments

    Updated

  17. NativeUI

    NativeUI for RageMP!
    This can only be used Clientside!
    Documentation: Click
    Github: Click

    3604 downloads

       (11 reviews)

    8 comments

    Updated

  18. Synced Time Progression

    I posted this in the forum, but it is probably better suited here.
     
    This is a very simple script that gives the same time progression experience as single player mode. The source for the time is current GMT time and the calculation rolls this time into an in-game day 24 hour period that lasts 48 minutes (IRL time). Note that as the calculations are based off GMT (and not local time) all clients using this will have the same in game time (dependent on whether their computer's time and timezone is set up correctly).
     
    To use it, simply copy the file somewhere and "require" it in your client_resources script.
     
    There's nothing to configure.
     
    Known Bugs:
    Because the date is not recalculated, it continues to reflect the current real world date regardless of how many in game 24 hour periods there are within the game.

    193 downloads

       (1 review)

    0 comments

    Updated

  19. [C++] L5RP Framework

    I wish to share this framework for ragempcppsdk, that L5RP team has created while we were developing for ragemp. Using C++ for serverside
    This framework worth both on Windows and on Linux operating systems. (Haven't tested it on mac OS).
    This framework contains some additional util features which are not present in cppsdk by default:
    Callable system for parsing command/event/console input/socket input arguments. Script system, which helps developers to split the code into seperate scripts. Some utilities such as Player and Vehicle components to fully utilize script system. Threaded CURL support (Could be used to call api calls in website to load/save server data) Threaded TCP Socket support (Could be used to integrate server with 3rd party applications such as discord bot, live players map and a lot more) (Currently only works on linux) Has been designed with an possibility in mind that rage-mp could die and scripts code could be lifted to other modifications. (Of course integration layer would be needed to be developed, but the thing is that once that would be developed scripts code wouldn't need to change at all) Command and Event system. (Currently its done in a bit weird way, where each player has his own set of commands. But Its not really good time for me to go and refactor one of the core parts of the framework) A lot of small utilites that makes developer's life easier whilst developing on cppsdk. Some bugfixes which are not present in ragemp. Timer/Promise support. (Promise is the same thing as a timer, but only executes once) Threaded Console Input/Output. Console Output being done through spdlog, having different severity levels and being logged into file. Ideas for the future:
    Example gamemode utilizing functions from this framework. Support for multi-language scripts. Some kind of documentation for this framework. In order to download/review this framework please use git: https://gitlab.com/l5rp/l5rp-api
    If you have any suggestions or improvements for this framework feel free to contact me in ragemp discord or in comment section. I'll also be reviewing pull request section from time to time.

    212 downloads

       (2 reviews)

    0 comments

    Updated

  20. Voice Chat

    Hi, my realization voice chat on cef in the RAGE:MP
    Voice working by distance position (noice control), activation F8 (push and talk)
    Installing
    1. Read all .js comments and put code in your gamemode
    2. Prepare security Web Server and start peer js server, generate crt files and put with server in one folder
    3. Change all urls my web project on yours
    For peerjs server, use next package install: npm install fs peer
    P.s, i dont know would be new version that scripts, but if you want himself update and i can upload its here
    Date Build: 22 feb 2018

    636 downloads

       (5 reviews)

    0 comments

    Updated

  21. Custom chat

    This is a simple example of using a custom chat in RAGE MP.
    You can set time of hide chat from chat.js:
    hide_chat: 15000 // in milliseconds  

    820 downloads

       (3 reviews)

    0 comments

    Updated

  22. Native Menu

    Here is an open-source native menu implementation for Rage-MP. (the documentation is not ready)
    https://github.com/BlueDadjun/Native-Menu-RageMP

    308 downloads

       (2 reviews)

    0 comments

    Updated

  23. Login Window | Design

    Login Window Design 

    268 downloads

       (0 reviews)

    1 comment

    Updated

  24. camerasManager

    This is a tool for using cameras.
    ONLY CLIENTSIDE;
    Using: 
    const camerasManager = require('./camerasManager.js'); //creating camera /** @param {String} - camera name @param {String} - type camera @param {Vector3} - position @param {Vector3} - rotation @param {Number} - fov */ const kemperrr_camera = camerasManager.createCamera('kemperrr_the_best?', 'default', new mp.Vector3(0, 0, 100), new mp.Vector3(), 50); //destroy camera /** @param {Camera} - destroyed camera */ camerasManager.destroyCamera(kemperrr_camera); //get camera by name /** @param {String} camera name */ const kemperrr_camera = camerasManager.getCamera('kemperrr_the_best?'); //activate camera /** @param {Camera} - camera to activate @param {Boolean} - toggle */ camerasManager.setActiveCamera(kemperrr_camera, true); //deactivate camera /** @param {Camera} - camera to activate @param {Boolean} - toggle */ camerasManager.setActiveCamera(kemperrr_camera, false); //activate with interpolation /** @param {Camera} - camera to activate @param {Vector3} - where the camera will fly @param {Vector3} - New camera rotation @param {Number} - The time for which the camera will fly by @param {Number} - hz @param {Number} - hz */ camerasManager.setActiveCameraWithInterp(kemperrr_camera, new mp.Vector3(100, 200, 100), new mp.Vector3(0, 0, 90), 5000, 0, 0); //get gameplay camera const gameplayCamera = camerasManager.gameplayCam; mp.game.notify(JSON.stringify(gameplayCamera.getDirection())); //get current active camera const activeCamera = camerasManager.activeCamera; mp.game.notify(JSON.stringify(activeCamera.getCoord())); //events //an event is triggered when any camera starts interpolating camerasManager.on('startInterp', (camera) => { mp.game.notify(JSON.stringify(camera.getCoord())); }); //the event is triggered when any camera has completed interpolation camerasManager.on('stopInterp', (camera) => { mp.game.notify(JSON.stringify(camera.getCoord())); });

    162 downloads

       (1 review)

    0 comments

    Updated

  25. Ajcom

    Asynchronous Javascript Communication is a module to allow easy communication between server, client and CEF/browser. This module lets you call server handlers from clients (and vice versa) without dealing with adding and managing custom event handlers.
    You can easily call a handler and get your callback called as soon as everything is returned from the handler in a promise like way! Let's see how it works in action:
    // server side const ajcom = require("./ajcom") ajcom.register("getServerName", hCtx => { return mp.config.name }) // client side const ajcom = require("./[package name]/ajcom.js") mp.events.add("guiReady", () => { ajcom.callServer("getServerName").then((ctx, serverName) => { mp.gui.chat.push(`Welcome to ${serverName} ragemp server!`) }) }) That's all! Not convinced yet? See how the above code is done without ajcom:
    // server side mp.events.add("getServerName", (player) => { player.call("gotServerName", [mp.config.name]) }) // client side mp.events.add("gotServerName", (serverName) => { mp.gui.chat.push(`Welcome to ${serverName} ragemp server!`) }) mp.events.add("guiReady", () => { mp.events.callRemote("getServerName") }) See? It eases the event handling mess. But there's a lot more to ajcom. You can easily handle errors happening on handler's side or any of the callbacks, set delays and other stuff. The full documentation is available here
    Please post your questions and issues to the forum post
    Github repo

    61 downloads

       (2 reviews)

    1 comment

    Updated

Sign in to follow this