CLEO Help Does scan string(0AD4) work with negative integers?

CLEO related
Status
Not open for further replies.

HooThaFuck

Active member
Joined
Apr 18, 2015
Messages
51
Reaction score
0
First off, I'm using this. The updated code is this:

Code:
{$CLEO}

thread "QUIZ" 
wait 5000 


while true
wait 0
end 

:QUIZ_25
wait 0 
if 
   SAMP.Available
then
0AC8: 1@ = 256
0AC8: 2@ = 256
0AC8: 3@ = 256
0AC8: 4@ = 256     
SAMP.GetChatString(97, 1@, 2@, 3@, 4@)                                           
if                
    0C18: 9@ = strstr string1 1@ string2 "Solve this question for money:"
then 
    jump @QUIZ_26  
else    
    //Multiply
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d * %d * %d ?" 5@ 6@ 7@
    THEN
        006A:5@ *= 6@
        006A:5@ *= 7@ 
    END
    
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d * %d ?" 5@ 6@
    THEN
        006A:5@ *= 6@  
    END
    
    //Divide
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d / %d / %d ?" 5@ 6@ 7@
    THEN
        0072:5@ /= 6@
        0072:5@ /= 7@ 
    END
    
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d / %d ?" 5@ 6@
    THEN
        0072:5@ /= 6@  
    END
           
    //Add
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d + %d + %d ?" 5@ 6@ 7@
    THEN
        005A: 5@ += 6@
        005A: 5@ += 7@
    END   
    
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d + %d ?" 5@ 6@
    THEN
        005A: 5@ += 6@  
    END    
           
    //Subtract
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d - %d - %d ?" 5@ 6@ 7@
    THEN
        0062: 5@ -= 6@
        0062: 5@ -= 7@
    END   
    
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d - %d ?" 5@ 6@
    THEN
        0062: 5@ -= 6@  
    END     
    
    0209: 15@ = random_int_in_ranges 500 2500
  
    wait 15@
    0AD3: 30@v = format "/answer %d" 5@
    say 30@v 
    wait 50   
     
    0AC9: 1@
    0AC9: 2@
    0AC9: 3@
    0AC9: 4@      
end
end

:QUIZ_26
wait 0 
if 
   SAMP.Available
then
0AC8: 1@ = 256
0AC8: 2@ = 256
0AC8: 3@ = 256
0AC8: 4@ = 256     
SAMP.GetChatString(98, 1@, 2@, 3@, 4@)                                           
if                
    0C18: 9@ = strstr string1 1@ string2 "Solve this question for money:"
then 
    jump @QUIZ_25  
else    
    //Multiply
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d * %d * %d ?" 5@ 6@ 7@
    THEN
        006A:5@ *= 6@
        006A:5@ *= 7@ 
    END
    
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d * %d ?" 5@ 6@
    THEN
        006A:5@ *= 6@  
    END
    
    //Divide
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d / %d / %d ?" 5@ 6@ 7@
    THEN
        0072:5@ /= 6@
        0072:5@ /= 7@ 
    END
    
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d / %d ?" 5@ 6@
    THEN
        0072:5@ /= 6@  
    END
           
    //Add
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d + %d + %d ?" 5@ 6@ 7@
    THEN
        005A: 5@ += 6@
        005A: 5@ += 7@
    END   
    
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d + %d ?" 5@ 6@
    THEN
        005A: 5@ += 6@  
    END    
           
    //Subtract
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d - %d - %d ?" 5@ 6@ 7@
    THEN
        0062: 5@ -= 6@
        0062: 5@ -= 7@
    END   
    
    IF
        0AD4: 33@ = scan_string 1@ format "Solve this question for money: %d - %d ?" 5@ 6@
    THEN
        0062: 5@ -= 6@  
    END     
    
    0209: 15@ = random_int_in_ranges 500 2500
    wait 15@
    0AD3: 30@v = format "/answer %d" 5@
    say 30@v 
    wait 50   
     
    0AC9: 1@
    0AC9: 2@
    0AC9: 3@
    0AC9: 4@      
end
end
When the message is received nothing happens, I'm not sure if it's being detected or not. If it is then the problem might be negative numbers. Using the code above I check the second and third to last line. It might also be the random wait time, can wait be used like that?
 

HooThaFuck

Active member
Joined
Apr 18, 2015
Messages
51
Reaction score
0
Opcode.eXe link said:
Solve this question for money:

does this line has a color?

normaly these lines look like
Solve this question for money: {FF000} asd etc.
Yes, it does have colors.

Here is the actual line:
Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}-9 x -3 x 5 ?

And in my script I have it as this:
0AD4: 33@ = scan_string 1@ format "Use /answer to solve this question: %d * %d * %d ?" 5@ 6@ 7@

EDIT: I've updated the script to this:
Code:
{$CLEO}

thread "QUIZ" 
wait 5000    


while true   
wait 0
end        

0AF8: samp add_message_to_chat "Stuck in while loop?" color 0xAAFFAAFF

:QUIZ_25
wait 0 
if 
   SAMP.Available
else_jump @QUIZ_25

0AC8: 1@ = 256
0AC8: 2@ = 256
0AC8: 3@ = 256
0AC8: 4@ = 256  
   
SAMP.GetChatString(97, 1@, 2@, 3@, 4@)     
0AF8: samp add_message_to_chat "Testing String" color 0xFF00FFFF  
0085: 5@ = -10000
                
//Multiply
IF
    0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 5@ 6@ 7@
THEN
    006A:5@ *= 6@
    006A:5@ *= 7@ 
END

IF
    0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d ?" 5@ 6@
THEN
    006A:5@ *= 6@  
END

//Divide
IF
    0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d / %d / %d ?" 5@ 6@ 7@
THEN
    0072:5@ /= 6@
    0072:5@ /= 7@ 
END

IF
    0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d / %d ?" 5@ 6@
THEN
    0072:5@ /= 6@  
END
       
//Add
IF
    0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d + %d + %d ?" 5@ 6@ 7@
THEN
    005A: 5@ += 6@
    005A: 5@ += 7@
END   

IF
    0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d + %d ?" 5@ 6@
THEN
    005A: 5@ += 6@  
END    
       
//Subtract
IF
    0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d - %d - %d ?" 5@ 6@ 7@
THEN
    0062: 5@ -= 6@
    0062: 5@ -= 7@
END   

IF
    0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d - %d ?" 5@ 6@
THEN
    0062: 5@ -= 6@  
END     

if
    8039: 5@ == -10000
then
    0209: 15@ = random_int_in_ranges 500 2500
    wait 15@
    0AD3: 30@v = format "/answer %d" 5@
    say 30@v                        
    0AD3: 31@v = format "Command being sent: %s" 30@v
    0AF8: samp add_message_to_chat 31@v color 0xFF00FFFF
    wait 50   
else                                                 
    0AF8: samp add_message_to_chat "Answer = -10000" color 0xFF00FFFF
end
 
0AC9: 1@
0AC9: 2@
0AC9: 3@
0AC9: 4@  

jump @QUIZ_25
None of the debug message are sent, so what's stopping them?

EDIT 2: I just gave a try at converting it to high instead of low code. Now it does actually send the first message. But after that I get a bunch of exceptions and crash instantly.
Code:
{$CLEO}     
                    
0000: NOP

thread "QUIZ" 
wait 5000   

while true   
    wait 0          
    if 
        SAMP.Available 
    then                 
        0AC8: 1@ = 256
        0AC8: 2@ = 256
        0AC8: 3@ = 256
        0AC8: 4@ = 256  
        SAMP.GetChatString(97, 1@, 2@, 3@, 4@)  
           
        0AF8: samp add_message_to_chat "[DEBUG] Testing String" color 0xFF00FFFF  
        0085: 5@ = -91
                        
        //Multiply
        if
            0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 5@ 6@ 7@
        then
            006A:5@ *= 6@
            006A:5@ *= 7@ 
            0AF8: samp add_message_to_chat "[DEBUG] Multiply 2" color 0xFF00FFFF  
        end
        
        if
            0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d ?" 5@ 6@
        then
            006A:5@ *= 6@ 
            0AF8: samp add_message_to_chat "[DEBUG] Multiply 1" color 0xFF00FFFF  
        end
        
        //Divide
        if
            0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d / %d / %d ?" 5@ 6@ 7@
        then
            0072:5@ /= 6@
            0072:5@ /= 7@  
            0AF8: samp add_message_to_chat "[DEBUG] Divide 2" color 0xFF00FFFF 
        end
        
        if
            0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d / %d ?" 5@ 6@
        then
            0072:5@ /= 6@   
            0AF8: samp add_message_to_chat "[DEBUG] Divide 1" color 0xFF00FFFF  
        end
               
        //Add
        if
            0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d + %d + %d ?" 5@ 6@ 7@
        then
            005A: 5@ += 6@
            005A: 5@ += 7@  
            0AF8: samp add_message_to_chat "[DEBUG] Add 2" color 0xFF00FFFF 
        end   
        
        if
            0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d + %d ?" 5@ 6@
        then
            005A: 5@ += 6@   
            0AF8: samp add_message_to_chat "[DEBUG] Add 1" color 0xFF00FFFF 
        end    
               
        //Subtract
        if
            0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d - %d - %d ?" 5@ 6@ 7@
        then
            0062: 5@ -= 6@
            0062: 5@ -= 7@   
            0AF8: samp add_message_to_chat "[DEBUG] Subtract 2" color 0xFF00FFFF  
        end   
        
        if
            0AD4: 28@ = scan_string 1@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d - %d ?" 5@ 6@
        then
            0062: 5@ -= 6@  
            0AF8: samp add_message_to_chat "[DEBUG] Subtract 1" color 0xFF00FFFF 
        end     
        
        if
            8039: 5@ == -91
        then
        //    0209: 15@ = random_int_in_ranges 500 2500
        //    wait 15@
            0AD3: 30@v = format "/answer %d" 5@
            say 30@v                        
            0AD3: 31@v = format "[DEBUG] Command being sent: %s" 30@v
            0AF8: samp add_message_to_chat 31@v color 0xFF00FFFF  
        else                                                 
            0AF8: samp add_message_to_chat "[DEBUG] Answer = -10000" color 0xFF00FFFF 
        end
        
        0AC9: 1@
        0AC9: 2@
        0AC9: 3@
        0AC9: 4@ 
    end   
end     
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
You can try to use my clean script.. just add the other calculations by urself... it should work.

Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY



WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @GETCHATENTRYTEXT 1 id 99 to 0@
    
    IF
    0AD4: 33@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 2@ 3@ 4@
    THEN
        0AF8: samp add_message_to_chat "Calculating: %d * %d * %d" color -1 2@ 3@ 4@ 
        006A: 2@ *= 3@
        006A: 2@ *= 4@ 
        0AF8: samp add_message_to_chat "Result: %d" color -1 2@
        0AF9: samp say_msg "/answer %d" 2@
    END
    
    IF
    0AD4: 33@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d ?" 2@ 3@
    THEN
        0AF8: samp add_message_to_chat "Calculating: %d * %d" color -1 2@ 3@ 
        006A: 2@ *= 3@
        0AF8: samp add_message_to_chat "Result: %d" color -1 2@
        0AF9: samp say_msg "/answer %d" 2@
    END    
    
    IF
    0AD4: 33@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d + %d ?" 2@ 3@
    THEN
        0AF8: samp add_message_to_chat "Calculating: %d + %d" color -1 2@ 3@ 
        005A: 2@ += 3@ 
        0AF8: samp add_message_to_chat "Result: %d" color -1 2@
        0AF9: samp say_msg "/answer %d" 2@
    END
        


    
    0AC9: free_allocated_memory 0@
    0AC9: free_allocated_memory 1@    
END




:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: ret 1 1@
 

HooThaFuck

Active member
Joined
Apr 18, 2015
Messages
51
Reaction score
0
Opcode.eXe link said:
You can try to use my clean script.. just add the other calculations by urself... it should work.

Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY



WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @GETCHATENTRYTEXT 1 id 99 to 0@
    
    IF
    0AD4: 33@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 2@ 3@ 4@
    THEN
        0AF8: samp add_message_to_chat "Calculating: %d * %d * %d" color -1 2@ 3@ 4@ 
        006A: 2@ *= 3@
        006A: 2@ *= 4@ 
        0AF8: samp add_message_to_chat "Result: %d" color -1 2@
        0AF9: samp say_msg "/answer %d" 2@
    END
    
    IF
    0AD4: 33@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d ?" 2@ 3@
    THEN
        0AF8: samp add_message_to_chat "Calculating: %d * %d" color -1 2@ 3@ 
        006A: 2@ *= 3@
        0AF8: samp add_message_to_chat "Result: %d" color -1 2@
        0AF9: samp say_msg "/answer %d" 2@
    END    
    
    IF
    0AD4: 33@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d + %d ?" 2@ 3@
    THEN
        0AF8: samp add_message_to_chat "Calculating: %d + %d" color -1 2@ 3@ 
        005A: 2@ += 3@ 
        0AF8: samp add_message_to_chat "Result: %d" color -1 2@
        0AF9: samp say_msg "/answer %d" 2@
    END
        


    
    0AC9: free_allocated_memory 0@
    0AC9: free_allocated_memory 1@    
END




:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: ret 1 1@
Using this I never connect to the server. It says the server didnt respond and keeps trying repeatedly.

EDIT: Fixed that by removing the repeat-until loop. Now I serve another problem. This code always prints (null). Even when it should print the message above it or print the answer, it prints null. Also 2@ is never changed (so it always equals -777 as my security check).
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
Fix your damn Gta_Sa and get the newest sampfuncs version including sascm.ini opcodes.txt and now  :fuck_you:
then goto options and find+check "as is" case converting and hope that it works.
dont forget that it has to be CLEO 4.1 not 4.3 dont ask me why  :table_flip:
 

HooThaFuck

Active member
Joined
Apr 18, 2015
Messages
51
Reaction score
0
Actually the problem was simple. I forgot to add the color parameter to the CM string.

So, now we're down to this:
Code:
{$CLEO .cs}
0000:

WHILE TRUE
    WAIT 2000
    IF
        SAMP.Available()
    THEN                     
        0AC8: 0@ = allocate_memory_size 260
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @GETCHATENTRYTEXT 1 id 98 to 0@ 
        
        0006: 2@ = -777
        
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d ?" 2@ 3@
        THEN
            0AF8: samp add_message_to_chat "Calculating: %d * %d" 0xFF00FFFF 2@ 3@ 
            006A: 2@ *= 3@
            0AF8: samp add_message_to_chat "Result: %d" 0xFF00FFFF 2@
        END       
        
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 2@ 3@ 4@
        THEN
            0AF8: samp add_message_to_chat "Calculating: %d * %d * %d" 0xFF00FFFF 2@ 3@ 4@ 
            006A: 2@ *= 3@
            006A: 2@ *= 4@ 
            0AF8: samp add_message_to_chat "Result: %d" 0xFF00FFFF 2@
        END
        
        IF 
            8039: 2@ == -777
        THEN                     
            0AF9: samp say_msg "/answer %d" 2@                
            0AF8: samp add_message_to_chat "AA: %d, %d, %d" 0xFF0000FF 2@ 3@ 4@ 
        ELSE                                     
            0AF8: samp add_message_to_chat "AM: %d, %d, %d" 0xFFFF0000 2@ 3@ 4@ 
        END       
        
        0AC9: free_allocated_memory 0@
        0AC9: free_allocated_memory 1@ 
    END 
END

:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: ret 1 1@
It all seems to work except the fact that the string parsing never works (and thus the command is also never sent).
This line is never true:
Code:
0AD4: 28@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 2@ 3@ 4@
And because of that, 2@ is always -777.

Clearly what should happen is:
1. Retrieve the second to last line (98). Done.
2. Scan the line for values. Not working.
3. Send the answer command. Will work if '2' was fixed (Tested).
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
Uhm... i dont know what you're doing wrong, but you can try this:

        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 2@ 3@ 4@
        THEN
            IF
            28@ == 3 // 3 numbers found
            THEN
                0AF8: samp add_message_to_chat "Calculating: %d * %d * %d" 0xFF00FFFF 2@ 3@ 4@
                006A: 2@ *= 3@
                006A: 2@ *= 4@
                0AF8: samp add_message_to_chat "Result: %d" 0xFF00FFFF 2@
            END
        END
 

HooThaFuck

Active member
Joined
Apr 18, 2015
Messages
51
Reaction score
0
Opcode.eXe link said:
Uhm... i dont know what you're doing wrong, but you can try this:

        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 2@ 3@ 4@
        THEN
            IF
            28@ == 3 // 3 numbers found
            THEN
                0AF8: samp add_message_to_chat "Calculating: %d * %d * %d" 0xFF00FFFF 2@ 3@ 4@
                006A: 2@ *= 3@
                006A: 2@ *= 4@
                0AF8: samp add_message_to_chat "Result: %d" 0xFF00FFFF 2@
            END
        END
The first THEN there is never reached, thats the problem. I'm pretty positive it's something to do with the 'scan string format' opcode. It must be testing the string, but the string never matches for some reason. I've even tried doing the same thing without the color codes. Is there any other way to parse a string like that?


EDIT: I found something out that blows this issue up ten times bigger. Here is what I found:
This returns true.
Code:
0AD4: 28@ = scan_string 0@ format "Use {FF0000}%s" 27@v
This returns false.
Code:
0AD4: 28@ = scan_string 0@ format "Use {FF0000}/answer%s" 27@v
I'm guessing there is either a limit or you can't use a slash in the format scanning (although if that were the case I wouldn't be able to check divisions). Of course 27@v both come out wacky (well, when its false it comes out to be nothing), but this still points out the issue. I wonder if we could cut like the first 60 characters (that's up to the first digit) then just scan up to the '?', is there a way to clip a string?
 

HooThaFuck

Active member
Joined
Apr 18, 2015
Messages
51
Reaction score
0
(refer to the end of the other post before reading this)

Out of all of the following checks, only '1' is printed when the quiz is received.
Code:
        //DEBUGGER
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}%s" 27@v
        THEN
            0AF8: samp add_message_to_chat "1" 0xFF00FFFF
        END 
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}/%s" 27@v
        THEN
            0AF8: samp add_message_to_chat "2" 0xFF00FFFF
        END 
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}\/%s" 27@v
        THEN
            0AF8: samp add_message_to_chat "3" 0xFF00FFFF
        END 
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}/answer%s" 27@v
        THEN
            0AF8: samp add_message_to_chat "4" 0xFF00FFFF
        END 
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}\/answer%s" 27@v
        THEN
            0AF8: samp add_message_to_chat "5" 0xFF00FFFF
        END 
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}/answer{00FFFF}%s" 27@v
        THEN
            0AF8: samp add_message_to_chat "6" 0xFF00FFFF
        END 
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}answer{00FFFF}%s" 27@v
        THEN
            0AF8: samp add_message_to_chat "7" 0xFF00FFFF
        END 
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}answer{00FFFF} to solve this question: {FF00CC}%d * %d * %d ?" 27@v 27@v 27@v
        THEN
            0AF8: samp add_message_to_chat "8" 0xFF00FFFF
        END 
        //DEBUGGER
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
Every time a check is succesful your mod will print something in the last chat line(99), thus 0@(the chat string pointer) will change it's content and further checks will be unsuccseful.

Code:
        IF
            0AD4: 28@ = scan_string 0@ format "Use {FF0000}%s" 27@v
        THEN
            0AF8: samp add_message_to_chat "1" 0xFF00FFFF //now 0@ = "1"
        END
        IF
            0AD4: 28@ = scan_string 0@ format "%d" 27@
        THEN
            0AF8: samp add_message_to_chat "0@ == 1" 0xFF00FFFF
        END
 
Status
Not open for further replies.
Top