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

SR_team

like pancake
BH Team
4,720
6,372
Хочу прикрепить текст к машине, но ничего не выходит, хочу пример
PHP:
0B44: samp 15@ = create_3d_text "Hello" color 0xc3d73e position 0.0 0.0 0.0 view_distance 200.0 show_behind_walls 0 attached_to_player -1 attached_to_vehicle 29@
Что не так?

В цвет добавь альфа канал. Должно быть ARGB, а у тебя просто RGB
 

Milleron

Новичок
14
0
PHP:
:FAKE_13
wait 0
if
  SAMP.Available
else_jump @FAKE_13
12@ = SAMP.Base()
0B34: samp register_client_command "fakead" to_label @FAKE_823
0B34: samp register_client_command "faketransfer1" to_label @FAKE_823
0B34: samp register_client_command "faketransfer2" to_label @FAKE_1399
0B34: samp register_client_command "fakebankomat" to_label @FAKE_1217
0B34: samp register_client_command "fakebalance" to_label @FAKE_1118
alloc 3@ 40
alloc 2@ 70
alloc 4@ 70
alloc 5@ 70
alloc 6@ 70
alloc 7@ 70
alloc 8@ 70
alloc 9@ 70
alloc 10@ 70
alloc 11@ 70
alloc 12@ 70
0AF4: 2@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer1" key "Ñêîëüêî ïåðåäàëè"
0AF4: 3@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer1" key "Êîìó ïåðåäàëè"
0AF4: 4@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer1" key "Äàòà"
0AF4: 5@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer1" key "Âðåìÿ"
0AF4: 6@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeBalance" key "Áàëàíñ"
0AF4: 7@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeBankomat" key "Ñêîëüêî ñíÿëè"
0AF4: 8@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeBankomat" key "Ñêîëüêî îñòàëîñü"
0AF4: 9@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer2" key "Ñêîëüêî ïåðåäàëè"
0AF4: 10@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer2" key "Êòî ïåðåäàë"
0AF4: 11@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer2" key "Äàòà"
0AF4: 12@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer2" key "Âðåìÿ"
Что там делает alloc , зачем оно , и как расставлять значение , то есть 70 , 40 ?
 

fonarik

Известный
206
3
PHP:
:FAKE_13
wait 0
if
  SAMP.Available
else_jump @FAKE_13
12@ = SAMP.Base()
0B34: samp register_client_command "fakead" to_label @FAKE_823
0B34: samp register_client_command "faketransfer1" to_label @FAKE_823
0B34: samp register_client_command "faketransfer2" to_label @FAKE_1399
0B34: samp register_client_command "fakebankomat" to_label @FAKE_1217
0B34: samp register_client_command "fakebalance" to_label @FAKE_1118
alloc 3@ 40
alloc 2@ 70
alloc 4@ 70
alloc 5@ 70
alloc 6@ 70
alloc 7@ 70
alloc 8@ 70
alloc 9@ 70
alloc 10@ 70
alloc 11@ 70
alloc 12@ 70
0AF4: 2@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer1" key "Ñêîëüêî ïåðåäàëè"
0AF4: 3@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer1" key "Êîìó ïåðåäàëè"
0AF4: 4@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer1" key "Äàòà"
0AF4: 5@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer1" key "Âðåìÿ"
0AF4: 6@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeBalance" key "Áàëàíñ"
0AF4: 7@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeBankomat" key "Ñêîëüêî ñíÿëè"
0AF4: 8@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeBankomat" key "Ñêîëüêî îñòàëîñü"
0AF4: 9@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer2" key "Ñêîëüêî ïåðåäàëè"
0AF4: 10@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer2" key "Êòî ïåðåäàë"
0AF4: 11@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer2" key "Äàòà"
0AF4: 12@ = read_string_from_ini_file "CLEO\INI\fakebank.ini" section "FakeTransfer2" key "Âðåìÿ"
Что там делает alloc , зачем оно , и как расставлять значение , то есть 70 , 40 ?

alloc - 0AC8: 0@ = allocate_memory_size 260
Выделяет память для переменной.Где 260 байты
 

PoccoJI

Новичок
135
10
{$CLEO .cs}
0000: nop

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end

while not SAMP.Available()
wait 100
end

0B34: samp register_client_command "q" to_label @q

while true
wait 0
end

:q
0af8: "CRASH" 0x800000
SAMP.CmdRet()
КРАШ
 

fonarik

Известный
206
3
{$CLEO .cs}
0000: nop

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end

while not SAMP.Available()
wait 100
end

0B34: samp register_client_command "q" to_label @q

while true
wait 0
end

:q
0af8: "CRASH" 0x800000
SAMP.CmdRet()
КРАШ
{$CLEO .cs}
0000: nop

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end

while not SAMP.Available()
wait 100
end

0B34: samp register_client_command "q" to_label @q

while true
wait 0
end

:q
0B35: samp 1@ = get_last_command_params
0af8: "CRASH" 0x800000
SAMP.CmdRet()
 

SR_team

like pancake
BH Team
4,720
6,372
Хотел сделать альтернативку /dl чтоб только ID показывало, но ничего не пашет
PHP:
{$CLEO}
0000: NOP
 
repeat
    wait 400
until 0AFA: is_samp_available
0B34: samp register_client_command "cid" to_label @cid
while true
    wait 0
end
 
1@ = 0
 
:cid
if 1@ == 0
    then
        0ACD: show_text_highpriority "Car-ID On" time 1337
        1@ = 1
    else
        0ACD: show_text_highpriority "Car-ID Off" time 1337
        1@ = 0
    end
0B43: samp cmd_ret
 
while true
    wait 0
 
    if 1@ == 1
    then
        00A0: store_actor $PLAYER_ACTOR position_to 22@ 23@ 24@
        0@ = 75.0
        if 0AE2: 31@ = random_vehicle_near_point 22@ 23@ 24@ in_radius 0@ find_next false pass_wrecked 0
        then
            gosub @draw_text
            while 0AE2: 31@ = random_vehicle_near_point 22@ 23@ 24@ in_radius 0@ find_next true pass_wrecked 0
                gosub @draw_text
            end
        end
    end
end
 
:draw_text
// Car - 31@
if 80DB: not actor $PLAYER_ACTOR in_car 31@
then
    0B2C: samp 5@ = get_vehicle_id_by_car_handle 31@
    0B44: samp 15@ = create_3d_text "Custom Text" color 0xFFFFFFFF position 0.0 0.0 0.0 view_distance 75.0 show_behind_walls true attached_to_player -1 attached_to_vehicle 5@
end
return

Во превых у тебя нет перехода на цикл, где ты ищишь кары. А во вторых ты не очищаешь старые 3д тексты, когда их станет больше 2048 игру крашнет

---------------------------------------------------------------
http://s019.radikal.ru/i618/1405/41/46f799d87f66.png А у меня все норм :D . Давно писал эту шнягу. Лежит на другом рессурсе :)
 

Milleron

Новичок
14
0
Код:
//-------------MAIN---------------
if
0@ = SAMP.Base()
else_jump @Noname_18
0A93: end_custom_thread
 
:Noname_18
  not SAMP.Available
else_jump @Noname_38
wait 100
jump @Noname_18
 
:Noname_38
0AF8: samp add_message_to_chat "[FSTATARP]: {EAEAEA}Чтобы посмотреть статистку введите {ff9a0a}/fstatarp{EAEAEA}." color 16751114 
0B34: samp register_client_command "fstatarp" to_label @Noname_157
 
:Noname_146
wait 0
jump @Noname_146
Смысл вот этого? P.s ниже смотри.
PHP:
:Noname_146
wait 0
jump @Noname_146
 

SR_team

like pancake
BH Team
4,720
6,372
Трандец блин draw_text поставил в цикл, когда к-ство надписей становится больше 100 они все очищаются, но когда снова накапливается 100 надписей цикл очищения почему-то не срабатывает
PHP:
1@ = 0
2@ = 0
 
:draw_text
wait 0
if
2@ < 100
then
    0B2C: samp 5@ = get_vehicle_id_by_car_handle 31@
    0B44: samp 15@ = create_3d_text "Custom Text" color 0xFFFFFFFF position 0.0 0.0 0.0 view_distance 0@ show_behind_walls true attached_to_player -1 attached_to_vehicle 5@
    2@++
else
    gosub @remove_text
end
return
 
:remove_text
2@ = 0
3@ = 0
while 3@ < 100
    if
    0B46: samp 3d_text 3@ defined
    then
        0B45: samp destroy_3d_text 3@
        3@++
    else
        3@++
    end
end
return

Он вроде перезаписывается в метку, поэтому и не очищается.
Код:
//-------------MAIN---------------
if
0@ = SAMP.Base()
else_jump @Noname_18
0A93: end_custom_thread
 
:Noname_18
  not SAMP.Available
else_jump @Noname_38
wait 100
jump @Noname_18
 
:Noname_38
0AF8: samp add_message_to_chat "[FSTATARP]: {EAEAEA}Чтобы посмотреть статистку введите {ff9a0a}/fstatarp{EAEAEA}." color 16751114
0B34: samp register_client_command "fstatarp" to_label @Noname_157
 
:Noname_146
wait 0
jump @Noname_146
Смысл вот этого? P.s ниже смотри.
PHP:
:Noname_146
wait 0
jump @Noname_146

Чтобы скрипт не выполнялся до ввода команды
 

Dark_Knight

Me, me and me.
Друг
4,065
2,079
Трандец блин draw_text поставил в цикл, когда к-ство надписей становится больше 100 они все очищаются, но когда снова накапливается 100 надписей цикл очищения почему-то не срабатывает
PHP:
1@ = 0
2@ = 0
 
:draw_text
wait 0
if
2@ < 100
then
    0B2C: samp 5@ = get_vehicle_id_by_car_handle 31@
    0B44: samp 15@ = create_3d_text "Custom Text" color 0xFFFFFFFF position 0.0 0.0 0.0 view_distance 0@ show_behind_walls true attached_to_player -1 attached_to_vehicle 5@
    2@++
else
    gosub @remove_text
end
return
 
:remove_text
2@ = 0
3@ = 0
while 3@ < 100
    if
    0B46: samp 3d_text 3@ defined
    then
        0B45: samp destroy_3d_text 3@
        3@++
    else
        3@++
    end
end
return

0B45: samp destroy_3d_text 3@ :facepalm:
 

SR_team

like pancake
BH Team
4,720
6,372
What, do you have best idea?


В переменную записывается ID, перемення в потоке ограничена 33@(text3D то у меня дохренище), поэтому я решил брать и искать рандомом :). Проблема как бЭ в том, что во второй раз оно игнорирует ограничение в 100, идет до 2048 и крашит

Попробуй обычный цикл: for 2@ = 0 to 99