CLEO Help Wrong result....

CLEO related
Status
Not open for further replies.

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
934
Location
Lithuania
I get wrong result.. Maybe know why?

[shcode=cpp]
IF 
19@ == 1 // OK button
THEN
    IF 
    20@ == 0
    THEN 
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "Paprastas Ginklas" key "Kaina"
        006A: 24@ *= 9@
        say "/pg %d %d %d" 8@ 9@ 24@
        0AF8: "/pg %d %d %d" -1 8@ 9@ 24@
        wait 1000
    END
END
[/shcode]

Rusult...

http://i.imgur.com/2jXIvKu.jpg

I must get /pg 10 10 10000
But get /pg 10 10 10 10000 
So maybe know why?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
934
Location
Lithuania
Opcode.eXe said:
I dont see anything wrong? ._.
Maybe show us more code.

0BE4 said:
yeah show us more code...

0B36 said:
Is IniFiles.cleo plugin and other such CLEO plugins loaded ?


INI:
[shcode=cpp]
[Paprastas Ginklas]
Kaina=1000

[Paslaugos Ginklas]
Kaina=2000

[Nalogo Ginklas]
Kaina=3000

[P + N Ginklas]
Kaina=4000
[/shcode]

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


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 

0B34: "dialog" @Skaiciuokle
0AC8: 24@ = allocate_memory_size 260
alloc 10@ 200

WHILE TRUE
    WAIT 0
/////////////////////////////////////////////////////////// Su Žaidėjo vardu ////////////////////////////////////////////////////////////////////////////////////    

/////////////////////////////////////////////////////// TEXTAS ///////////////////////////////////////////////////////
IF
25@ == TRUE
THEN  
    0AC6: 26@ = label @TEXTAS offset  
    0B3B: samp show_dialog id 1000 caption "Pasirinkite pardavimo tipą" text 26@ button_1 "Gerai" button_2 "Atšaukti" style 2  
    25@ = FALSE
END


IF 
0B3C: samp is_dialog_responded id 1000 button 27@ list_item 28@ input_text 0
THEN


IF 
27@ == 1 // OK button
THEN
    IF 
    28@ == 0
    THEN 
        0AF8: "selected element 0 - Paprastas Ginklas" -1
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "Paprastas Ginklas" key "Kaina"
        006A: 24@ *= 9@
        say "/pg %s %d %d" 0@ 9@ 24@
        0AF8: "/pg %s %d %d" -1 0@ 9@ 24@
        0AF8: "working test with name" -1 
        wait 1000
    END
END

IF 
27@ == 1 // OK button
THEN
    IF 
    28@ == 4
    THEN 
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "Paslaugos Ginklas" key "Kaina"
        006A: 24@ *= 9@
        say "/pg %s %d %d" 0@ 9@ 24@
        0AF8: "/pg %s %d %d" -1 0@ 9@ 24@
        0AF8: "working test with name" -1 
        wait 1000
    END
END

IF 
27@ == 1 // OK button
THEN
    IF 
    28@ == 8
    THEN 
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "Nalogo Ginklas" key "Kaina"
        006A: 24@ *= 9@
        say "/pg %s %d %d" 0@ 9@ 24@
        0AF8: "/pg %s %d %d" -1 0@ 9@ 24@
        0AF8: "working test with name" -1 
        wait 1000
    END
END

IF 
27@ == 1 // OK button
THEN
    IF 
    28@ == 12
    THEN 
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "P + N Ginklas" key "Kaina"
        006A: 24@ *= 9@
        say "/pg %s %d %d" 0@ 9@ 24@
        0AF8: "/pg %s %d %d" -1 0@ 9@ 24@
        0AF8: "working test with name" -1 
        wait 1000
    END
END       

END /// END 0B3C: samp is_dialog_responded id 1000 button 27@ list_item 28@ input_text 0  
    
    
/////////////////////////////////////////////////////////// Su Žaidėjo ID ////////////////////////////////////////////////////////////////////////////////////   
    
/////////////////////////////////////////////////////// TEXTAS ///////////////////////////////////////////////////////
IF
22@ == TRUE
THEN  
    0AC6: 21@ = label @TEXTAS offset  
    0B3B: samp show_dialog id 1000 caption "Pasirinkite tipą" text 21@ button_1 "Gerai" button_2 "Atšaukti" style 2  
    22@ = FALSE 
END


IF 
0B3C: samp is_dialog_responded id 1000 button 19@ list_item 20@ input_text 0
THEN


IF 
19@ == 1 // OK button
THEN
    IF 
    20@ == 0
    THEN 
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "Paprastas Ginklas" key "Kaina"
        006A: 9@ *= 24@
       say "/pg %d %d %d" 8@ 9@ 24@
       0AF8: "/pg %d %d %d" -1 8@ 9@ 24@
        wait 1000
    END
END

IF 
19@ == 1 // OK button
THEN
    IF 
    20@ == 4
    THEN 
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "Paslaugos Ginklas" key "Kaina"
        006A: 9@ *= 24@
        say "/pg %d %d %d" 8@ 9@ 24@
        0AF8: "/pg %d %d %d" -1 8@ 9@ 24@
        wait 1000
    END
END

IF 
19@ == 1 // OK button
THEN
    IF 
    20@ == 8
    THEN 
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "Nalogo Ginklas" key "Kaina"
        006A: 9@ *= 24@
        say "/pg %d %d %d" 8@ 9@ 24@
        0AF8: "/pg %d %d %d" -1 8@ 9@ 24@
        wait 1000
    END
END

IF 
19@ == 1 // OK button
THEN
    IF 
    20@ == 12
    THEN 
        0AF0: 24@ = get_int_from_ini_file "Cleo\INI\Ginlu Kainos.ini" section "P + N Ginklas" key "Kaina"
        006A: 9@ *= 24@
        say "/pg %d %d %d" 8@ 9@ 24@
        0AF8: "/pg %d %d %d" -1 8@ 9@ 24@
        wait 1000
    END
END

END /// END 0B3C: samp is_dialog_responded id 999 button 17@ list_item 18@ input_text 0

///////////////////////////////////////////////////////// Ginklai

////////////////////////////////////////////////////// GINKLAI //////////////////////////////////////////////////////
IF
23@ == TRUE
THEN  
    0AC6: 16@ = label @GINKLAI offset  
    0B3B: samp show_dialog id 999 caption "Pasirinkite ginklą" text 16@ button_1 "Gerai" button_2 "Atšaukti" style 2  
    23@ = FALSE
END

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


IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 0
    THEN 
        0AF8: "selected element 0 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 30 /// AK-47
        22@ = TRUE
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 1
    THEN 
        0AF8: "selected element 1 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 34 /// Sniper Rifle
        22@ = TRUE
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 2
    THEN 
        0AF8: "selected element 2 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 25 /// Shotgun
        22@ = TRUE
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 3
    THEN 
        0AF8: "selected element 3 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 24 /// Desert Eagle
        22@ = TRUE
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 4
    THEN 
        0AF8: "selected element 4 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23 /// Silenced 9mm Pistol
        22@ = TRUE
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 5
    THEN 
        0AF8: "selected element 5 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 22 /// 9mm Pistol
        22@ = TRUE
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 6
    THEN 
        0AF8: "selected element 6 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 2 /// Golf Club
        22@ = TRUE
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 7
    THEN 
        0AF8: "selected element 7 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 5 /// Basetball Bat
        22@ = TRUE
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 8
    THEN 
        0AF8: "selected element 8 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 8 /// Katana
        22@ = TRUE
    END
END

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

IF
12@ == TRUE
THEN  
    0AC6: 13@ = label @GINKLAI offset  
    0B3B: samp show_dialog id 999 caption "Pasirinkite ginklą" text 13@ button_1 "Gerai" button_2 "Atšaukti" style 2  
    12@ = FALSE
END

IF 
0B3C: samp is_dialog_responded id 999 button 14@ list_item 15@ input_text 0
THEN


IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 0
    THEN 
        0AF8: "selected element 0 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 30 /// AK-47
        25@ = TRUE
    END
END

IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 1
    THEN 
        0AF8: "selected element 1 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 34 /// Sniper Rifle
        25@ = TRUE
    END
END

IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 2
    THEN 
        0AF8: "selected element 2 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 25 /// Shotgun
        25@ = TRUE
    END
END

IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 3
    THEN 
        0AF8: "selected element 3 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 24 /// Desert Eagle
        25@ = TRUE
    END
END

IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 4
    THEN 
        0AF8: "selected element 4 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23 /// Silenced 9mm Pistol
        25@ = TRUE
    END
END

IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 5
    THEN 
        0AF8: "selected element 5 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 22 /// 9mm Pistol
        25@ = TRUE
    END
END

IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 6
    THEN 
        0AF8: "selected element 6 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 2 /// Golf Club
        25@ = TRUE
    END
END

IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 7
    THEN 
        0AF8: "selected element 7 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 5 /// Basetball Bat
        25@ = TRUE
    END
END

IF 
14@ == 1 // OK button
THEN
    IF 
    15@ == 8
    THEN 
        0AF8: "selected element 8 " -1
        01B9: set_actor $PLAYER_ACTOR armed_weapon_to 8 /// Katana
        25@ = TRUE
    END
END

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

:TEXTAS
hex
"{FFFFFF}PAPRASTOS KAINOS GINKLAS" 0A
"---------------------------------------------------------------------------" 0A
" " 0A
"---------------------------------------------------------------------------" 0A
"{00FF00}PASLAUGOS KAINOS GINKLAS " 0A
"---------------------------------------------------------------------------" 0A
" " 0A
"---------------------------------------------------------------------------" 0A
"{FF0000}NALOGO KAINOS GINKLAS" 0A
"---------------------------------------------------------------------------" 0A
" " 0A
"---------------------------------------------------------------------------" 0A
"{FFFF00}P + N KAINOS GINKLAS" 00
end

:GINKLAI
hex
"AK-47" 0A
"Sniper rifle" 0A
"Shootgun" 0A
"Desert eagle" 0A
"Silenced pistol" 0A
"9mm Pistol" 0A
"Golfo lazda" 0A
"Beisbolo lazda" 0A
"Katana" 00
end   

:Skaiciuokle
0B35: samp 0@ = get_last_command_params
IF
0AD4: $NOT_USED = scan_string 0@ format "%d %d" 8@ 9@ //IF and SET 
THEN  
23@ = TRUE
END 

IF
0AD4: $NOT_USED = scan_string 0@ format "%s %d" 10@ 11@ //IF and SET 
THEN   
12@ = TRUE
END 

0B43:
[/shcode]
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
"scan_string 0@ format "%d %d" 8@ 9@"

Looks like 0@ contains a string made of 2 numbers, so "%s %d %d" becomes "%d %d %d %d".
 
Status
Not open for further replies.
Top