Binder Script for FiveM Users
Binder Script for FiveM Users
require "[Link]"
require 'encoding'.default = 'CP1251'
local u8 = require 'encoding'.UTF8
local settings = {}
local default_settings = {
commands = {
{ cmd = 'pass' , description = 'Mostre ao jogador seu passaporte' ,
text = '/do ������� ��������� � ����� ������� ������.&/me ����� ����� ������ ����
������� �� ������ ������� ������&/do ������� ��������� � ����� ����.&/todo ��� ���
�������, ������*�������� ���� ������� �������� {get_ru_nick({arg_id})}&/showpass
{arg_id}', arg = '{arg_id}' , enable = true, deleted = false, waiting = '1.200' },
},
}
local configDirectory = getWorkingDirectory() .. "/config"
local path = configDirectory .. "/[Link]"
function load_settings()
if not doesDirectoryExist(configDirectory) then
createDirectory(configDirectory)
end
if not doesFileExist(path) then
settings = default_settings
print('[Binder] ���� � ����������� �� ������, �������� �����������
���������!')
else
local file = [Link](path, 'r')
if file then
local contents = file:read('*a')
file:close()
if #contents == 0 then
settings = default_settings
print('[Binder] �� ������� ������� ���� � �����������,
�������� ����������� ���������!')
else
local result, loaded = pcall(decodeJson, contents)
if result then
settings = loaded
for category, _ in pairs(default_settings) do
if settings[category] == nil then
settings[category] = {}
end
for key, value in
pairs(default_settings[category]) do
if settings[category][key] == nil then
settings[category][key] = value
end
end
end
print('[Binder] Configuracoes carregadas com
sucesso!')
else
print('[Binder] Nao foi possivel abrir o arquivo de
configuracoes, estou usando as configuracoes padrao!')
end
end
else
settings = default_settings
print('[Binder] Falha ao abrir o arquivo de configuracoes usando
configuracoes padrao!')
end
end
end
function save_settings()
local file, errstr = [Link](path, 'w')
if file then
local result, encoded = pcall(encodeJson, settings)
file:write(result and encoded or "")
file:close()
return result
else
print('[Binder] Falha ao salvar configuracoes auxiliares, erro: ', errstr)
return false
end
end
load_settings()
local fa = require('fAwesome6_solid')
local imgui = require('mimgui')
local sizeX, sizeY = getScreenResolution()
local new = [Link]
local MainWindow = [Link]()
local BinderWindow = [Link]()
local ComboTags = [Link]()
local item_list = {u8'Sem argumento', u8'{arg} - aceita qualquer coisa,
letras/numeros/simbolos', u8'{arg_id} - aceita apenas ID de jogador', u8'{arg_id}
{arg2} - leva 2 argumentos: ID jogador e segundo qualquer coisa'}
local ImItems = [Link]['const char*'][#item_list](item_list)
local change_cmd_bool = false
local change_cmd = ''
local change_description = ''
local change_text = ''
local change_arg = ''
local slider = [Link](0)
local tagReplacements = {
my_id = function() return select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))
end,
my_nick = function() return sampGetPlayerNickname(select(2,
sampGetPlayerIdByCharHandle(PLAYER_PED))) end,
my_ru_nick = function() return TranslateNick(sampGetPlayerNickname(select(2,
sampGetPlayerIdByCharHandle(PLAYER_PED)))) end,
get_time = function ()
return [Link]("%H:%M:%S")
end,
}
local binder_tags_text = [[
{my_id} - Seu ID do jogo
{my_nick} - Seu Nick de jogo
{my_ru_nick} - Seu nome e sobrenome especificados no auxiliar
function main()
wait(-1)
end
function registerCommandsFrom(array)
for _, command in ipairs(array) do
if [Link] and not [Link] then
register_command([Link], [Link], [Link],
tonumber([Link]))
end
end
end
function register_command(chat_cmd, cmd_arg, cmd_text, cmd_waiting)
sampRegisterChatCommand(chat_cmd, function(arg)
if not isActiveCommand then
local arg_check = false
local modifiedText = cmd_text
if cmd_arg == '{arg}' then
if arg and arg ~= '' then
modifiedText = modifiedText:gsub('{arg}', arg or "")
arg_check = true
else
sampAddChatMessage('[Binder] {ffffff}Usar ' ..
message_color_hex .. '/' .. chat_cmd .. ' [argumento]', message_color)
play_error_sound()
end
elseif cmd_arg == '{arg_id}' then
if isParamSampID(arg) then
arg = tonumber(arg)
modifiedText = modifiedText:gsub('%{get_nick%(%
{arg_id%}%)%}', sampGetPlayerNickname(arg) or "")
modifiedText = modifiedText:gsub('%{get_rp_nick%(%
{arg_id%}%)%}', sampGetPlayerNickname(arg):gsub('_',' ') or "")
modifiedText = modifiedText:gsub('%{get_ru_nick%(%
{arg_id%}%)%}', TranslateNick(sampGetPlayerNickname(arg)) or "")
modifiedText = modifiedText:gsub('%{arg_id%}', arg or
"")
arg_check = true
else
sampAddChatMessage('[Binder] {ffffff} Usar ' ..
message_color_hex .. '/' .. chat_cmd .. ' [ID jogador]', message_color)
play_error_sound()
end
elseif cmd_arg == '{arg_id} {arg2}' then
if arg and arg ~= '' then
local arg_id, arg2 = arg:match('(%d+) (.+)')
if isParamSampID(arg_id) and arg2 then
arg_id = tonumber(arg_id)
modifiedText = modifiedText:gsub('%{get_nick%(%
{arg_id%}%)%}', sampGetPlayerNickname(arg_id) or "")
modifiedText = modifiedText:gsub('%{get_rp_nick
%(%{arg_id%}%)%}', sampGetPlayerNickname(arg_id):gsub('_',' ') or "")
modifiedText = modifiedText:gsub('%{get_ru_nick
%(%{arg_id%}%)%}', TranslateNick(sampGetPlayerNickname(arg_id)) or "")
modifiedText = modifiedText:gsub('%{arg_id%}',
arg_id or "")
modifiedText = modifiedText:gsub('%{arg2%}',
arg2 or "")
arg_check = true
else
sampAddChatMessage('[Binder] {ffffff}Usar ' ..
message_color_hex .. '/' .. chat_cmd .. ' [ID jogador] [argumento]', message_color)
play_error_sound()
end
else
sampAddChatMessage('[Binder] {ffffff}Usar ' ..
message_color_hex .. '/' .. chat_cmd .. ' [ID jogador] [argumento]', message_color)
play_error_sound()
end
elseif cmd_arg == '' then
arg_check = true
end
if arg_check then
lua_thread.create(function()
isActiveCommand = true
local lines = {}
for line in [Link](modifiedText, "[^&]+") do
[Link](lines, line)
end
for _, line in ipairs(lines) do
if command_stop then
command_stop = false
isActiveCommand = false
sampAddChatMessage('[Binder]
{ffffff}Interpretando uma comando /' .. chat_cmd .. " parado com sucesso!",
message_color)
return
end
for tag, replacement in pairs(tagReplacements)
do
-- local success, result =
pcall([Link], line, "{" .. tag .. "}", replacement())
-- if success then
-- line = result
-- end
line = line:gsub("{" .. tag .. "}",
replacement())
end
sampSendChat(line)
wait(cmd_waiting * 1000)
end
isActiveCommand = false
end)
end
else
sampAddChatMessage('[Binder] {ffffff}Aguarde at#e que o comando
anterior seja conclu#do!', message_color)
end
end)
end
[Link](function()
[Link]().IniFilename = nil
[Link](14 * MONET_DPI_SCALE)
apply_dark_theme()
end)
[Link](u8([Link]))
[Link]()
end
[Link](' ')
[Link]()
if [Link] then
if [Link](fa.TOGGLE_ON ..
'##'..[Link]) then
[Link] = not [Link]
save_settings()
sampUnregisterChatCommand([Link])
end
if [Link]() then
[Link](u8"Desativar o
comando /"..[Link])
end
else
if [Link](fa.TOGGLE_OFF ..
'##'..[Link]) then
[Link] = not [Link]
save_settings()
register_command([Link],
[Link], [Link], tonumber([Link]))
end
if [Link]() then
[Link](u8"Ativar o
comando /"..[Link])
end
end
[Link]()
if [Link](fa.PEN_TO_SQUARE ..
'##'..[Link]) then
change_description = [Link]
input_description = [Link][256]
(u8(change_description))
change_arg = [Link]
if [Link] == '' then
ComboTags[0] = 0
elseif [Link] == '{arg}' then
ComboTags[0] = 1
elseif [Link] == '{arg_id}' then
ComboTags[0] = 2
elseif [Link] == '{arg_id} {arg2}' then
ComboTags[0] = 3
end
change_cmd = [Link]
input_cmd = [Link][256]
(u8([Link]))
change_text = [Link]:gsub('&', '\n')
input_text = [Link][8192]
(u8(change_text))
change_waiting = [Link]
waiting_slider =
[Link](tonumber([Link]))
BinderWindow[0] = true
end
if [Link]() then
[Link](u8"Edicao no
comando /"..[Link])
end
[Link]()
if [Link](fa.TRASH_CAN ..
'##'..[Link]) then
[Link](fa.TRIANGLE_EXCLAMATION .. u8'
Aviso ##' .. [Link])
end
if [Link]() then
[Link](u8"Excluir o
comando /"..[Link])
end
if [Link](fa.TRIANGLE_EXCLAMATION ..
u8' Aviso ##' .. [Link], _, [Link] ) then
[Link](u8'Tem certeza de que deseja
excluir o comando? /' .. u8([Link]) .. '?')
[Link]()
if [Link](fa.CIRCLE_XMARK .. u8' Nao,
cancelar', imgui.ImVec2(200 * MONET_DPI_SCALE, 25 * MONET_DPI_SCALE)) then
[Link]()
end
[Link]()
if [Link](fa.TRASH_CAN .. u8' Sim,
excluir', imgui.ImVec2(200 * MONET_DPI_SCALE, 25 * MONET_DPI_SCALE)) then
[Link] = false
[Link] = true
sampUnregisterChatCommand([Link])
save_settings()
[Link]()
end
[Link]()
end
[Link](1)
[Link]()
end
end
[Link]()
end
if [Link](fa.CIRCLE_PLUS .. u8' Criar um novo
comando##new_cmd',imgui.ImVec2([Link](1), 0)) then
local new_cmd = {cmd = '', description = ' Nome do Comando', text
= '', arg = '', enable = true , waiting = '1.200', deleted = false }
[Link]([Link], new_cmd)
change_description = new_cmd.description
input_description = [Link][256](u8(change_description))
change_arg = new_cmd.arg
ComboTags[0] = 0
change_cmd = new_cmd.cmd
input_cmd = [Link][256](u8(new_cmd.cmd))
change_text = new_cmd.text:gsub('&', '\n')
input_text = [Link][8192](u8(change_text))
change_waiting = 1.200
waiting_slider = [Link](1.200)
BinderWindow[0] = true
end
if [Link]([Link] .. u8' Servidor do Discord MTG MODS (Entre
em contato com o autor e suporte tecnico)',imgui.ImVec2([Link](1),
0)) then
openLink('[Link]
end
[Link]()
end
)
[Link](
function() return BinderWindow[0] end,
function(player)
[Link](imgui.ImVec2(sizeX / 2, sizeY / 2),
[Link], imgui.ImVec2(0.5, 0.5))
[Link](imgui.ImVec2(600 * MONET_DPI_SCALE, 425 *
MONET_DPI_SCALE), [Link])
[Link]([Link]..u8" Binder by MTG MODS - Editando um
comando /" .. change_cmd, BinderWindow, [Link] +
[Link] )
if [Link]('##binder_edit', imgui.ImVec2(589 *
MONET_DPI_SCALE, 361 * MONET_DPI_SCALE), true) then
[Link](fa.FILE_LINES .. u8' Nome do comando:')
[Link](579 * MONET_DPI_SCALE)
[Link]("##input_description", input_description, 256)
[Link]()
[Link]([Link] .. u8' Atalho para usar no chat (sem
/):')
[Link](579 * MONET_DPI_SCALE)
[Link]("##input_cmd", input_cmd, 256)
[Link]()
[Link]([Link] .. u8' Argumentos que o comando
aceita:')
[Link](u8'',ComboTags, ImItems, #item_list)
[Link]()
[Link](fa.FILE_WORD .. u8' Texto ligado no comando:')
[Link]("##text_multiple", input_text, 8192,
imgui.ImVec2(579 * MONET_DPI_SCALE, 173 * MONET_DPI_SCALE))
[Link]() end
if [Link](fa.CIRCLE_XMARK .. u8' Cancelar',
imgui.ImVec2([Link](4), 0)) then
BinderWindow[0] = false
end
[Link]()
if [Link]([Link] .. u8'
Atraso',imgui.ImVec2([Link](4), 0)) then
[Link]([Link] .. u8' Latencia(segundos) ')
end
if [Link]([Link] .. u8' Latencia(segundos) ', _,
[Link] ) then
[Link](200 * MONET_DPI_SCALE)
[Link](u8'##waiting', waiting_slider, 0.3, 5)
[Link]()
if [Link](fa.CIRCLE_XMARK .. u8' Cancelar',
imgui.ImVec2([Link](2), 0)) then
waiting_slider = [Link](tonumber(change_waiting))
[Link]()
end
[Link]()
if [Link](fa.FLOPPY_DISK .. u8' Salvar',
imgui.ImVec2([Link](2), 0)) then
[Link]()
end
[Link]()
end
[Link]()
if [Link]([Link] .. u8' Tags',
imgui.ImVec2([Link](4), 0)) then
[Link]([Link] .. u8' Tags b#asicas para usar em um
ficheiro')
end
if [Link]([Link] .. u8' Tags b#asicas para usar em um
ficheiro', _, [Link] + [Link] +
[Link] + [Link] ) then
[Link](u8(binder_tags_text))
[Link]()
if [Link](fa.CIRCLE_XMARK .. u8' Fechar',
imgui.ImVec2([Link](1), 0)) then
[Link]()
end
[Link]()
end
[Link]()
if [Link](fa.FLOPPY_DISK .. u8' Salvar',
imgui.ImVec2([Link](4), 0)) then
if [Link](input_cmd):find('%W') or [Link](input_cmd) ==
'' or [Link](input_description) == '' or [Link](input_text) == '' then
[Link](fa.TRIANGLE_EXCLAMATION .. u8' Erro ao
salvar o comando!')
else
local new_arg = ''
if ComboTags[0] == 0 then
new_arg = ''
elseif ComboTags[0] == 1 then
new_arg = '{arg}'
elseif ComboTags[0] == 2 then
new_arg = '{arg_id}'
elseif ComboTags[0] == 3 then
new_arg = '{arg_id} {arg2}'
end
local new_waiting = waiting_slider[0]
local new_description =
u8:decode([Link](input_description))
local new_command = u8:decode([Link](input_cmd))
local new_text = u8:decode([Link](input_text)):gsub('\
n', '&')
if binder_create_command_9_10 then
for _, command in ipairs(settings.commands_manage) do
if [Link] == change_cmd and
[Link] == change_description and [Link] == change_arg and
[Link]:gsub('&', '\n') == change_text then
[Link] = new_command
[Link] = new_arg
[Link] = new_description
[Link] = new_text
[Link] = new_waiting
save_settings()
if [Link] == '' then
sampAddChatMessage('[Binder]
{ffffff}Usar ' .. message_color_hex .. '/' .. new_command .. ' {ffffff}salvo com
sucesso!', message_color)
elseif [Link] == '{arg}' then
sampAddChatMessage('[Binder]
{ffffff}Usar ' .. message_color_hex .. '/' .. new_command .. ' [argumento]
{ffffff}salvo com sucesso!', message_color)
elseif [Link] == '{arg_id}' then
sampAddChatMessage('[Binder]
{ffffff}Usar ' .. message_color_hex .. '/' .. new_command .. ' [ID jogador]
{ffffff}salvo com sucesso!', message_color)
elseif [Link] == '{arg_id} {arg2}'
then
sampAddChatMessage('[Binder]
{ffffff}Usar ' .. message_color_hex .. '/' .. new_command .. ' [ID jogador]
[argumento] {ffffff}salvo com sucesso!', message_color)
end
sampUnregisterChatCommand(change_cmd)
register_command([Link],
[Link], [Link], tonumber([Link]))
binder_create_command_9_10 = false
break
end
end
else
for _, command in ipairs([Link]) do
if [Link] == change_cmd and
[Link] == change_description and [Link] == change_arg and
[Link]:gsub('&', '\n') == change_text then
[Link] = new_command
[Link] = new_arg
[Link] = new_description
[Link] = new_text
[Link] = new_waiting
save_settings()
if [Link] == '' then
sampAddChatMessage('[Binder]
{ffffff}comando ' .. message_color_hex .. '/' .. new_command .. ' {ffffff}salvo com
sucesso!', message_color)
elseif [Link] == '{arg}' then
sampAddChatMessage('[Binder]
{ffffff}comando ' .. message_color_hex .. '/' .. new_command .. ' [Argumento]
{ffffff}salvo com sucesso!', message_color)
elseif [Link] == '{arg_id}' then
sampAddChatMessage('[Binder]
{ffffff}comando ' .. message_color_hex .. '/' .. new_command .. ' [ID Jogador]
{ffffff}salvo com sucesso!', message_color)
elseif [Link] == '{arg_id} {arg2}'
then
sampAddChatMessage('[Binder]
{ffffff}comando ' .. message_color_hex .. '/' .. new_command .. ' [ID Jogador]
[Argumento] {ffffff}salvo com sucesso!', message_color)
end
sampUnregisterChatCommand(change_cmd)
register_command([Link],
[Link], [Link], tonumber([Link]))
break
end
end
end
BinderWindow[0] = false
end
end
if [Link](fa.TRIANGLE_EXCLAMATION .. u8' Erro ao salvar
o comando!', _, [Link] ) then
if [Link](input_cmd):find('%W') then
[Link](u8"Erro, Retire o / do Atalho para poder
salvar")
elseif [Link](input_cmd) == '' then
[Link](u8"O Atalho nao pode ficar vazio!")
end
if [Link](input_description) == '' then
[Link](u8" O Nome do Comando nao pode ficar
vazia!")
end
if [Link](input_text) == '' then
[Link](u8"O Texto de Ligacao ao comando nao pode
ficar vazia")
end
[Link]()
if [Link](fa.CIRCLE_XMARK .. u8' Fechar', imgui.ImVec2(300
* MONET_DPI_SCALE, 25 * MONET_DPI_SCALE)) then
[Link]()
end
[Link]()
end
[Link]()
end
)
function [Link](text)
local width = [Link]()
local calc = [Link](text)
[Link]( width / 2 - calc.x / 2 )
[Link](text)
end
function [Link](text)
[Link](([Link]() + ([Link]() / 2)) -
[Link](text).x / 2)
[Link](text)
end
function [Link](text)
[Link](([Link]() + ([Link]() / 2)) -
[Link](text).x / 2)
[Link](text)
end
function [Link](imgui_RGBA, text)
[Link](([Link]() + ([Link]() / 2)) -
[Link](text).x / 2)
[Link](imgui_RGBA, text)
end
function [Link](text,v,size)
if text:find('^(.+)##(.+)') then
local text1, text2 = text:match('(.+)##(.+)')
[Link](([Link]() +
([Link]() / 2)) - ([Link](text1).x / 2) -
([Link](v).x / 2 ))
elseif text:find('^##(.+)') then
[Link](([Link]() +
([Link]() / 2) ) - ([Link](v).x / 2 ) )
else
[Link](([Link]() +
([Link]() / 2)) - ([Link](text).x / 2) -
([Link](v).x / 2 ))
end
if [Link](text,v,size) then
return true
else
return false
end
end
function [Link](text)
if text:find('(.+)##(.+)') then
local text1, text2 = text:match('(.+)##(.+)')
[Link](([Link]() +
([Link]() / 2)) - [Link](text1).x / 2)
else
[Link](([Link]() +
([Link]() / 2)) - [Link](text).x / 2)
end
if [Link](text) then
return true
else
return false
end
end
function [Link](text)
if text:find('(.+)##(.+)') then
local text1, text2 = text:match('(.+)##(.+)')
[Link](([Link]() +
([Link]() / 2)) - [Link](text1).x / 2)
else
[Link](([Link]() +
([Link]() / 2)) - [Link](text).x / 2)
end
if [Link](text) then
return true
else
return false
end
end
function [Link](text)
local width = [Link]()
local calc = [Link](text)
[Link]( width / 2 - calc.x / 2 )
[Link](text)
end
function [Link](count)
local width = [Link]() -- largura do contexto da
janela
local space = [Link]().ItemSpacing.x
return count == 1 and width or width/count - ((space * (count-1)) / count) --
retornar# larguras m#dias por quantidade
end
function apply_dark_theme()
[Link]()
[Link]().WindowPadding = imgui.ImVec2(5 * MONET_DPI_SCALE, 5 *
MONET_DPI_SCALE)
[Link]().FramePadding = imgui.ImVec2(5 * MONET_DPI_SCALE, 5 *
MONET_DPI_SCALE)
[Link]().ItemSpacing = imgui.ImVec2(5 * MONET_DPI_SCALE, 5 *
MONET_DPI_SCALE)
[Link]().ItemInnerSpacing = imgui.ImVec2(2 * MONET_DPI_SCALE, 2 *
MONET_DPI_SCALE)
[Link]().TouchExtraPadding = imgui.ImVec2(0, 0)
[Link]().IndentSpacing = 0
[Link]().ScrollbarSize = 10 * MONET_DPI_SCALE
[Link]().GrabMinSize = 10 * MONET_DPI_SCALE
[Link]().WindowBorderSize = 1 * MONET_DPI_SCALE
[Link]().ChildBorderSize = 1 * MONET_DPI_SCALE
[Link]().PopupBorderSize = 1 * MONET_DPI_SCALE
[Link]().FrameBorderSize = 1 * MONET_DPI_SCALE
[Link]().TabBorderSize = 1 * MONET_DPI_SCALE
[Link]().WindowRounding = 8 * MONET_DPI_SCALE
[Link]().ChildRounding = 8 * MONET_DPI_SCALE
[Link]().FrameRounding = 8 * MONET_DPI_SCALE
[Link]().PopupRounding = 8 * MONET_DPI_SCALE
[Link]().ScrollbarRounding = 8 * MONET_DPI_SCALE
[Link]().GrabRounding = 8 * MONET_DPI_SCALE
[Link]().TabRounding = 8 * MONET_DPI_SCALE
[Link]().WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
[Link]().ButtonTextAlign = imgui.ImVec2(0.5, 0.5)
[Link]().SelectableTextAlign = imgui.ImVec2(0.5, 0.5)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
1.00, 1.00, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.50,
0.50, 0.50, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.07,
0.07, 0.07, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.07,
0.07, 0.07, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.07,
0.07, 0.07, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.25,
0.25, 0.26, 0.54)
[Link]().Colors[[Link]] = imgui.ImVec4(0.00,
0.00, 0.00, 0.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.25,
0.25, 0.26, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.25,
0.25, 0.26, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.00,
0.00, 0.00, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.41,
0.41, 0.41, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.51,
0.51, 0.51, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
1.00, 1.00, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.21,
0.20, 0.20, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.21,
0.20, 0.20, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.21,
0.20, 0.20, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.41,
0.41, 0.41, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.20,
0.20, 0.20, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.47,
0.47, 0.47, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
1.00, 1.00, 0.25)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
1.00, 1.00, 0.67)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
1.00, 1.00, 0.95)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.28,
0.28, 0.28, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.30,
0.30, 0.30, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.07,
0.10, 0.15, 0.97)
[Link]().Colors[[Link]] = imgui.ImVec4(0.14,
0.26, 0.42, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.61,
0.61, 0.61, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
0.43, 0.35, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(0.90,
0.70, 0.00, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
0.60, 0.00, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
0.00, 0.00, 0.35)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
1.00, 0.00, 0.90)
[Link]().Colors[[Link]] = imgui.ImVec4(0.26,
0.59, 0.98, 1.00)
[Link]().Colors[[Link]] = imgui.ImVec4(1.00,
1.00, 1.00, 0.70)
[Link]().Colors[[Link]] = imgui.ImVec4(0.80,
0.80, 0.80, 0.20)
[Link]().Colors[[Link]] = imgui.ImVec4(0.12,
0.12, 0.12, 0.95)
end
function openLink(link)
if isMonetLoader() then
local gta = [Link]('GTASA')
[Link][[
void _Z12AND_OpenLinkPKc(const char* link);
]]
gta._Z12AND_OpenLinkPKc(link)
else
[Link]("explorer " .. link)
end
end
function play_error_sound()
if not isMonetLoader() and sampIsLocalPlayerSpawned() then
addOneOffSound(getCharCoordinates(PLAYER_PED), 1149)
end
end
local russian_characters = {
[168] = '�', [184] = '�', [192] = '�', [193] = '�', [194] = '�', [195] = '�',
[196] = '�', [197] = '�', [198] = '�', [199] = '�', [200] = '�', [201] = '�', [202]
= '�', [203] = '�', [204] = '�', [205] = '�', [206] = '�', [207] = '�', [208] =
'�', [209] = '�', [210] = '�', [211] = '�', [212] = '�', [213] = '�', [214] = '�',
[215] = '�', [216] = '�', [217] = '�', [218] = '�', [219] = '�', [220] = '�', [221]
= '�', [222] = '�', [223] = '�', [224] = '�', [225] = '�', [226] = '�', [227] =
'�', [228] = '�', [229] = '�', [230] = '�', [231] = '�', [232] = '�', [233] = '�',
[234] = '�', [235] = '�', [236] = '�', [237] = '�', [238] = '�', [239] = '�', [240]
= '�', [241] = '�', [242] = '�', [243] = '�', [244] = '�', [245] = '�', [246] =
'�', [247] = '�', [248] = '�', [249] = '�', [250] = '�', [251] = '�', [252] = '�',
[253] = '�', [254] = '�', [255] = '�',
}
function [Link](s)
s = s:lower()
local strlen = s:len()
if strlen == 0 then return s end
s = s:lower()
local output = ''
for i = 1, strlen do
local ch = s:byte(i)
if ch >= 192 and ch <= 223 then -- upper russian characters
output = output .. russian_characters[ch + 32]
elseif ch == 168 then -- �
output = output .. russian_characters[184]
else
output = output .. [Link](ch)
end
end
return output
end
function [Link](s)
s = s:upper()
local strlen = s:len()
if strlen == 0 then return s end
s = s:upper()
local output = ''
for i = 1, strlen do
local ch = s:byte(i)
if ch >= 224 and ch <= 255 then -- lower russian characters
output = output .. russian_characters[ch - 32]
elseif ch == 184 then -- �
output = output .. russian_characters[168]
else
output = output .. [Link](ch)
end
end
return output
end
function TranslateNick(name)
if name:match('%a+') then
for k, v in pairs({['ph'] = '�',['Ph'] = '�',['Ch'] = '�',['ch'] = '�',
['Th'] = '�',['th'] = '�',['Sh'] = '�',['sh'] = '�', ['ea'] = '�',['Ae'] = '�',
['ae'] = '�',['size'] = '����',['Jj'] = '��������',['Whi'] = '���',['lack'] =
'���',['whi'] = '���',['Ck'] = '�',['ck'] = '�',['Kh'] = '�',['kh'] = '�',['hn'] =
'�',['Hen'] = '���',['Zh'] = '�',['zh'] = '�',['Yu'] = '�',['yu'] = '�',['Yo'] =
'�',['yo'] = '�',['Cz'] = '�',['cz'] = '�', ['ia'] = '�', ['ea'] = '�',['Ya'] =
'�', ['ya'] = '�', ['ove'] = '��',['ay'] = '��', ['rise'] = '����',['oo'] = '�',
['Oo'] = '�', ['Ee'] = '�', ['ee'] = '�', ['Un'] = '��', ['un'] = '��', ['Ci'] =
'��', ['ci'] = '��', ['yse'] = '��', ['cate'] = '����', ['eow'] = '��', ['rown'] =
'����', ['yev'] = '���', ['Babe'] = '�����', ['Jason'] = '�������', ['liy'] =
'���', ['ane'] = '���', ['ame'] = '���'}) do
name = name:gsub(k, v)
end
for k, v in pairs({['B'] = '�',['Z'] = '�',['T'] = '�',['Y'] = '�',
['P'] = '�',['J'] = '��',['X'] = '��',['G'] = '�',['V'] = '�',['H'] = '�',['N'] =
'�',['E'] = '�',['I'] = '�',['D'] = '�',['O'] = '�',['K'] = '�',['F'] = '�',['y`']
= '�',['e`'] = '�',['A'] = '�',['C'] = '�',['L'] = '�',['M'] = '�',['W'] = '�',
['Q'] = '�',['U'] = '�',['R'] = '�',['S'] = '�',['zm'] = '���',['h'] = '�',['q'] =
'�',['y'] = '�',['a'] = '�',['w'] = '�',['b'] = '�',['v'] = '�',['g'] = '�',['d'] =
'�',['e'] = '�',['z'] = '�',['i'] = '�',['j'] = '�',['k'] = '�',['l'] = '�',['m'] =
'�',['n'] = '�',['o'] = '�',['p'] = '�',['r'] = '�',['s'] = '�',['t'] = '�',['u'] =
'�',['f'] = '�',['x'] = 'x',['c'] = '�',['``'] = '�',['`'] = '�',['_'] = ' '}) do
name = name:gsub(k, v)
end
return name
end
return name
end
function isParamSampID(id)
id = tonumber(id)
if id ~= nil and tostring(id):find('%d') and not tostring(id):find('%D') and
[Link](id) >= 1 and [Link](id) <= 3 then
if id == select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)) then
return true
elseif sampIsPlayerConnected(id) then
return true
else
return false
end
else
return false
end
end