BLN Ultimate Elections & Voting System - RedM Script

Published on
5 mins read
--- views
BLN Ultimate Elections & Voting System - RedM Script

An immersive and feature-rich election system for your RedM server. Create election points, manage candidates, automate role assignments, and provide a seamless voting experience for your community.

📝 Description

Transform your RedM server's governance with our comprehensive election system. Create dynamic voting points anywhere in the world, manage candidates through an intuitive interface, and automate winner announcements and role assignments through Discord integration. Perfect for faction leadership elections, mayor selections, or any community voting needs.

✨ Features

Core Features

  • 📍 Create election points anywhere in the world
  • 🎯 Visual markers and blips for easy navigation
  • 🔐 Secure voting system with anti-cheat measures
  • 📊 Real-time vote counting and results
  • 🏆 Automatic winner determination

Admin Features

  • 🛠️ Intuitive admin UI for election management
  • 👥 Easy candidate management
  • ⚡ Manual election completion option
  • 📋 Real-time election monitoring
  • 🗑️ Delete or modify existing elections

Discord Integration

  • 🤖 Automatic role assignment for winners
  • 📢 Beautiful embedded result announcements with:
    • Total votes cast
    • Winner announcement with vote percentage
    • Detailed breakdown of all candidates
    • Professional formatting with medals (🥇, 🥈, 🥉)
  • 🔗 Discord user linking for candidates
  • 📈 Detailed voting statistics

Technical Features

  • 💾 MySQL database for data persistence
  • 🔄 Efficient caching system
  • 🛡️ Anti-exploitation measures
  • ⚙️ Highly configurable
  • 🎨 Customizable UI elements

Preview

Works with

✅ VORP ✅ REDEMRP(old/2023) ✅ RSG ✅QBR

🔧 Installation

  1. Download the resource
  2. Extract to your resources folder
  3. Configure your config.lua as your needs
  4. ensure bln_elections in your resources.cfg

Dependencies

⚙️ Configuration

Config = {}

Config.ResetDatabaseOnStart = false -- Set to true if you want to reset the database on resource start (for testing purposes)
Config.debug = true -- Set to true to enable debug messages

-- Admin Configuration
Config.AdminCommand = 'election' -- Base command for all election actions
Config.AdminGroups = {'admin'} -- Groups that can manage elections

-- Visual Settings
Config.Blip = {
    enabled = true,
    sprite = -272216216, -- Election blip sprite
    name = "Election Point"
}

-- Marker Settings
Config.Marker = {
    enabled = true,
    type = 0x94FDAE17, -- Marker type
    scale = vector3(1.0, 1.0, 1.0),
    color = {r = 255, g = 255, b = 255, a = 30}
}

-- Screen FX Settings
Config.screenFx = {
    enable = true,
    fx = "WheelHUDIn",
    duration = 0,
    looped = true
}

-- Prompt Settings
Config.Prompt = {
    group = "election_vote",
    key = 0xC7B5340A,
    text = "Vote Now"
}

-- Discord Settings
Config.Discord = {
    enabled = true,
    webhook = "YOUR_WEBHOOK_URL",     -- For results announcements
    botToken = "YOUR_BOT_TOKEN",      -- From bot settings
    guildId = "YOUR_GUILD_ID",        -- Server ID
    embedColor = 16766720,            -- Color for embeds
    serverName = "Your Server Name",
    footer = {
        text = "RedM Elections System",
        icon_url = "YOUR_SERVER_ICON"
    }
}

-- Gameplay Settings
Config.VoteDistance = 2.0 -- Distance to show vote prompt
Config.NotificationDuration = 4000 -- Duration for notifications in ms

-- Language
Config.Lang = {
    electionCreated = "Election point created successfully",
    alreadyVoted = "You have already voted in this election",
    voteRecorded = "Your vote has been recorded",
    invalidElection = "This election is no longer valid",
    noPermission = "You don't have permission to do this",
    electionExpired = "This election has expired",
    winnerAnnounced = "The election has concluded! Winner: %s",
    roleAssigned = "Winner role has been assigned",
    invalidCandidate = "Invalid candidate selection",
    electionEnded = "Election ended successfully",
    electionDeleted = "Election deleted successfully",
}

-- ------------------------------------------------
-- If you want to custom voter's identifier
-- ------------------------------------------------
-- Config.customIdentifier = function (source)
--     return GetPlayerIdentifier(source, 0) -- Steam ID
-- end

Discord Setup Guide

  1. Create Discord Application

  2. Configure Bot Settings

    • Enable "Server Members Intent"
    • Enable "Message Content Intent"
  3. Bot Permissions Required

    • Manage Roles
    • Send Messages
    • Embed Links
    • Read Message History
  4. Invite Bot to Your Server

    • Go to OAuth2 > URL Generator
    • Select scopes: bot
    • Select required permissions
    • Use generated URL to invite bot
  5. Configure in config.lua:

-- Discord Settings
Config.Discord = {
    enabled = true,
    webhook = "YOUR_WEBHOOK_URL",     -- For results announcements
    botToken = "YOUR_BOT_TOKEN",      -- From bot settings
    guildId = "YOUR_GUILD_ID",        -- Server ID
    embedColor = 16766720,            -- Color for embeds
    serverName = "Your Server Name",
    footer = {
        text = "RedM Elections System",
        icon_url = "YOUR_SERVER_ICON"
    }
}

Custom Voter Identifier

By default, the system uses the player's primary identifier (steam). You can customize this by adding the following to your config.lua:

-- Custom identifier function
Config.customIdentifier = function(source)
    -- Examples:
    return GetPlayerIdentifier(source, 0)  -- Steam
    -- or
    return GetPlayerIdentifier(source, 1)  -- License
    -- or your own custom logic
end

This allows you to:

  • Use different identifier types (steam, license, etc.)
  • Use character-based voting instead of account-based
  • Implement your own custom identification logic
  • Control how duplicate votes are prevented

Leave it commented as it is, to use the default logic (steam).

Credits 🙏

Created by BLN Studio

Join Our Community!

Get help, share ideas, get free scripts, and connect with other RedM enthusiasts in our Discord server.

Join Discord