Help Draw problem

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
738
Likes
16
Points
23
Location
Lithuania
Website
ugbase.eu
#1
I wanna draw command from .ini file , but probably i doing something wrong...
Who know where is problem?

[shcode=cpp]
0AC8: [email protected] = allocate_memory_size 260
0AF4: [email protected] = read_string_from_ini_file "cleo\Config.ini" section "Command" key "type"
0AB1: @DRAW_WITH_TEXT_COMMAND_FROM_INI 3 X 162.0 Y 230.0 [email protected]


:DRAW_WITH_TEXT_COMMAND_FROM_INI
03F0: enable_text_draw 1
0342: set_text_draw_centered 1
03E0: draw_text_behind_textures 0
0340: set_text_draw_RGBA 66 195 227 255
033F: set_text_draw_letter_size width 0.205 height 0.955
0349: set_text_draw_font 2
060D: draw_text_shadow 0 rgba 43 43 43 255
033E: set_draw_text_position [email protected] [email protected] GXT [email protected] // "String"
0AB2: 0

[/shcode]

@monday
@springfield
@supahdupahnubah
etc...
 
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
738
Likes
16
Points
23
Location
Lithuania
Website
ugbase.eu
#3
supahdupahnubah said:
033F: set_text_draw_letter_size width 0.205 height 0.955
This can't be problem, word from .ini is not longest , longest word is NAME + SURNAME and work good with.:
033F: set_text_draw_letter_size width 0.205 height 0.955

Look.:
[img=728x400]https://i.imgur.com/i9lkwQG.png[/img]
 

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
696
Likes
5
Points
48
#4
Parazitas said:
supahdupahnubah said:
033F: set_text_draw_letter_size width 0.205 height 0.955
This can't be problem, word from .ini is not longest , longest word is NAME + SURNAME and work good with.:
033F: set_text_draw_letter_size width 0.205 height 0.955

Look.:
[img=728x400]https://i.imgur.com/i9lkwQG.png[/img]
i mean dude you're literally making the size of a text less than a pixel

anyway i might be wrong with the scaling tho, but do you also draw this text in a while loop? it should be drawed every frame
 

kazkaS

Well-Known Member
Joined
Mar 30, 2018
Messages
113
Likes
7
Points
18
10
#5
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
738
Likes
16
Points
23
Location
Lithuania
Website
ugbase.eu
#6
Alternative.:
Code:
:DRAW_WITH_TEXT_COMMAND_FROM_INI
{
0AC8: [email protected] = allocate_memory_size 260
0AF4: [email protected] = read_string_from_ini_file "cleo\Config.ini" section "Command" key "type"
0AB1: @DRAW_WITH_TEXT_COMMAND_FROM_INI 3 X 160.0 Y 230.0 [email protected]
}
03F0: enable_text_draw 1
0342: set_text_draw_centered 1
03E0: draw_text_behind_textures 0
0340: set_text_draw_RGBA 66 195 227 255
033F: set_text_draw_letter_size width 0.205 height 0.955
0349: set_text_draw_font 2
060D: draw_text_shadow 0 rgba 43 43 43 255
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED036' [email protected] //// Get gxt text address by gxt name
0AA5: call 0x718600 2 pop 2 [email protected] [email protected] // [email protected] = TEXT
033E: set_draw_text_position [email protected] [email protected] GXT 'CRED036' // "String"
0AB2: 0
or

Code:
{
0AC8: [email protected] = allocate_memory_size 260
0AF4: [email protected] = read_string_from_ini_file "cleo\Config.ini" section "Command" key "type"
0AB1: @DRAW_WITH_TEXT_COMMAND_FROM_INI 3 X 160.0 Y 230.0 [email protected]
}
:DRAW_WITH_TEXT_COMMAND_FROM_INI
0AC8: [email protected] = allocate_memory_size 260
0AD3: [email protected] = format "%s" [email protected]
0C48: samp textdraw 1016 create [email protected] pos [email protected] [email protected]
0C4C: samp textdraw 1016 set_style 2
0C52: samp textdraw 1016 set_letter_size width 0.210000 height 0.860000 color 0xFF42C3E3
0AC9: free_allocated_memory [email protected]
0AB2: 0
 
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
738
Likes
16
Points
23
Location
Lithuania
Website
ugbase.eu
#7
@supahdupahnubah
Maybe u know why i get crash when use this two opcodes from last answer?

Crash reason flooding in chat.:

SignText: Can't create font Arial
SignText: Can't create font Arial
SignText: Can't create font Arial
SignText: Can't create font Arial
SignText: Can't create font Arial
....
 

Opcode.eXe

Well-Known Member
Joined
Feb 18, 2013
Messages
1,320
Likes
64
Points
98
Location
( ͡° ͜ʖ ͡°)
Website
www.youtube.com
10
#8
I dont know if i need to tell you guys that you cant pass a allocated variable to a function in cleo . . i mean you can but i dont know how or what it was again. . ?!?"31!

Here is what i tested, and it works 100%:


{$CLEO .cs}
0000:


REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY



WHILE TRUE
WAIT 0
0AC8: [email protected] = allocate_memory_size 64
0AF4: [email protected] = read_string_from_ini_file "cleo\Config.ini" section "Command" key "type"
0AF8: samp add_message_to_chat "STRING_READ: %s" color 0xFF00FF00 [email protected]
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED020' [email protected]
0AA5: call 0x718600 2 pop 2 [email protected] [email protected]
03F0: enable_text_draw 1
0342: set_text_draw_centered 1
03E0: draw_text_behind_textures 0
0340: set_text_draw_RGBA 66 195 227 255
033F: set_text_draw_letter_size width 0.205 height 0.955
0349: set_text_draw_font 2
060D: draw_text_shadow 0 rgba 43 43 43 255
033E: set_draw_text_position 162.0 Y 230.0 GXT 'CRED020' // GXT ARE PREDEFINED . .
0AC9: free_allocated_memory [email protected]
END
 
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
738
Likes
16
Points
23
Location
Lithuania
Website
ugbase.eu
#9
I dont know if i need to tell you guys that you cant pass a allocated variable to a function in cleo . . i mean you can but i dont know how or what it was again. . ?!?"31!

Here is what i tested, and it works 100%:


{$CLEO .cs}
0000:


REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY



WHILE TRUE
WAIT 0
0AC8: [email protected] = allocate_memory_size 64
0AF4: [email protected] = read_string_from_ini_file "cleo\Config.ini" section "Command" key "type"
0AF8: samp add_message_to_chat "STRING_READ: %s" color 0xFF00FF00 [email protected]
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED020' [email protected]
0AA5: call 0x718600 2 pop 2 [email protected] [email protected]
03F0: enable_text_draw 1
0342: set_text_draw_centered 1
03E0: draw_text_behind_textures 0
0340: set_text_draw_RGBA 66 195 227 255
033F: set_text_draw_letter_size width 0.205 height 0.955
0349: set_text_draw_font 2
060D: draw_text_shadow 0 rgba 43 43 43 255
033E: set_draw_text_position 162.0 Y 230.0 GXT 'CRED020' // GXT ARE PREDEFINED . .
0AC9: free_allocated_memory [email protected]
END
Sorry man , i solved it , all crash i get from other cleo , i check my cleo folder. Anyway Thanks for help guys
And yes i finished it.

[BOT] Auto accept calls from taxi, trucks etc...
sa-mp-014.png

@Opcode.eXe Thanks for turtorial about cursor and opcode 05A5

http://ugbase.eu/index.php?threads/advanced-guis-in-cleo-not-dialogs.18001/#post-105855

Edit.:
This two codes working good without crash my problem was from other cleo.
http://ugbase.eu/index.php?threads/draw-problem.19777/#post-114519
 
Last edited:
Top