#1 02-07-2017 08:40

Nikita592
Registered: 14-06-2017
Posts: 36

Проблема с выводом текстуры

Здравствуйте, дорогие форумчане! Вообщем, такая странная проблема у меня.  В txd-файле "icon_weapon.txd" хранятся иконки оружия. Но, проблема в том, что, когда я вывожу текстуру (Иконок оружия), она моргает каждую секунду. Помогите пожалуйста это исправить.
Вот код:

:WEAPON_ICON
thread 'ICON_W'
wait 0
if
Player.Defined(0)
jf @WEAPON_ICON
0826: enable_hud 0
0390: load_txd_dictionary 'icon_weapon'
03F0: enable_text_draw 1
03E3: set_texture_to_be_drawn_antialiased 1

:WEAPON_ICON_2
wait 0
if
02D8: actor $PLAYER_ACTOR current_weapon == 1
jf @WEAPON_ICON_3
038F: load_texture "1" as 1

:WEAPON_ICON_3
if
02D8: actor $PLAYER_ACTOR current_weapon == 2
jf @WEAPON_ICON_4
038F: load_texture "2" as 1

:WEAPON_ICON_4
if
02D8: actor $PLAYER_ACTOR current_weapon == 3
jf @WEAPON_ICON_5
038F: load_texture "3" as 1

:WEAPON_ICON_5
if
02D8: actor $PLAYER_ACTOR current_weapon == 4
jf @WEAPON_ICON_6
038F: load_texture "4" as 1

:WEAPON_ICON_6
if
02D8: actor $PLAYER_ACTOR current_weapon == 5
jf @WEAPON_ICON_7
038F: load_texture "5" as 1

:WEAPON_ICON_7
if
02D8: actor $PLAYER_ACTOR current_weapon == 6
jf @WEAPON_ICON_8
038F: load_texture "6" as 1

:WEAPON_ICON_8
if
02D8: actor $PLAYER_ACTOR current_weapon == 7
jf @WEAPON_ICON_10
038F: load_texture "7" as 1

:WEAPON_ICON_10
if
02D8: actor $PLAYER_ACTOR current_weapon == 8
jf @WEAPON_ICON_11
038F: load_texture "8" as 1

:WEAPON_ICON_11
if
02D8: actor $PLAYER_ACTOR current_weapon == 9
jf @WEAPON_ICON_12
038F: load_texture "9" as 1

:WEAPON_ICON_12
if
02D8: actor $PLAYER_ACTOR current_weapon == 10
jf @WEAPON_ICON_13
038F: load_texture "10" as 1

:WEAPON_ICON_13
if
02D8: actor $PLAYER_ACTOR current_weapon == 11
jf @WEAPON_ICON_14
038F: load_texture "11" as 1

:WEAPON_ICON_14
if
02D8: actor $PLAYER_ACTOR current_weapon == 12
jf @WEAPON_ICON_15
038F: load_texture "12" as 1

:WEAPON_ICON_15
if
02D8: actor $PLAYER_ACTOR current_weapon == 13
jf @WEAPON_ICON_16
038F: load_texture "13" as 1

:WEAPON_ICON_16
if
02D8: actor $PLAYER_ACTOR current_weapon == 14
jf @WEAPON_ICON_17
038F: load_texture "14" as 1

:WEAPON_ICON_17
if
02D8: actor $PLAYER_ACTOR current_weapon == 15
jf @WEAPON_ICON_18
038F: load_texture "15" as 1

:WEAPON_ICON_18
if
02D8: actor $PLAYER_ACTOR current_weapon == 16
jf @WEAPON_ICON_20
038F: load_texture "16" as 1

:WEAPON_ICON_20
if
02D8: actor $PLAYER_ACTOR current_weapon == 17
jf @WEAPON_ICON_21
038F: load_texture "17" as 1

:WEAPON_ICON_21
if
02D8: actor $PLAYER_ACTOR current_weapon == 18
jf @WEAPON_ICON_22
038F: load_texture "18" as 1

:WEAPON_ICON_22
if
02D8: actor $PLAYER_ACTOR current_weapon == 22
jf @WEAPON_ICON_23
038F: load_texture "19" as 1

:WEAPON_ICON_23
if
02D8: actor $PLAYER_ACTOR current_weapon == 23
jf @WEAPON_ICON_24
038F: load_texture "20" as 1

:WEAPON_ICON_24
if
02D8: actor $PLAYER_ACTOR current_weapon == 24
jf @WEAPON_ICON_25
038F: load_texture "21" as 1

:WEAPON_ICON_25
if
02D8: actor $PLAYER_ACTOR current_weapon == 25
jf @WEAPON_ICON_26
038F: load_texture "22" as 1

:WEAPON_ICON_26
if
02D8: actor $PLAYER_ACTOR current_weapon == 26
jf @WEAPON_ICON_27
038F: load_texture "23" as 1

:WEAPON_ICON_27
if
02D8: actor $PLAYER_ACTOR current_weapon == 27
jf @WEAPON_ICON_28
038F: load_texture "24" as 1

:WEAPON_ICON_28
if
02D8: actor $PLAYER_ACTOR current_weapon == 28
jf @WEAPON_ICON_29
038F: load_texture "25" as 1

:WEAPON_ICON_29
if
02D8: actor $PLAYER_ACTOR current_weapon == 29
jf @WEAPON_ICON_30
038F: load_texture "26" as 1

:WEAPON_ICON_30
if
02D8: actor $PLAYER_ACTOR current_weapon == 32
jf @WEAPON_ICON_31
038F: load_texture "27" as 1

:WEAPON_ICON_31
if
02D8: actor $PLAYER_ACTOR current_weapon == 30
jf @WEAPON_ICON_32
038F: load_texture "28" as 1

:WEAPON_ICON_32
if
02D8: actor $PLAYER_ACTOR current_weapon == 31
jf @WEAPON_ICON_33
038F: load_texture "29" as 1

:WEAPON_ICON_33
if
02D8: actor $PLAYER_ACTOR
current_weapon == 33
jf @WEAPON_ICON_34
038F: load_texture "30" as 1

:WEAPON_ICON_34
if
02D8: actor $PLAYER_ACTOR current_weapon == 34
jf @WEAPON_ICON_35
038F: load_texture "31" as 1

:WEAPON_ICON_35
if
02D8: actor $PLAYER_ACTOR current_weapon == 35
jf @WEAPON_ICON_36
038F: load_texture "32" as 1

:WEAPON_ICON_36
if
02D8: actor $PLAYER_ACTOR current_weapon == 36
jf @WEAPON_ICON_37
038F: load_texture "33" as 1

:WEAPON_ICON_37
if
02D8: actor $PLAYER_ACTOR current_weapon == 37
jf @WEAPON_ICON_38
038F: load_texture "34" as 1

:WEAPON_ICON_38
if
02D8: actor $PLAYER_ACTOR current_weapon == 38
jf @WEAPON_ICON_39
038F: load_texture "35" as 1

:WEAPON_ICON_39
if
02D8: actor $PLAYER_ACTOR current_weapon == 39
jf @WEAPON_ICON_40
038F: load_texture "36" as 1

:WEAPON_ICON_40
if
02D8: actor $PLAYER_ACTOR current_weapon == 40
jf @WEAPON_ICON_41
038F: load_texture "37" as 1

:WEAPON_ICON_41
if
02D8: actor $PLAYER_ACTOR current_weapon == 41
jf @WEAPON_ICON_42
038F: load_texture "38" as 1

:WEAPON_ICON_42
if
02D8: actor $PLAYER_ACTOR current_weapon == 42
jf @WEAPON_ICON_43
038F: load_texture "39" as 1

:WEAPON_ICON_43
if
02D8: actor $PLAYER_ACTOR current_weapon == 43
jf @WEAPON_ICON_44
038F: load_texture "40" as 1

:WEAPON_ICON_44
if
02D8: actor $PLAYER_ACTOR current_weapon == 44
jf @WEAPON_ICON_45
038F: load_texture "41" as 1

:WEAPON_ICON_45
if
02D8: actor $PLAYER_ACTOR current_weapon == 45
jf @WEAPON_ICON_46
038F: load_texture "42" as 1

:WEAPON_ICON_46
if
02D8: actor $PLAYER_ACTOR current_weapon == 46
jf @WEAPON_ICON_47
038F: load_texture "43" as 1

:WEAPON_ICON_47
wait 0
038D: draw_texture 1 position 555.0 35.0 size 35.0 40.0 RGBA 255 255 255 255
jump @WEAPON_ICON

Offline

#2 02-07-2017 10:02

Goldfish
From: Псков
Registered: 21-04-2015
Posts: 177
Website

Re: Проблема с выводом текстуры

В цикле ты допустил 2 опкода задержки (wait), а для правильной отрисовки текстур на экране должно быть не больше одной.
Исправленный вариант.

thread 'ICON_W'
0826: enable_hud 0
0390: load_txd_dictionary 'icon_weapon'

:WEAPON_ICON
wait 0
if
Player.Defined(0)
jf @WEAPON_ICON

:WEAPON_ICON_2
if
02D8: actor $PLAYER_ACTOR current_weapon == 1
jf @WEAPON_ICON_3
038F: load_texture "1" as 1

:WEAPON_ICON_3
if
02D8: actor $PLAYER_ACTOR current_weapon == 2
jf @WEAPON_ICON_4
038F: load_texture "2" as 1

:WEAPON_ICON_4
if
02D8: actor $PLAYER_ACTOR current_weapon == 3
jf @WEAPON_ICON_5
038F: load_texture "3" as 1

:WEAPON_ICON_5
if
02D8: actor $PLAYER_ACTOR current_weapon == 4
jf @WEAPON_ICON_6
038F: load_texture "4" as 1

:WEAPON_ICON_6
if
02D8: actor $PLAYER_ACTOR current_weapon == 5
jf @WEAPON_ICON_7
038F: load_texture "5" as 1

:WEAPON_ICON_7
if
02D8: actor $PLAYER_ACTOR current_weapon == 6
jf @WEAPON_ICON_8
038F: load_texture "6" as 1

:WEAPON_ICON_8
if
02D8: actor $PLAYER_ACTOR current_weapon == 7
jf @WEAPON_ICON_10
038F: load_texture "7" as 1

:WEAPON_ICON_10
if
02D8: actor $PLAYER_ACTOR current_weapon == 8
jf @WEAPON_ICON_11
038F: load_texture "8" as 1

:WEAPON_ICON_11
if
02D8: actor $PLAYER_ACTOR current_weapon == 9
jf @WEAPON_ICON_12
038F: load_texture "9" as 1

:WEAPON_ICON_12
if
02D8: actor $PLAYER_ACTOR current_weapon == 10
jf @WEAPON_ICON_13
038F: load_texture "10" as 1

:WEAPON_ICON_13
if
02D8: actor $PLAYER_ACTOR current_weapon == 11
jf @WEAPON_ICON_14
038F: load_texture "11" as 1

:WEAPON_ICON_14
if
02D8: actor $PLAYER_ACTOR current_weapon == 12
jf @WEAPON_ICON_15
038F: load_texture "12" as 1

:WEAPON_ICON_15
if
02D8: actor $PLAYER_ACTOR current_weapon == 13
jf @WEAPON_ICON_16
038F: load_texture "13" as 1

:WEAPON_ICON_16
if
02D8: actor $PLAYER_ACTOR current_weapon == 14
jf @WEAPON_ICON_17
038F: load_texture "14" as 1

:WEAPON_ICON_17
if
02D8: actor $PLAYER_ACTOR current_weapon == 15
jf @WEAPON_ICON_18
038F: load_texture "15" as 1

:WEAPON_ICON_18
if
02D8: actor $PLAYER_ACTOR current_weapon == 16
jf @WEAPON_ICON_20
038F: load_texture "16" as 1

:WEAPON_ICON_20
if
02D8: actor $PLAYER_ACTOR current_weapon == 17
jf @WEAPON_ICON_21
038F: load_texture "17" as 1

:WEAPON_ICON_21
if
02D8: actor $PLAYER_ACTOR current_weapon == 18
jf @WEAPON_ICON_22
038F: load_texture "18" as 1

:WEAPON_ICON_22
if
02D8: actor $PLAYER_ACTOR current_weapon == 22
jf @WEAPON_ICON_23
038F: load_texture "19" as 1

:WEAPON_ICON_23
if
02D8: actor $PLAYER_ACTOR current_weapon == 23
jf @WEAPON_ICON_24
038F: load_texture "20" as 1

:WEAPON_ICON_24
if
02D8: actor $PLAYER_ACTOR current_weapon == 24
jf @WEAPON_ICON_25
038F: load_texture "21" as 1

:WEAPON_ICON_25
if
02D8: actor $PLAYER_ACTOR current_weapon == 25
jf @WEAPON_ICON_26
038F: load_texture "22" as 1

:WEAPON_ICON_26
if
02D8: actor $PLAYER_ACTOR current_weapon == 26
jf @WEAPON_ICON_27
038F: load_texture "23" as 1

:WEAPON_ICON_27
if
02D8: actor $PLAYER_ACTOR current_weapon == 27
jf @WEAPON_ICON_28
038F: load_texture "24" as 1

:WEAPON_ICON_28
if
02D8: actor $PLAYER_ACTOR current_weapon == 28
jf @WEAPON_ICON_29
038F: load_texture "25" as 1

:WEAPON_ICON_29
if
02D8: actor $PLAYER_ACTOR current_weapon == 29
jf @WEAPON_ICON_30
038F: load_texture "26" as 1

:WEAPON_ICON_30
if
02D8: actor $PLAYER_ACTOR current_weapon == 32
jf @WEAPON_ICON_31
038F: load_texture "27" as 1

:WEAPON_ICON_31
if
02D8: actor $PLAYER_ACTOR current_weapon == 30
jf @WEAPON_ICON_32
038F: load_texture "28" as 1

:WEAPON_ICON_32
if
02D8: actor $PLAYER_ACTOR current_weapon == 31
jf @WEAPON_ICON_33
038F: load_texture "29" as 1

:WEAPON_ICON_33
if
02D8: actor $PLAYER_ACTOR
current_weapon == 33
jf @WEAPON_ICON_34
038F: load_texture "30" as 1

:WEAPON_ICON_34
if
02D8: actor $PLAYER_ACTOR current_weapon == 34
jf @WEAPON_ICON_35
038F: load_texture "31" as 1

:WEAPON_ICON_35
if
02D8: actor $PLAYER_ACTOR current_weapon == 35
jf @WEAPON_ICON_36
038F: load_texture "32" as 1

:WEAPON_ICON_36
if
02D8: actor $PLAYER_ACTOR current_weapon == 36
jf @WEAPON_ICON_37
038F: load_texture "33" as 1

:WEAPON_ICON_37
if
02D8: actor $PLAYER_ACTOR current_weapon == 37
jf @WEAPON_ICON_38
038F: load_texture "34" as 1

:WEAPON_ICON_38
if
02D8: actor $PLAYER_ACTOR current_weapon == 38
jf @WEAPON_ICON_39
038F: load_texture "35" as 1

:WEAPON_ICON_39
if
02D8: actor $PLAYER_ACTOR current_weapon == 39
jf @WEAPON_ICON_40
038F: load_texture "36" as 1

:WEAPON_ICON_40
if
02D8: actor $PLAYER_ACTOR current_weapon == 40
jf @WEAPON_ICON_41
038F: load_texture "37" as 1

:WEAPON_ICON_41
if
02D8: actor $PLAYER_ACTOR current_weapon == 41
jf @WEAPON_ICON_42
038F: load_texture "38" as 1

:WEAPON_ICON_42
if
02D8: actor $PLAYER_ACTOR current_weapon == 42
jf @WEAPON_ICON_43
038F: load_texture "39" as 1

:WEAPON_ICON_43
if
02D8: actor $PLAYER_ACTOR current_weapon == 43
jf @WEAPON_ICON_44
038F: load_texture "40" as 1

:WEAPON_ICON_44
if
02D8: actor $PLAYER_ACTOR current_weapon == 44
jf @WEAPON_ICON_45
038F: load_texture "41" as 1

:WEAPON_ICON_45
if
02D8: actor $PLAYER_ACTOR current_weapon == 45
jf @WEAPON_ICON_46
038F: load_texture "42" as 1

:WEAPON_ICON_46
if
02D8: actor $PLAYER_ACTOR current_weapon == 46
jf @WEAPON_ICON_47
038F: load_texture "43" as 1

:WEAPON_ICON_47
03F0: enable_text_draw 1
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 1 position 555.0 35.0 size 35.0 40.0 RGBA 255 255 255 255
jump @WEAPON_ICON

Last edited by Goldfish (02-07-2017 10:04)

Offline

#3 02-07-2017 10:11

Nikita592
Registered: 14-06-2017
Posts: 36

Re: Проблема с выводом текстуры

Исправленный вариант не работает.

Offline

#4 03-07-2017 12:19

wmysterio
Registered: 04-03-2011
Posts: 215
Website

Re: Проблема с выводом текстуры

Nikita592 wrote:

Исправленный вариант не работает.

Попробуйте это:

{$CLEO} 
0826: enable_hud 0  
0390: load_txd_dictionary 'icon_weapon'  

for 4@ = 1 to 43
0AD3: 0@v = format "%d" 4@   
038F: load_texture 0@v as 4@ 
end

while true
wait 0 
    if
    Player.Defined($PLAYER_CHAR)
    then                  
    0470: 4@ = actor $PLAYER_ACTOR current_weapon
    0085: 5@ = 4@ // (int)
         
        if
        4@ == 32
        then   
        0A8F: 5@ = 4@ - 5 // int
        jump @WEAPON_DRAW_ICON
        end   
        
        if and
        4@ > 29
        33 > 4@
        then   
        0A8F: 5@ = 4@ - 2 // int   
        jump @WEAPON_DRAW_ICON
        end
        
        if
        4@ > 18
        then
        0A8F: 5@ = 4@ - 3 // int 
        end

        :WEAPON_DRAW_ICON       
        03F0: enable_text_draw 1
        03E3: set_texture_to_be_drawn_antialiased 1    
        038D: draw_texture 5@ position 555.0 35.0 size 35.0 40.0 RGBA 255 255 255 255
    end
end

Было бы намного проще, если имя текстуры соответствовало ID оружия. Цикл сократилбыся на 24 строчки. А так пришлось шаманить с переменными, чтобы ID текстуры выводился относительно ID оружия.

Last edited by wmysterio (03-07-2017 12:32)

Offline

#5 03-07-2017 15:18

DK22Pac
From: Ukraine
Registered: 26-03-2010
Posts: 447
Website

Re: Проблема с выводом текстуры

Вроде нигде не оговаривалось, что имя текстуры может не соответствовать ID.


Plugin-SDK https://github.com/DK22Pac/plugin-sdk
Discord-сервер по plugin-sdk и программированию в GTA
RU https://discord.gg/QEesDGb
ENG https://discord.gg/zaVqFQv

Offline

#6 03-07-2017 19:46

Nikita592
Registered: 14-06-2017
Posts: 36

Re: Проблема с выводом текстуры

То ли я, такой глупый, то ли ещё что-то. Но вариант от wmysterio не работает sad(

Offline

#7 03-07-2017 20:16

Goldfish
From: Псков
Registered: 21-04-2015
Posts: 177
Website

Re: Проблема с выводом текстуры

Дружок, кинька сюда свой txd'шник и скомпилированный скрипт.

Offline

#8 04-07-2017 08:12

Nikita592
Registered: 14-06-2017
Posts: 36

Re: Проблема с выводом текстуры

Вот код:
                                                                                                                                                                                   
:WEAPON_ICON
if                                                                                                                                                   
Player.Defined(0)
jf @WEAPON_ICON
0826: enable_hud 0
0390: load_txd_dictionary 'icon_weapon'

:WEAPON_ICON_2
wait 0
if
02D8: actor $PLAYER_ACTOR current_weapon == 1
jf @WEAPON_ICON_3
038F: load_texture "1" as 1

:WEAPON_ICON_3
if
02D8: actor $PLAYER_ACTOR current_weapon == 2
jf @WEAPON_ICON_4
038F: load_texture "2" as 1

:WEAPON_ICON_4
if
02D8: actor $PLAYER_ACTOR current_weapon == 3
jf @WEAPON_ICON_5
038F: load_texture "3" as 1

:WEAPON_ICON_5
if
02D8: actor $PLAYER_ACTOR current_weapon == 4
jf @WEAPON_ICON_6
038F: load_texture "4" as 1

:WEAPON_ICON_6
if
02D8: actor $PLAYER_ACTOR current_weapon == 5
jf @WEAPON_ICON_7
038F: load_texture "5" as 1

:WEAPON_ICON_7
if
02D8: actor $PLAYER_ACTOR current_weapon == 6
jf @WEAPON_ICON_8
038F: load_texture "6" as 1

:WEAPON_ICON_8
if
02D8: actor $PLAYER_ACTOR current_weapon == 7
jf @WEAPON_ICON_10
038F: load_texture "7" as 1

:WEAPON_ICON_10
if
02D8: actor $PLAYER_ACTOR current_weapon == 8
jf @WEAPON_ICON_11
038F: load_texture "8" as 1

:WEAPON_ICON_11
if
02D8: actor $PLAYER_ACTOR current_weapon == 9
jf @WEAPON_ICON_12
038F: load_texture "9" as 1

:WEAPON_ICON_12
if
02D8: actor $PLAYER_ACTOR current_weapon == 10
jf @WEAPON_ICON_13
038F: load_texture "10" as 1

:WEAPON_ICON_13
if
02D8: actor $PLAYER_ACTOR current_weapon == 11
jf @WEAPON_ICON_14
038F: load_texture "11" as 1

:WEAPON_ICON_14
if
02D8: actor $PLAYER_ACTOR current_weapon == 12
jf @WEAPON_ICON_15
038F: load_texture "12" as 1

:WEAPON_ICON_15
if
02D8: actor $PLAYER_ACTOR current_weapon == 13
jf @WEAPON_ICON_16
038F: load_texture "13" as 1

:WEAPON_ICON_16
if
02D8: actor $PLAYER_ACTOR current_weapon == 14
jf @WEAPON_ICON_17
038F: load_texture "14" as 1

:WEAPON_ICON_17
if
02D8: actor $PLAYER_ACTOR current_weapon == 15
jf @WEAPON_ICON_18
038F: load_texture "15" as 1

:WEAPON_ICON_18
if
02D8: actor $PLAYER_ACTOR current_weapon == 16
jf @WEAPON_ICON_20
038F: load_texture "16" as 1

:WEAPON_ICON_20
if
02D8: actor $PLAYER_ACTOR current_weapon == 17
jf @WEAPON_ICON_21
038F: load_texture "17" as 1

:WEAPON_ICON_21
if
02D8: actor $PLAYER_ACTOR current_weapon == 18
jf @WEAPON_ICON_22
038F: load_texture "18" as 1

:WEAPON_ICON_22
if
02D8: actor $PLAYER_ACTOR current_weapon == 22
jf @WEAPON_ICON_23
038F: load_texture "19" as 1

:WEAPON_ICON_23
if
02D8: actor $PLAYER_ACTOR current_weapon == 23
jf @WEAPON_ICON_24
038F: load_texture "20" as 1

:WEAPON_ICON_24
if
02D8: actor $PLAYER_ACTOR current_weapon == 24
jf @WEAPON_ICON_25
038F: load_texture "21" as 1

:WEAPON_ICON_25
if
02D8: actor $PLAYER_ACTOR current_weapon == 25
jf @WEAPON_ICON_26
038F: load_texture "22" as 1

:WEAPON_ICON_26
if
02D8: actor $PLAYER_ACTOR current_weapon == 26
jf @WEAPON_ICON_27
038F: load_texture "23" as 1

:WEAPON_ICON_27
if
02D8: actor $PLAYER_ACTOR current_weapon == 27
jf @WEAPON_ICON_28
038F: load_texture "24" as 1

:WEAPON_ICON_28
if
02D8: actor $PLAYER_ACTOR current_weapon == 28
jf @WEAPON_ICON_29
038F: load_texture "25" as 1

:WEAPON_ICON_29
if
02D8: actor $PLAYER_ACTOR current_weapon == 29
jf @WEAPON_ICON_30
038F: load_texture "26" as 1

:WEAPON_ICON_30
if
02D8: actor $PLAYER_ACTOR current_weapon == 32
jf @WEAPON_ICON_31
038F: load_texture "27" as 1

:WEAPON_ICON_31
if
02D8: actor $PLAYER_ACTOR current_weapon == 30
jf @WEAPON_ICON_32
038F: load_texture "28" as 1

:WEAPON_ICON_32
if
02D8: actor $PLAYER_ACTOR current_weapon == 31
jf @WEAPON_ICON_33
038F: load_texture "29" as 1

:WEAPON_ICON_33
if
02D8: actor $PLAYER_ACTOR current_weapon == 33
jf @WEAPON_ICON_34
038F: load_texture "30" as 1

:WEAPON_ICON_34
if
02D8: actor $PLAYER_ACTOR current_weapon == 34
jf @WEAPON_ICON_35
038F: load_texture "31" as 1

:WEAPON_ICON_35
if
02D8: actor $PLAYER_ACTOR current_weapon == 35
jf @WEAPON_ICON_36
038F: load_texture "32" as 1

:WEAPON_ICON_36
if
02D8: actor $PLAYER_ACTOR current_weapon == 36
jf @WEAPON_ICON_37
038F: load_texture "33" as 1

:WEAPON_ICON_37
if
02D8: actor $PLAYER_ACTOR current_weapon == 37
jf @WEAPON_ICON_38
038F: load_texture "34" as 1

:WEAPON_ICON_38
if
02D8: actor $PLAYER_ACTOR current_weapon == 38
jf @WEAPON_ICON_39
038F: load_texture "35" as 1

:WEAPON_ICON_39
if
02D8: actor $PLAYER_ACTOR current_weapon == 39
jf @WEAPON_ICON_40
038F: load_texture "36" as 1

:WEAPON_ICON_40
if
02D8: actor $PLAYER_ACTOR current_weapon == 40
jf @WEAPON_ICON_41
038F: load_texture "37" as 1

:WEAPON_ICON_41
if
02D8: actor $PLAYER_ACTOR current_weapon == 41
jf @WEAPON_ICON_42
038F: load_texture "38" as 1

:WEAPON_ICON_42
if
02D8: actor $PLAYER_ACTOR current_weapon == 42
jf @WEAPON_ICON_43
038F: load_texture "39" as 1

:WEAPON_ICON_43
if
02D8: actor $PLAYER_ACTOR current_weapon == 43
jf @WEAPON_ICON_44
038F: load_texture "40" as 1

:WEAPON_ICON_44
if
02D8: actor $PLAYER_ACTOR current_weapon == 44
jf @WEAPON_ICON_45
038F: load_texture "41" as 1

:WEAPON_ICON_45
if
02D8: actor $PLAYER_ACTOR current_weapon == 45
jf @WEAPON_ICON_46
038F: load_texture "42" as 1

:WEAPON_ICON_46
if
02D8: actor $PLAYER_ACTOR current_weapon == 46
jf @WEAPON_ICON_47
038F: load_texture "43" as 1

:WEAPON_ICON_47
03F0: enable_text_draw 1
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 1 position 555.0 35.0 size 35.0 40.0 RGBA 255 255 255 255
jump @WEAPON_ICON


Вот TXD-Файл:
https://yadi.sk/d/oBlfg-hD3Kiuui

Last edited by Nikita592 (04-07-2017 08:17)

Offline

#9 04-07-2017 10:39

Goldfish
From: Псков
Registered: 21-04-2015
Posts: 177
Website

Re: Проблема с выводом текстуры

Слишком длинное название txd файла. Переименуй файл в icon_wpn и попробуй этот код
п.с. не стоит в цикле постоянно применять опкоды 0390: и 0826:

{$CLEO .cs}

0826: enable_hud 0
0390: load_txd_dictionary 'icon_wpn'

:WEAPON_ICON
if                                                                                                                                                   
Player.Defined(0)
jf @WEAPON_ICON

:WEAPON_ICON_2
wait 0
if
02D8: actor $PLAYER_ACTOR current_weapon == 1
jf @WEAPON_ICON_3
038F: load_texture "1" as 1

:WEAPON_ICON_3
if
02D8: actor $PLAYER_ACTOR current_weapon == 2
jf @WEAPON_ICON_4
038F: load_texture "2" as 1

:WEAPON_ICON_4
if
02D8: actor $PLAYER_ACTOR current_weapon == 3
jf @WEAPON_ICON_5
038F: load_texture "3" as 1

:WEAPON_ICON_5
if
02D8: actor $PLAYER_ACTOR current_weapon == 4
jf @WEAPON_ICON_6
038F: load_texture "4" as 1

:WEAPON_ICON_6
if
02D8: actor $PLAYER_ACTOR current_weapon == 5
jf @WEAPON_ICON_7
038F: load_texture "5" as 1

:WEAPON_ICON_7
if
02D8: actor $PLAYER_ACTOR current_weapon == 6
jf @WEAPON_ICON_8
038F: load_texture "6" as 1

:WEAPON_ICON_8
if
02D8: actor $PLAYER_ACTOR current_weapon == 7
jf @WEAPON_ICON_10
038F: load_texture "7" as 1

:WEAPON_ICON_10
if
02D8: actor $PLAYER_ACTOR current_weapon == 8
jf @WEAPON_ICON_11
038F: load_texture "8" as 1

:WEAPON_ICON_11
if
02D8: actor $PLAYER_ACTOR current_weapon == 9
jf @WEAPON_ICON_12
038F: load_texture "9" as 1

:WEAPON_ICON_12
if
02D8: actor $PLAYER_ACTOR current_weapon == 10
jf @WEAPON_ICON_13
038F: load_texture "10" as 1

:WEAPON_ICON_13
if
02D8: actor $PLAYER_ACTOR current_weapon == 11
jf @WEAPON_ICON_14
038F: load_texture "11" as 1

:WEAPON_ICON_14
if
02D8: actor $PLAYER_ACTOR current_weapon == 12
jf @WEAPON_ICON_15
038F: load_texture "12" as 1

:WEAPON_ICON_15
if
02D8: actor $PLAYER_ACTOR current_weapon == 13
jf @WEAPON_ICON_16
038F: load_texture "13" as 1

:WEAPON_ICON_16
if
02D8: actor $PLAYER_ACTOR current_weapon == 14
jf @WEAPON_ICON_17
038F: load_texture "14" as 1

:WEAPON_ICON_17
if
02D8: actor $PLAYER_ACTOR current_weapon == 15
jf @WEAPON_ICON_18
038F: load_texture "15" as 1

:WEAPON_ICON_18
if
02D8: actor $PLAYER_ACTOR current_weapon == 16
jf @WEAPON_ICON_20
038F: load_texture "16" as 1

:WEAPON_ICON_20
if
02D8: actor $PLAYER_ACTOR current_weapon == 17
jf @WEAPON_ICON_21
038F: load_texture "17" as 1

:WEAPON_ICON_21
if
02D8: actor $PLAYER_ACTOR current_weapon == 18
jf @WEAPON_ICON_22
038F: load_texture "18" as 1

:WEAPON_ICON_22
if
02D8: actor $PLAYER_ACTOR current_weapon == 22
jf @WEAPON_ICON_23
038F: load_texture "19" as 1

:WEAPON_ICON_23
if
02D8: actor $PLAYER_ACTOR current_weapon == 23
jf @WEAPON_ICON_24
038F: load_texture "20" as 1

:WEAPON_ICON_24
if
02D8: actor $PLAYER_ACTOR current_weapon == 24
jf @WEAPON_ICON_25
038F: load_texture "21" as 1

:WEAPON_ICON_25
if
02D8: actor $PLAYER_ACTOR current_weapon == 25
jf @WEAPON_ICON_26
038F: load_texture "22" as 1

:WEAPON_ICON_26
if
02D8: actor $PLAYER_ACTOR current_weapon == 26
jf @WEAPON_ICON_27
038F: load_texture "23" as 1

:WEAPON_ICON_27
if
02D8: actor $PLAYER_ACTOR current_weapon == 27
jf @WEAPON_ICON_28
038F: load_texture "24" as 1

:WEAPON_ICON_28
if
02D8: actor $PLAYER_ACTOR current_weapon == 28
jf @WEAPON_ICON_29
038F: load_texture "25" as 1

:WEAPON_ICON_29
if
02D8: actor $PLAYER_ACTOR current_weapon == 29
jf @WEAPON_ICON_30
038F: load_texture "26" as 1

:WEAPON_ICON_30
if
02D8: actor $PLAYER_ACTOR current_weapon == 32
jf @WEAPON_ICON_31
038F: load_texture "27" as 1

:WEAPON_ICON_31
if
02D8: actor $PLAYER_ACTOR current_weapon == 30
jf @WEAPON_ICON_32
038F: load_texture "28" as 1

:WEAPON_ICON_32
if
02D8: actor $PLAYER_ACTOR current_weapon == 31
jf @WEAPON_ICON_33
038F: load_texture "29" as 1

:WEAPON_ICON_33
if
02D8: actor $PLAYER_ACTOR current_weapon == 33
jf @WEAPON_ICON_34
038F: load_texture "30" as 1

:WEAPON_ICON_34
if
02D8: actor $PLAYER_ACTOR current_weapon == 34
jf @WEAPON_ICON_35
038F: load_texture "31" as 1

:WEAPON_ICON_35
if
02D8: actor $PLAYER_ACTOR current_weapon == 35
jf @WEAPON_ICON_36
038F: load_texture "32" as 1

:WEAPON_ICON_36
if
02D8: actor $PLAYER_ACTOR current_weapon == 36
jf @WEAPON_ICON_37
038F: load_texture "33" as 1

:WEAPON_ICON_37
if
02D8: actor $PLAYER_ACTOR current_weapon == 37
jf @WEAPON_ICON_38
038F: load_texture "34" as 1

:WEAPON_ICON_38
if
02D8: actor $PLAYER_ACTOR current_weapon == 38
jf @WEAPON_ICON_39
038F: load_texture "35" as 1

:WEAPON_ICON_39
if
02D8: actor $PLAYER_ACTOR current_weapon == 39
jf @WEAPON_ICON_40
038F: load_texture "36" as 1

:WEAPON_ICON_40
if
02D8: actor $PLAYER_ACTOR current_weapon == 40
jf @WEAPON_ICON_41
038F: load_texture "37" as 1

:WEAPON_ICON_41
if
02D8: actor $PLAYER_ACTOR current_weapon == 41
jf @WEAPON_ICON_42
038F: load_texture "38" as 1

:WEAPON_ICON_42
if
02D8: actor $PLAYER_ACTOR current_weapon == 42
jf @WEAPON_ICON_43
038F: load_texture "39" as 1

:WEAPON_ICON_43
if
02D8: actor $PLAYER_ACTOR current_weapon == 43
jf @WEAPON_ICON_44
038F: load_texture "40" as 1

:WEAPON_ICON_44
if
02D8: actor $PLAYER_ACTOR current_weapon == 44
jf @WEAPON_ICON_45
038F: load_texture "41" as 1

:WEAPON_ICON_45
if
02D8: actor $PLAYER_ACTOR current_weapon == 45
jf @WEAPON_ICON_46
038F: load_texture "42" as 1

:WEAPON_ICON_46
if
02D8: actor $PLAYER_ACTOR current_weapon == 46
jf @WEAPON_ICON_47
038F: load_texture "43" as 1

:WEAPON_ICON_47
03F0: enable_text_draw 1
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 1 position 555.0 35.0 size 35.0 40.0 RGBA 255 255 255 255
jump @WEAPON_ICON

Last edited by Goldfish (04-07-2017 10:57)

Offline

#10 04-07-2017 10:43

wmysterio
Registered: 04-03-2011
Posts: 215
Website

Re: Проблема с выводом текстуры

Nikita592 wrote:

То ли я, такой глупый, то ли ещё что-то. Но вариант от wmysterio не работает sad(

Да работает он, тестировал с Вашим же TXD.
delete_after.png
Вот, бросаю архив. Файлы я немного переделал, в частности добавил иконку кулака и добавил условия когда нужно отображать иконку телефона и Джетпака. Переименовал TXD-файл, потому, что имя архива не должно превышать 7 символов, опкод 0390 требует это сделать, так как s-строки не могут иметь длину больше 7 символов.

Last edited by wmysterio (04-07-2017 10:57)

Offline

#11 04-07-2017 10:59

Goldfish
From: Псков
Registered: 21-04-2015
Posts: 177
Website

Re: Проблема с выводом текстуры

припоздал, wmysterio уже поправил )

Offline

#12 04-07-2017 19:42

Nikita592
Registered: 14-06-2017
Posts: 36

Re: Проблема с выводом текстуры

Всем спасибо за помощь! Теперь текстура не моргает))) Всем спасибо за помощь! Удачи Вам!

Offline

Board footer

Powered by FluxBB