I have a problem with my code

Status
Not open for further replies.
Joined
Jan 5, 2020
Messages
8
Likes
0
Points
1
Location
Russia
1
#1
So , i made a dialog CMD which helps instructors but when i execute it is making my game working slow but i have more then 60 fps , what should i do?

My Code:

PHP:
{$CLEO .cs}

0000: NOP

0662: "InstructorCMD by TaZZeRR"
thread "InstructorCMD"
wait 2500

0AB1: call_scm_func @chatmsg 0
$activ = 0
while true
wait 0


if and
0AB0: 16
0AB0: 90
then
    if
    $activ == 0
     then
     $activ = 1
      wait 2000
     else
      $activ = 0
       wait 2000
     end
end

if and
    $activ == 1
    0AB0: 88
    then
    0AC6: [email protected] = label @dialog_hex offset
    0B3B: samp show_dialog id 1000 caption "Choose the language" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
    wait 1000
    end

if
0B3C:  samp is_dialog_responded id 1000 button [email protected] list_item [email protected] input_text 0
then
    if and
       [email protected] == 1
       [email protected] == 0
       then
            chatmsg "The eng version isn't done at the moment" -1
        end
    
      
       if and
       [email protected] == 1
       [email protected] == 1
       then
           0AC6: [email protected] = label @dialog_licente offset
           0B3B: samp show_dialog id 1001 caption "Alege licenta pe care doresti sa o acorzi" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
        end
        
    end
    
    if
            0B3C:  samp is_dialog_responded id 1001 button [email protected] list_item [email protected] input_text 0
            then
                if and
                    [email protected] == 1
                    [email protected] == 0
                    then
                    0AC6: [email protected] = label @dialog_gun offset
                    0B3B: samp show_dialog id 1002 caption "Licenta de gun" text [email protected] button_1 "Ok" button_2 "Back" style 2
                end
                
                if and
                    [email protected] == 1
                    [email protected] == 1
                    then
                  0AF9: samp say_msg "Iisus e un sfant"
                end
                
                if and
                    [email protected] == 1
                    [email protected] == 2
                    then
                  0AF9: samp say_msg "Iisus vorbeste urat"
                end
                
    end
    
    if
     0B3C:  samp is_dialog_responded id 1002 button [email protected] list_item [email protected] input_text 0
     then
    
     if and
     [email protected] == 1
     [email protected] == 0
     then
       chatmsg "{408080}InstructorCMD: Licenta gun - 1/9."
    0AF9: samp say_msg "Salut, sunt membrul factiunii School Instructors LS si te voi ajuta sa obtii licenta de 'Gun'."
     end
    
     if and
     [email protected] == 1
     [email protected] == 1
     then
     0B3B: samp show_dialog id 1003 caption "Gun 2/9" text "Tasteaza id-ul player-ului in casuta de mai jos" button_1 "Ok" button_2 "Cancel" style 1
     end
    
       if
        [email protected] == 0
        then
          0AC6: [email protected] = label @dialog_licente offset
          0B3B: samp show_dialog id 1001 caption "Alege licenta pe care doresti sa o acorzi" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
       end
      
     end
    
     if
      0B3C:  samp is_dialog_responded id 1003 button [email protected] list_item [email protected] input_text [email protected]
      then
      0AC8: [email protected] = allocate_memory_size 128
      0AD4: [email protected] [email protected] format "%d" [email protected]
      0B36: samp [email protected] = get_player_nickname [email protected]
      if
      [email protected] == 1
       then
       chatmsg "{408080}InstructorCMD: Licenta gun - 2/9."
        0AF9: samp say_msg "Pentru inceput tasteaza comanda [/sl %s] pentru a-ti verifica licentele." [email protected]
               0AC9: free_allocated_memory [email protected]         
       end
      
       if
       [email protected] == 0
       then
      end
    
end

:dialog_hex
 HEX
 "EN" A
 "RO" 0
 END
 
 :dialog_licente
 HEX
 "Gun" A
 "Boat" A
 "Fly" 0
 END
 :dialog_gun
 HEX
 "Gun1" A
 "Gun2" A
 "Gun3" A
 "Gun4" A
 "Gun5" A
 "Gun6" A
 "Gun7" A
 "Gun8" A
 "Gun9" 0
 END
 
 :chatmsg
0AA2: [email protected] = load_library "samp.dll" // IF and SET
chatmsg "{bfff00}Mod created by: {0080ff}TaZZeRR" -1
0085: [email protected] = [email protected] // (int)
[email protected] += 2203876
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 1
0085: [email protected] = [email protected] // (int)
[email protected] += 409616       
0AB2: ret 0
 

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
1,718
Likes
235
Points
93
Location
Lithuania
Website
ugbase.eu
#2
What this should do?
PHP:
if
0B3C:  samp is_dialog_responded id 1003 button [email protected] list_item [email protected] input_text [email protected]
then
    0AC8: [email protected] = allocate_memory_size 128
    0AD4: [email protected] [email protected] format "%d" [email protected]
    0B36: samp [email protected] = get_player_nickname [email protected]
    if
    [email protected] == 1
    then
        chatmsg "{408080}InstructorCMD: Licenta gun - 2/9."
        0AF9: samp say_msg "Pentru inceput tasteaza comanda [/sl %s] pentru a-ti verifica licentele." [email protected]
        0AC9: free_allocated_memory [email protected]       
    end
    
    if
    [email protected] == 0
    then
        ////
    end
end
Also...
You must add end for while true everytime
PHP:
{$CLEO .cs}

0000: "InstructorCMD by TaZZeRR"
THREAD "InstructorCMD"

wait 8500

0AF8: "{bfff00}Mod created by: {0080ff}TaZZeRR" -1

$activ = 0

while true
wait 0

if and
0AB0: 16
0AB0: 90
then
    if
    [email protected] == 0
    then
        [email protected] = 1
    else
        [email protected] = 0
     end
    wait 2000 // anti spam
end

if and
[email protected] == 1
0AB0: 88
then
    0AC6: [email protected] = label @dialog_hex offset
    0B3B: samp show_dialog id 1000 caption "Choose the language" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
    wait 1000
end

if
0B3C:  samp is_dialog_responded id 1000 button [email protected] list_item [email protected] input_text 0
then
    if and
    [email protected] == 1
    [email protected] == 0
    then
        chatmsg "The eng version isn't done at the moment" -1
    end
    
    if and
    [email protected] == 1
    [email protected] == 1
    then
        0AC6: [email protected] = label @dialog_licente offset
        0B3B: samp show_dialog id 1001 caption "Alege licenta pe care doresti sa o acorzi" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
    end       
end
   
if
0B3C:  samp is_dialog_responded id 1001 button [email protected] list_item [email protected] input_text 0
then
    if and
    [email protected] == 1
    [email protected] == 0
    then
        0AC6: [email protected] = label @dialog_gun offset
        0B3B: samp show_dialog id 1002 caption "Licenta de gun" text [email protected] button_1 "Ok" button_2 "Back" style 2
    end
           
    if and
    [email protected] == 1
    [email protected] == 1
    then
        0AF9: samp say_msg "Iisus e un sfant"
    end
           
    if and
    [email protected] == 1
    [email protected] == 2
    then
        0AF9: samp say_msg "Iisus vorbeste urat"
    end       
end
   
if
0B3C:  samp is_dialog_responded id 1002 button [email protected] list_item [email protected] input_text 0
then
    if and
    [email protected] == 1
    [email protected] == 0
    then
        chatmsg "{408080}InstructorCMD: Licenta gun - 1/9."
        0AF9: samp say_msg "Salut, sunt membrul factiunii School Instructors LS si te voi ajuta sa obtii licenta de 'Gun'."
    end
   
    if and
    [email protected] == 1
    [email protected] == 1
    then
        0B3B: samp show_dialog id 1003 caption "Gun 2/9" text "Tasteaza id-ul player-ului in casuta de mai jos" button_1 "Ok" button_2 "Cancel" style 1
    end
   
    if
    [email protected] == 0
    then
        0AC6: [email protected] = label @dialog_licente offset
        0B3B: samp show_dialog id 1001 caption "Alege licenta pe care doresti sa o acorzi" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
    end
end
   
if
0B3C:  samp is_dialog_responded id 1003 button [email protected] list_item [email protected] input_text [email protected]
then
    0AC8: [email protected] = allocate_memory_size 128
    0AD4: [email protected] [email protected] format "%d" [email protected]
    0B36: samp [email protected] = get_player_nickname [email protected]
    if
    [email protected] == 1
    then
        chatmsg "{408080}InstructorCMD: Licenta gun - 2/9."
        0AF9: samp say_msg "Pentru inceput tasteaza comanda [/sl %s] pentru a-ti verifica licentele." [email protected]
        0AC9: free_allocated_memory [email protected]        
    end
     
    if
    [email protected] == 0
    then
        ////
    end
end

end

:dialog_hex
HEX
"EN" A
"RO" 0
END

:dialog_licente
HEX
"Gun" A
"Boat" A
"Fly" 0
END

:dialog_gun
HEX
"Gun1" A
"Gun2" A
"Gun3" A
"Gun4" A
"Gun5" A
"Gun6" A
"Gun7" A
"Gun8" A
"Gun9" 0
END
 
Last edited:
OP
OP
T
Joined
Jan 5, 2020
Messages
8
Likes
0
Points
1
Location
Russia
1
#3
What this should do?
PHP:
if
0B3C:  samp is_dialog_responded id 1003 button [email protected] list_item [email protected] input_text [email protected]
then
    0AC8: [email protected] = allocate_memory_size 128
    0AD4: [email protected] [email protected] format "%d" [email protected]
    0B36: samp [email protected] = get_player_nickname [email protected]
    if
    [email protected] == 1
    then
        chatmsg "{408080}InstructorCMD: Licenta gun - 2/9."
        0AF9: samp say_msg "Pentru inceput tasteaza comanda [/sl %s] pentru a-ti verifica licentele." [email protected]
        0AC9: free_allocated_memory [email protected]      
    end
   
    if
    [email protected] == 0
    then
        ////
    end
end
Also...
You must add end for while true everytime
PHP:
{$CLEO .cs}

0000: "InstructorCMD by TaZZeRR"
THREAD "InstructorCMD"

wait 8500

0AF8: "{bfff00}Mod created by: {0080ff}TaZZeRR" -1

$activ = 0

while true
wait 0

if and
0AB0: 16
0AB0: 90
then
    if
    [email protected] == 0
    then
        [email protected] = 1
    else
        [email protected] = 0
     end
    wait 2000 // anti spam
end

if and
[email protected] == 1
0AB0: 88
then
    0AC6: [email protected] = label @dialog_hex offset
    0B3B: samp show_dialog id 1000 caption "Choose the language" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
    wait 1000
end

if
0B3C:  samp is_dialog_responded id 1000 button [email protected] list_item [email protected] input_text 0
then
    if and
    [email protected] == 1
    [email protected] == 0
    then
        chatmsg "The eng version isn't done at the moment" -1
    end
   
    if and
    [email protected] == 1
    [email protected] == 1
    then
        0AC6: [email protected] = label @dialog_licente offset
        0B3B: samp show_dialog id 1001 caption "Alege licenta pe care doresti sa o acorzi" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
    end      
end
  
if
0B3C:  samp is_dialog_responded id 1001 button [email protected] list_item [email protected] input_text 0
then
    if and
    [email protected] == 1
    [email protected] == 0
    then
        0AC6: [email protected] = label @dialog_gun offset
        0B3B: samp show_dialog id 1002 caption "Licenta de gun" text [email protected] button_1 "Ok" button_2 "Back" style 2
    end
          
    if and
    [email protected] == 1
    [email protected] == 1
    then
        0AF9: samp say_msg "Iisus e un sfant"
    end
          
    if and
    [email protected] == 1
    [email protected] == 2
    then
        0AF9: samp say_msg "Iisus vorbeste urat"
    end      
end
  
if
0B3C:  samp is_dialog_responded id 1002 button [email protected] list_item [email protected] input_text 0
then
    if and
    [email protected] == 1
    [email protected] == 0
    then
        chatmsg "{408080}InstructorCMD: Licenta gun - 1/9."
        0AF9: samp say_msg "Salut, sunt membrul factiunii School Instructors LS si te voi ajuta sa obtii licenta de 'Gun'."
    end
  
    if and
    [email protected] == 1
    [email protected] == 1
    then
        0B3B: samp show_dialog id 1003 caption "Gun 2/9" text "Tasteaza id-ul player-ului in casuta de mai jos" button_1 "Ok" button_2 "Cancel" style 1
    end
  
    if
    [email protected] == 0
    then
        0AC6: [email protected] = label @dialog_licente offset
        0B3B: samp show_dialog id 1001 caption "Alege licenta pe care doresti sa o acorzi" text [email protected] button_1 "Ok" button_2 "Cancel" style 2
    end
end
  
if
0B3C:  samp is_dialog_responded id 1003 button [email protected] list_item [email protected] input_text [email protected]
then
    0AC8: [email protected] = allocate_memory_size 128
    0AD4: [email protected] [email protected] format "%d" [email protected]
    0B36: samp [email protected] = get_player_nickname [email protected]
    if
    [email protected] == 1
    then
        chatmsg "{408080}InstructorCMD: Licenta gun - 2/9."
        0AF9: samp say_msg "Pentru inceput tasteaza comanda [/sl %s] pentru a-ti verifica licentele." [email protected]
        0AC9: free_allocated_memory [email protected]       
    end
    
    if
    [email protected] == 0
    then
        ////
    end
end

end

:dialog_hex
HEX
"EN" A
"RO" 0
END

:dialog_licente
HEX
"Gun" A
"Boat" A
"Fly" 0
END

:dialog_gun
HEX
"Gun1" A
"Gun2" A
"Gun3" A
"Gun4" A
"Gun5" A
"Gun6" A
"Gun7" A
"Gun8" A
"Gun9" 0
END
The first one is a input dialog which you type the player id.
 
Status
Not open for further replies.
Top