(Lua)Не запускается скрипт в самп

R-Roach

Участник
Автор темы
76
7
Версия SA-MP
  1. 0.3.7 (R1)
СЕЙЧАС ТАК - ТО ПЫТАЮСЬ УЧИТЬ ['LUA'], СМОТРЮ РОЛИКИ И ТД И ТП, ВСЕ ВРОДЕ ПОВТОРИЛ С РОЛИКА НО СКРИПТ НЕ ЗАПУСКАЕТСЯ ВЧЕРА СИДЕЛ 1.3ч И ДУМАЛ ПОЧЕМУ ОН НЕ ЗАПУСКАЕТСЯ. Так и решение не нашел help
Код :

script_name('New script') -- название скрипта
script_author('RORMS') -- автор скрипта
script_description('imgui') -- описание скрипта

require "lib.moonloader" -- подключение библиотеки
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8


local tag = '[My First Script]:' -- локальная переменная
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end

sampRegisterChatCommand("imgui", cmd_imgui)

_, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickname(id)

imgui.Process = false

if main.window_state.v == false then
imgui.Process == false
end

--Блок выполняется один раз после старта игры.

while true do
wait(0)

if isKeyJustPressed(VK_F3) then
sampAddChatMessage("Вы нажали клавишу {FFFFFF}F3. " .. main_color_text .. "Ваш ник: {FFFFFF}" .. nick .. ", " .. main_color_text .. "ваш ID: {FFFFFF}" .. id, main_color)
end

if isKeyDown(VK_MENU) and isKeyJustPressed(VK_9) then
sampAddChatMessage("Вы крут, вы зажали комбинацию клавиш!", main_color)
wait(500)
sampAddChatMessage("Прошло пол секунды", main_color)
end

--End
--End

function cmd_imgui(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end


function imgui.OnDrawFrame()
imgui.Begin(u8"Привет", main_window_state)
imgui.InputText(u8'Вводить текст сюда', text_buffer)
x, y, z = getCharCoordinates(PLAYER_PED)
imgui.text(u8("Позиция игроква : X:" .. math.floor(x) .. "| Y: " .. math.floor:good: .. math.floor:good: .. " | Z: " .. math.floor(z)))
if imgui.Buttom('Press me') then
sampAddChatMessage(u8:decode(text_buffer.v), -1)
End
imgui.End()
-- Блок выполняется бесконечно (пока самп активен)
end

end
end


function cmd_normal(arg)
thread:run("normal", arg)
end

function cmd_cool(arg)
thread:run("cool", arg)
end

function thread_fuction(option, arg)
if option == "normal" then
sampAddChatMessage(sampGetMaxPlayerId(false), -1)
wait(2000)
sampSendChat(arg)
end
if option == "cool" then
sampAddChatMessage("Привет ютуб, you cool", -1)
wait(1000)
sampSendChat(arg, main_color)
end
end

--for i, j in pairs(colorsName) do
--sampAddChatMessage(i, j)



--sampAddChatMessage(text, colorsName["red"])

--for i, value in ipairs(array) do
--sampAddChatMessage(i .. "Элемент" .. value, main_color)
--end



function cmd_optimal(arg)
if #arg == 0 then
sampAddChatMessage("Привет, вы ввели команду, но не ввели аргумент :(", main_color)
else
sampAddChatMessage("Привет! Вы ввели команду и ввели аргумент: {FFFFFF}" .. arg, main_color)
end
end

function cmd_cool(arg)
var1, var2 = string.match(arg, "(.+) (.+)")
if var1 == nill or var1 == "" then
sampAddChatMessage("Неплохо, у вас уже 2 аргумента, но вы их их не ввели :(", main_color)
else
sampAddChatMessage("Круто, вы ввели команду и 2 аргумента. 1ый: " .. white_color .. var1 .. ", " .. main_color_text .. "2ой: " .. white_color .. var2, main_color)
end
end



--function sampev.onSendChat(text)
--return {"Текст"}
--end


function sampev.xonSendExitVehicle(vehicleId)
sampAddChatMessage("Вы вышли с авто с ID" .. vehicleId , color)
end


function sampev.onSendEnterVehicle(vehicleId, passenger)
sampAddChatMessage("Вы сели в авто с ID" .. vehicleId .. " / Пассажир : " .. tostring(passenger) , color )
end


function sampev.onServerMessage(color, text)
if string.find(text, 'Администратор', 1, true) then
return false
end
end


function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
sampAddChatMessage(diaglogId, color)
sampAddChatMessage(style, color)
sampAddChatMessage(title, color)
sampAddChatMessage(button1, color)
sampAddChatMessage(button2, color)
sampAddChatMessage(text, color)
end

function sampev.onSetInterior(interior)
sampAddChatMessage("Вы зашли в интерьер с ID" .. interior , color)
end

function sampev.onDisplayGameText(style, time, text)
sampAddChatMessage(style, color)
sampAddChatMessage(time, color)
sampAddChatMessage(text, color)
end

function sampev.onApplyPlayerAnimation(playerId, animLib, animName, loop, lockX, lockY, freeze, time)
sampAddChatMessage(playerId, color)
sampAddChatMessage(animLib, color)
sampAddChatMessage(animName, color)
sampAddChatMessage(tostring(loop), color)
sampAddChatMessage(tostring(lockX), color)
sampAddChatMessage(tostring(lockY), color)
sampAddChatMessage(tostring(freeze), color)
sampAddChatMessage(time, color)
end


Скрипт название "Test2"
[18:11:45.989612] (info) Working directory: C:\Test scripts sborka\moonloader
[18:11:45.989612] (debug) FP Control: 0009001F
[18:11:45.989612] (debug) Game: GTA SA 1.0.0.0 US
[18:11:45.989612] (system) Installing pre-game hooks...
[18:11:46.005613] (system) Hooks installed.
[18:11:49.111791] (debug) Initializing opcode handler table
[18:11:49.111791] (debug) package.path = C:\Test scripts sborka\moonloader\lib\?.lua;C:\Test scripts sborka\moonloader\lib\?\init.lua;C:\Test scripts sborka\moonloader\?.lua;C:\Test scripts sborka\moonloader\?\init.lua;.\?.lua;C:\Test scripts sborka\moonloader\lib\?.luac;C:\Test scripts sborka\moonloader\lib\?\init.luac;C:\Test scripts sborka\moonloader\?.luac;C:\Test scripts sborka\moonloader\?\init.luac;.\?.luac
[18:11:49.111791] (debug) package.cpath = C:\Test scripts sborka\moonloader\lib\?.dll;
[18:11:49.112791] (system) Loading script 'C:\Test scripts sborka\moonloader\AIRBRAKE by SanderFisher.lua'...
[18:11:49.141792] (debug) New script: 0AB255C4
[18:11:49.154793] (system) AIRBRAKE by SanderFisher.lua: Loaded successfully.
[18:11:49.154793] (system) Loading script 'C:\Test scripts sborka\moonloader\CheckOnline.lua'...
[18:11:49.154793] (debug) New script: 0AB2638C
[18:11:49.192795] (system) CheckOnline: Loaded successfully.
[18:11:49.192795] (system) Loading script 'C:\Test scripts sborka\moonloader\Custom_NameTags_v_2.0.lua'...
[18:11:49.192795] (debug) New script: 0AD20494
[18:11:49.198796] (system) Custom NameTags: Loaded successfully.
[18:11:49.198796] (system) Loading script 'C:\Test scripts sborka\moonloader\de_50.lua'...
[18:11:49.199796] (debug) New script: 0AD2061C
[18:11:49.215797] (system) de_50.lua: Loaded successfully.
[18:11:49.215797] (system) Loading script 'C:\Test scripts sborka\moonloader\DTime1.3.lua'...
[18:11:49.216797] (debug) New script: 0AD2092C
[18:11:49.389807] (system) DTime: Loaded successfully.
[18:11:49.389807] (system) Loading script 'C:\Test scripts sborka\moonloader\FullText.lua'...
[18:11:49.389807] (debug) New script: 0AD20AB4
[18:11:49.411808] (error) FullText.lua: C:\Test scripts sborka\moonloader\FullText.lua:27: 'end' expected (to close 'function' at line 19) near '<eof>'
[18:11:49.411808] (error) FullText.lua: Script died due to an error. (0AD20AB4)
[18:11:49.411808] (system) Loading script 'C:\Test scripts sborka\moonloader\GameFixer.lua'...
[18:11:49.411808] (debug) New script: 0AD20AB4
[18:11:49.596818] (system) GameFixer.lua: Loaded successfully.
[18:11:49.596818] (system) Loading script 'C:\Test scripts sborka\moonloader\GODMODE by SanderFisher.lua'...
[18:11:49.596818] (debug) New script: 0AD20C3C
[18:11:49.613819] (system) GODMODE by SanderFisher.lua: Loaded successfully.
[18:11:49.613819] (system) Loading script 'C:\Test scripts sborka\moonloader\lock.lua'...
[18:11:49.613819] (debug) New script: 0AD20DC4
[18:11:49.674823] (system) Benjamin Busterenko: Loaded successfully.
[18:11:49.674823] (system) Loading script 'C:\Test scripts sborka\moonloader\NoAdmins.lua'...
[18:11:49.674823] (debug) New script: 0AD20F4C
[18:11:49.695824] (error) NoAdmins.lua: C:\Test scripts sborka\moonloader\NoAdmins.lua:21: 'end' expected (to close 'function' at line 7) near '<eof>'
[18:11:49.696824] (error) NoAdmins.lua: Script died due to an error. (0AD20F4C)
[18:11:49.696824] (system) Loading script 'C:\Test scripts sborka\moonloader\Player Remover.lua'...
[18:11:49.696824] (debug) New script: 0AD20F4C
[18:11:49.728826] (system) Player Remover: Loaded successfully.
[18:11:49.728826] (system) Loading script 'C:\Test scripts sborka\moonloader\reload_all.lua'...
[18:11:49.728826] (debug) New script: 0AD210D4
[18:11:49.744827] (system) ML-ReloadAll: Loaded successfully.
[18:11:49.744827] (system) Loading script 'C:\Test scripts sborka\moonloader\samp++.lua'...
[18:11:49.744827] (debug) New script: 0AD2125C
[18:11:49.753827] (system) samp++.lua: Loaded successfully.
[18:11:49.753827] (system) Loading script 'C:\Test scripts sborka\moonloader\Test2.lua'...
[18:11:49.753827] (debug) New script: 0AD213E4
[18:11:49.753827] (error) Test2.lua: C:\Test scripts sborka\moonloader\Test2.lua:61: '<eof>' expected near 'end'
[18:11:49.753827] (error) Test2.lua: Script died due to an error. (0AD213E4)
[18:11:49.753827] (system) Loading script 'C:\Test scripts sborka\moonloader\WALLHACK by SanderFisher.luac'...
[18:11:49.753827] (debug) New script: 0AD213E4
[18:11:49.797830] (system) WallHack: Loaded successfully.
[18:11:49.798830] (system) Loading script 'C:\Test scripts sborka\moonloader\быстрая загрузка.lua'...
[18:11:49.798830] (debug) New script: 0AD2156C
[18:11:49.800830] (system) быстрая загрузка: Loaded successfully.
[18:11:56.387207] (system) Installing post-load hooks...
[18:11:56.387207] (system) Hooks installed.
[18:12:05.862749] (error) CheckOnline: C:\Test scripts sborka\moonloader\CheckOnline.lua:0: Server not found.
stack traceback:
[C]: in function 'assert'
C:\Test scripts sborka\moonloader\CheckOnline.lua: in function <C:\Test scripts sborka\moonloader\CheckOnline.lua:0>
[18:12:05.862749] (error) CheckOnline: Script died due to an error. (0AB2638C)
[18:12:14.222227] (script) de_50.lua: Dialog: 1, Button: 1Input: 123321
[18:12:14.733256] (script) de_50.lua: Dialog: 1, Button: 1Input: Мужчина
[18:12:15.239285] (script) de_50.lua: Dialog: 1, Button: 1Input: Светлый
[18:12:15.741314] (script) de_50.lua: Dialog: 1, Button: 1Input: Вкладка 'Hosted'
[18:12:45.121994] (script) de_50.lua: Dialog: 222, Button: 1Input:
[18:12:47.644139] (script) de_50.lua: Dialog: 8821, Button: 1Input: 50-
[18:12:48.472186] (script) de_50.lua: Dialog: 0, Button: 1Input:
[18:12:50.087278] (script) de_50.lua: Dialog: 8994, Button: 1Input:
[18:12:50.616309] (script) de_50.lua: Dialog: 0, Button: 1Input:
[18:12:51.006331] (script) de_50.lua: Dialog: 8996, Button: 1Input:
[18:12:52.910440] (script) de_50.lua: Dialog: 9003, Button: 1Input:
[18:12:54.029504] (script) de_50.lua: Dialog: 8995, Button: 1Input:
[18:13:00.782890] (script) de_50.lua: Dialog: 6702, Button: 1Input: 50
[18:16:34.139093] (system) AIRBRAKE by SanderFisher.lua: Script terminated. (0AB255C4)
[18:16:34.139093] (system) Custom NameTags: Script terminated. (0AD20494)
[18:16:34.140093] (system) de_50.lua: Script terminated. (0AD2061C)
[18:16:34.141093] (system) DTime: Script terminated. (0AD2092C)
[18:16:34.142093] (system) GameFixer.lua: Script terminated. (0AD20AB4)
[18:16:34.144094] (system) GODMODE by SanderFisher.lua: Script terminated. (0AD20C3C)
[18:16:34.145094] (system) Benjamin Busterenko: Script terminated. (0AD20DC4)
[18:16:34.145094] (system) Player Remover: Script terminated. (0AD20F4C)
[18:16:34.146094] (system) ML-ReloadAll: Script terminated. (0AD210D4)
[18:16:34.147094] (system) samp++.lua: Script terminated. (0AD2125C)
[18:16:34.148094] (system) WallHack: Script terminated. (0AD213E4)
[18:16:34.149094] (system) быстрая загрузка: Script terminated. (0AD2156C)
[18:16:34.150094] (system) Loading script 'C:\Test scripts sborka\moonloader\AIRBRAKE by SanderFisher.lua'...
[18:16:34.150094] (debug) New script: 0AD2156C
[18:16:34.151094] (system) AIRBRAKE by SanderFisher.lua: Loaded successfully.
[18:16:34.151094] (system) Loading script 'C:\Test scripts sborka\moonloader\CheckOnline.lua'...
[18:16:34.151094] (debug) New script: 0AD213E4
[18:16:34.156094] (system) CheckOnline: Loaded successfully.
[18:16:34.156094] (system) Loading script 'C:\Test scripts sborka\moonloader\Custom_NameTags_v_2.0.lua'...
[18:16:34.156094] (debug) New script: 0AD2125C
[18:16:34.160095] (system) Custom NameTags: Loaded successfully.
[18:16:34.160095] (system) Loading script 'C:\Test scripts sborka\moonloader\de_50.lua'...
[18:16:34.160095] (debug) New script: 0AD210D4
[18:16:34.165095] (system) de_50.lua: Loaded successfully.
[18:16:34.165095] (system) Loading script 'C:\Test scripts sborka\moonloader\DTime1.3.lua'...
[18:16:34.165095] (debug) New script: 0AD20F4C
[18:16:34.172095] (system) DTime: Loaded successfully.
[18:16:34.173095] (system) Loading script 'C:\Test scripts sborka\moonloader\FullText.lua'...
[18:16:34.173095] (debug) New script: 0AD20DC4
[18:16:34.173095] (error) FullText.lua: C:\Test scripts sborka\moonloader\FullText.lua:27: 'end' expected (to close 'function' at line 19) near '<eof>'
[18:16:34.173095] (error) FullText.lua: Script died due to an error. (0AD20DC4)
[18:16:34.173095] (system) Loading script 'C:\Test scripts sborka\moonloader\GameFixer.lua'...
[18:16:34.173095] (debug) New script: 0AD20DC4
[18:16:34.192096] (system) GameFixer.lua: Loaded successfully.
[18:16:34.192096] (system) Loading script 'C:\Test scripts sborka\moonloader\GODMODE by SanderFisher.lua'...
[18:16:34.192096] (debug) New script: 0AD20C3C
[18:16:34.196097] (system) GODMODE by SanderFisher.lua: Loaded successfully.
[18:16:34.196097] (system) Loading script 'C:\Test scripts sborka\moonloader\lock.lua'...
[18:16:34.196097] (debug) New script: 0AD20AB4
[18:16:34.201097] (system) Benjamin Busterenko: Loaded successfully.
[18:16:34.201097] (system) Loading script 'C:\Test scripts sborka\moonloader\NoAdmins.lua'...
[18:16:34.201097] (debug) New script: 0AD2092C
[18:16:34.201097] (error) NoAdmins.lua: C:\Test scripts sborka\moonloader\NoAdmins.lua:21: 'end' expected (to close 'function' at line 7) near '<eof>'
[18:16:34.201097] (error) NoAdmins.lua: Script died due to an error. (0AD2092C)
[18:16:34.201097] (system) Loading script 'C:\Test scripts sborka\moonloader\Player Remover.lua'...
[18:16:34.201097] (debug) New script: 0AD2092C
[18:16:34.216098] (system) Player Remover: Loaded successfully.
[18:16:34.216098] (system) Loading script 'C:\Test scripts sborka\moonloader\reload_all.lua'...
[18:16:34.216098] (debug) New script: 0AD2061C
[18:16:34.220098] (system) ML-ReloadAll: Loaded successfully.
[18:16:34.220098] (system) Loading script 'C:\Test scripts sborka\moonloader\samp++.lua'...
[18:16:34.220098] (debug) New script: 0AD20494
[18:16:34.226098] (system) samp++.lua: Loaded successfully.
[18:16:34.226098] (system) Loading script 'C:\Test scripts sborka\moonloader\Test2.lua'...
[18:16:34.226098] (debug) New script: 076CDEFC
[18:16:34.227098] (error) Test2.lua: C:\Test scripts sborka\moonloader\Test2.lua:63: '<eof>' expected near 'end'
[18:16:34.227098] (error) Test2.lua: Script died due to an error. (076CDEFC)
[18:16:34.227098] (system) Loading script 'C:\Test scripts sborka\moonloader\WALLHACK by SanderFisher.luac'...
[18:16:34.227098] (debug) New script: 076CDEFC
[18:16:34.236099] (system) WallHack: Loaded successfully.
[18:16:34.236099] (system) Loading script 'C:\Test scripts sborka\moonloader\быстрая загрузка.lua'...
[18:16:34.236099] (debug) New script: 076CE394
[18:16:34.237099] (system) быстрая загрузка: Loaded successfully.
[18:16:34.237099] (error) CheckOnline: C:\Test scripts sborka\moonloader\CheckOnline.lua:0: Server not found.
stack traceback:
[C]: in function 'assert'
C:\Test scripts sborka\moonloader\CheckOnline.lua: in function <C:\Test scripts sborka\moonloader\CheckOnline.lua:0>
[18:16:34.237099] (error) CheckOnline: Script died due to an error. (0AD213E4)
[18:20:41.383235] (system) AIRBRAKE by SanderFisher.lua: Script terminated. (0AD2156C)
[18:20:41.383235] (system) Custom NameTags: Script terminated. (0AD2125C)
[18:20:41.384235] (system) de_50.lua: Script terminated. (0AD210D4)
[18:20:41.385235] (system) DTime: Script terminated. (0AD20F4C)
[18:20:41.386235] (system) GameFixer.lua: Script terminated. (0AD20DC4)
[18:20:41.388235] (system) GODMODE by SanderFisher.lua: Script terminated. (0AD20C3C)
[18:20:41.389235] (system) Benjamin Busterenko: Script terminated. (0AD20AB4)
[18:20:41.389235] (system) Player Remover: Script terminated. (0AD2092C)
[18:20:41.390235] (system) ML-ReloadAll: Script terminated. (0AD2061C)
[18:20:41.391235] (system) samp++.lua: Script terminated. (0AD20494)
[18:20:41.392235] (system) WallHack: Script terminated. (076CDEFC)
[18:20:41.393235] (system) быстрая загрузка: Script terminated. (076CE394)
[18:20:41.393235] (system) Loading script 'C:\Test scripts sborka\moonloader\AIRBRAKE by SanderFisher.lua'...
[18:20:41.393235] (debug) New script: 076CE394
[18:20:41.394236] (system) AIRBRAKE by SanderFisher.lua: Loaded successfully.
[18:20:41.394236] (system) Loading script 'C:\Test scripts sborka\moonloader\CheckOnline.lua'...
[18:20:41.394236] (debug) New script: 076CDEFC
[18:20:41.398236] (system) CheckOnline: Loaded successfully.
[18:20:41.399236] (system) Loading script 'C:\Test scripts sborka\moonloader\Custom_NameTags_v_2.0.lua'...
[18:20:41.399236] (debug) New script: 076CE20C
[18:20:41.403236] (system) Custom NameTags: Loaded successfully.
[18:20:41.403236] (system) Loading script 'C:\Test scripts sborka\moonloader\de_50.lua'...
[18:20:41.403236] (debug) New script: 076CDD74
[18:20:41.408236] (system) de_50.lua: Loaded successfully.
[18:20:41.408236] (system) Loading script 'C:\Test scripts sborka\moonloader\DTime1.3.lua'...
[18:20:41.408236] (debug) New script: 076CE084
[18:20:41.416237] (system) DTime: Loaded successfully.
[18:20:41.416237] (system) Loading script 'C:\Test scripts sborka\moonloader\FullText.lua'...
[18:20:41.416237] (debug) New script: 076CE82C
[18:20:41.416237] (error) FullText.lua: C:\Test scripts sborka\moonloader\FullText.lua:27: 'end' expected (to close 'function' at line 19) near '<eof>'
[18:20:41.416237] (error) FullText.lua: Script died due to an error. (076CE82C)
[18:20:41.416237] (system) Loading script 'C:\Test scripts sborka\moonloader\GameFixer.lua'...
[18:20:41.416237] (debug) New script: 076CE82C
[18:20:41.435238] (system) GameFixer.lua: Loaded successfully.
[18:20:41.435238] (system) Loading script 'C:\Test scripts sborka\moonloader\GODMODE by SanderFisher.lua'...
[18:20:41.435238] (debug) New script: 076CE51C
[18:20:41.440238] (system) GODMODE by SanderFisher.lua: Loaded successfully.
[18:20:41.440238] (system) Loading script 'C:\Test scripts sborka\moonloader\lock.lua'...
[18:20:41.440238] (debug) New script: 076CDBEC
[18:20:41.445238] (system) Benjamin Busterenko: Loaded successfully.
[18:20:41.445238] (system) Loading script 'C:\Test scripts sborka\moonloader\NoAdmins.lua'...
[18:20:41.445238] (debug) New script: 076CE6A4
[18:20:41.445238] (error) NoAdmins.lua: C:\Test scripts sborka\moonloader\NoAdmins.lua:21: 'end' expected (to close 'function' at line 7) near '<eof>'
[18:20:41.445238] (error) NoAdmins.lua: Script died due to an error. (076CE6A4)
[18:20:41.445238] (system) Loading script 'C:\Test scripts sborka\moonloader\Player Remover.lua'...
[18:20:41.445238] (debug) New script: 076CE6A4
[18:20:41.459239] (system) Player Remover: Loaded successfully.
[18:20:41.459239] (system) Loading script 'C:\Test scripts sborka\moonloader\reload_all.lua'...
[18:20:41.459239] (debug) New script: 0AB24B0C
[18:20:41.463239] (system) ML-ReloadAll: Loaded successfully.
[18:20:41.463239] (system) Loading script 'C:\Test scripts sborka\moonloader\samp++.lua'...
[18:20:41.463239] (debug) New script: 0AB24674
[18:20:41.469240] (system) samp++.lua: Loaded successfully.
[18:20:41.469240] (system) Loading script 'C:\Test scripts sborka\moonloader\Test2.lua'...
[18:20:41.470240] (debug) New script: 0AB2638C
[18:20:41.470240] (error) Test2.lua: C:\Test scripts sborka\moonloader\Test2.lua:70: '<eof>' expected near 'end'
[18:20:41.470240] (error) Test2.lua: Script died due to an error. (0AB2638C)
[18:20:41.470240] (system) Loading script 'C:\Test scripts sborka\moonloader\WALLHACK by SanderFisher.luac'...
[18:20:41.470240] (debug) New script: 0AB2638C
[18:20:41.479240] (system) WallHack: Loaded successfully.
[18:20:41.479240] (system) Loading script 'C:\Test scripts sborka\moonloader\быстрая загрузка.lua'...
[18:20:41.479240] (debug) New script: 0AB247FC
[18:20:41.480240] (system) быстрая загрузка: Loaded successfully.
[18:20:41.480240] (error) CheckOnline: C:\Test scripts sborka\moonloader\CheckOnline.lua:0: Server not found.
stack traceback:
[C]: in function 'assert'
C:\Test scripts sborka\moonloader\CheckOnline.lua: in function <C:\Test scripts sborka\moonloader\CheckOnline.lua:0>
[18:20:41.480240] (error) CheckOnline: Script died due to an error. (076CDEFC)
[18:26:00.297476] (system) AIRBRAKE by SanderFisher.lua: Script terminated. (076CE394)
[18:26:00.297476] (system) Custom NameTags: Script terminated. (076CE20C)
[18:26:00.298476] (system) de_50.lua: Script terminated. (076CDD74)
[18:26:00.299476] (system) DTime: Script terminated. (076CE084)
[18:26:00.300476] (system) GameFixer.lua: Script terminated. (076CE82C)
[18:26:00.303476] (system) GODMODE by SanderFisher.lua: Script terminated. (076CE51C)
[18:26:00.304476] (system) Benjamin Busterenko: Script terminated. (076CDBEC)
[18:26:00.304476] (system) Player Remover: Script terminated. (076CE6A4)
[18:26:00.305476] (system) ML-ReloadAll: Script terminated. (0AB24B0C)
[18:26:00.307476] (system) samp++.lua: Script terminated. (0AB24674)
[18:26:00.308476] (system) WallHack: Script terminated. (0AB2638C)
[18:26:00.308476] (system) быстрая загрузка: Script terminated. (0AB247FC)
[18:26:00.309476] (system) Loading script 'C:\Test scripts sborka\moonloader\AIRBRAKE by SanderFisher.lua'...
[18:26:00.309476] (debug) New script: 0AB247FC
[18:26:00.310476] (system) AIRBRAKE by SanderFisher.lua: Loaded successfully.
[18:26:00.310476] (system) Loading script 'C:\Test scripts sborka\moonloader\CheckOnline.lua'...
[18:26:00.310476] (debug) New script: 0AB2638C
[18:26:00.315477] (system) CheckOnline: Loaded successfully.
[18:26:00.315477] (system) Loading script 'C:\Test scripts sborka\moonloader\Custom_NameTags_v_2.0.lua'...
[18:26:00.315477] (debug) New script: 0AB24674
[18:26:00.319477] (system) Custom NameTags: Loaded successfully.
[18:26:00.319477] (system) Loading script 'C:\Test scripts sborka\moonloader\de_50.lua'...
[18:26:00.319477] (debug) New script: 0AB24B0C
[18:26:00.325477] (system) de_50.lua: Loaded successfully.
[18:26:00.325477] (system) Loading script 'C:\Test scripts sborka\moonloader\DTime1.3.lua'...
[18:26:00.325477] (debug) New script: 0AB25EF4
[18:26:00.332478] (system) DTime: Loaded successfully.
[18:26:00.332478] (system) Loading script 'C:\Test scripts sborka\moonloader\FullText.lua'...
[18:26:00.332478] (debug) New script: 0AB24984
[18:26:00.332478] (error) FullText.lua: C:\Test scripts sborka\moonloader\FullText.lua:27: 'end' expected (to close 'function' at line 19) near '<eof>'
[18:26:00.332478] (error) FullText.lua: Script died due to an error. (0AB24984)
[18:26:00.333478] (system) Loading script 'C:\Test scripts sborka\moonloader\GameFixer.lua'...
[18:26:00.333478] (debug) New script: 0AB24984
[18:26:00.353479] (system) GameFixer.lua: Loaded successfully.
[18:26:00.353479] (system) Loading script 'C:\Test scripts sborka\moonloader\GODMODE by SanderFisher.lua'...
[18:26:00.353479] (debug) New script: 0AB24C94
[18:26:00.358479] (system) GODMODE by SanderFisher.lua: Loaded successfully.
[18:26:00.358479] (system) Loading script 'C:\Test scripts sborka\moonloader\lock.lua'...
[18:26:00.358479] (debug) New script: 0AB2512C
[18:26:00.362479] (system) Benjamin Busterenko: Loaded successfully.
[18:26:00.362479] (system) Loading script 'C:\Test scripts sborka\moonloader\NoAdmins.lua'...
[18:26:00.362479] (debug) New script: 0AB252B4
[18:26:00.363480] (error) NoAdmins.lua: C:\Test scripts sborka\moonloader\NoAdmins.lua:21: 'end' expected (to close 'function' at line 7) near '<eof>'
[18:26:00.363480] (error) NoAdmins.lua: Script died due to an error. (0AB252B4)
[18:26:00.363480] (system) Loading script 'C:\Test scripts sborka\moonloader\Player Remover.lua'...
[18:26:00.363480] (debug) New script: 0AB252B4
[18:26:00.377480] (system) Player Remover: Loaded successfully.
[18:26:00.377480] (system) Loading script 'C:\Test scripts sborka\moonloader\reload_all.lua'...
[18:26:00.377480] (debug) New script: 0AB24FA4
[18:26:00.381481] (system) ML-ReloadAll: Loaded successfully.
[18:26:00.381481] (system) Loading script 'C:\Test scripts sborka\moonloader\samp++.lua'...
[18:26:00.381481] (debug) New script: 0AB255C4
[18:26:00.387481] (system) samp++.lua: Loaded successfully.
[18:26:00.388481] (system) Loading script 'C:\Test scripts sborka\moonloader\Test2.lua'...
[18:26:00.388481] (debug) New script: 0AB25BE4
[18:26:00.388481] (error) Test2.lua: C:\Test scripts sborka\moonloader\Test2.lua:66: '=' expected near 'End'
[18:26:00.388481] (error) Test2.lua: Script died due to an error. (0AB25BE4)
[18:26:00.388481] (system) Loading script 'C:\Test scripts sborka\moonloader\WALLHACK by SanderFisher.luac'...
[18:26:00.388481] (debug) New script: 0AB25BE4
[18:26:00.397481] (system) WallHack: Loaded successfully.
[18:26:00.397481] (system) Loading script 'C:\Test scripts sborka\moonloader\быстрая загрузка.lua'...
[18:26:00.397481] (debug) New script: 0AB2574C
[18:26:00.398482] (system) быстрая загрузка: Loaded successfully.
[18:26:00.398482] (error) CheckOnline: C:\Test scripts sborka\moonloader\CheckOnline.lua:0: Server not found.
stack traceback:
[C]: in function 'assert'
C:\Test scripts sborka\moonloader\CheckOnline.lua: in function <C:\Test scripts sborka\moonloader\CheckOnline.lua:0>
[18:26:00.398482] (error) CheckOnline: Script died due to an error. (0AB2638C)
[18:28:21.116530] (system) AIRBRAKE by SanderFisher.lua: Script terminated. (0AB247FC)
[18:28:21.116530] (system) Custom NameTags: Script terminated. (0AB24674)
[18:28:21.117530] (system) de_50.lua: Script terminated. (0AB24B0C)
[18:28:21.117530] (system) DTime: Script terminated. (0AB25EF4)
[18:28:21.119530] (system) GameFixer.lua: Script terminated. (0AB24984)
[18:28:21.121530] (system) GODMODE by SanderFisher.lua: Script terminated. (0AB24C94)
[18:28:21.122530] (system) Benjamin Busterenko: Script terminated. (0AB2512C)
[18:28:21.122530] (system) Player Remover: Script terminated. (0AB252B4)
[18:28:21.123531] (system) ML-ReloadAll: Script terminated. (0AB24FA4)
[18:28:21.124531] (system) samp++.lua: Script terminated. (0AB255C4)
[18:28:21.125531] (system) WallHack: Script terminated. (0AB25BE4)
[18:28:21.126531] (system) быстрая загрузка: Script terminated. (0AB2574C)
[18:28:21.126531] (system) Loading script 'C:\Test scripts sborka\moonloader\AIRBRAKE by SanderFisher.lua'...
[18:28:21.126531] (debug) New script: 0AB2574C
[18:28:21.127531] (system) AIRBRAKE by SanderFisher.lua: Loaded successfully.
[18:28:21.127531] (system) Loading script 'C:\Test scripts sborka\moonloader\CheckOnline.lua'...
[18:28:21.128531] (debug) New script: 0AB25BE4
[18:28:21.132531] (system) CheckOnline: Loaded successfully.
[18:28:21.132531] (system) Loading script 'C:\Test scripts sborka\moonloader\Custom_NameTags_v_2.0.lua'...
[18:28:21.132531] (debug) New script: 0AB255C4
[18:28:21.136531] (system) Custom NameTags: Loaded successfully.
[18:28:21.136531] (system) Loading script 'C:\Test scripts sborka\moonloader\de_50.lua'...
[18:28:21.136531] (debug) New script: 0AB24FA4
[18:28:21.140531] (system) de_50.lua: Loaded successfully.
[18:28:21.140531] (system) Loading script 'C:\Test scripts sborka\moonloader\DTime1.3.lua'...
[18:28:21.140531] (debug) New script: 0AB252B4
[18:28:21.148532] (system) DTime: Loaded successfully.
[18:28:21.148532] (system) Loading script 'C:\Test scripts sborka\moonloader\FullText.lua'...
[18:28:21.148532] (debug) New script: 0AB2512C
[18:28:21.148532] (error) FullText.lua: C:\Test scripts sborka\moonloader\FullText.lua:27: 'end' expected (to close 'function' at line 19) near '<eof>'
[18:28:21.148532] (error) FullText.lua: Script died due to an error. (0AB2512C)
[18:28:21.148532] (system) Loading script 'C:\Test scripts sborka\moonloader\GameFixer.lua'...
[18:28:21.148532] (debug) New script: 0AB2512C
[18:28:21.168533] (system) GameFixer.lua: Loaded successfully.
[18:28:21.168533] (system) Loading script 'C:\Test scripts sborka\moonloader\GODMODE by SanderFisher.lua'...
[18:28:21.168533] (debug) New script: 0AB24C94
[18:28:21.173533] (system) GODMODE by SanderFisher.lua: Loaded successfully.
[18:28:21.173533] (system) Loading script 'C:\Test scripts sborka\moonloader\lock.lua'...
[18:28:21.173533] (debug) New script: 0AB24984
[18:28:21.178534] (system) Benjamin Busterenko: Loaded successfully.
[18:28:21.178534] (system) Loading script 'C:\Test scripts sborka\moonloader\NoAdmins.lua'...
[18:28:21.178534] (debug) New script: 0AB25EF4
[18:28:21.178534] (error) NoAdmins.lua: C:\Test scripts sborka\moonloader\NoAdmins.lua:21: 'end' expected (to close 'function' at line 7) near '<eof>'
[18:28:21.178534] (error) NoAdmins.lua: Script died due to an error. (0AB25EF4)
[18:28:21.178534] (system) Loading script 'C:\Test scripts sborka\moonloader\Player Remover.lua'...
[18:28:21.178534] (debug) New script: 0AB25EF4
[18:28:21.193535] (system) Player Remover: Loaded successfully.
[18:28:21.193535] (system) Loading script 'C:\Test scripts sborka\moonloader\reload_all.lua'...
[18:28:21.193535] (debug) New script: 0AB24B0C
[18:28:21.197535] (system) ML-ReloadAll: Loaded successfully.
[18:28:21.197535] (system) Loading script 'C:\Test scripts sborka\moonloader\samp++.lua'...
[18:28:21.197535] (debug) New script: 0AB24674
[18:28:21.204535] (system) samp++.lua: Loaded successfully.
[18:28:21.204535] (system) Loading script 'C:\Test scripts sborka\moonloader\Test2.lua'...
[18:28:21.204535] (debug) New script: 0AB247FC
[18:28:21.209535] (error) New script: C:\Test scripts sborka\moonloader\Test2.lua:126: attempt to index global 'sampev' (a nil value)
stack traceback:
C:\Test scripts sborka\moonloader\Test2.lua:126: in main chunk
[18:28:21.209535] (error) New script: Script died due to an error. (0AB247FC)
[18:28:21.210535] (system) Loading script 'C:\Test scripts sborka\moonloader\WALLHACK by SanderFisher.luac'...
[18:28:21.210535] (debug) New script: 0AB247FC
[18:28:21.219536] (system) WallHack: Loaded successfully.
[18:28:21.219536] (system) Loading script 'C:\Test scripts sborka\moonloader\быстрая загрузка.lua'...
[18:28:21.219536] (debug) New script: 0AB258D4
[18:28:21.220536] (system) быстрая загрузка: Loaded successfully.
[18:28:21.220536] (error) CheckOnline: C:\Test scripts sborka\moonloader\CheckOnline.lua:0: Server not found.
stack traceback:
[C]: in function 'assert'
C:\Test scripts sborka\moonloader\CheckOnline.lua: in function <C:\Test scripts sborka\moonloader\CheckOnline.lua:0>
[18:28:21.220536] (error) CheckOnline: Script died due to an error. (0AB25BE4)
[18:32:58.568399] (system) AIRBRAKE by SanderFisher.lua: Script terminated. (0AB2574C)
[18:32:58.568399] (system) Custom NameTags: Script terminated. (0AB255C4)
[18:32:58.570400] (system) de_50.lua: Script terminated. (0AB24FA4)
[18:32:58.570400] (system) DTime: Script terminated. (0AB252B4)
[18:32:58.572400] (system) GameFixer.lua: Script terminated. (0AB2512C)
[18:32:58.574400] (system) GODMODE by SanderFisher.lua: Script terminated. (0AB24C94)
[18:32:58.575400] (system) Benjamin Busterenko: Script terminated. (0AB24984)
[18:32:58.575400] (system) Player Remover: Script terminated. (0AB25EF4)
[18:32:58.576400] (system) ML-ReloadAll: Script terminated. (0AB24B0C)
[18:32:58.578400] (system) samp++.lua: Script terminated. (0AB24674)
[18:32:58.579400] (system) WallHack: Script terminated. (0AB247FC)
[18:32:58.580400] (system) быстрая загрузка: Script terminated. (0AB258D4)
[18:32:58.580400] (system) Loading script 'C:\Test scripts sborka\moonloader\AIRBRAKE by SanderFisher.lua'...
[18:32:58.580400] (debug) New script: 0AB258D4
[18:32:58.581400] (system) AIRBRAKE by SanderFisher.lua: Loaded successfully.
[18:32:58.581400] (system) Loading script 'C:\Test scripts sborka\moonloader\CheckOnline.lua'...
[18:32:58.581400] (debug) New script: 0AB247FC
[18:32:58.586400] (system) CheckOnline: Loaded successfully.
[18:32:58.586400] (system) Loading script 'C:\Test scripts sborka\moonloader\Custom_NameTags_v_2.0.lua'...
[18:32:58.586400] (debug) New script: 0AB24674
[18:32:58.591401] (system) Custom NameTags: Loaded successfully.
[18:32:58.591401] (system) Loading script 'C:\Test scripts sborka\moonloader\de_50.lua'...
[18:32:58.591401] (debug) New script: 0AB24B0C
[18:32:58.596401] (system) de_50.lua: Loaded successfully.
[18:32:58.596401] (system) Loading script 'C:\Test scripts sborka\moonloader\DTime1.3.lua'...
[18:32:58.596401] (debug) New script: 0AB25EF4
[18:32:58.605402] (system) DTime: Loaded successfully.
[18:32:58.605402] (system) Loading script 'C:\Test scripts sborka\moonloader\FullText.lua'...
[18:32:58.605402] (debug) New script: 0AB24984
[18:32:58.605402] (error) FullText.lua: C:\Test scripts sborka\moonloader\FullText.lua:27: 'end' expected (to close 'function' at line 19) near '<eof>'
[18:32:58.605402] (error) FullText.lua: Script died due to an error. (0AB24984)
[18:32:58.605402] (system) Loading script 'C:\Test scripts sborka\moonloader\GameFixer.lua'...
[18:32:58.605402] (debug) New script: 0AB24984
[18:32:58.627403] (system) GameFixer.lua: Loaded successfully.
[18:32:58.627403] (system) Loading script 'C:\Test scripts sborka\moonloader\GODMODE by SanderFisher.lua'...
[18:32:58.627403] (debug) New script: 0AB24C94
[18:32:58.632403] (system) GODMODE by SanderFisher.lua: Loaded successfully.
[18:32:58.632403] (system) Loading script 'C:\Test scripts sborka\moonloader\lock.lua'...
[18:32:58.632403] (debug) New script: 0AB2512C
[18:32:58.638403] (system) Benjamin Busterenko: Loaded successfully.
[18:32:58.638403] (system) Loading script 'C:\Test scripts sborka\moonloader\NoAdmins.lua'...
[18:32:58.638403] (debug) New script: 0AB24E1C
[18:32:58.638403] (error) NoAdmins.lua: C:\Test scripts sborka\moonloader\NoAdmins.lua:21: 'end' expected (to close 'function' at line 7) near '<eof>'
[18:32:58.638403] (error) NoAdmins.lua: Script died due to an error. (0AB24E1C)
[18:32:58.638403] (system) Loading script 'C:\Test scripts sborka\moonloader\Player Remover.lua'...
[18:32:58.638403] (debug) New script: 0AB24E1C
[18:32:58.652404] (system) Player Remover: Loaded successfully.
[18:32:58.653404] (system) Loading script 'C:\Test scripts sborka\moonloader\reload_all.lua'...
[18:32:58.653404] (debug) New script: 0AB252B4
[18:32:58.657405] (system) ML-ReloadAll: Loaded successfully.
[18:32:58.657405] (system) Loading script 'C:\Test scripts sborka\moonloader\samp++.lua'...
[18:32:58.657405] (debug) New script: 0AB24FA4
[18:32:58.663405] (system) samp++.lua: Loaded successfully.
[18:32:58.663405] (system) Loading script 'C:\Test scripts sborka\moonloader\Test2.lua'...
[18:32:58.663405] (debug) New script: 0AB255C4
[18:32:58.663405] (error) Test2.lua: C:\Test scripts sborka\moonloader\Test2.lua:34: '=' expected near '=='
[18:32:58.663405] (error) Test2.lua: Script died due to an error. (0AB255C4)
[18:32:58.664405] (system) Loading script 'C:\Test scripts sborka\moonloader\WALLHACK by SanderFisher.luac'...
[18:32:58.664405] (debug) New script: 0AB255C4
[18:32:58.673405] (system) WallHack: Loaded successfully.
[18:32:58.673405] (system) Loading script 'C:\Test scripts sborka\moonloader\быстрая загрузка.lua'...
[18:32:58.673405] (debug) New script: 0AB2574C
[18:32:58.674406] (system) быстрая загрузка: Loaded successfully.
[18:32:58.674406] (error) CheckOnline: C:\Test scripts sborka\moonloader\CheckOnline.lua:0: Server not found.
 

Kirkjubaijaarklaustur

Известный
390
130
Lua:
script_name('New script') -- название скрипта
script_author('RORMS') -- автор скрипта
script_description('imgui') -- описание скрипта

require "lib.moonloader" -- подключение библиотеки
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8


local tag = '[My First Script]:' -- локальная переменная
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end

sampRegisterChatCommand("imgui", cmd_imgui)

_, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickname(id)

imgui.Process = false

if main.window_state.v == false then
imgui.Process == false
end

--Блок выполняется один раз после старта игры.

while true do
wait(0)

if isKeyJustPressed(VK_F3) then
sampAddChatMessage("Вы нажали клавишу {FFFFFF}F3. " .. main_color_text .. "Ваш ник: {FFFFFF}" .. nick .. ", " .. main_color_text .. "ваш ID: {FFFFFF}" .. id, main_color)
end

if isKeyDown(VK_MENU) and isKeyJustPressed(VK_9) then
sampAddChatMessage("Вы крут, вы зажали комбинацию клавиш!", main_color)
wait(500)
sampAddChatMessage("Прошло пол секунды", main_color)
end

end
--End

function cmd_imgui(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end


function imgui.OnDrawFrame()
imgui.Begin(u8"Привет", main_window_state)
imgui.InputText(u8'Вводить текст сюда', text_buffer)
x, y, z = getCharCoordinates(PLAYER_PED)
imgui.text(u8("Позиция игроква : X:" .. math.floor(x) .. "| Y: " .. math.floor:good: .. math.floor:good: .. " | Z: " .. math.floor(z)))
if imgui.Buttom('Press me') then
sampAddChatMessage(u8:decode(text_buffer.v), -1)
End
imgui.End()
-- Блок выполняется бесконечно (пока самп активен)
end

end
end


function cmd_normal(arg)
thread:run("normal", arg)
end

function cmd_cool(arg)
thread:run("cool", arg)
end

function thread_fuction(option, arg)
if option == "normal" then
sampAddChatMessage(sampGetMaxPlayerId(false), -1)
wait(2000)
sampSendChat(arg)
end
if option == "cool" then
sampAddChatMessage("Привет ютуб, you cool", -1)
wait(1000)
sampSendChat(arg, main_color)
end
end

--for i, j in pairs(colorsName) do
--sampAddChatMessage(i, j)



--sampAddChatMessage(text, colorsName["red"])

--for i, value in ipairs(array) do
--sampAddChatMessage(i .. "Элемент" .. value, main_color)
--end



function cmd_optimal(arg)
if #arg == 0 then
sampAddChatMessage("Привет, вы ввели команду, но не ввели аргумент :(", main_color)
else
sampAddChatMessage("Привет! Вы ввели команду и ввели аргумент: {FFFFFF}" .. arg, main_color)
end
end

function cmd_cool(arg)
var1, var2 = string.match(arg, "(.+) (.+)")
if var1 == nill or var1 == "" then
sampAddChatMessage("Неплохо, у вас уже 2 аргумента, но вы их их не ввели :(", main_color)
else
sampAddChatMessage("Круто, вы ввели команду и 2 аргумента. 1ый: " .. white_color .. var1 .. ", " .. main_color_text .. "2ой: " .. white_color .. var2, main_color)
end
end



--function sampev.onSendChat(text)
--return {"Текст"}
--end


function sampev.xonSendExitVehicle(vehicleId)
sampAddChatMessage("Вы вышли с авто с ID" .. vehicleId , color)
end


function sampev.onSendEnterVehicle(vehicleId, passenger)
sampAddChatMessage("Вы сели в авто с ID" .. vehicleId .. " / Пассажир : " .. tostring(passenger) , color )
end


function sampev.onServerMessage(color, text)
if string.find(text, 'Администратор', 1, true) then
return false
end
end


function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
sampAddChatMessage(diaglogId, color)
sampAddChatMessage(style, color)
sampAddChatMessage(title, color)
sampAddChatMessage(button1, color)
sampAddChatMessage(button2, color)
sampAddChatMessage(text, color)
end

function sampev.onSetInterior(interior)
sampAddChatMessage("Вы зашли в интерьер с ID" .. interior , color)
end

function sampev.onDisplayGameText(style, time, text)
sampAddChatMessage(style, color)
sampAddChatMessage(time, color)
sampAddChatMessage(text, color)
end

function sampev.onApplyPlayerAnimation(playerId, animLib, animName, loop, lockX, lockY, freeze, time)
sampAddChatMessage(playerId, color)
sampAddChatMessage(animLib, color)
sampAddChatMessage(animName, color)
sampAddChatMessage(tostring(loop), color)
sampAddChatMessage(tostring(lockX), color)
sampAddChatMessage(tostring(lockY), color)
sampAddChatMessage(tostring(freeze), color)
sampAddChatMessage(time, color)
end
В 52 строке енда не было
Пожалуйста не кидай код в спойлер, для этого есть отдельная кнопка
1681748059484.png
 
  • Нравится
Реакции: MLycoris

R-Roach

Участник
Автор темы
76
7
Lua:
script_name('New script') -- название скрипта
script_author('RORMS') -- автор скрипта
script_description('imgui') -- описание скрипта

require "lib.moonloader" -- подключение библиотеки
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8


local tag = '[My First Script]:' -- локальная переменная
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end

sampRegisterChatCommand("imgui", cmd_imgui)

_, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickname(id)

imgui.Process = false

if main.window_state.v == false then
imgui.Process == false
end

--Блок выполняется один раз после старта игры.

while true do
wait(0)

if isKeyJustPressed(VK_F3) then
sampAddChatMessage("Вы нажали клавишу {FFFFFF}F3. " .. main_color_text .. "Ваш ник: {FFFFFF}" .. nick .. ", " .. main_color_text .. "ваш ID: {FFFFFF}" .. id, main_color)
end

if isKeyDown(VK_MENU) and isKeyJustPressed(VK_9) then
sampAddChatMessage("Вы крут, вы зажали комбинацию клавиш!", main_color)
wait(500)
sampAddChatMessage("Прошло пол секунды", main_color)
end

end
--End

function cmd_imgui(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end


function imgui.OnDrawFrame()
imgui.Begin(u8"Привет", main_window_state)
imgui.InputText(u8'Вводить текст сюда', text_buffer)
x, y, z = getCharCoordinates(PLAYER_PED)
imgui.text(u8("Позиция игроква : X:" .. math.floor(x) .. "| Y: " .. math.floor:good: .. math.floor:good: .. " | Z: " .. math.floor(z)))
if imgui.Buttom('Press me') then
sampAddChatMessage(u8:decode(text_buffer.v), -1)
End
imgui.End()
-- Блок выполняется бесконечно (пока самп активен)
end

end
end


function cmd_normal(arg)
thread:run("normal", arg)
end

function cmd_cool(arg)
thread:run("cool", arg)
end

function thread_fuction(option, arg)
if option == "normal" then
sampAddChatMessage(sampGetMaxPlayerId(false), -1)
wait(2000)
sampSendChat(arg)
end
if option == "cool" then
sampAddChatMessage("Привет ютуб, you cool", -1)
wait(1000)
sampSendChat(arg, main_color)
end
end

--for i, j in pairs(colorsName) do
--sampAddChatMessage(i, j)



--sampAddChatMessage(text, colorsName["red"])

--for i, value in ipairs(array) do
--sampAddChatMessage(i .. "Элемент" .. value, main_color)
--end



function cmd_optimal(arg)
if #arg == 0 then
sampAddChatMessage("Привет, вы ввели команду, но не ввели аргумент :(", main_color)
else
sampAddChatMessage("Привет! Вы ввели команду и ввели аргумент: {FFFFFF}" .. arg, main_color)
end
end

function cmd_cool(arg)
var1, var2 = string.match(arg, "(.+) (.+)")
if var1 == nill or var1 == "" then
sampAddChatMessage("Неплохо, у вас уже 2 аргумента, но вы их их не ввели :(", main_color)
else
sampAddChatMessage("Круто, вы ввели команду и 2 аргумента. 1ый: " .. white_color .. var1 .. ", " .. main_color_text .. "2ой: " .. white_color .. var2, main_color)
end
end



--function sampev.onSendChat(text)
--return {"Текст"}
--end


function sampev.xonSendExitVehicle(vehicleId)
sampAddChatMessage("Вы вышли с авто с ID" .. vehicleId , color)
end


function sampev.onSendEnterVehicle(vehicleId, passenger)
sampAddChatMessage("Вы сели в авто с ID" .. vehicleId .. " / Пассажир : " .. tostring(passenger) , color )
end


function sampev.onServerMessage(color, text)
if string.find(text, 'Администратор', 1, true) then
return false
end
end


function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
sampAddChatMessage(diaglogId, color)
sampAddChatMessage(style, color)
sampAddChatMessage(title, color)
sampAddChatMessage(button1, color)
sampAddChatMessage(button2, color)
sampAddChatMessage(text, color)
end

function sampev.onSetInterior(interior)
sampAddChatMessage("Вы зашли в интерьер с ID" .. interior , color)
end

function sampev.onDisplayGameText(style, time, text)
sampAddChatMessage(style, color)
sampAddChatMessage(time, color)
sampAddChatMessage(text, color)
end

function sampev.onApplyPlayerAnimation(playerId, animLib, animName, loop, lockX, lockY, freeze, time)
sampAddChatMessage(playerId, color)
sampAddChatMessage(animLib, color)
sampAddChatMessage(animName, color)
sampAddChatMessage(tostring(loop), color)
sampAddChatMessage(tostring(lockX), color)
sampAddChatMessage(tostring(lockY), color)
sampAddChatMessage(tostring(freeze), color)
sampAddChatMessage(time, color)
end
В 52 строке енда не было
Пожалуйста не кидай код в спойлер, для этого есть отдельная кнопкаПосмотреть вложение 198064
Я код кинул в функции 'Код'

а moonloader log кинул в функцию 'Спойлер'