Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/04/20 in all areas

  1. Version 1.0.1

    365 downloads

    Timer Bars 2 is a complete rewrite of my old Timer Bars resource. It's not backwards compatible, meaning you'll need to update your existing timerbar code if you want to switch to this resource. Changes Now requires RAGE Multiplayer 1.1.0 and above Now using offsets, sizes and logic from alexguirre's RAGENativeUI. It really is a great project and deserves some GitHub stars, check it out. OOP approach Probably a bit more efficient Definitely more pleasing to look at Clientside API You can access the API by loading timerbars into a variable: const timerBarPool = require("timerbars"); timerbars/index.js exports these functions: // Adds timerbars into the internal timerbar pool. Values sent to this function must be an instance of TimerBarBase or they'll be ignored. add(...args); // Returns whether the internal timerbar pool has specified timerbar. has(timerBar); // Removes the specified timerbar from the internal timerbar pool. If you added the same timerbar multiple times, you'll need to use this function multiple times. remove(timerBar); // Empties the internal timerbar pool. clear(); Timer Bars TimerBarBase This is the base class for other timer bar classes, not really useful on its own since it just draws the title and background. You can inherit from this class to implement your own timer bar designs. /* Constructor */ new TimerBarBase(title); /* Properties */ // Title (left text) of the timer bar. Accepts and returns a string. title // Color of the timer bar's title. Accepts HUD color IDs or RGBA array, returns RGBA array. titleColor // Highlight color of the timer bar. Accepts HUD color IDs or RGBA array. Returns null if a highlight color isn't set and RGBA array otherwise. highlightColor /* Functions */ // Calls mp.game.gxt.reset on the internal GXT entries. Should be used if you're going to stop using a timer bar completely. resetGxt() TextTimerBar This is the timer bar with a title and a text. /* Constructor */ new TextTimerBar(title, text); /* Properties */ // Inherited from TimerBarBase title titleColor highlightColor // Label (right text) of the timer bar. Accepts and returns a string. text // Color of the timer bar's label. Accepts HUD color IDs or RGBA array, returns RGBA array. textColor // Color of the timer bar's label and title, accepts HUD color IDs or RGBA array. No return value since it's just a setter. color /* Functions */ // Inherited from TimerBarBase resetGxt() PlayerTimerBar This is the timer bar with a title and a text, except the title is styled to be like GTA Online's player name display. /* Constructor */ new PlayerTimerBar(title, text); /* Properties */ // Inherited from TimerBarBase title titleColor highlightColor // Inherited from TextTimerBar text textColor color /* Functions */ // Inherited from TimerBarBase resetGxt() BarTimerBar This is the timer bar with a title and a progress bar. /* Constructor */ new BarTimerBar(title, progress); /* Properties */ // Inherited from TimerBarBase title titleColor highlightColor // Progress of the timer bar. Accepts and returns a number between 0.0 and 1.0. progress // Background color of the progress bar. Accepts HUD color IDs or RGBA array, returns RGBA array. backgroundColor // Foreground color of the progress bar. Accepts HUD color IDs or RGBA array, returns RGBA array. foregroundColor /* Functions */ // Inherited from TimerBarBase resetGxt() CheckpointTimerBar This is the timer bar with a title and a bunch of circles. /* Constructor */ new CheckpointTimerBar(title, numCheckpoints); /* Static properties */ CheckpointTimerBar.state = { inProgress: 0, completed: 1, failed: 2 }; /* Properties */ // Inherited from TimerBarBase title titleColor highlightColor // The amount of checkpoints of the timer bar. Read only, returns a number. numCheckpoints // Color of the checkpoints with the state "completed". Accepts HUD color IDs or RGBA array, returns RGBA array. color // Color of the checkpoints with the state "inProgress". Accepts HUD color IDs or RGBA array, returns RGBA array. inProgressColor // Color of the checkpoints with the state "failed". Accepts HUD color IDs or RGBA array, returns RGBA array. failedColor /* Functions */ // Inherited from TimerBarBase resetGxt() // Sets a specified checkpoint's state, checkpoint indices start from 0 and go up to numCheckpoints - 1. Refer to static properties section for newState values. setCheckpointState(index, newState); // Sets all checkpoints state of the timer bar. Refer to static properties section for newState values. setAllCheckpointsState(newState); Check the wiki for HUD colors: https://wiki.rage.mp/index.php?title=Fonts_and_Colors#HUD_Colors Example Creating the timerbars in the screenshot: const timerBarPool = require("timerbars"); const TextTimerBar = require("timerbars/classes/TextTimerBar"); const PlayerTimerBar = require("timerbars/classes/PlayerTimerBar"); const BarTimerBar = require("timerbars/classes/BarTimerBar"); const CheckpointTimerBar = require("timerbars/classes/CheckpointTimerBar"); // Set up text bars const mapTimeBar = new TextTimerBar("MAP TIME", "00:08"); mapTimeBar.textColor = [224, 50, 50, 255]; // or 6 (HUD_COLOUR_RED) mapTimeBar.highlightColor = 8; // HUD_COLOUR_REDDARK const ksBar = new TextTimerBar("KILLSTREAK", "5"); // Set up progress bar const progressBar = new BarTimerBar("CAPTURING", 0.33); // Set up checkpoint bar const checkpointBar = new CheckpointTimerBar("BASES", 5); checkpointBar.color = 18; // HUD_COLOUR_GREEN, or [114, 204, 114, 255] for (let i = 0; i < 3; i++) { checkpointBar.setCheckpointState(i, CheckpointTimerBar.state.completed); } // Set up player bars const playerBars = [ new PlayerTimerBar("3rd: PlayerName3", "9 kills"), new PlayerTimerBar("2nd: PlayerName2", "12 kills"), new PlayerTimerBar("1st: AimbotNub", "30 kills") ]; playerBars.forEach((bar, index) => { bar.color = 107 + index; }); // Bars won't be drawn until they are in the timerBarPool, so press F6 to add them mp.keys.bind(0x75 /* F6 */, false, () => { timerBarPool.add(mapTimeBar, ksBar, progressBar, checkpointBar, ...playerBars); }); // ...and press F7 to clear the timerBarPool (or remove them individually with the timerBarPool.remove function) mp.keys.bind(0x76 /* F7 */, false, () => { timerBarPool.clear(); }); // Pressing F8 toggles a loading prompt, which makes the timerbars go up a bit mp.keys.bind(0x77 /* F8 */, false, () => { mp.game.gxt.set("TB_TEST_LOADING", "Preparing next map..."); if (!mp.game.invoke("0xD422FCC5F239A915") /* BUSYSPINNER_IS_ON */) { mp.game.ui.setLoadingPromptTextEntry("TB_TEST_LOADING"); mp.game.ui.showLoadingPrompt(1); } else { mp.game.invoke("0x10D373323E5B9C0D" /* BUSYSPINNER_OFF */); } }); Source code is available on GitHub in case you don't want to download: https://github.com/root-cause/ragemp-timerbars
    4 points
  2. League 0.7a [work in progress] [Old github] [Discord] 0.7a unstable version Gamemode: league07a.zip Arenas (count: 17): arenas.zip New life of gamemode, new features: Rounds, Configurable damage, (also many options could be configured by conf.json) Statistic, new UI, Permissions, Scoreboard (Tab), Game panel (F2), Deathlog, Damage huds, Info panel, Custom chat, Winner Effect, Kill/Death Effect, Voting system, Weapon switching (by hotkeys 1, 2, 3) Admin commands: /start, /arena, /a <id|name> start arena /stop, /s - stop round /add <id|name> add a player to the round /remove <id|name> remove a player from the round /pause - pause round /unpause - unpause round /swap - Change team places (Team spawn points) Player commands: /vote <id|code> vote for arena /kill kill yourself /spec <id|name> spectate for a player Auth commands: /rcon log as root Its still alpha because I didnt test it completely, so if you find a bug push it to issues here or to discord: https://discord.gg/5RBfSc3hvE 0.7a changelog 0.7a video: 0.6a videos: 0.5.0 Screenshots: 0.5.0 Videos: 0.4.0 Screenshots: Previous versions screenshots: Ver. 0.5.0 download league 0.5.0-alpha from github Gamemode discord for any questions. Changelog (previous versions): Current changelog:
    2 points
  3. Inside your server folder, open config.json and add the following line "allow-cef-debugging": true Now head to your registry (Windows Key + R ) and type regedit and hit enter. Head to the following path: Once you're there, right click and Go New > String Value and put "launch.cefPort" as the name and Hit Enter, then right click and hit Modify and set the data to the port you'd like to use (9222 for example) and it should look the same as below Now head to your browser using the following: http://localhost:9222/ or whatever port you had entered to enable it. You'll need to quit Rage and open it back up if you enabled this while in game, and make sure you restart your server when you change the setting. Credits to @kemperrr as I used his post on Discord to make this up.
    1 point
  4. Version 1.1.0

    1885 downloads

    This resource lets you display GTA V/Online styled shard messages. Installing: Put scaleform_messages into your server's client_packages directory, then add require('scaleform_messages/index.js'); to index.js. Available events: ShowMidsizedMessage // title, message, time = 5000 ShowMidsizedShardMessage // title, message, bgColor, useDarkerShard, condensed, time = 5000 ShowWeaponPurchasedMessage // title, weaponName, weaponHash, time = 5000 ShowPlaneMessage // title, planeName, planeHash, time = 5000 ShowShardMessage // title, message, titleColor, bgColor, time = 5000 Clientside example (will show different messages when you press numpad0 - numpad6): mp.keys.bind(0x60, false, () => { mp.events.call("ShowMidsizedMessage", "Title", "ShowMidsizedMessage example"); // or: mp.game.ui.messages.showMidsized("Title", "ShowMidsizedMessage example"); }); mp.keys.bind(0x61, false, () => { mp.events.call("ShowMidsizedShardMessage", "Title", "ShowMidsizedShardMessage example", 21, false, false); // or: mp.game.ui.messages.showMidsizedShard("Title", "ShowMidsizedShardMessage example", 21, false, false); }); mp.keys.bind(0x62, false, () => { mp.events.call("ShowMidsizedShardMessage", "Title", "ShowMidsizedShardMessage example 2 (condensed = true)", 21, false, true); // or: mp.game.ui.messages.showMidsizedShard("Title", "ShowMidsizedShardMessage example 2 (condensed = true)", 21, false, true); }); mp.keys.bind(0x63, false, () => { mp.events.call("ShowWeaponPurchasedMessage", "Title", "ShowWeaponPurchasedMessage example", -2084633992); // or: mp.game.ui.messages.showWeaponPurchased("Title", "ShowWeaponPurchasedMessage example", -2084633992); }); mp.keys.bind(0x64, false, () => { mp.events.call("ShowPlaneMessage", "Title", "ShowPlaneMessage example", 788747387); // or: mp.game.ui.messages.showPlane("Title", "ShowPlaneMessage example", 788747387); }); mp.keys.bind(0x65, false, () => { mp.events.call("ShowShardMessage", "Title", "ShowShardMessage example"); // or: mp.game.ui.messages.showShard("Title", "ShowShardMessage example"); }); mp.keys.bind(0x66, false, () => { mp.events.call("ShowShardMessage", "Title", "ShowShardMessage example (colored)", 0, 11); // or: mp.game.ui.messages.showShard("Title", "ShowShardMessage example (colored)", 0, 11); }); Serverside example (will show a wasted message when you die): mp.events.add('playerDeath', (player) => { player.call("ShowShardMessage", ["~r~Wasted", "You died."]); });
    1 point
  5. Love the progress you've continued to do with this gamemode, I might try this out myself later and see how it goes.
    1 point
  6. 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.
    1 point
  7. Better way is to: npm i -g create-react-app create-react-app projectname Than doin strange things for ez projects lol
    1 point
  8. function showSpeed() { const player = mp.players.local; if (player.isSittingInAnyVehicle(true)) { let velocity = player.vehicle.getVelocity(); let speed = Math.sqrt(velocity.x * velocity.x + velocity.y * velocity.y + velocity.z * velocity.z); speed = Math.round(speed) mp.game.graphics.drawText(`Speed: ${speed}`, [0.825, 0.875], { font: 6, color: [255, 255, 255, 255], scale: [0.9, 0.9], outline: true }); } } mp.events.add('render', () => { showSpeed(); });
    1 point
  9. Hello guys. Im new at rageMP. I created a server but dont know nothing... How to install mysql, how to write commands for admin, and all that stuff. Can someone help?
    0 points
    When I press F2 I get two errors (latest version): https://gyazo.com/da4bbbb00af3edb9c964aed15923e967 https://gyazo.com/f660e1cf9c277797ceee4b1b99651cfc
    0 points
×
×
  • Create New...