Power Scripts
  • ๐Ÿ“„Home
  • ๐ŸšฒBikerack
  • ๐Ÿ“ธBodycams
  • ๐Ÿ“นDashcams V2
  • ๐Ÿ“ฑEncrypted Chat
  • ๐Ÿ”งMechanic Tablet
  • ๐ŸขPlayer Owned Offices
  • ๐ŸšขPlayer Owned Yachts
  • ๐Ÿ Stash Houses
  • ๐Ÿ”’Storage Lockers
  • ๐ŸงนSunset Bleach
  • ๐Ÿ“ฆWarehouses V2
Powered by GitBook
On this page
  • Introduction
  • Installation
  • Configuration
  • Editable files
  • client.lua
  • server.lua
  • Emojis

Was this helpful?

Encrypted Chat

Introduction

Encrypted Chat will allow players to view and post on an encrypted phone. This uses a social media style system that allows players to post messages with a custom username and profile picture.

By default, the chat command /darkweb is used to open the phone, however, this can also be configured to any command or even set up to be opened by using an item.

Players can change their username, profile picture, and phone size on the settings page.

This is a standalone script, however, you can enable QBCore support within the config.


Installation

  • Download the power_encryptedChat from Keymaster

  • Run the .sql file in your database. It is located within the README folder.

  • Add the files to your resources folder

  • Ensure that the resource file will start (either ensure your resource in the server.cfg or inside a folder which is started on server start)

  • Edit the config file to your needs

  • Restart your server


Configuration

Select the tab below for your framework to see the configuration options available.

useStandalone = false  

useQBCore = true 

resourceName = 'qb-core' -- Only change if you have renamed your QBCore file

useItem = false -- True if you want to have the encrypted chat opened by using an item
itemName = 'darkweb_phone' -- Name of the item (if left as default, you will need to create an item)

usingRealtime = false -- False is based on game time / True is based on real-time

usingTimezone = 'Europe/London' -- You can view the names of time zones here. https://momentjs.com/timezone/

enableCommand = true -- True if you want a chat command to open the encrypted chat

commandName = 'darkweb' -- Command used to open the chat. The default would be /darkweb

restrictFromJobs = true -- True means specified jobs will not be able to open encrypted chat

restrictedJobs = {
 ['police'] = true -- This will disable players with the police job from using the encrypted chat.
}

costPerMessage = 0 -- 0 is disabled / Any value over 0 is the price per message

When used as standalone, your player data will be stored based on Rockstar license and not by character ID.

This is not recommended for servers that allow multiple characters per player.

useStandalone = true

useQBCore = false

-- QBCore Only
-- resourceName = 'qb-core' -- Only change if you have renamed your QBCore file

-- useItem = false -- True if you want to have the encrypted chat opened by using an item
-- itemName = 'darkweb_phone' -- Name of the item (if left as default, you will need to create an item)

usingRealtime = false -- False is based on game time / True is based on real-time

usingTimezone = 'Europe/London' -- You can view the names of time zones here. https://momentjs.com/timezone/

enableCommand = true -- True if you want a chat command to open the encrypted chat

commandName = 'darkweb' -- Command used to open the chat. The default would be /darkweb

-- restrictFromJobs = true -- True means specified jobs will not be able to open encrypted chat

-- restrictedJobs = {
--  ['police'] = true -- This will disable players with the police job from using the encrypted chat.
-- }

costPerMessage = 0 -- 0 is disabled / Any value over 0 is the price per message

If you want to use an item with standalone, you will need to create a useable item that triggers the following client event:

power_encryptedChat:open

Editable files

client.lua

Custom Notifications

If you would like to edit the notifications to add your own custom notifications or to match them to your other server notifications, you can edit them in the client.lua file. Default notifications are as follows:

-- Edit the below if you would like to change the notification type.
RegisterNetEvent('power_encryptedChat:newMessageNotfication')
AddEventHandler('power_encryptedChat:newMessageNotfication', function(username)
 TriggerEvent('chat:addMessage', {color = {255, 255, 255}, args = {"^8DARKWEB", 'New Post from '..username}})
end)

RegisterNetEvent('power_encryptedChat:notification')
AddEventHandler('power_encryptedChat:notification', function(message)
 TriggerEvent('chat:addMessage', {color = {255, 255, 255}, args = {"^8DARKWEB", message}})
end)

server.lua

Discord Webhook

If you would like to add a discord webhook, you can add it to the server.lua. Be sure to change the CHANGEME to your webhook URL.

the-- Discord Webhook
-- Sends a copy of the darkweb message to discord as a chat message using the webhook.
local enableDiscordWebhook = true

-- Discord Webhook URL 
local discordWebhookURL = "https://discord.com/api/webhooks/CHANGEME"  

function discordMessage(data)
 if enableDiscordWebhook then 
  local embeds = {}
  if string.len(data.image) > 0 then 
   embeds = {{image = {url = data.image}}}
  end 
  PerformHttpRequest(discordWebhookURL, function(Error, Content, Head) end, 'POST', json.encode({username = data.username, embeds = embeds, content = data.message, avatar_url = data.picture}), {['Content-Type'] = 'application/json'})
 end 
end 

Money Management

If you would like the money taken from the cost per message to be added into a money management fund, you can add in your custom code in the server.lua here:

function moneyTakenForPost(source, costPerMessage)
 -- You can add your own code here to add money that is taken from the player to a management fund.
end 

Emojis

The following emoji's can be used within the chat with the following text codes

:smile: - ๐Ÿ˜„
:joy: - ๐Ÿ˜‚
:heart_eyes: - ๐Ÿ˜
:sob: - ๐Ÿ˜ญ
:rolling_eyes: - ๐Ÿ™„
:weary: - ๐Ÿ˜ฉ
:thinking: - ๐Ÿค”
:blush: - ๐Ÿ˜Š
:skull: - ๐Ÿ’€
:unamused: - ๐Ÿ˜’
:kissing_heart: - ๐Ÿ˜˜
:relieved: - ๐Ÿ˜Œ
:sleeping: - ๐Ÿ˜ด
:s_smile: - ๐Ÿ˜…
:eyes: - ๐Ÿ‘€
:smirk: - ๐Ÿ˜
:sunglasses: - ๐Ÿ˜Ž
:devil: - ๐Ÿ˜ˆ
:flushed: - ๐Ÿ˜ณ
:grin: - ๐Ÿ˜
:pensive: - ๐Ÿ˜”
:pray: - ๐Ÿ™
:stuck_out_tongue: - ๐Ÿ˜›
:hug: - ๐Ÿค—
:tired: - ๐Ÿ˜ซ
:confused: - ๐Ÿ˜•
:tongue_wink: - ๐Ÿ˜œ
:innocent: - ๐Ÿ˜‡
:raised_hands: - ๐Ÿ™Œ
:cry: - ๐Ÿ˜ข
:heart_eyes_cat: - ๐Ÿ˜ป
:yum: - ๐Ÿ˜‹
:wink: - ๐Ÿ˜‰
:slight_smile: - ๐Ÿ™‚
:goat: - ๐Ÿ
:sleepy: - ๐Ÿ˜ช
:crown: - ๐Ÿ‘‘
:heart: - โค๏ธ
:ok: - ๐Ÿ‘Œ
:tongue: - ๐Ÿ‘…
:ring: - ๐Ÿ’
:kiss: - ๐Ÿ’‹
:mask: - ๐Ÿ˜ท
:money_face: - ๐Ÿค‘
:scream: - ๐Ÿ˜ฑ
:flex: - ๐Ÿ’ช
:v: - โœŒ๏ธ
:poo: - ๐Ÿ’ฉ
:fist: - โœŠ
:cold_sweat: - ๐Ÿ˜ฐ
:ghost: - ๐Ÿ‘ป
:nerd: - ๐Ÿค“
:bikini: - ๐Ÿ‘™
:hurt: - ๐Ÿค•
:lipstick: - ๐Ÿ’„
:nails: - ๐Ÿ’…
:point_up: - โ˜๏ธ
:wave: - ๐Ÿ‘‹
:thumb_down: - ๐Ÿ‘Ž
:thumb_up ๐Ÿ‘
:shock: - ๐Ÿ˜ฎ
:vulcan: - ๐Ÿ––
:call_me: - ๐Ÿค™
:clown: - ๐Ÿคก
:vomit: - ๐Ÿคฎ
:rainbow: - ๐ŸŒˆ
PreviousDashcams V2NextMechanic Tablet

Last updated 1 year ago

Was this helpful?

๐Ÿ“ฑ