Преобразуйте этот код в Lua

Mattioli

Участник
Автор темы
45
2
Здравствуйте, большое спасибо за вашу поддержку, я хочу преобразовать это

CLEO:
:__tpmf_1099
0001: wait 0 ms
0860: link_actor $PLAYER_ACTOR to_interior 0
0B2E: 3@ = read_samp_memory offset 19728 size 1
0B2D: write_samp_memory offset 19728 value 195 size 1
02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 1 EP 1 CP 1 MP 1
0AFB: samp request_class 0
0ACD: show_text_highpriority "~Y~Por favor espere~s~." time 800
0001: wait 800 ms
0ACD: show_text_highpriority "~Y~Por favor espere~s~." time 800
0001: wait 800 ms
0ACD: show_text_highpriority "~Y~Por favor espere~s~." time 800
0001: wait 800 ms
0ACD: show_text_highpriority "~Y~Por favor espere~s~." time 800
0001: wait 600 ms
0ACD: show_text_highpriority "~Y~Por favor espere~s~." time 800
018C: play_sound 1139 at 0.0 0.0 0.0
0860: link_actor $PLAYER_ACTOR to_interior 0
0ACD: show_text_highpriority "~>~ ~p~teletransporte ~s~exitoso ~<~" time 2500
00A1: put_actor $PLAYER_ACTOR at 0@ 1@ 2@
02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
0B2D: write_samp_memory offset 19728 value 3@ size 1
0AB2: 0 ret

в коде LUA проблема в том, что я не могу сделать это как есть, не могли бы вы мне помочь? Спасибо
 
Решение
[22:25:00.551225] (error) tp.lua: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'writeMemory'
...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:8: in function <...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:4>
[22:25:00.551225] (error) tp.lua: Script died due to an error. (0BE23D74)
corrected again, recopy

paulohardy

вы еще постите говно? тогда я иду к вам
Всефорумный модератор
1,909
1,286
Lua:
local function tpmf_1099(x, y, z)
    setCharInterior(PLAYER_PED, 0)
    local someAddress = sampGetBase() + 19728
    local someValue = readMemory(someAddress, 1, true)
    writeMemory(someAddress, 1, 195, true)
    setCharProofs(PLAYER_PED, true, true, true, true, true)
    sampRequestClass(0)
    printStringNow('~Y~Por favor espere~s~.', 4000)
    wait(3800)
    addOneOffSound(0.0, 0.0, 0.0, 1139)
    setCharInterior(PLAYER_PED, 0)
    printStringNow('~>~ ~p~teletransporte ~s~exitoso ~<~', 2500)
    setCharCoordinates(PLAYER_PED, x, y, z)
    setCharProofs(PLAYER_PED, false, false, false, false, false)
    writeMemory(someAddress, 1, someValue, true)
end
-- how use:
lua_thread.create(tpmf_1099, 100, 200, 10) -- where '100, 200, 10' - x y z teleport pos
 
Последнее редактирование:
  • Нравится
Реакции: ARMOR

Mattioli

Участник
Автор темы
45
2
Lua:
local function tpmf_1099(x, y, z)
    setCharInterior(PLAYED_PED, 0)
    local someAddress = sampGetBase() + 19728
    local someValue = readMemory(someAddress, 1, false)
    writeMemory(someAddress, 1, 195, false)
    setCharProofs(PLAYER_PED, true, true, true, true, true)
    sampRequestClass(0)
    printStringNow('~Y~Por favor espere~s~.', 4000)
    wait(3800)
    addOneOffSound(0.0, 0.0, 0.0, 1139)
    setCharInterior(PLAYED_PED, 0)
    printStringNow('~>~ ~p~teletransporte ~s~exitoso ~<~', 2500)
    setCharCoordinates(PLAYER_PED, x, y, z)
    setCharProofs(PLAYER_PED, false, false, false, false, false)
    writeMemory(someAddress, 1, someValue, false)
end
-- how use:
lua_thread.create(tpmf_1099, 100, 200, 10) -- where '100, 200, 10' - x y z teleport pos
Это не работает

[22:10:12.772713] (error) tp.lua: opcode '0860' call caused an unhandled exception
stack traceback:
[C]: in function 'setCharInterior'
...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:5: in function <...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:4>
stack traceback:
[C]: in function 'create'
...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:23: in function <...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:21>
[22:10:12.772713] (error) tp.lua: Script died due to an error. (0BD3959C)
 

paulohardy

вы еще постите говно? тогда я иду к вам
Всефорумный модератор
1,909
1,286
Это не работает

[22:10:12.772713] (error) tp.lua: opcode '0860' call caused an unhandled exception
stack traceback:
[C]: in function 'setCharInterior'
...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:5: in function <...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:4>
stack traceback:
[C]: in function 'create'
...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:23: in function <...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:21>
[22:10:12.772713] (error) tp.lua: Script died due to an error. (0BD3959C)
copy again, fixed the error
 

Mattioli

Участник
Автор темы
45
2
copy again, fixed the error
[22:25:00.551225] (error) tp.lua: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'writeMemory'
...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:8: in function <...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:4>
[22:25:00.551225] (error) tp.lua: Script died due to an error. (0BE23D74)
 
  • Эм
Реакции: paulohardy

paulohardy

вы еще постите говно? тогда я иду к вам
Всефорумный модератор
1,909
1,286
[22:25:00.551225] (error) tp.lua: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'writeMemory'
...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:8: in function <...s (x86)\Rockstar Games\GTA San Andreas\moonloader\tp.lua:4>
[22:25:00.551225] (error) tp.lua: Script died due to an error. (0BE23D74)
corrected again, recopy
 
  • Влюблен
Реакции: Mattioli