Спасибо за Ваш ответ.
Я получаю сообщение об ошибке, вы можете помочь?
Я получаю сообщение об ошибке, вы можете помочь?
попытка вызвать глобальный sampGetCharHandleBySampPlayerId (нулевое значение).
Думаю, я не могу найти или добавить библиотеку.
Это lua (moonloader)Я кодирую с помощью Visual Studio C #.
script_name("Test Code")
script_author("CaJlaT && HomeTown")
require "lib.moonloader"
function main()
wait(5000)
local result, ped = sampGetCharHandleBySampPlayerId(0)
if result then
local X, Y, Z = getCharCoordinates(ped)
print (X, Y, Z)
else
print ('bla bla bla')
end
end
Покажи полный код скрипта и лог moonloaderЯ только что установил, должно быть 2.6.
Спасибо также за быстрые ответы.
[00:54:46.717277] (debug) Module handle: 6AEC0000
MoonLoader v.026.5-beta loaded.
Developers: FYP, hnnssy, EvgeN 1137
Copyright (c) 2016, BlastHack Team
https://www.blast.hk/moonloader/
[00:54:46.717277] (info) Working directory: D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader
[00:54:46.717277] (debug) FP Control: 0009001F
[00:54:46.717277] (debug) Game: GTA SA 1.0.0.0 US
[00:54:46.717277] (system) Installing pre-game hooks...
[00:54:46.721280] (system) Hooks installed.
[00:54:49.792463] (debug) Initializing opcode handler table
[00:54:49.792463] (debug) package.path = D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?.lua;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?\init.lua;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\?.lua;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\?\init.lua;.\?.lua;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?.luac;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?\init.luac;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\?.luac;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\?\init.luac;.\?.luac
[00:54:49.792463] (debug) package.cpath = D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?.dll;
[00:54:49.795464] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\AutoReboot.lua'...
[00:54:49.795464] (debug) New script: 097F645C
[00:54:49.796465] (system) ML-AutoReboot: Loaded successfully.
[00:54:49.796465] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\check-moonloader-updates.lua'...
[00:54:49.796465] (debug) New script: 097F68F4
[00:54:49.798466] (system) Check MoonLoader Updates: Loaded successfully.
[00:54:49.798466] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\MYTESTCODE.lua'...
[00:54:49.798466] (debug) New script: 097F6A7C
[00:54:49.799468] (system) Test Code: Loaded successfully.
[00:54:49.799468] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\reload_all.lua'...
[00:54:49.799468] (debug) New script: 097F6D8C
[00:54:49.800468] (system) ML-ReloadAll: Loaded successfully.
[00:54:49.800468] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\SF Integration.lua'...
[00:54:49.800468] (debug) New script: 097F6C04
[00:54:49.802470] (system) SF Integration: Loaded successfully.
[00:54:50.534989] (system) Installing post-load hooks...
[00:54:50.534989] (system) Hooks installed.
[00:54:55.510561] (error) Test Code: ...heft Auto San Andreas\moonloader\MYTESTCODE.lua:7: attempt to call global 'sampGetCharHandleBySampPlayerId' (a nil value)
stack traceback:
...heft Auto San Andreas\moonloader\MYTESTCODE.lua: in function <...heft Auto San Andreas\moonloader\MYTESTCODE.lua:5>
[00:54:55.510561] (error) Test Code: Script died due to an error. (097F6A7C)
полный код скрипта покажиMoonloader.log
log:[00:54:46.717277] (debug) Module handle: 6AEC0000 MoonLoader v.026.5-beta loaded. Developers: FYP, hnnssy, EvgeN 1137 Copyright (c) 2016, BlastHack Team https://www.blast.hk/moonloader/ [00:54:46.717277] (info) Working directory: D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader [00:54:46.717277] (debug) FP Control: 0009001F [00:54:46.717277] (debug) Game: GTA SA 1.0.0.0 US [00:54:46.717277] (system) Installing pre-game hooks... [00:54:46.721280] (system) Hooks installed. [00:54:49.792463] (debug) Initializing opcode handler table [00:54:49.792463] (debug) package.path = D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?.lua;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?\init.lua;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\?.lua;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\?\init.lua;.\?.lua;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?.luac;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?\init.luac;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\?.luac;D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\?\init.luac;.\?.luac [00:54:49.792463] (debug) package.cpath = D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\lib\?.dll; [00:54:49.795464] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\AutoReboot.lua'... [00:54:49.795464] (debug) New script: 097F645C [00:54:49.796465] (system) ML-AutoReboot: Loaded successfully. [00:54:49.796465] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\check-moonloader-updates.lua'... [00:54:49.796465] (debug) New script: 097F68F4 [00:54:49.798466] (system) Check MoonLoader Updates: Loaded successfully. [00:54:49.798466] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\MYTESTCODE.lua'... [00:54:49.798466] (debug) New script: 097F6A7C [00:54:49.799468] (system) Test Code: Loaded successfully. [00:54:49.799468] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\reload_all.lua'... [00:54:49.799468] (debug) New script: 097F6D8C [00:54:49.800468] (system) ML-ReloadAll: Loaded successfully. [00:54:49.800468] (system) Loading script 'D:\Program Files\Steam\steamapps\common\Grand Theft Auto San Andreas\moonloader\SF Integration.lua'... [00:54:49.800468] (debug) New script: 097F6C04 [00:54:49.802470] (system) SF Integration: Loaded successfully. [00:54:50.534989] (system) Installing post-load hooks... [00:54:50.534989] (system) Hooks installed. [00:54:55.510561] (error) Test Code: ...heft Auto San Andreas\moonloader\MYTESTCODE.lua:7: attempt to call global 'sampGetCharHandleBySampPlayerId' (a nil value) stack traceback: ...heft Auto San Andreas\moonloader\MYTESTCODE.lua: in function <...heft Auto San Andreas\moonloader\MYTESTCODE.lua:5> [00:54:55.510561] (error) Test Code: Script died due to an error. (097F6A7C)
полный код скрипта покажи
script_name("Test Code")
script_author("CaJlaT && HomeTown")
require "lib.moonloader"
function main()
wait(5000)
local result, ped = sampGetCharHandleBySampPlayerId(0)
if result then
local X, Y, Z = getCharCoordinates(ped)
print (X, Y, Z)
else
print ('bla bla bla')
end
end
Код:script_author("CaJlaT && HomeTown") require "lib.moonloader" function main() wait(5000) local result, ped = sampGetCharHandleBySampPlayerId(0) if result then local X, Y, Z = getCharCoordinates(ped) print (X, Y, Z) else print ('bla bla bla') end end
script_author("CaJlaT && HomeTown")
require "lib.moonloader"
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
local result, ped = sampGetCharHandleBySampPlayerId(0)
if result then
local X, Y, Z = getCharCoordinates(ped)
print (X, Y, Z)
else
print ('bla bla bla')
end
end
moonloader.logLua:script_author("CaJlaT && HomeTown") require "lib.moonloader" function main() if not isSampfuncsLoaded() or not isSampLoaded() then return end while not isSampAvailable() do wait(100) end local result, ped = sampGetCharHandleBySampPlayerId(0) if result then local X, Y, Z = getCharCoordinates(ped) print (X, Y, Z) else print ('bla bla bla') end end
Поэтому и не работает. Прости, но я не знаю что и как на 0.3DLВ качестве версии я использую 0.3DL. Могу ли я использовать SampFuncs?