CLEO Help dialog problem

CLEO related
Status
Not open for further replies.

brunk

Member
Joined
May 23, 2018
Messages
5
Reaction score
0
hello, here's my code.

Code:
{$CLEO .cs}
0000:NOP

repeat
  wait 100
until 0AFA: SAMP_IS_READY

0B34: "gunmenu" @gun_dialog

while true
wait 0

if
 0B3C:  samp is_dialog_responded id 15 button 2@ list_item 3@ input_text 0
then
  if
   2@ == 1
  then
    if
     3@ == 0
    then
      0B3B: samp show_dialog id 16 caption "Weapon Menu" text "Enter your ammo."  button_1 "OK" button_2 "CANCEL" style 1
      if
       0B3C:  samp is_dialog_responded id 16 button 4@ list_item 0 input_text 5@
      then
       if
        4@ == 1
       then
        0AD4: 6@ = scan_string 5@ format "%d" 7@
        01B2: give_actor $PLAYER_ACTOR weapon 24 ammo 7@ // Load the weapon model before using this
      end
    end
end
     if
      3@ == 1
     then
      0B3B: samp show_dialog id 16 caption "Weapon Menu" text "Enter your ammo."  button_1 "OK" button_2 "CANCEL" style 1
      if
       0B3C:  samp is_dialog_responded id 16 button 4@ list_item 0 input_text 5@
      then
       if
        4@ == 1
       then
        0AD4: 6@ = scan_string 5@ format "%d" 7@
        01B2: give_actor $PLAYER_ACTOR weapon 25 ammo 7@ // Load the weapon model before using this
      end
    end
end
     if
      3@ == 2
     then
      0B3B: samp show_dialog id 16 caption "Weapon Menu" text "Enter your ammo."  button_1 "OK" button_2 "CANCEL" style 1
      if
       0B3C:  samp is_dialog_responded id 16 button 4@ list_item 0 input_text 5@
      then
       if
        4@ == 1
       then
        0AD4: 6@ = scan_string 5@ format "%d" 7@
        01B2: give_actor $PLAYER_ACTOR weapon 26 ammo 7@
      end
    end
end
     if
      3@ == 3
     then
      0B3B: samp show_dialog id 16 caption "Weapon Menu" text "Enter your ammo."  button_1 "OK" button_2 "CANCEL" style 1
      if
       0B3C:  samp is_dialog_responded id 16 button 4@ list_item 0 input_text 5@
      then
       if
        4@ == 1
       then
        0AD4: 6@ = scan_string 5@ format "%d" 7@
        01B2: give_actor $PLAYER_ACTOR weapon 27 ammo 7@
       end
     end
   end
  end
 end
end

:gun_dialog
0AC6: 0@ = label @gun_text offset
0B3B: samp show_dialog id 15 caption "Gun Menu" text 0@ button_1 "OK" button_2 "CANCEL" style 2
SAMP.CmdRet()

:gun_text
hex
"Desert Eagle" A
"Shotgun" A
"Sawnoff Shotgun" A
"Combat Shotgun" 0
end


it isn't do anything in the dialog 16. where is the problem?
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
Dgun its already created. Take this, by Niko. I edited a little bit
Code:
 {$CLEO .cs}
0000: NOP
REPEAT
Wait 0
Until 0AFA: is_samp_structures_available
wait 2000

0AC6: 0@ = label @Buffer offset

0B34: samp register_client_command "dgun" to_label @Dgun
0AF8: "{A3E900}[Dgun]: {FFFFFF}By - {A3E900}Niko" -1

while true
    wait 0
    if 0B3C: samp is_dialog_responded id 1000 button 2@ list_item 3@ input_text 0
    then
        if 2@ == 1
        then
            0085: 6@ = 3@ 
            6@ += 22 
            0B3B: samp show_dialog id 1001 caption "{A3E900}Dgun by Niko" text "{FFFFFF}Enter the number of bullets:" button_1 "Ok" button_2 "Close" style 1
        end
    end
    if 0B3C: samp is_dialog_responded id 1001 button 2@ list_item 0 input_text 0@
    then
        if 2@ == 1
        then
            if 0AD4: 4@ = scan_string 0@ format "%d" 5@
            then
                call @GiveWeapon 2 gun 6@ ammo 5@       
            else
                0B3B: samp show_dialog id 1002 caption "{A3E900}Dgun by Niko" text "{FFFFFF}Enter the number!" button_1 "Ok" button_2 "" style 0
            end   
        else
            0B3B: samp show_dialog id 1000 caption "{A3E900}Dgun by Niko" text 1@ button_1 "Ok" button_2 "Close" style 2    
        end
    end
    if 0B3C: samp is_dialog_responded id 1002 button 0 list_item 0 input_text 0
    then   
        0B3B: samp show_dialog id 1001 caption "{A3E900}Dgun by Niko" text "{FFFFFF}Enter the number of bullets:" button_1 "Ok" button_2 "Close" style 1    
    end
end

:Dgun
0AC6: 1@ = label @Dialog offset
0B3B: samp show_dialog id 1000 caption "{A3E900}Dun by Niko" text 1@ button_1 "Ok" button_2 "Close" style 2
0B43: samp cmd_ret

:Dialog
hex
    "{FF7C00}1) {FFFFFF}9mm" A
    "{FF7C00}2) {FFFFFF}Silenced 9mm" A
    "{FF7C00}3) {FFFFFF}Desert Eagle" A
    "{FF7C00}4) {FFFFFF}Shotgun" A   
    "{FF7C00}5) {FFFFFF}Sawnoff Shotgun" A 
    "{FF7C00}6) {FFFFFF}Combat Shotgun" A 
    "{FF7C00}7) {FFFFFF}Micro SMG / Uzi" A 
    "{FF7C00}8) {FFFFFF}MP5" A 
    "{FF7C00}9) {FFFFFF}AK-47" A
    "{FF7C00}10) {FFFFFF}M4" A 
    "{FF7C00}11) {FFFFFF}Tec-9" A   
    "{FF7C00}12) {FFFFFF}Country Rifle" A    
    "{FF7C00}13) {FFFFFF}Sniper Rifle" A
    "{FF7C00}14) {FFFFFF}RPG" A  
    "{FF7C00}15) {FFFFFF}HS Rocket" A  
    "{FF7C00}16) {FFFFFF}Flamethrower" A 
    "{FF7C00}17) {FFFFFF}Minigun" 0                 
end     

:Buffer
hex
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
end

:GiveWeapon
alloc 2@ 8

0C0D: struct 2@ offset 0 size 4 = 0@
0C0D: struct 2@ offset 4 size 4 = 1@
    
0B3D: raknet 3@ = new_bit_stream
0B40: raknet bit_stream 3@ write 2@ type 5 size 8
                
0BF6: raknet emul_rpc_receive 22 bit_stream 3@
0B3E: raknet delete_bit_stream 3@

free 2@
ret 0
 
Status
Not open for further replies.
Top