Brew Telegram: A feature rich telegram system

Brew Telegram offers a complete solution with station, company numbers and more.

This script is only for VORP Framework!

Features

  • Automatic generation of your telegram number
  • Company numbers can be configured, after that the company employees can use the company number to send and receive messages.
  • YOU CAN! configure citylabels so that telegrams need to be sended with Citylabel + Number
  • Get a telegram message as item
  • Telegrams as paper can be torn by a button to delete the item
  • Send bulk messages to multiple players
  • Have a addressbook with a note system that you see in the send message dropdown menu when selecting a contact
  • Configure stations to be job locked for private station for sheriffs for example

Events

Here you can find events that you can listen for to make specific actions when a recipe is crafted or failed.

--Client Events

("brew_telegram:openStation", cityLabel)
 -- This event is triggered when a recipe is failed.
 -- Parameters:
 -- cityLabel: string -- The citylabel of the station


Exports

With this export you can open a specific station from the client side. This allows you to create your own opening methods for a telegram station.

--Client Seitig
exports.brew_telegram:openStation(cityLabel)

Translation

To translate the telegram system, you need to adjust the language settings in the config.lua and the scripts.js file. Also there are some values you need to adjust in the index.html to fully translate the system.

Citylabels what are they? and how to use them?

The citylabels are used to send the telegrams to the correct station. If you dont want to use citylabels, you can disable it in the config.lua and in the scripts.js file. When you enable the citylabels, you need to add the citylabels in front of the number in the telegram station.

Example:

SD1232

This will send the telegram to the station with the citylabel SD. And the user with the number 1232 will receive the telegram. He only can see this telegram at stations with the citylabel SD.

You can configure the citylabels in the config.lua file.

Change the telegram year

You can change the year of the telegram in the scripts.js file. Go into the html folder and open the scripts.js file.

There you find the editYear variable.

const editYear = 1881;

This sets the year of the telegram.

Script configuration

Config = {}

Config.PromptKey = 0xB2F377E8         	-- F // Check docs.landminentester.de for more information about prompt keys
Config.PromptRange = 2.0				-- This is the range of the prompt


Config.Debug = true

-- This sets if the address book is used, if true then you need the book to see the adressbook tab.
--The book itself doesnt hold any data its just the requirement to see the adressbook.
Config.useAddressbookItem = false     

Config.addressbookItem = "adressbook" -- This is the item that will be used to check for

-- This is the command that will be used to change the number of a player
Config.changeNumberCommand = "changeNumber" 

-- This sets if the telegrams stations (citylabels) are seperate or every station got the same messages so global message pool
Config.UseCitys = false               

--Citylabel and and company number are not allowed to be the same
Config.CompanyNumbers = {
	["sdwoodworker"] = { number = "SDWOOD", grade = 2 }, -- This is an example of how to add a company number to a job
	["gov"] = { number = "GOV", grade = 1 }, -- This is an example of how to add a company number to a job
}

--Reserve Number spaces for players to set manual numbers
Config.ReservedNumbers = {
	{ startRange = 1, endRange = 100 }, -- This is an example of how to reserve a range of numbers
	{ startRange = 150, endRange = 600 }, -- This is an example of how to reserve a range of numbers
}

-- Here you can write cityLabels and their costs
Config.TelegramCost = {
    -- [CITYLABEL] = COST
	["DEFAULT"] = 0.25, -- This is the default cost of the telegram
	["SD"] = 0.45,
	["VA"] = 0.15,
}

-- This is the list of city labels that will be used for the telegrams stations
Config.CityLabels = { "SD", "VA", "AN", "RH", "SB", "BW", "AR", "TW", "EM", "VH" } 

 -- This is the item that will be used for the telegram paper
Config.telegramPaperItem = "telegram"      

-- This is the item that will be used for the paper
Config.paperItem = "paper"                                                                                                                                           

Config.AutomaticProps = { -- Add props that get Auto generated by the script
	["p_mailbox01x"] = {
		prop = "p_mailbox01x", --Set the prop that will be used for the telegram station
		cityLabel = "SD", --Set the city label of the telegram station
		label = "Mailbox", --Set the label of the telegram station
	},
}


Config.TelegramStations = {
	{
		label = "DOJ Telegram",                          -- This is the label of the telegram station
		cityLabel = "SD",                                -- This is the city label of the telegram station
		jobLock = {
			{ job = "gov", grade = 1 },                  -- This is an example of how to add a job to the job lock
			{ job = "doj", grade = 1 },                  -- This is an example of how to add a job to the job lock
		},

        -- This feature sets this station as checker station where you can enter a telegram numbe and company number to see the station like the entered values
		checkerStation = true,                            
        
        coords = { 2597.0249, -1311.1094, 52.8264, 195.8145 }, -- This is the coords of the telegram station
		npc = {                                          --Optional NPC for the telegram station
			model = "re_kidnappedvictim_females_01",
			displayRange = 25.0,
			x = -177.8109,
			y = 628.6130,
			z = 113.0896,
			h = 148.5947,
		},
		object = {                                                               --Spawn object at the station
			model = "p_mailbox01x",                                              -- Model of the object
			coords = vector3(-190.56060791015625, 631.3736572265625, 112.69080352783203), -- Location of the object
			rotation = vector3(0, 0, 52.17405319213867),                         -- Rotation of the object
			range = 5.0,
		},
		blipSettings = {
			name = "DOJ Telegram",
			sprite = "blip_ambient_tithing",
			color = "PINKISH"
		}
	},
}

Here you can find a list of all the prompt keys:

Prompt keys

You can adjust the prompt key in the config file.

Config.PromptKey = 0xB2F377E8 -- F

Here you can find a list of all the prompt keys:

Source: https://forum.cfx.re/t/keybind-hashes/1666877/3

keys = {
    -- Letters

    ["A"] = 0x7065027D, ["B"] = 0x4CC0E2FE, ["C"] = 0x9959A6F0, ["D"] = 0xB4E465B4, ["E"] = 0xCEFD9220, ["F"] = 0xB2F377E8,
    ["G"] = 0x760A9C6F, ["H"] = 0x24978A28, ["I"] = 0xC1989F95, ["J"] = 0xF3830D8E, ["K"] = Missing, ["L"] = 0x80F28E95,
    ["M"] = 0xE31C6A41, ["N"] = 0x4BC9DABB (Push to talk key), ["O"] = 0xF1301666, ["P"] = 0xD82E0BD2, ["Q"] = 0xDE794E3E,
    ["R"] = 0xE30CD707, ["S"] = 0xD27782E3, ["T"] = Missing, ["U"] = 0xD8F73058, ["V"] = 0x7F8D09B8, ["W"] = 0x8FD015D8,
    ["X"] = 0x8CC9CD42, ["Y"] = Missing, ["Z"] = 0x26E9DC00

    -- Symbol Keys

    ["RIGHTBRACKET"] = 0xA5BDCD3C, ["LEFTBRACKET"] = 0x430593AA

    -- Mouse buttons

    ["MOUSE1"] = 0x07CE1E61, ["MOUSE2"] = 0xF84FA74F, ["MOUSE3"] = 0xCEE12B50, ["MWUP"] = 0x3076E97C

    -- Modifier Keys

    ["CTRL"] = 0xDB096B85, ["TAB"] = 0xB238FE0B, ["SHIFT"] = 0x8FFC75D6, ["SPACEBAR"] = 0xD9D0E1C0, ["ENTER"] = 0xC7B5340A,
    ["BACKSPACE"] = 0x156F7119, ["LALT"] = 0x8AAA0AD4, ["DEL"] = 0x4AF4D473, ["PGUP"] = 0x446258B6, ["PGDN"] = 0x3C3DD371,

    -- Function Keys

    ["F1"] = 0xA8E3F467, ["F4"] = 0x1F6D95E5, ["F6"] = 0x3C0A40F2

    -- Number Keys

    ["1"] = 0xE6F612E4, ["2"] = 0x1CE6D9EB, ["3"] = 0x4F49CC4C, ["4"] = 0x8F9F9E58, ["5"] = 0xAB62E997, ["6"] = 0xA1FDE2A6,
    ["7"] = 0xB03A913B, ["8"] = 0x42385422

    -- Arrow Keys

    ["DOWN"] = 0x05CA7C52, ["UP"] = 0x6319DB71, ["LEFT"] = 0xA65EBAB4, ["RIGHT"] = 0xDEB34313,
}

Possible colors

Here you can see all the possible colors you can use for the blip.

    --LIGHT_BLUE
    --DARK_RED
    --PURPLE
    --ORANGE
    --TEAL
    --LIGHT_YELLOW
    --PINK
    --GREEN
    --DARK_TEAL
    --RED
    --LIGHT_GREEN
    --TEAL2
    --BLUE
    --DARK_PUPLE
    --DARK_PINK
    --DARK_DARK_RED
    --GRAY
    --PINKISH
    --YELLOW_GREEN
    --DARK_GREEN
    --BRIGHT_BLUE
    --BRIGHT_PURPLE
    --YELLOW_ORANGE
    --BLUE2
    --TEAL3
    --TAN
    --OFF_WHITE
    --LIGHT_YELLOW2
    --LIGHT_PINK
    --LIGHT_RED
    --LIGHT_YELLOW3
    --WHITE