CLEO Help Help with Dialog Box

CLEO related
Status
Not open for further replies.

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
How to make a Dialog box and write some options on it and select the option of SAMP?  :sadpepe: :sadpepe: :sadpepe:
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,156
Solutions
5
Reaction score
894
Location
Lithuania
I working with this... , so  here is result, but i don't know how add more items from ini in dialog list :(

[shcode=cpp]
{$CLEO .cs}
0000:


REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

0B34: "servers" @Servers

IF
 0AAB:   file_exists "CLEO\INI\Servers.ini"
THEN
/////////////////////////// Successfully loaded ///////////////////////////
0ACC: show_text_lowpriority "Server.ini File Successfully loaded" time 2000
///////////////////////////// Allocate memory /////////////////////////////
0AC8: 1@ = allocate_memory_size 260
0AC8: 3@ = allocate_memory_size 260
0AC8: 5@ = allocate_memory_size 260
0AC8: 7@ = allocate_memory_size 260
0AC8: 9@ = allocate_memory_size 260
0AC8: 11@ = allocate_memory_size 260
0AC8: 12@ = allocate_memory_size 260
0AC8: 13@ = allocate_memory_size 260
0AC8: 14@ = allocate_memory_size 260
0AC8: 15@ = allocate_memory_size 260
/////////////////////////////////////////// Servers ///////////////////////////////////////////
0AF4: 11@ = read_string_from_ini_file "CLEO\INI\Servers.ini" section "Server1" key "ServerName"
0AF4: 1@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server1" key "IP"
0AF0: 2@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server1" key "Port"

0AF4: 12@ = read_string_from_ini_file "CLEO\INI\Servers.ini" section "Server2" key "ServerName"
0AF4: 3@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server2" key "IP"
0AF0: 4@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server2" key "Port"

0AF4: 13@ = read_string_from_ini_file "CLEO\INI\Servers.ini" section "Server3" key "ServerName"
0AF4: 5@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server3" key "IP"
0AF0: 6@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server3" key "Port"

0AF4: 14@ = read_string_from_ini_file "CLEO\INI\Servers.ini" section "Server4" key "ServerName"
0AF4: 7@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server4" key "IP"
0AF0: 8@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server4" key "Port"

0AF4: 15@ = read_string_from_ini_file "CLEO\INI\Servers.ini" section "Server5" key "ServerName"
0AF4: 9@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server5" key "IP"
0AF0: 10@ = get_float_from_ini_file "CLEO\INI\Servers.ini" section "Server5" key "Port"
ELSE
wait 100
////////////////////////// Not Successfully loaded //////////////////////////
0ACC: show_text_lowpriority "File CLEO\INI\Servers.ini Not found!" time 2000
END

WHILE TRUE
   WAIT 0

IF
23@ == TRUE
THEN    
   0B3B: samp show_dialog id 1000 caption "Servers" text 11@ button_1 "OK" button_2 "CLOSE" style 2  
   23@ = FALSE
END

IF
0B3C: samp is_dialog_responded id 1000 button 17@ list_item 18@ input_text 0
THEN


IF
17@ == 1 // OK button
THEN
   IF
   18@ == 0
   THEN
       0AF8: "selected element 0 " -1
   END
END

IF
17@ == 1 // OK button
THEN
   IF
   18@ == 1
   THEN
       0AF8: "selected element 1 " -1
   END
END

IF
17@ == 1 // OK button
THEN
   IF
   18@ == 2
   THEN
       0AF8: "selected element 2 " -1
   END
END

IF
17@ == 1 // OK button
THEN
   IF
   18@ == 3
   THEN
       0AF8: "selected element 3 " -1
   END
END

IF
17@ == 1 // OK button
THEN
   IF
   18@ == 4
   THEN
       0AF8: "selected element 4 " -1
   END
END

END /// END 0B3C: samp is_dialog_responded id 1000 button 17@ list_item 18@ input_text 0
   
END /// END WHILE TRUE

:Servers
0B12: 23@ = 23@ XOR TRUE

0B43:
[/shcode]
 

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
That's look like my "Server Joiner" but you can edit it if you want. Everyone is Allowed

but actually i didn't understand what you just type. I just need a simple samp box with options so, i can select any of them if i want to. You know how to make it? If yes then please paste another snippet which only contains the information about "how to create a box".
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,156
Solutions
5
Reaction score
894
Location
Lithuania
Yes its your server joiner ,  i just tried make him on dialog , but stuck on dialog list item  ;)


Here is simple dialog  + when you press list item get chat msg.
[shcode=cpp]
{$CLEO .cs}
0000:


REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

0B34: "Dialog" @Show

WHILE TRUE
   WAIT 0

IF
23@ == TRUE
THEN  
   0AC6: 16@ = label @TEXT offset  
   0B3B: samp show_dialog id 1000 caption "Servers" text 16@ button_1 "OK" button_2 "CLOSE" style 2  
   23@ = FALSE
END

IF
0B3C: samp is_dialog_responded id 1000 button 17@ list_item 18@ input_text 0
THEN


IF
17@ == 1 // OK button
THEN
   IF
   18@ == 0
   THEN
       0AF8: "selected element 0 " -1
   END
END

IF
17@ == 1 // OK button
THEN
   IF
   18@ == 1
   THEN
       0AF8: "selected element 1 " -1
   END
END

IF
17@ == 1 // OK button
THEN
   IF
   18@ == 2
   THEN
       0AF8: "selected element 2 " -1
   END
END

IF
17@ == 1 // OK button
THEN
   IF
   18@ == 3
   THEN
       0AF8: "selected element 3 " -1
   END
END

IF
17@ == 1 // OK button
THEN
   IF
   18@ == 4
   THEN
       0AF8: "selected element 4 " -1
   END
END

END /// END 0B3C: samp is_dialog_responded id 1000 button 17@ list_item 18@ input_text 0
   
END /// END WHILE TRUE

:TEXT
hex
"{FFFFFF}NUMBER 0 " A
"{009900}NUMBER 1" A
"{009900}NUMBER 2" A
"{B00003}NUMBER 3" A
"{B00003}NUMBER 4" A 
00                        
end

:Show
0B12: 23@ = 23@ XOR TRUE

0B43:
[/shcode]
 
Status
Not open for further replies.
Top