CLEO Help Help

CLEO related
Status
Not open for further replies.

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
[shcode=cpp]{$CLEO .cs}
0000: NOP

thread "LSSI"

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end
while not SAMP.Available()
wait 100
end
wait 100

0af8: "TXD Editor by Popica & Shanker. | Scrie /txdr." -1
              
           0b63: "txdr"     
0B34: samp register_client_command "txdr" to_label @dialog
Dialog.Create(1@, "Textdraw Editor by Popica & Shanker ")
Dialog.AddButton(1@,36,"{22FF00}Exit", 5, 420, 130, 30)
Dialog.AddStatic(1@,2,"Nume:",5,5,100,30) 
Dialog.AddStatic(1@,2,"R-",65,5,30,30)   
Dialog.AddEditBox(1@,200,"",90,5,55,40)
Dialog.AddStatic(1@,2,"G-",160,5,30,30) 
Dialog.AddEditBox(1@,201,"",190,5,55,40)
Dialog.AddStatic(1@,2,"B-",250,5,30,30) 
Dialog.AddEditBox(1@,202,"",280,5,55,40)
Dialog.AddStatic(1@,2,"Date:",5,45,100,30) 
Dialog.AddStatic(1@,2,"R-",65,45,30,30)             
Dialog.AddEditBox(1@,203,"",90,45,55,40)
Dialog.AddStatic(1@,2,"G-",160,45,30,30) 
Dialog.AddEditBox(1@,204,"",190,45,55,40)
Dialog.AddStatic(1@,2,"B-",250,45,30,30) 
Dialog.AddEditBox(1@,205,"",280,45,55,40)
Dialog.AddStatic(1@,2,"Time:",5,85,100,30) 
Dialog.AddStatic(1@,2,"R-",65,85,30,30)   
Dialog.AddEditBox(1@,206,"",90,85,55,40)
Dialog.AddStatic(1@,2,"G-",160,85,30,30) 
Dialog.AddEditBox(1@,207,"",190,85,55,40)
Dialog.AddStatic(1@,2,"B-",250,85,30,30) 
Dialog.AddEditBox(1@,208,"",280,85,55,40)   
Dialog.AddStatic(1@,2,"Server:",5,125,100,30) 
Dialog.AddStatic(1@,2,"R-",65,125,30,30)   
Dialog.AddEditBox(1@,209,"",90,125,55,40)
Dialog.AddStatic(1@,2,"G-",160,125,30,30) 
Dialog.AddEditBox(1@,210,"",190,125,55,40)
Dialog.AddStatic(1@,2,"B-",250,125,30,30) 
Dialog.AddEditBox(1@,211,"",280,125,55,40)
Dialog.AddStatic(1@,2,"Fuel:",5,165,100,30) 
Dialog.AddStatic(1@,2,"R-",65,165,30,30)   
Dialog.AddEditBox(1@,212,"",90,165,55,40)
Dialog.AddStatic(1@,2,"G-",160,165,30,30) 
Dialog.AddEditBox(1@,213,"",190,165,55,40)
Dialog.AddStatic(1@,2,"B-",250,165,30,30) 
Dialog.AddEditBox(1@,214,"",280,165,55,40)
Dialog.AddStatic(1@,2,"Speed:",5,205,100,30) 
Dialog.AddStatic(1@,2,"R-",65,205,30,30)   
Dialog.AddEditBox(1@,215,"",90,205,55,40)
Dialog.AddStatic(1@,2,"G-",160,205,30,30) 
Dialog.AddEditBox(1@,216,"",190,205,55,40)
Dialog.AddStatic(1@,2,"B-",250,205,30,30) 
Dialog.AddEditBox(1@,217,"",280,205,55,40)
Dialog.AddStatic(1@,2,"KM:",5,245,100,30) 
Dialog.AddStatic(1@,2,"R-",65,245,30,30)   
Dialog.AddEditBox(1@,218,"",90,245,55,40)
Dialog.AddStatic(1@,2,"G-",160,245,30,30) 
Dialog.AddEditBox(1@,219,"",190,245,55,40)
Dialog.AddStatic(1@,2,"B-",250,245,30,30) 
Dialog.AddEditBox(1@,220,"",280,245,55,40) 
Dialog.AddStatic(1@,2,"Status:",5,285,100,30) 
Dialog.AddStatic(1@,2,"R-",65,285,30,30)   
Dialog.AddEditBox(1@,221,"",90,285,55,40)
Dialog.AddStatic(1@,2,"G-",160,285,30,30) 
Dialog.AddEditBox(1@,222,"",190,285,55,40)
Dialog.AddStatic(1@,2,"B-",250,285,30,30) 
Dialog.AddEditBox(1@,223,"",280,285,55,40)
Dialog.AddButton(1@,50,"{00FFFF}Coloreaza",200,420,130, 30)
0B5A: get_screen_resolution 2@ 3@
3@ /= 2
2@ /=2
2@ -=250//160
3@ -=170
0B84: samp dialog 1@ set_pos_XY 2@ 3@ size 350 480
0B86: samp dialog 1@ set_visible false
$v = 0
$_xx = 0
$_yy = 0
$_zz = 0
$_z = 0
$_y = 0
$_y = 0
$str = 0
$astr = 0 
        $enspe = 0
        
        
      

while true
wait 0
    if 4@ == 1
    then
    0B8D: samp set_cursor_mode 2
    0B86: samp dialog 1@ set_visible true
        if 0AB0: key_pressed 1
        then
        0B5E: get_cursor_pos 28@ 27@
        0B85: samp dialog 1@ get_position_to 26@ 25@ size_to 0@ 0@
            if and
            001D: 28@ > 26@
            001D: 27@ > 25@ 
            then                       
            26@ += 340
            25@ += 20
                if and
                001D: 26@ > 28@
                001D: 25@ > 27@ 
                then
                26@ -= 340
                25@ -= 20 
                0062: 28@ -= 26@
                0062: 27@ -= 25@ 
                    while 0AB0: key_pressed 1
                    wait 0
                    0B5E: get_cursor_pos 26@ 25@
                    0062: 26@ -= 28@ 
                    0062: 25@ -= 27@
                    0B84: samp dialog 1@ set_pos_XY 26@ 25@ size 350 480
                    end
                end
            end
        end
        if
        Dialog.PopEvent(1@, 5@, 6@)
        then
        if and
        6@ == 50
        5@ == 257
        then
        alloc $r__n 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,200,$r__n)
        0AD4: $moc = scan_string $r__n format "%d" $r_n
        alloc $g__n 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,201,$g__n)   
        0AD4: $moc = scan_string $g__n format "%d" $g_n
        alloc $b__n 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,202,$b__n)
        0AD4: $moc = scan_string $b__n format "%d" $b_n
         0B67: 0xFF $r_n $g_n $b_n IN 32@
        30@ = 0.350000
   31@ = 1.100000
   0C52: TXD 2057 30@ 31@ IN 32@
   0AF1: write_int $r_n to_ini_file "cleo\txdr.ini" section "Name" key "r"
   0AF1: write_int $g_n to_ini_file "cleo\txdr.ini" section "Name" key "g"
   0AF1: write_int $b_n to_ini_file "cleo\txdr.ini" section "Name" key "b"
   ////////////////////////////////////////////////////////////////////////////
                    alloc $r__d 10                    
        Dialog.GetControlText(1@,203,$r__d)
        0AD4: $moc = scan_string $r__d format "%d" $r_d
        alloc $g__d 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,204,$g__d)   
        0AD4: $moc = scan_string $g__d format "%d" $g_d
        alloc $b__d 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,205,$b__d)
        0AD4: $moc = scan_string $b__n format "%d" $b_d
         0B67: 0xFF $r_d $g_d $b_d IN 10@
        30@ = 0.350000
   31@ = 1.100000
   0C52: TXD 3 30@ 31@ IN 10@
   0AF1: write_int $r_d to_ini_file "cleo\txdr.ini" section "Date" key "r"
   0AF1: write_int $g_d to_ini_file "cleo\txdr.ini" section "Date" key "g"
   0AF1: write_int $b_d to_ini_file "cleo\txdr.ini" section "Date" key "b"
    ////////////////////////////////////////////////////////////////////////////
                    alloc $r__t 10                    
        Dialog.GetControlText(1@,206,$r__t)
        0AD4: $moc = scan_string $r__t format "%d" $r_t
        alloc $g__t 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,207,$g__t)   
        0AD4: $moc = scan_string $g__t format "%d" $g_t
        alloc $b__t 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,208,$b__t)
        0AD4: $moc = scan_string $b__n format "%d" $b_t
         0B67: 0xFF $r_t $g_t $b_t IN 11@
      30@ = 0.570000
   31@ = 2.050000
   0C52: TXD 2 30@ 31@ IN 11@
   0AF1: write_int $r_t to_ini_file "cleo\txdr.ini" section "Time" key "r"
   0AF1: write_int $g_t to_ini_file "cleo\txdr.ini" section "Time" key "g"
   0AF1: write_int $b_t to_ini_file "cleo\txdr.ini" section "Time" key "b"  
   ////////////////////////////////////////////////////////////////////////////
                    alloc $r__s 10                    
        Dialog.GetControlText(1@,209,$r__s)
        0AD4: $moc = scan_string $r__s format "%d" $r_s
        alloc $g__s 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,210,$g__s)   
        0AD4: $moc = scan_string $g__s format "%d" $g_s
        alloc $b__s 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,211,$b__s)
        0AD4: $moc = scan_string $b__n format "%d" $b_s
         0B67: 0xFF $r_s $g_s $b_s IN 11@
     30@ = 0.350000
   31@ = 1.100000
   0C52: TXD 0 30@ 31@ IN 11@
   0AF1: write_int $r_s to_ini_file "cleo\txdr.ini" section "Server" key "r"
   0AF1: write_int $g_s to_ini_file "cleo\txdr.ini" section "Server" key "g"
   0AF1: write_int $b_s to_ini_file "cleo\txdr.ini" section "Server" key "b"
    ////////////////////////////////////////////////////////////////////////////
                    alloc $r__f 10                    
        Dialog.GetControlText(1@,212,$r__f)
        0AD4: $moc = scan_ftring $r__f format "%d" $r_f
        alloc $g__f 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,213,$g__f)   
        0AD4: $moc = scan_ftring $g__f format "%d" $g_f
        alloc $b__f 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,214,$b__f)
        0AD4: $moc = scan_ftring $b__n format "%d" $b_f
         0B67: 0xFF $r_f $g_f $b_f IN 11@
      30@ = 0.350000
   31@ = 1.100000
   0C52: TXD 2054 30@ 31@ IN 11@
   0AF1: write_int $r_f to_ini_file "cleo\txdr.ini" section "Fuel" key "r"
   0AF1: write_int $g_f to_ini_file "cleo\txdr.ini" section "Fuel" key "g"
   0AF1: write_int $b_f to_ini_file "cleo\txdr.ini" section "Fuel" key "b"    
   
    ////////////////////////////////////////////////////////////////////////////
        alloc $r__sp 10                    
        Dialog.GetControlText(1@,215,$r__sp)
        0AD4: $moc = scan_sptring $r__sp format "%d" $r_sp
        
        alloc $g__sp 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,216,$g__sp)   
        0AD4: $moc = scan_sptring $g__sp format "%d" $g_sp
        
        alloc $b__sp 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,217,$b__sp)
        0AD4: $moc = scan_sptring $b__n format "%d" $b_sp
        
        0B67: 0xFF $r_sp $g_sp $b_sp IN 11@
        30@ = 0.350000
        31@ = 1.100000
        0C52: TXD 2055 30@ 31@ IN 11@
        0AF1: write_int $r_sp to_ini_spile "cleo\txdr.ini" section "Speed" key "r"
        0AF1: write_int $g_sp to_ini_spile "cleo\txdr.ini" section "Speed" key "g"
        0AF1: write_int $b_sp to_ini_spile "cleo\txdr.ini" section "Speed" key "b" 
        
        alloc $r__km 10                    
        Dialog.GetControlText(1@,218,$r__km)
        0AD4: $moc = scan_kmtring $r__km format "%d" $r_km
        alloc $g__km 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,219,$g__km)   
        0AD4: $moc = scan_kmtring $g__km format "%d" $g_km
        alloc $b__km 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,220,$b__km)
        0AD4: $moc = scan_kmtring $b__n format "%d" $b_km
        0B67: 0xFF $r_km $g_km $b_km IN 11@
        30@ = 0.350000
        31@ = 1.100000
        0C52: TXD 2056 30@ 31@ IN 11@
        0AF1: write_int $r_km to_ini_kmile "cleo\txdr.ini" section "KM" key "r"
        0AF1: write_int $g_km to_ini_kmile "cleo\txdr.ini" section "KM" key "g"
        0AF1: write_int $b_km to_ini_kmile "cleo\txdr.ini" section "KM" key "b"   
        alloc $r__Status 10                    
        Dialog.GetControlText(1@,221,$r__Status)
        0AD4: $moc = scan_Statustring $r__Status format "%d" $r_Status
        alloc $g__Status 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,222,$g__Status)   
        0AD4: $moc = scan_Statustring $g__Status format "%d" $g_Status
        alloc $b__Status 10                    //200 - r || 201 - g || 202 - b
        Dialog.GetControlText(1@,223,$b__Status)
        0AD4: $moc = scan_Statustring $b__Status format "%d" $b_Status
        0B67: 0xFF $r_Status $g_Status $b_Status IN 11@
        30@ = 0.350000
        31@ = 1.100000
        0C52: TXD 2059 30@ 31@ IN 11@
        0AF1: write_int $r_Status to_ini_Statusile "cleo\txdr.ini" section "Status" key "r"
        0AF1: write_int $g_Status to_ini_Statusile "cleo\txdr.ini" section "Status" key "g"
        0AF1: write_int $b_Status to_ini_Statusile "cleo\txdr.ini" section "Status" key "b"                     
        end
                if and
                6@ == 36
                5@ == 257
                then
                0B8D: samp set_cursor_mode 0
                0B86: samp dialog 1@ set_visible false 
                4@ = 0  
                end
        end
    end
    {if 4@ == 0
    then
    0B8D: samp set_cursor_mode 0
    0B86: samp dialog 1@ set_visible false
    4@ == 0
    end} 
end 

 






:dialog  
0AF0: $n_r = get_int_from_ini_file "cleo\txdr.ini" section "Name" key "r"
0AF0: $n_g = get_int_from_ini_file "cleo\txdr.ini" section "Name" key "g"
0AF0: $n_b = get_int_from_ini_file "cleo\txdr.ini" section "Name" key "b"
alloc $n_tr 10
alloc $n_tg 10
alloc $n_tb 10
format $n_tr "%d" $n_r
format $n_tg "%d" $n_g           //200 - r || 201 - g || 202 - b
format $n_tb "%d" $n_b
0B94: dialog 1@ set_control 200 text $n_tr
0B94: dialog 1@ set_control 201 text $n_tg
0B94: dialog 1@ set_control 202 text $n_tb    
////////////////////////////// date //////////////////////////////////
0AF0: $d_r = get_int_from_ini_file "cleo\txdr.ini" section "Date" key "r"
0AF0: $d_g = get_int_from_ini_file "cleo\txdr.ini" section "Date" key "g"
0AF0: $d_b = get_int_from_ini_file "cleo\txdr.ini" section "Date" key "b"
alloc $d_tr 10
alloc $d_tg 10
alloc $d_tb 10
format $d_tr "%d" $d_r
format $d_tg "%d" $d_g           //200 - r || 201 - g || 202 - b
format $d_tb "%d" $d_b
0B94: dialog 1@ set_control 203 text $d_tr
0B94: dialog 1@ set_control 204 text $d_tg
0B94: dialog 1@ set_control 205 text $d_tb  
////////////////////////////// Time //////////////////////////////////
0AF0: $t_r = get_int_from_ini_file "cleo\txdr.ini" section "Time" key "r"
0AF0: $t_g = get_int_from_ini_file "cleo\txdr.ini" section "Time" key "g"
0AF0: $t_b = get_int_from_ini_file "cleo\txdr.ini" section "Time" key "b"
alloc $t_tr 10
alloc $t_tg 10
alloc $t_tb 10
format $t_tr "%d" $t_r
format $t_tg "%d" $t_g           //200 - r || 201 - g || 202 - b
format $t_tb "%d" $t_b
0B94: dialog 1@ set_control 206 text $t_tr
0B94: dialog 1@ set_control 207 text $t_tg
0B94: dialog 1@ set_control 208 text $t_tb 

////////////////////////////// Server //////////////////////////////////
0AF0: $s_r = get_int_from_ini_file "cleo\txdr.ini" section "Server" key "r"
0AF0: $s_g = get_int_from_ini_file "cleo\txdr.ini" section "Server" key "g"
0AF0: $s_b = get_int_from_ini_file "cleo\txdr.ini" section "Server" key "b"
alloc $s_tr 10
alloc $s_tg 10
alloc $s_tb 10
format $s_tr "%d" $s_r
format $s_tg "%d" $s_g           //200 - r || 201 - g || 202 - b
format $s_tb "%d" $s_b
0B94: dialog 1@ set_control 209 text $s_tr
0B94: dialog 1@ set_control 210 text $s_tg
0B94: dialog 1@ set_control 211 text $s_tb 

////////////////////////////// Fuel //////////////////////////////////
0AF0: $f_r = get_int_from_ini_file "cleo\txdr.ini" section "Fuel" key "r"
0AF0: $f_g = get_int_from_ini_file "cleo\txdr.ini" section "Fuel" key "g"
0AF0: $f_b = get_int_from_ini_file "cleo\txdr.ini" section "Fuel" key "b"
alloc $f_tr 10
alloc $f_tg 10
alloc $f_tb 10
format $f_tr "%d" $f_r
format $f_tg "%d" $f_g           //200 - r || 201 - g || 202 - b
format $f_tb "%d" $f_b
0B94: dialog 1@ set_control 212 text $f_tr
0B94: dialog 1@ set_control 213 text $f_tg
0B94: dialog 1@ set_control 214 text $f_tb  

////////////////////////////// Speed //////////////////////////////////
0AF0: $sp_r = get_int_from_ini_file "cleo\txdr.ini" section "Speed" key "r"
0AF0: $sp_g = get_int_from_ini_file "cleo\txdr.ini" section "Speed" key "g"
0AF0: $sp_b = get_int_from_ini_file "cleo\txdr.ini" section "Speed" key "b"
alloc $sp_tr 10
alloc $sp_tg 10
alloc $sp_tb 10
format $sp_tr "%d" $sp_r
format $sp_tg "%d" $sp_g           //200 - r || 201 - g || 202 - b
format $sp_tb "%d" $sp_b
0B94: dialog 1@ set_control 215 text $sp_tr
0B94: dialog 1@ set_control 216 text $sp_tg
0B94: dialog 1@ set_control 217 text $sp_tb 

////////////////////////////// KM //////////////////////////////////
0AF0: 18@ = get_int_from_ini_file "cleo\txdr.ini" section "KM" key "r"
0AF0: 19@ = get_int_from_ini_file "cleo\txdr.ini" section "KM" key "g"
0AF0: 20@ = get_int_from_ini_file "cleo\txdr.ini" section "KM" key "b"
alloc 21@ 10
alloc 22@ 10
alloc 23@ 10
format 21@ "%d" 18@
format 22@ "%d" 19@           //200 - r || 201 - g || 202 - b
format 23@ "%d" 20@
0B94: dialog 1@ set_control 218 text 21@
0B94: dialog 1@ set_control 219 text 22@
0B94: dialog 1@ set_control 220 text 23@ 

////////////////////////////// Status //////////////////////////////////
0AF0: $Status_r = get_int_from_ini_file "cleo\txdr.ini" section "Status" key "r"
0AF0: $Status_g = get_int_from_ini_file "cleo\txdr.ini" section "Status" key "g"
0AF0: $Status_b = get_int_from_ini_file "cleo\txdr.ini" section "Status" key "b"
alloc $Status_tr 10
alloc $Status_tg 10
alloc $Status_tb 10
format $Status_tr "%d" $Status_r
format $Status_tg "%d" $Status_g           //200 - r || 201 - g || 202 - b
format $Status_tb "%d" $Status_b
0B94: dialog 1@ set_control 221 text $Status_tr
0B94: dialog 1@ set_control 222 text $Status_tg
0B94: dialog 1@ set_control 223 text $Status_tb 
4@ = 1
SAMP.CmdRet()
[/shcode]

You have video with it here: https://www.youtube.com/watch?v=AOcyHdkJlKQ


When I insert a value in the three box (Format RGB, 3 = B) the others boxes (B) will get the same value like that, without the last, "Status:" and ofc, when I apply the colours all of the textdraws will get R, G and the same B Value. There  has no logic, I give up, i hope you can find the bug...

////////////////////////////////////////////////

another problem,
[shcode=cpp]{$CLEO .cs}
 
0b34: "Textdraw" @Textdraw
//-------------MAIN---------------
0000: NOP 
 
:Noname_2
0001: wait 0 ms 
 
:Noname_6
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @Noname_492
0001: wait 0 ms 
IF
30@ == 1
004D: jump_if_false @Noname_460 
  0@ = 214  // DATA  
  1@ = 254
  2@ = 7
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.500000
  0C52: TXD 3 4@ 5@ IN 3@   
  0@ = 215  // CEAS    
  1@ = 23
  2@ = 100                                       
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.570000
  5@ = 2.050000
  0C52: TXD 2 4@ 5@ IN 3@  
  0@ = 212 // Server Nickname
  1@ = 69                   
  2@ = 26
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 0 4@ 5@ IN 3@   
  0@ = 246  //  Fuel
  1@ = 18
  2@ = 25 
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2054 4@ 5@ IN 3@   
  0@ = 18 // Speed
  1@ = 48
  2@ = 246 
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2055 4@ 5@ IN 3@    
  0@ = 102 // Odometer
  1@ = 15
  2@ = 70  
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2056 4@ 5@ IN 3@ 
  0@ = 51 // Status
  1@ = 112
  2@ = 61 
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2059 4@ 5@ IN 3@     
  0@ = 215  // Nume    
  1@ = 23
  2@ = 100                                       
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2057 4@ 5@ IN 3@
  ///////////////////////////
  wait 1000
  0@ = 29  // DATA  
  1@ = 98
  2@ = 41
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.500000
  0C52: TXD 3 4@ 5@ IN 3@   
  0@ = 26  // CEAS    
  1@ = 90   
  2@ = 174                                       
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.570000
  5@ = 2.050000
  0C52: TXD 2 4@ 5@ IN 3@  
  0@ = 63 // Server Nickname
  1@ = 195                
  2@ = 89
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 0 4@ 5@ IN 3@   
  0@ = 238  //  Fuel
  1@ = 16    
  2@ = 68 
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2054 4@ 5@ IN 3@   
  0@ = 18 // Speed
  1@ = 48
  2@ = 246 
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2055 4@ 5@ IN 3@    
  0@ = 102 // Odometer
  1@ = 15
  2@ = 70  
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2056 4@ 5@ IN 3@ 
  0@ = 51 // Status
  1@ = 112
  2@ = 61 
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2059 4@ 5@ IN 3@     
  0@ = 215  // Nume    
  1@ = 23
  2@ = 100                                       
  0B67: 0xFF 0@ 1@ 2@ IN 3@
  4@ = 0.350000
  5@ = 1.100000
  0C52: TXD 2057 4@ 5@ IN 3@
 
:Noname_460
00D6: if and
0ADC:   test_cheat "BLOWUP42"
8B21:   not samp is_chat_opened 
004D: jump_if_false @Noname_485 
 
:Noname_485
0002: jump @Noname_6 
 
:Noname_492
0002: jump @Noname_2 
 
:Noname_499
0001: wait 0 ms 
0002: jump @Noname_499
 
:Textdraw
SAMP.IsCommandTyped(19@)
IF 0ad4: 20@ 19@ "%d" 30@
SAMP.CmdRet[/shcode]

there i wanted to do a rainbow, but after "wait" script wont change the color, i really don't know why.

//////////////////////////////////////////////

another question is, how can i change in real time skins effects?
I know how to do a text behind skin but, i wanna do smt like: "Shanker" wait 500 "E" wait 500" Smeker" in real time, is there an opcode?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Make a smaller script? And try with only two textdraws, nobody got time to read the whole code + it's very messy.

About the second thing, you need to understand how a loop works.

[shcode=cpp]

:loop
0C52: TXD 2057 0.3 1.0 IN 0xFF00FF00 //the textdraw color is red now
wait 1000                            //you wait some time
0C52: TXD 2057 0.3 1.0 IN 0xFF0000FF //you change the color to blue now

//but now the script has reach the end and it will jump to the first 0C52
//and it will set the color back to red instantly, so fast you won't even see the change
//you need to wait some time with the second color also, so add a wait after
wait 1000
jump @loop

[/shcode]
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
springfield said:
Make a smaller script? And try with only two textdraws, nobody got time to read the whole code + it's very messy.

About the second thing, you need to understand how a loop works.

[shcode=cpp]

:loop
0C52: TXD 2057 0.3 1.0 IN 0xFF00FF00 //the textdraw color is red now
wait 1000                            //you wait some time
0C52: TXD 2057 0.3 1.0 IN 0xFF0000FF //you change the color to blue now

//but now the script has reach the end and it will jump to the first 0C52
//and it will set the color back to red instantly, so fast you won't even see the change
//you need to wait some time with the second color also, so add a wait after
wait 1000
jump @loop

[/shcode]

I will try rewrite it, but u miss my three question, can u check again pls ?:)
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Oh, sorry, didn't see that.
But i don't understand what you mean by "how can i change in real time skins effects"?
You mean you want to morph a textdraw to slowly change from one text to another?
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
springfield said:
Oh, sorry, didn't see that.
But i don't understand what you mean by "how can i change in real time skins effects"?
You mean you want to morph a textdraw to slowly change from one text to another?

Yes sir, btw I just rewrited first script and now is working, idk what was the problem :| but im happy is working now :))
P.S: is possible to change SA textdraws colors/size? Then how can i get ID from these textdraws?

look in the next photo: http://imgur.com/a/PvCF8
in .ini file i have float without 000 , ex: 0.35 , 0.32 etc, but when i use 0B94: , script will put 000 behind the number :(
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
You could add a textdraw above, and increase/decrease the alpha in a reverse way so it looks like it's becoming something else.
Yeah, but they don't have ids, you'd need to find/edit the call parameters in memory.
Format the text using "%0.2f", where 2 is the number of decimals you want.
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
springfield said:
You could add a textdraw above, and increase/decrease the alpha in a reverse way so it looks like it's becoming something else.
Yeah, but they don't have ids, you'd need to find/edit the call parameters in memory.
Format the text using "%0.2f", where 2 is the number of decimals you want.

"Format the text using "%0.2f", where 2 is the number of decimals you want." , i got it ty

"Yeah, but they don't have ids, you'd need to find/edit the call parameters in memory." can you give me an example? i really don't know how to use memories
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
Haha:)) ,  http://imgur.com/a/Qkw7f do you like this interface editor? if it will have  functions to edit sa textdraws then it will be monster :))

Mai am o întrebare, şi ca să înţelegi din prima la ce anume mă refer o să-ţi explic în română. Când ţin Click 1 apăsat pe Dialog şi mişc mouse-ul, acesta capătă o formă ciudată şi trebuie să dau relog să revină la forma iniţială ::( O poză să inţelegi mai bine: http://imgur.com/a/gTsxk

another question, when i left the car, x4 textdraws will dissapear, and after i enter in the car, sv will remove my settings from that textdraws, can u make a function for me what check when im going in the car and textdraws will get again the old settings?(from the ini), i tried it but i failed, i really thought it is a really  easy function but ... some times what is easy it gets more harder than harder things :))

@springfield, can you test this mod and telling me if u get crash? some guys when write /txdr in game, they get crash but me and the other author from this mod, we dont get :)) idk what's the problem with them.. link: https://www.dropbox.com/s/m2f8j0v461ysxw9/New%20WinRAR%20archive.rar?dl=0 last screen: http://imgur.com/a/nGvH4
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
supahdupahnubah said:
^ Doubling request, would be good to know the structure of SA Textdraw

There is no struct like sa-mp textdraw, in gta they're done on the fly in some functions.
There is a struct of base colors, starting at 0xBAB22C which is an array of 15 colors used for different stuff(like money, menu etc).

For money textdraw as an example:
[shcode=cpp]
0x58F57F (byte) = text style (0-3)
0x858F14 (float) = scale X
0x866CAC (float) = scale Y
0x58F58D (byte) = outline size
0x58F598 (byte) = outline B color
0x58F59A (byte) = outline G color
0x58F59C (byte) = outline R color
0xBAB230 (4bytes) = money text ABGR
[/shcode]

@doroftel

If the textdraw appears only in the car, then you can simply check if the textdraw exists and modify it.
I can't test your mod at the moment, make sure whoever crashes has the latest version of SF.

About your mouse problem, if you'd spend some time to check the code you just copy/pasted you'd figure out why that is happening.
[shcode=cpp]
while 0AB0: key_pressed 1
   wait 0
   0B5E: get_cursor_pos 26@ 25@
   0062: 26@ -= 28@ 
   0062: 25@ -= 27@
   0B84: samp dialog 1@ set_pos_XY 26@ 25@ size 350 480 //ce-ai facut ma nene ma
end
[/shcode]
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
i got it all ty :) but minimized function can be disabled?

i did the function what get automaticaly settings from .ini and set it in the game, i learned a bit more how this "end,if,then, working :D

[shcode=cpp]while true
wait 0
    if 0B21: samp is_chat_opened
       then 0B8D: samp set_cursor_mode 2
       0B86: samp dialog 1@ set_visible false
       END
       if 00DF:   actor $PLAYER_ACTOR driving
          then
          0AF2: $GET_FUEL_POS_X = get float from "cleo\txdr.ini" "Fuel" "PosX"
          0AF2: $GET_FUEL_POS_Y = get float from "cleo\txdr.ini" "Fuel" "PosY"
          0AF0: $F_R = get_int_from_ini_file "cleo\txdr.ini" section "Fuel" key "r"
          0AF0: $F_G = get_int_from_ini_file "cleo\txdr.ini" section "Fuel" key "g"
          0AF0: $F_B = get_int_from_ini_file "cleo\txdr.ini" section "Fuel" key "b"
          0AF2: $FUEL_SX_2_ = get_float_from_ini_file "cleo\txdr.ini" section "Fuel" key "SizeX"
          0B67: 0xFF $F_R $F_G $F_B IN 11@
          31@ = 1.100000
          0C52: samp textdraw 2054 set_letter_size $FUEL_SX_2_ 31@ color 11@
          0C51: samp textdraw 2054 set_pos $GET_FUEL_POS_X $GET_FUEL_POS_Y
          
          0AF2: $GET_STATUS_POS_X = get float from "cleo\txdr.ini" "Status" "PosX"
          0AF2: $GET_STATUS_POS_Y = get float from "cleo\txdr.ini" "Status" "PosY"
          0AF2: $STATUS_SX_ = get_float_from_ini_file "cleo\txdr.ini" section "Status" key "SizeX"
          0AF0: $STATUS_R = get_int_from_ini_file "cleo\txdr.ini" section "Status" key "r"
          0AF0: $STATUS_G = get_int_from_ini_file "cleo\txdr.ini" section "Status" key "g"
          0AF0: $STATUS_B = get_int_from_ini_file "cleo\txdr.ini" section "Status" key "b"
          0C51: samp textdraw 2059 set_pos $GET_STATUS_POS_X $GET_STATUS_POS_Y
          0B67: 0xFF $STATUS_R $STATUS_G $STATUS_B IN 11@ 
          31@ = 1.100000
          0C52: TXD 2059 $STATUS_SX_ 31@ IN 11@
          
          0AF2: $GET_KM_POS_X = get float from "cleo\txdr.ini" "KM" "PosX"
          0AF2: $GET_KM_POS_Y = get float from "cleo\txdr.ini" "KM" "PosY"
          0AF2: $KM_SX_2 = get_float_from_ini_file "cleo\txdr.ini" section "KM" key "SizeX"
          0AF0: $KILOM_RX = get_int_from_ini_file "cleo\txdr.ini" section "KM" key "r"
          0AF0: $KILOM_GX = get_int_from_ini_file "cleo\txdr.ini" section "KM" key "g"
          0AF0: $KILOM_BX = get_int_from_ini_file "cleo\txdr.ini" section "KM" key "b"
          31@ = 1.100000
          0B67: 0xFF $KILOM_RX $KILOM_GX $KILOM_BX IN 11@
          0C51: samp textdraw 2056 set_pos $GET_KM_POS_X $GET_KM_POS_Y
          0C52: TXD 2056 $KM_SX_2 31@ IN 11@
          
          0AF2: $GET_SPEED_POS_X = get float from "cleo\txdr.ini" "Speed" "PosX"
          0AF2: $GET_SPEED_POS_Y = get float from "cleo\txdr.ini" "Speed" "PosY"
          0AF2: $SPEED_SX_ = get float from "cleo\txdr.ini" "Speed" "SizeX"
          0AF0: $SP_R = get_int_from_ini_file "cleo\txdr.ini" section "Speed" key "r"
          0AF0: $SP_G = get_int_from_ini_file "cleo\txdr.ini" section "Speed" key "g"
          0AF0: $SP_B = get_int_from_ini_file "cleo\txdr.ini" section "Speed" key "b"
          0C51: samp textdraw 2055 set_pos $GET_SPEED_POS_X $GET_SPEED_POS_Y
          31@ = 1.100000
          0C52: TXD 2055 $SPEED_SX_ 31@ IN 11@
          0B67: 0xFF $SP_R $SP_G $SP_B 11@
    END[/shcode]

O să iţi spun pe română iară deoarece nu mă vei inţelege, deci după ce tastez txdr mouse-ul tot sclipeşte, nu că m-ar încurca asta dar este posibil să pot rezolva asta adăugând un wait la sfărsit de 4s să zicem şi acesta va sclipii doar la 4s?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
springfield said:
supahdupahnubah said:
^ Doubling request, would be good to know the structure of SA Textdraw

There is no struct like sa-mp textdraw, in gta they're done on the fly in some functions.
There is a struct of base colors, starting at 0xBAB22C which is an array of 15 colors used for different stuff(like money, menu etc).

Well okay that's still useful, thanks, thought you know as well addresses that remains for Textdraw style which being called by server to print some quick text :
https://pp.vk.me/c604723/v604723994/30373/czclbT719n4.jpg
 

MrChristmas

Expert
Joined
Jul 29, 2014
Messages
563
Reaction score
26
supahdupahnubah said:
springfield said:
supahdupahnubah said:
^ Doubling request, would be good to know the structure of SA Textdraw

There is no struct like sa-mp textdraw, in gta they're done on the fly in some functions.
There is a struct of base colors, starting at 0xBAB22C which is an array of 15 colors used for different stuff(like money, menu etc).

Well okay that's still useful, thanks, thought you know as well addresses that remains for Textdraw style which being called by server to print some quick text :
https://pp.vk.me/c604723/v604723994/30373/czclbT719n4.jpg

What do you mean by Texdraw style? (0x4F5FB8 is used to draw the texdraw - if im not mistaking)
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
supahdupahnubah said:
Well okay that's still useful, thanks, thought you know as well addresses that remains for Textdraw style which being called by server to print some quick text :
https://pp.vk.me/c604723/v604723994/30373/czclbT719n4.jpg

Hmm? I don't really understand, if it's a textdraw then the style is a byte in the struct(look mod_sa src).

@doroftel, as said above, use english. And i still don't understand what you mean by the 'mouse is shining'.
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
springfield said:
Hmm? I don't really understand, if it's a textdraw then the style is a byte in the struct(look mod_sa src).


Incorrectly explained what I need, sorry, I'm looking for the address that remains for outline, outline color, color etc of this game textdraw
I've been searching for it in mod_sa but didn't really find it, was looking at all files that has something simillar with hud\text etc
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
By game textdraw you mean is a gta native textdraw or it's a samp server custom textdraw?
Cause' all the sa-mp related textdraw stuff are already in mod_sa textdraw struct(byteOutline, dwShadowColor, dwLetterColor etc.).
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.h#L291
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
springfield said:
By game textdraw you mean is a gta native textdraw or it's a samp server custom textdraw?
Cause' all the sa-mp related textdraw stuff are already in mod_sa textdraw struct(byteOutline, dwShadowColor, dwLetterColor etc.).
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.h#L291

Yea I meant native textdraw, because you already helped me out with samp textdraws :blush:
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
supahdupahnubah said:
Yea I meant native textdraw, because you already helped me out with samp textdraws :blush:

Can't seem to find that textdraw in my game, i've looked for -$%d, how does it trigger in GTA SP?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
springfield said:
supahdupahnubah said:
Yea I meant native textdraw, because you already helped me out with samp textdraws :blush:

Can't seem to find that textdraw in my game, i've looked for -$%d, how does it trigger in GTA SP?

Can't really load SP, keeps me crashing, but I know that text of that textdraw is alocated at 0xBAAD40 and can be showed only 1 at the time, I can give you IP of the server if you wan't to test it out
 
Status
Not open for further replies.
Top