Не работает .lua скрипт!

Alan__Morales

Новичок
Автор темы
9
0
Версия SA-MP
  1. 0.3.7 (R1)
  2. 0.3.7-R2
  3. 0.3.7-R3
  4. 0.3.7-R4
Здраствуйте, помогите пожалуйста решить проблема снизу лог.

(error) OneLuaScript.lua: D:\Games\AaaaGTAtopppsss\moonloader\OneLuaScript.lua:5: '=' expected near '*'
[ML] (error) OneLuaScript.lua: Script died due to an error. (0DD9B354)
Этот луа скрипт не грузиться я не могу понять в чем его проблема? = и * все правильно стоят я 8 раз проверил ошибок не нашел а самп ругается



[ML] (system) ML-AutoReboot: Script terminated. (0DD9B354)
[ML] (system) Check MoonLoader Updates: Script terminated. (0DD9B664)
[ML] (system) ML-ReloadAll: Script terminated. (0DD9BAFC)
[ML] (system) SF Integration: Script terminated. (0DD9B4DC)
[ML] (system) Loading script 'D:\Games\AaaaGTAtopppsss\moonloader\AutoReboot.lua'...
[ML] (system) ML-AutoReboot: Loaded successfully.
[ML] (system) Loading script 'D:\Games\AaaaGTAtopppsss\moonloader\check-moonloader-updates.lua'...
[ML] (system) Check MoonLoader Updates: Loaded successfully.
[ML] (system) Loading script 'D:\Games\AaaaGTAtopppsss\moonloader\OneLuaScript.lua'...
[ML] (error) OneLuaScript.lua: D:\Games\AaaaGTAtopppsss\moonloader\OneLuaScript.lua:5: '=' expected near '*'
[ML] (error) OneLuaScript.lua: Script died due to an error. (0DD9B354)
[ML] (system) Loading script 'D:\Games\AaaaGTAtopppsss\moonloader\reload_all.lua'...
[ML] (system) ML-ReloadAll: Loaded successfully.
[ML] (system) Loading script 'D:\Games\AaaaGTAtopppsss\moonloader\SF Integration.lua'...
[ML] (system) SF Integration: Loaded successfully.
 

Alan__Morales

Новичок
Автор темы
9
0
ошибка в 5 строчке. Покажи код файла.
Извиняюсь еще одна ошика выскочила уже проблемы с imgui вот исходник:
script_name('OneLuaScript')
script_author('Dronov')
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 = "(OneLuaScript):"
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{SA90CE}"
local white_color = "{FFFFFF}"


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

sampRegisterChatCommand("imgui", cmd_imgui)

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

imgui.Process = true

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)

end

function imgui.onDrawFrame()
imgui.Begin("StartImgui")
imgui.Text("Some Text")
imgui.End()
end
 

Fott

Простреленный
3,423
2,249
Извиняюсь еще одна ошика выскочила уже проблемы с imgui вот исходник:
script_name('OneLuaScript')
script_author('Dronov')
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 = "(OneLuaScript):"
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{SA90CE}"
local white_color = "{FFFFFF}"


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

sampRegisterChatCommand("imgui", cmd_imgui)

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

imgui.Process = true

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)

end

function imgui.onDrawFrame()
imgui.Begin("StartImgui")
imgui.Text("Some Text")
imgui.End()
end
в 50 строк кода ошибок больше чем в моей жизни.
 

Alan__Morales

Новичок
Автор темы
9
0
в 50 строк кода ошибок больше чем в моей жизни.
Я это все прочитал все так как у него сделано сделал но у меня место русского иероглифы как их исправить?


local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local test_text_buffer = imgui.ImBuffer(256)
function imgui.OnDrawFrame()
imgui.Begin(u8'Title')
if imgui.InputText(u8'Текст', test_text_buffer) then
print('Search123:', u8:decode(test_text_buffer.v))
end
imgui.Text(u8'Search: ' .. test_text_buffer.v)
imgui.Text(u8(string.format('Datas: %s', os.date())))
imgui.End()
end

function main()
imgui.Process = true
end
 

Fott

Простреленный
3,423
2,249
Я это все прочитал все так как у него сделано сделал но у меня место русского иероглифы как их исправить?


local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local test_text_buffer = imgui.ImBuffer(256)
function imgui.OnDrawFrame()
imgui.Begin(u8'Title')
if imgui.InputText(u8'Текст', test_text_buffer) then
print('Search123:', u8:decode(test_text_buffer.v))
end
imgui.Text(u8'Search: ' .. test_text_buffer.v)
imgui.Text(u8(string.format('Datas: %s', os.date())))
imgui.End()
end

function main()
imgui.Process = true
end
сохранить скрипт в кодировке CP1251