Ошибка IMGUI

accord-

Потрачен
Автор темы
437
79
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Здрасте, подскажите пожалуйста что тут не так

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

Вот что в moonloader

[14:15:47.068389] (system) Loading script 'C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua'...
[14:15:47.068389] (debug) New script: 0EC3443C
[14:15:47.069386] (error) AdmTools.lua: C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua:42: ')' expected near 'main_color_text'
[14:15:47.069386] (error) AdmTools.lua: Script died due to an error. (0EC3443C)
 

accord-

Потрачен
Автор темы
437
79
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
if isKeyJustPressed(VK_F3) then
sampAddChatMessage('Вы нажали клавишу {FFFFFF}F3.' .. main_color_text .. 'Ваш ник {FFFFFF}' .. nick ..', ' .. main_color_text .. 'ваш ID: {FFFFFF}' .. id, -1)
end
вместо последнего параметра main_color поставь -1
Не помогло

.
 

Вложения

  • moonloader.log
    18.7 KB · Просмотры: 4

Rice.

Известный
Модератор
1,697
1,461
Здрасте, подскажите пожалуйста что тут не так

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

Вот что в moonloader

[14:15:47.068389] (system) Loading script 'C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua'...
[14:15:47.068389] (debug) New script: 0EC3443C
[14:15:47.069386] (error) AdmTools.lua: C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua:42: ')' expected near 'main_color_text'
[14:15:47.069386] (error) AdmTools.lua: Script died due to an error. (0EC3443C)
Скинь сам код
 

accord-

Потрачен
Автор темы
437
79
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.


script_author('See_Rose')
require 'lib.moonloader'
local imgui = require 'imgui'
local encoding = require "encoding"
local memory = require 'memory'
local ffi = require 'ffi'
local imguiad = require 'lib.imgui_addons'
local samp = require 'lib.samp.events'
local rkeys = require 'lib.rkeys'
local inicfg = require 'inicfg'
local GK = require 'game.keys'
local vkeys = require 'vkeys'
local dlstatus = require('moonloader').download_status
local Matrix3X3 = require "matrix3x3"
local Vector3D = require "vector3d"
local fa = require 'fAwesome5'
encoding.default = 'CP1251'
u8 = encoding.UTF8


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

sampRegisterChatCommand(amen, cmd_amen)

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

imgui.Process = false



while true do
wait(0)

if main_window_state.v == false then
imgui.Process = false
end

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

if isKeyDown(VK_MENU) and isKeyJustPressed(VK_9) then
sampAddChatMessage('Зажим комбо клавиш', main_color)
wait(500)
sampAddChatMessage('Прошло пол секунды', main_color)
end
--Бесконечно пока активен самп

end
end

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

function imgui.OnDrawFrame()
imgui.Begin('Start imgui', main_window_state)
imgui.Text('Some text')
imgui.End()
end
 

Вложения

  • AdmTools.lua
    1.7 KB · Просмотры: 3

Rice.

Известный
Модератор
1,697
1,461



script_author('See_Rose')
require 'lib.moonloader'
local imgui = require 'imgui'
local encoding = require "encoding"
local memory = require 'memory'
local ffi = require 'ffi'
local imguiad = require 'lib.imgui_addons'
local samp = require 'lib.samp.events'
local rkeys = require 'lib.rkeys'
local inicfg = require 'inicfg'
local GK = require 'game.keys'
local vkeys = require 'vkeys'
local dlstatus = require('moonloader').download_status
local Matrix3X3 = require "matrix3x3"
local Vector3D = require "vector3d"
local fa = require 'fAwesome5'
encoding.default = 'CP1251'
u8 = encoding.UTF8


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

sampRegisterChatCommand(amen, cmd_amen)

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

imgui.Process = false



while true do
wait(0)

if main_window_state.v == false then
imgui.Process = false
end

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

if isKeyDown(VK_MENU) and isKeyJustPressed(VK_9) then
sampAddChatMessage('Зажим комбо клавиш', main_color)
wait(500)
sampAddChatMessage('Прошло пол секунды', main_color)
end
--Бесконечно пока активен самп

end
end

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

function imgui.OnDrawFrame()
imgui.Begin('Start imgui', main_window_state)
imgui.Text('Some text')
imgui.End()
end
 

Вложения

  • AdmTools.lua
    1.7 KB · Просмотры: 8
  • Нравится
Реакции: Andrinall

accord-

Потрачен
Автор темы
437
79
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
[ML] (error) AdmTools.lua: C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua:42: ')' expected near 'main_color_text'
[ML] (error) AdmTools.lua: Script died due to an error. (0ECA37A4)
 

accord-

Потрачен
Автор темы
437
79
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
ну так у тебя переменной main_color_text нету пацан
Исправрил теперь такая проблема
[ML] (error) AdmTools.lua: C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua:28: attempt to call global 'sampGetPlayerNickName' (a nil value)
stack traceback:
C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua: in function <C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua:21>
[ML] (error) AdmTools.lua: Script died due to an error. (0E8CAD44)
 

Rice.

Известный
Модератор
1,697
1,461
Исправрил теперь такая проблема
[ML] (error) AdmTools.lua: C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua:28: attempt to call global 'sampGetPlayerNickName' (a nil value)
stack traceback:
C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua: in function <C:\Games\1337SAMP_CLASSICAL_EDITION\moonloader\AdmTools.lua:21>
[ML] (error) AdmTools.lua: Script died due to an error. (0E8CAD44)
Lua:
local id = 1
if sampIsPlayerConnected(id) then
    local name = sampGetPlayerNickname(id)
end