Captien Posted December 6, 2017 Posted December 6, 2017 (edited) Hello Everyone, Have you ever been bothered by the notifications that is in front of the mini-map? Is it to small for people to see it? Well today I have the solution for you! Today i'll present to you the Dx-bar messages. Dx-bar messages are 2 bars on the top of your screen and the bottom of your screen. You can use them to send notifications for anybody you want and its pretty easy to use!. Source: Spoiler const maxMessages = 5; // The max messages that will show (on each bar) const DefaultTime = 8; // The max time each message will show if time isn't defined. const DefaultPos = 'top'; // Default position if not specified in calling the function. const top = []; // Top Bar const bot = []; // Bottom Bar mp.events.add('Createinfo', (msg, r, g, b, pos) => { // Event that will be global to call if (!msg) return false; // No message? No bar! if (pos == undefined) pos = DefaultPos; let data = { // Gathering Data to push to the bar text: msg, r: r, g: g, b: b, position: pos }; if (pos.toLowerCase() === 'top') { // Sending data to Top top.push(data); setTimeout(_ => { // After 8 seconds, the message will be deleted if (top.includes(data)) top.splice(top.indexOf(data), 1) }, DefaultTime * 1000) } else if (pos.toLowerCase() === 'bot') { // Sending data to bot bot.push(data) setTimeout(_ => { // After 8 seconds, the message will be deleted if (bot.includes(data)) bot.splice(bot.indexOf(data), 1) }, DefaultTime * 1000) } }) function renderbar() { if (top.length > 7) top.splice(0, 1) // if the messages are more than 7, Delete the first message. if (bot.length > 7) bot.splice(0, 1) for (let i in top) { // Top bar manager const margin = 0.01; const x = 0.5; const y = (0.03 + margin) * i; // Bar coordination management mp.game.graphics.drawRect(x, y + 0.01, 0.5, 0.040, 0, 0, 0, 200) mp.game.graphics.drawText(top[i].text, 0, [top[i].r, top[i].g, top[i].b, 185], 0.3, 0.3, false, x, y) } for (let z in bot) { // Bot bar manager const margin_ = 0.03; const x_ = 0.5; let y_ = 0.96 - margin_ * z // Bar coordination management mp.game.graphics.drawRect(x_, y_, 0.5, 0.030, 0, 0, 0, 200); mp.game.graphics.drawText(bot[z].text, 0, [bot[z].r, bot[z].g, bot[z].b, 185], 0.3, 0.3, true, x_, y_ - 0.01); } } mp.events.add('render', renderbar); // Drawing the bar on each frame event. Bar Creation: //Server-side player.call('Createinfo', '<text>', R, G, B, 'top or bot') //Client-side mp.game.call('Createinfo', '<text>', R, G, B, 'top or bot') Here is the download I wish you enjoy resource. Feel free to report any bugs. Feel free to edit, use, or copy the resource, but don't forget the credits . Thanks for watching, Best Regards, Captien Edited January 12, 2018 by Captien Improved Top bar coordination 2
Captien Posted December 6, 2017 Author Posted December 6, 2017 (edited) Well it still needs some improvements, i'll be updating it time by time to make it "Sexier". Ps: Added a Horny Gurl for Sexuality, and Improved Top bar Management. Edited December 6, 2017 by Captien 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now