if 0aab: "cleo\ki\fonts.txt"
then
2@ = file.Open("cleo\ki\fonts.txt", "rt")
0ac8: 31@ = 256
3@ = 11
repeat
wait 0
0AD7: read_string_from_file 2@ to 31@ size 256
dialog.ListBoxInsertElement(Font_Dialog, 1, 31@, 3@, -1)
3@ ++
until file.EOF(2@)
0ac9: 31
file.Close(2@)
end
Добавляет елемент в конец списка. Вместо строк можно переменные вставлять.Код:if 0aab: "cleo\ki\fonts.txt" then 2@ = file.Open("cleo\ki\fonts.txt", "rt") 0ac8: 31@ = 256 3@ = 11 repeat wait 0 0AD7: read_string_from_file 2@ to 31@ size 256 dialog.ListBoxInsertElement(Font_Dialog, 1, 31@, 3@, -1) 3@ ++ until file.EOF(2@) 0ac9: 31 file.Close(2@) end
Use this:Hello. I need a little help to read the colors of a text.
0AF8: samp add_message_to_chat "{B2E4FF}Fail" color 0x19F577
If this text would be shown on chat, I want to read the B2E4FF, but using the getChatEntryColor function, it will return 10F577,
0B75: samp get_chat_string 1@ text_to 2@ prefix_to 3@ color_to 4@ prefix_color_to 5@
I've tried to use this function, but I keep getting crash. Will the 2@ include a {COLOR} code?Use this:
and then write a 2@ to the .txt file.Код:0B75: samp get_chat_string 1@ text_to 2@ prefix_to 3@ color_to 4@ prefix_color_to 5@
You must alocated the memory for all variables. 1@ - the number of chat_string. 99 - last chat message.I've tried to use this function, but I keep getting crash. Will the 2@ include a {COLOR} code?
EDIT: The function is now working, but who is 1@???
ifYou must alocated the memory for all variables. 1@ - the number of chat_string. 99 - last chat message.
You must write the text to the .txt file if you wont get the color code.if
0AB0: key_pressed 75
then
0ac8: 3@ = 260
0B75: samp get_chat_string 99 text_to 3@ prefix_to 4@ color_to 5@ prefix_color_to 6@
0AF8: samp add_message_to_chat "%s" color 0xFFFFFF 3@
0ac9: 3@
end
This crashes.... if I replace 99 with 1@ it works, but returns weird characters
EDIT: oooh, all variables, wait
FINALLY! Thanks, now let me find that color code.
Я именно хочу чтобы с этих переменных вставить например хп игрока, и чтобы изменения в хп отображались там, а не считывать информацию с txt
Тебе нужно что-то на подобии этого?Я именно хочу чтобы с этих переменных вставить например хп игрока, и чтобы изменения в хп отображались там, а не считывать информацию с txt
example for you - script get text and color of the line in hex and a r g b typeif
Thanks, now let me find that color code.
{$CLEO}
0662: "qwerty"
thread "compile"
repeat
wait 40
until Samp.Available()
0B34: samp register_client_command "cinfo" to_label @cmd
const
line = 1@
none = 0@
cmd = 2@
string = 3@
pref = 5@
end
while true
wait 0
end
:cmd
0B35: samp cmd = get_last_command_params
if 8AD4: cmd = scan_string cmd format "%d" line //IF and SET
then
line = 99
end
0AC8: string = free_allocated_memory 128 // max samp chat size 128
0AC8: pref = free_allocated_memory 64 // to prefix also
0B75: samp get_chat_string line text_to string prefix_to pref color_to 4@ prefix_color_to none
0B66: render argb 4@ to_a 6@ r 7@ g 8@ b 9@
0af8: "You sucessfully checked text and color to line %d" -1 line
0af8: "Text {00FF00}%s {FFFFFF}| color {00FFFF}%c%x%c{FFFFFF} and {FFFF00} %d %d %d %d {FFFFFF}in ARGB" -1 string 123 4@ 125 6@ 7@ 8@ 9@
0AC9: free_allocated_memory pref
0AC9: free_allocated_memory string
Samp.CmdRet()
Вот тебе тоже пример - показывает твое изменение здоровья, сколько было и сталоЯ именно хочу чтобы с этих переменных вставить например хп игрока, и чтобы изменения в хп отображались там, а не считывать информацию с txt
{$CLEO}
0662: "This CLEO file"
thread "compile"
repeat
wait 40
until Samp.Available()
Dialog.Create(29@, "Health Indicator")
0B5A: get_screen_resolution 25@ 26@
26@ /= 2
0B84: dialog 29@ set_pos_XY 0 26@ size 300 300
Dialog.AddListBox(29@, 2, 0, 0, 300, 300)
Dialog.SetVisible(29@, true)
Dialog.ListBoxInsertElement(29@, 2, "Script Loaded", 0, -1)
alloc 4@ 128
const
health = 0@
health2 = 1@
end
while true
wait 0
health = Actor.Health($PLAYER_ACTOR)
wait 1000
health2 = Actor.Health($PLAYER_ACTOR)
if 803B: health == health2 // (int)
then
if and
Dialog.IsVisible(29@)
not Dialog.IsMinimized(29@)
then
format 4@ "{00FFFF}Было %d | {00FF00}стало %d" 0@ 1@
5@ ++
Dialog.ListBoxInsertElement(29@, 2, 4@, 5@, -1)
end
end
end
Вот тебе тоже пример - показывает твое изменение здоровья, сколько было и стало
Код:{$CLEO} 0662: "This CLEO file" thread "compile" repeat wait 40 until Samp.Available() Dialog.Create(29@, "Health Indicator") 0B5A: get_screen_resolution 25@ 26@ 26@ /= 2 0B84: dialog 29@ set_pos_XY 0 26@ size 300 300 Dialog.AddListBox(29@, 2, 0, 0, 300, 300) Dialog.SetVisible(29@, true) Dialog.ListBoxInsertElement(29@, 2, "Script Loaded", 0, -1) alloc 4@ 128 const health = 0@ health2 = 1@ end while true wait 0 health = Actor.Health($PLAYER_ACTOR) wait 1000 health2 = Actor.Health($PLAYER_ACTOR) if 803B: health == health2 // (int) then if and Dialog.IsVisible(29@) not Dialog.IsMinimized(29@) then format 4@ "{00FFFF}Было %d | {00FF00}стало %d" 0@ 1@ 5@ ++ Dialog.ListBoxInsertElement(29@, 2, 4@, 5@, -1) end end end
{$CLEO .cs}
0000: NOP
// SAMPFUNCS
if 8AF7: get_samp_base_to 33@
then 0A93: end_custom_thread
end
repeat
wait 400
until 0AFA: is_samp_structures_available
// ---------------------
while true
wait 0
if and
0ab0: 52
Player.Defined($PLAYER_ACTOR)
then
wait 1000
0@ = Actor.Health($PLAYER_ACTOR)
format 4@v "Actor Health: %d" 0@
0B80: samp 29@ = create_dialog "Info player"
0B84: samp dialog 29@ set_pos_XY 46 350 size 200 80
0B91: dialog 29@ add_static id 2 text 4@v pos_XY 6 13 size 150 15
0B86: samp dialog 29@ set_visible true
end
end
Тебе нужно что-то на подобии этого?
http://imgdepo.ru/id/i5744100.png