Help dialog problem

Joined
May 23, 2018
Messages
5
Likes
0
Points
1
#1
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 [email protected] list_item [email protected] input_text 0
then
  if
   [email protected] == 1
  then
    if
     [email protected] == 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 [email protected] list_item 0 input_text [email protected]
      then
       if
        [email protected] == 1
       then
        0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
        01B2: give_actor $PLAYER_ACTOR weapon 24 ammo [email protected] // Load the weapon model before using this
      end
    end
end
     if
      [email protected] == 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 [email protected] list_item 0 input_text [email protected]
      then
       if
        [email protected] == 1
       then
        0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
        01B2: give_actor $PLAYER_ACTOR weapon 25 ammo [email protected] // Load the weapon model before using this
      end
    end
end
     if
      [email protected] == 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 [email protected] list_item 0 input_text [email protected]
      then
       if
        [email protected] == 1
       then
        0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
        01B2: give_actor $PLAYER_ACTOR weapon 26 ammo [email protected]
      end
    end
end
     if
      [email protected] == 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 [email protected] list_item 0 input_text [email protected]
      then
       if
        [email protected] == 1
       then
        0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
        01B2: give_actor $PLAYER_ACTOR weapon 27 ammo [email protected]
       end
     end
   end
  end
 end
end

:gun_dialog
0AC6: [email protected] = label @gun_text offset
0B3B: samp show_dialog id 15 caption "Gun Menu" text [email protected] 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?
 

kazkaS

Well-Known Member
Joined
Mar 30, 2018
Messages
87
Likes
0
Points
6
#8
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: [email protected] = 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 [email protected] list_item [email protected] input_text 0
    then
        if [email protected] == 1
        then
            0085: [email protected] = [email protected] 
            [email protected] += 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 [email protected] list_item 0 input_text [email protected]
    then
        if [email protected] == 1
        then
            if 0AD4: [email protected] = scan_string [email protected] format "%d" [email protected]
            then
                call @GiveWeapon 2 gun [email protected] ammo [email protected]       
            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 [email protected] 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: [email protected] = label @Dialog offset
0B3B: samp show_dialog id 1000 caption "{A3E900}Dun by Niko" text [email protected] 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 [email protected] 8

0C0D: struct [email protected] offset 0 size 4 = [email protected]
0C0D: struct [email protected] offset 4 size 4 = [email protected]
    
0B3D: raknet [email protected] = new_bit_stream
0B40: raknet bit_stream [email protected] write [email protected] type 5 size 8
                
0BF6: raknet emul_rpc_receive 22 bit_stream [email protected]
0B3E: raknet delete_bit_stream [email protected]

free [email protected]
ret 0
 
Top