Вопросы по CLEO-скриптингу

MISTER_GONWIK

Всефорумный гонщик
Всефорумный модератор
1,260
1,742
Код:
{$CLEO .cs}
0000: NOP
wait 5000
 
:1
0AC8: 0@ = allocate_memory_size 64
0AC8: 1@ = allocate_memory_size 64
if
8AAB: file_exists "CLEO\FAKE.ini"
then
0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
else
0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
end
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s..." color 0xFF61BB 0@
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s" color 0xFF61BB 1@
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 1@
0B43: end_custom_thread

пак варнингов....

для этих опкодов память выделять не нужно
и вот тут должно быть вот так:

PHP:
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
else
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
end

т.е. вместo
PHP:
8AAB: ..
должно быть
PHP:
0AAB: ..

и вообще т.к. ты используешь SF в своём скрипте, то обязательно нужно загрузить базу:
PHP:
:load_samp_base
    if not 0@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end

result:
PHP:
{$CLEO .cs}
0000: NOP
wait 5000
 
:load_samp_base
    if not 30@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end
 
:start
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
else
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
end
 
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s..." color 0xFF61BB 0@
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s" color 0xFF61BB 1@
0A93: end_custom_thread
 

patrikmister

Новичок
88
7
для этих опкодов память выделять не нужно
и вот тут должно быть вот так:

PHP:
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
else
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
end

т.е. вместo
PHP:
8AAB: ..
должно быть
PHP:
0AAB: ..

и вообще т.к. ты используешь SF в своём скрипте, то обязательно нужно загрузить базу:
PHP:
:load_samp_base
    if not 0@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end

result:
PHP:
{$CLEO .cs}
0000: NOP
wait 5000
 
:load_samp_base
    if not 30@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end
 
:start
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
else
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
end
 
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s..." color 0xFF61BB 0@
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s" color 0xFF61BB 1@
0B43: end_custom_thread


Код:
{$CLEO .cs}
0000: NOP
wait 5000
 
:load_samp_base
    if not 30@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end
 
:start
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
else
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
end
 
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s..." color 0xFF61BB 0@
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s" color 0xFF61BB 1@
0B43: end_custom_thread

варнинги вылезают. мноооого
 

MISTER_GONWIK

Всефорумный гонщик
Всефорумный модератор
1,260
1,742
PHP:
0B43: end_custom_thread
замени на
PHP:
0A93: end_custom_thread
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,462
заменил. итог: 2 варнинга, потом вылезает текст (вне зависимости от написанного в ини файле)

la-la-la
(null)
la-la-la...
(null)

0@ на 0@v
1@ на 1@v
и не мучайся... правда, 15 символов всего вместит :D
 

patrikmister

Новичок
88
7
0@ на 0@v
1@ на 1@v
и не мучайся... правда, 15 символов всего вместит :D

заменил. пустой текст теперь на тех местах, где он должен быть.

Код:
{$CLEO .cs}
0000: NOP
wait 5000
 
:load_samp_base
    if not 30@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end
 
:start
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
else
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
end
 
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s..." color 0xFF61BB 0@v
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s" color 0xFF61BB 1@v
0A93: end_custom_thread
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,462
заменил. пустой текст теперь на тех местах, где он должен быть.

Код:
{$CLEO .cs}
0000: NOP
wait 5000
 
:load_samp_base
    if not 30@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end
 
:start
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
else
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF5: write_string "new string value" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
end
 
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s..." color 0xFF61BB 0@v
0AF8: samp msg "la-la-la" color 0xFF61BB
0AF8: samp msg "%s" color 0xFF61BB 1@v
0A93: end_custom_thread

А это:
0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip"
0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
 

Sneyk_Next

Новичок
7
0


Какой пакет или опкод нужно использовать чтобы взять одну из строчек этого диалога
 

patrikmister

Новичок
88
7
0AC8: 0@ = 60
0AC8: 1@ = 60
//
0AC9: 0@
0AC9: 1@


Код:
{$CLEO .cs}
0000: NOP
wait 6000
 
:load_samp_base
    if not 30@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end
 
:start
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@v = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip1"
    0AF4: 1@v = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 2@v = read_string_from_ini_file "cleo\FAKE.ini" section "PORT" key "server_port"
else
    0AF5: write_string "228" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip1"
    0AF5: write_string "02" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF5: write_string "7777" to_ini_file "cleo\FAKE.ini" section "PORT" key "server_port"
    0AF4: 0@v = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip1"
    0AF4: 1@v = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 2@v = read_string_from_ini_file "cleo\FAKE.ini" section "PORT" key "server_port"
end
 
0AF8: samp msg "SA-MP 0.3x-R1-2 Started" color 0xB0C4DE
0AF8: samp msg "Connecting to %s:%s..." color 0xB0C4DE 0@v 2@v
0AF8: samp msg "Connected. Joining the game" color 0xB0C4DE
0AF8: samp msg "Connected to Samp-Rp.Ru | Server: %s | Client: 0.3x" color 0xB0C4DE 1@v
0A93: end_custom_thread

куда именно тут вставлять?
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,462
Код:
{$CLEO .cs}
0000: NOP
wait 6000
 
:load_samp_base
    if not 30@ = SAMP.Base()
    then 0A93: end_custom_thread
    end
while not SAMP.Available()
    wait 100
end
 
0AC8: 0@ 16
0AC8: 1@ 128
0AC8: 2@ 8
 
:start
if 0AAB: file_exists "CLEO\FAKE.ini"
then
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip1"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 2@ = read_string_from_ini_file "cleo\FAKE.ini" section "PORT" key "server_port"
else
    0AF5: write_string "228" to_ini_file "cleo\FAKE.ini" section "IP" key "server_ip1"
    0AF5: write_string "02" to_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF5: write_string "7777" to_ini_file "cleo\FAKE.ini" section "PORT" key "server_port"
    0AF4: 0@ = read_string_from_ini_file "cleo\FAKE.ini" section "IP" key "server_ip1"
    0AF4: 1@ = read_string_from_ini_file "cleo\FAKE.ini" section "NAME" key "server_name"
    0AF4: 2@ = read_string_from_ini_file "cleo\FAKE.ini" section "PORT" key "server_port"
end
 
0AF8: samp msg "SA-MP 0.3x-R1-2 Started" color 0xB0C4DE
0AF8: samp msg "Connecting to %s:%s..." color 0xB0C4DE 0@ 2@
0AF8: samp msg "Connected. Joining the game" color 0xB0C4DE
0AF8: samp msg "Connected to Samp-Rp.Ru | Server: %s | Client: 0.3x" color 0xB0C4DE 1@
 
0AC9: 0@
0AC9: 1@
0AC9: 2@
0A93: end_custom_thread

P.S. server_name и server_port - должны быть int, в твоем случае, никак не string.
По твоему желанию, и так можно.