Bogach
Активный
- 558
- 27
Код скинь сюда.Пишет " Неизвестная команда until samp.Available() "
Код скинь сюда.Пишет " Неизвестная команда until samp.Available() "
{$CLEO}
0000:
repeat
wait 0
samp.Available()
0B34: samp register_client_command "tp" to_label @tplist
repeat
wait 0
if 0B3C: samp is_dialog_responded id 2 button 1@ list_item 2@ input_text 0
then
if 1@ == 1 // Enter
then
if 2@ == 0 // МО
then
actor.PutAt($Player_Actor, 1028.3125, 1029.9607, 11.0)
end
if 2@ == 1 // СВ
then
actor.PutAt($Player_Actor, 285.335, 1967.4998, 17.6406)
end
if 2@ == 2 // ВВС
then
actor.PutAt($Player_Actor, 391.7883, 2600.0054, 16.4844)
end
if 2@ == 3 // ВМФ
then
actor.PutAt($Player_Actor, -2292.8208, 2288.0754, 4.9508)
end
end
end
until false
:tplist
0AC8: 0@ = allocate_memory_size 50
0AD3: 0@ = format "1. Мин. Обороны%c2. СВ%c3. ВВС%c4.ВМФ" 0xA 0xA 0xA
0B3B: samp show_dialog id 2 caption "Телепорт" text 0@ button_1 "-ok-" button_2 "-close-" style 2
0AC9: free_allocated_memory 0@
samp.CmdRet()
цикл неправильно построенПишет " Неизвестная команда until samp.Available() "
Код скинь сюда.
<{$cleo}
0000:
repeat
wait 1000
until samp.Available()
0B34: samp register_client_command "tp" to_label @cmd
while true
wait 0
if 15@ == 1
then
if 0AB6: store_target_marker_coords_to 0@ 1@ 2@ // IF and SET
then
Actor.PutAt($PLAYER_ACTOR,0@,1@,-100.0)
wait 5
Actor.PutAt($PLAYER_ACTOR,0@,1@,-100.0)
end
15@ = 0
end
end
:cmd
15@ = 1
samp.CmdRet()
/CODE] >
repeatПочему много fps жрёт, не при телепортировании, а вообще когда в игру заходишь с ним.
C++:{$CLEO} 0000: repeat wait 0 samp.Available() 0B34: samp register_client_command "tp" to_label @tplist repeat wait 0 if 0B3C: samp is_dialog_responded id 2 button 1@ list_item 2@ input_text 0 then if 1@ == 1 // Enter then if 2@ == 0 // МО then actor.PutAt($Player_Actor, 1028.3125, 1029.9607, 11.0) end if 2@ == 1 // СВ then actor.PutAt($Player_Actor, 285.335, 1967.4998, 17.6406) end if 2@ == 2 // ВВС then actor.PutAt($Player_Actor, 391.7883, 2600.0054, 16.4844) end if 2@ == 3 // ВМФ then actor.PutAt($Player_Actor, -2292.8208, 2288.0754, 4.9508) end end end until false :tplist 0AC8: 0@ = allocate_memory_size 50 0AD3: 0@ = format "1. Мин. Обороны%c2. СВ%c3. ВВС%c4.ВМФ" 0xA 0xA 0xA 0B3B: samp show_dialog id 2 caption "Телепорт" text 0@ button_1 "-ok-" button_2 "-close-" style 2 0AC9: free_allocated_memory 0@ samp.CmdRet()
Вместо samp.Available() всунь 0AFA: is_samp_availableCLEO:<{$cleo} 0000: repeat wait 1000 until samp.Available() 0B34: samp register_client_command "tp" to_label @cmd while true wait 0 if 15@ == 1 then if 0AB6: store_target_marker_coords_to 0@ 1@ 2@ // IF and SET then Actor.PutAt($PLAYER_ACTOR,0@,1@,-100.0) wait 5 Actor.PutAt($PLAYER_ACTOR,0@,1@,-100.0) end 15@ = 0 end end :cmd 15@ = 1 samp.CmdRet() /CODE] >
{$CLEO}
0000:
REPEAT
0001: wait 0 ms
UNTIL 0AFA: is_samp_available
0AC6: 0@ = label @Buffer offset
WHILE TRUE
0001: wait 5000 ms
0B75: samp get_chat_string 99 text_to 0@ prefix_to -1 color_to -1 prefix_color_to -1
IF 0C14: strcmp string1 0@ string2 "Server closed the connection."
THEN 0B27: samp set_gamestate 1
END
END
:Buffer
HEX
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
END
что это дает?CLEO:{$CLEO} 0000: REPEAT 0001: wait 0 ms UNTIL 0AFA: is_samp_available 0AC6: 0@ = label @Buffer offset WHILE TRUE 0001: wait 5000 ms 0B75: samp get_chat_string 99 text_to 0@ prefix_to -1 color_to -1 prefix_color_to -1 IF 0C14: strcmp string1 0@ string2 "Server closed the connection." THEN 0B27: samp set_gamestate 1 END END :Buffer HEX 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 END
Можно так, но лучше всего ставить hook.
Буфер для хранения строк.что это дает?
HEX
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
END
{$CLEO}
0000:
wait 2000
0AC8: 10@ = allocate_memory_size 128
0C11: memset destination 10@ value 0 size 128
0006: 0@ = 0
while not 0@ > 6
0AD3: 10@ = format "%i" 0@
0AF1: write_int 0@ to_ini_file "cleo\Test.ini" section 10@ key "Test"
wait 1000
0@++
end
0A93: end_custom_thread
INI опкоды не работают с указателями.Почему не работает такая конструкция?
{$CLEO}
0AC6: 0@ = label @BufferlpAppName offset
0AD3: 0@ = format "Main"
0AC6: 1@ = label @BufferlpKeyName offset
0AD3: 1@ = format "Test"
0AC6: 2@ = label @BufferlpString offset
0AC6: 3@ = label @BufferlpFileName offset
0AD3: 3@ = format "CLEO\Test.INI"
WHILE 8019: not 4@ > 6
0AD3: 2@ = format "%d" 4@
0AB1: call_scm_func @SCM_WritePrivateProfileStringA params 4 | lpAppName 0@ lpKeyName 1@ lpString 2@ lpFileName 3@ ||
000A: 4@ += 1
END
0A93:
:BufferlpAppName // 128 + 1
HEX
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0
END
:BufferlpKeyName // 128 + 1
HEX
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0
END
:BufferlpString // 128 + 1
HEX
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0
END
:BufferlpFileName // 128 + 1
HEX
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0
END
:SCM_WritePrivateProfileStringA // 0AB1: call_scm_func @SCM_WritePrivateProfileStringA params 4 | lpAppName 0@ lpKeyName 1@ lpString 2@ lpFileName 3@ ||
0AA2: 25@ = load_library "Kernel32.DLL"
0AA4: 26@ = get_proc_address "WritePrivateProfileStringA" library 25@
0AA7: call_function 26@ num_params 4 pop 0 | lpFileName 3@ lpString 2@ lpKeyName 1@ lpAppName 0@ | _errorCode 27@ |
0AA3: free_library 25@
0AB2: ret 0 ||
Спасибо!INI опкоды не работают с указателями.
Можно так:
CLEO:{$CLEO} 0AC6: 0@ = label @BufferlpAppName offset 0AD3: 0@ = format "Main" 0AC6: 1@ = label @BufferlpKeyName offset 0AD3: 1@ = format "Test" 0AC6: 2@ = label @BufferlpString offset 0AC6: 3@ = label @BufferlpFileName offset 0AD3: 3@ = format "CLEO\Test.INI" WHILE 8019: not 4@ > 6 0AD3: 2@ = format "%d" 4@ 0AB1: call_scm_func @SCM_WritePrivateProfileStringA params 4 | lpAppName 0@ lpKeyName 1@ lpString 2@ lpFileName 3@ || 000A: 4@ += 1 END 0A93: :BufferlpAppName // 128 + 1 HEX 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 END :BufferlpKeyName // 128 + 1 HEX 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 END :BufferlpString // 128 + 1 HEX 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 END :BufferlpFileName // 128 + 1 HEX 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0 END :SCM_WritePrivateProfileStringA // 0AB1: call_scm_func @SCM_WritePrivateProfileStringA params 4 | lpAppName 0@ lpKeyName 1@ lpString 2@ lpFileName 3@ || 0AA2: 25@ = load_library "Kernel32.DLL" 0AA4: 26@ = get_proc_address "WritePrivateProfileStringA" library 25@ 0AA7: call_function 26@ num_params 4 pop 0 | lpFileName 3@ lpString 2@ lpKeyName 1@ lpAppName 0@ | _errorCode 27@ | 0AA3: free_library 25@ 0AB2: ret 0 ||
Через 10@v делай.Почему не работает такая конструкция?
CLEO:{$CLEO} 0000: wait 2000 0AC8: 10@ = allocate_memory_size 128 0C11: memset destination 10@ value 0 size 128 0006: 0@ = 0 while not 0@ > 6 0AD3: 10@ = format "%i" 0@ 0AF1: write_int 0@ to_ini_file "cleo\Test.ini" section 10@ key "Test" wait 1000 0@++ end 0A93: end_custom_thread