CLEO Help save the message inside an allocated string buffer, then use it later in a series of Say opcode message.

CLEO related
Status
Not open for further replies.

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
hello im trying to make a mod that will read the message after an used command or how can we call it.

let s say You use the command /sendmsj "message".

it will be like /sendmsj "sell car who wants to buy?"

Now the text "sell car who wants to buy" can be a random text so any text i put after the /sendmsj it will be readed and sent to the multiple chats like /c /ad /pc /vip etc.

This is the points if we can send multiple messages to more chat by using a command but the message text should be random

this is an example :

register command "/sendmsj"

if any text was detected after the /sendmsj command then send that text to /c /pc /ad /vip etc.

another example with ss:



as you seee in that ss, after the command /sendmsj u can see i typed the message "i sell car who want to buy"

Now if we press enter, that message will be sent to more chats in game like /r /f /c etc etc.

and that message should be random like i can type whatever i want. so if i type let s say "/sendmsj we are making cmd" it will send the we are making cmd message to other chats. like /r /f /c etc etc.

so the mod should detect the text i typed after the command and sent it to more chats in game after i press enter..

I asked @ajom about that and him gave me some codes but i dont know how to assemble the code i tryed some ways but game crash at start or when i use the command.

This is what ajom gave me hope you can assemble it if you want of course..

Code:
You can initialize an allocated buffer before the main loop using:
PHP:
alloc 31@ 300 // now 31@ can handle up to 299 characters sized string
alloc 30@ 300 // now 30@ can handle up to 299 characters sized string

Then at CMD hook:
PHP:
:cmdhook
0B35: samp 0@ = get_last_command_params
If 0@ > 0
Then format 31@ 0@
End
29@ = True // tell the main loop to make a series of message
cmd_ret

At Main Loop:
PHP:
If 29@ == true
Then
Format 30@ "/c %s " 31@
Say 30@
Wait 500
Format 30@ "/pc %s " 31@
Say 30@
Wait 500
Format 30@ "/ad %s " 31@
Say 30@
Wait 500
Format 30@ "/vip %s " 31@
Say 30@
29@ = false // turn off the message series
End
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
No SAMPFUNCS
Any SAMP


"/msg yourtext"
PHP:
{$CLEO .cs}

0000: 'Author: Parazitas | UGBASE.EU'

WAIT 8500

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    0AC8: 31@ = allocate_memory_size 1024
    0AD3: 31@ = format "msg" // format command
    0AC8: 30@ = allocate_memory_size 1024
    0AD3: 30@ = format "{FF0000}Wrong command {FFFFFF}Use: {0000FF}/msg [message]" // format wrong command message
    0AB1: @Chatmsg 3 SampVersionID 0@ text 4@ color 0xFF00FF00
    IF 0AB1: @ReadCommand 2 Command 31@ WrongCommandMessage 30@ _Returned: CommandParams 29@
    THEN
        0AB1: @Chatmsg 3 SampVersionID 1 text 29@ color 0xFF00FF00
    END
END

END

:ReadCommand
{
    0AB1: @ReadCommand 0
}
IF 0256:   player $PLAYER_CHAR defined
THEN                
    0AB1: @get_samp_version_id 0 _Returned: ID 31@
  
    // Unmute server chat after message ' unknown command ' was blocked
    0AB1: @ReadServerChat 1 SampVersionID 31@ _Returned: NopValue 30@
    IF 30@ == 0xC3 // NOP
    THEN
        IF 33@ > 500
        THEN
            0AB1: @MuteServerChat 2 SampVersionID 31@ State FALSE
            33@ = 0
        END                             
    END
    // 
  
    0AB1: @GetLastSentTextFromChatBox 1 SampVersionID 31@ _Returned: Command 29@ Text 28@
    0A8D: 27@ = readMem 29@ sz 1 vp 0
    0A8D: 26@ = readMem 28@ sz 1 vp 0
    IF AND
    27@ > 0
    26@ > 0
    THEN
      
        0AB1: @lowercase 1 29@ // self retrun
        0AB1: @lowercase 1 28@ // self return
      
        IF 0AB1: @cmpString1andString2 2 String1 29@ String2 0@ // compare command
        THEN
            // Mute / Block message ' unknow command ' from server
            0AB1: @MuteServerChat 2 SampVersionID 31@ State TRUE
            33@ = 0 // reset timer
            //
            0AB1: @strlen 1 string 0@ _length 25@ // get command length
            IF 0AB1: @IfTextContains 2 String1 28@ String2 0@ _Returned: Text 24@ // compare command and text
            THEN
                005A: 24@ += 25@ // skip command
                0A8D: 23@ = readMem 24@ sz 1 vp 0
                IF 23@ == 32 // check: is space after command
                THEN
                    24@ += 1  // skip 'space'
                    0A8D: 23@ = readMem 24@ sz 1 vp 0
                    IF NOT 23@ > 0 // check: is any text after 'command and space'
                    THEN        
                        0AB1: @Chatmsg 3 SampVersionID 31@ text 1@ color 0xFF00FF00
                        0A8C: writeMem 28@ sz 1 vl 0 vp 0 // clear last entered text to chatbox
                        0A8C: writeMem 24@ sz 1 vl 0 vp 0 // clear last text
                    ELSE
                        0A8D: 23@ = readMem 24@ sz 1 vp 0
                        IF 23@ > 32 // to check next string isn't empty
                        THEN
                            0AC8: 22@ = allocate_memory_size 1024
                            0AD3: 22@ = format "%s" 24@
                        ELSE        
                            0AB1: @Chatmsg 3 SampVersionID 31@ text 1@ color 0xFF00FF00
                        END
                        0A8C: writeMem 28@ sz 1 vl 0 vp 0 // clear last entered text to chatbox
                        0A8C: writeMem 24@ sz 1 vl 0 vp 0 // clear last text
                    END  
                ELSE
                    0AB1: @Chatmsg 3 SampVersionID 31@ text 1@ color 0xFF00FF00
                    0A8C: writeMem 28@ sz 1 vl 0 vp 0 // clear last entered text to chatbox
                    0A8C: writeMem 24@ sz 1 vl 0 vp 0 // clear last text
                END
            END
        END
    END
END                 
0AB2: ret 1 22@
             
:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _Returned: ID 0@
30@ = 0
IF 0AA2: 31@ = "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END
  
    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END
  
    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END
  
    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
  
    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END
  
    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
    IF 29@ == 0x6094ACAB
    THEN // 0.3.7 R4 - v2
        30@ = 6
    END
END
0AB2: ret 1 30@

:GetLastSentTextFromChatBox
{
    0AB1: @GetLastSentTextFromChatBox 1 SampVersionID 5 _Returned: Command 0@ Text 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN    
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E8 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
   
        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0F0 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
   
        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA14 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
   
        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8CC // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
   
        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
      
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
    END
END
0AB2: ret 2 29@ 28@

:lowercase
// 0AB1: @lowercase 1 0@ // 0@ - SelfReturn
0AA5: call 0x718740 num_params 1 pop 1 0@
0AB2: ret 0

:cmpString1andString2
{
    Example: 0AB1: @cmpString1andString2 2 String1 1@ String2 2@
    In: 0@, 1@ - strings
    Out: result 0/1
}
FOR 7@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0 
    0A8D: 3@ = readMem 1@ sz 1 vp 0
    0@ += 1
    1@ += 1
    IF 003B: 2@ == 3@
    JF break
    IF AND
    2@ == 0
    3@ == 0
    THEN
        0485: return_true
        0AB2: ret 0
    END
END
059A: return_false
0AB2: ret 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
IF 001D:   30@ > 31@  // (int)
THEN
    059A:  return_false
    0AB2: ret 1 0
END

31@ -= 1
26@ = 0 // counter of the same chars in a row
FOR 29@ = 0 TO 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = readMem 24@ sz 1 vp 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = readMem 23@ sz 1 vp 0

    IF 003B:   28@ == 27@  // (int)
    THEN
    26@++
        IF 002D:   26@ >= 30@  // (int)
        THEN
            0485:  return_true
            0062: 24@ -= 30@  // (int)
            24@ += 1
            0AB2: ret 1 24@
        END
    ELSE
        IF 26@ > 0
        THEN 29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        END
    26@ = 0
    END
END

059A:  return_false
0AB2: ret 1 0

:strlen
// 0AB1: @strlen 1 string 1@ _return: size 3@
FOR 1@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0
    IF NOT 2@ == 0
    JF break
    0@ += 1
END
0AB2: ret 1 1@

:MuteServerChat
{
    NOPs
    0AB1: @MuteServerChat 2 SampVersionID 0@ State TRUE
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN    
            31@ += 0xC050
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN    
            31@ += 0xC050
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END   
        END
      
        IF 0@ == 3 // 0.3.DL
        THEN    
            31@ += 0xEE60
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END   
        END
      
        IF 0@ == 4 // 0.3.7 R3
        THEN    
            31@ += 0xEC50
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END     
        END
      
        IF 0@ == 5 // 0.3.7 R4
        THEN    
            31@ += 0xEF60
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END      
        END
      
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN    
            31@ += 0xEF90
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END      
        END
    END
END
0AB2: ret 0

:ReadServerChat
{
    NOPs
    0AB1: @ReadServerChat 1 SampVersionID 29@ _Returned: NopValue 15@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN    
            31@ += 0xC050
            0A8D: 30@ = readMem 31@ sz 1 vp 1
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN    
            31@ += 0xC050
            0A8D: 30@ = readMem 31@ sz 1 vp 1  
        END
      
        IF 0@ == 3 // 0.3.DL
        THEN    
            31@ += 0xEE60
            0A8D: 30@ = readMem 31@ sz 1 vp 1
        END
      
        IF 0@ == 4 // 0.3.7 R3
        THEN    
            31@ += 0xEC50
            0A8D: 30@ = readMem 31@ sz 1 vp 1   
        END
      
        IF 0@ == 5 // 0.3.7 R4
        THEN    
            31@ += 0xEF60
            0A8D: 30@ = readMem 31@ sz 1 vp 1     
        END
      
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN    
            31@ += 0xEF90
            0A8D: 30@ = readMem 31@ sz 1 vp 1     
        END
    END
END
0AB2: ret 1 30@

:ProcessChatInput
{
    0AB1: @ProcessChatInput 2 SampVersionID 0@ InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN  
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 21@ = 20@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
         
            0A8E: 24@ = 20@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x65D30 // PROCESS_INPUT
        END
  
        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 21@ = 20@ + 0x21A0F0            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
         
            0A8E: 24@ = 20@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x65E00 // PROCESS_INPUT
        END
  
        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 21@ = 20@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
         
            0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT 
        END
  
        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 21@ = 20@ + 0x26E8CC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
         
            0A8E: 24@ = 20@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69260 // PROCESS_INPUT
        END
  
        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 21@ = 20@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
         
            0A8E: 24@ = 20@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69990 // PROCESS_INPUT
        END
      
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 21@ = 20@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
         
            0A8E: 24@ = 20@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x699D0 // PROCESS_INPUT
        END
        0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 1@ _retVal 6@
        0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
    END
END
0AB2: 0

:Chatmsg
/*
     0AC8: 4@ = allocate_memory_size 1024
     0AD3: 4@ = format "{FFFFFF}Auto Accept: {00FF00}ON"
     0AB1: @Chatmsg 3 SampVersionID 0@ text 4@ color 0xFF00FF00
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E4            // SAMP_CHAT_INFO_OFFSET (R1)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x64010             // FUNC_ADDTOCHATWND (R1)
        END

        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0EC            // SAMP_CHAT_INFO_OFFSET (R2)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x640E0            // FUNC_ADDTOCHATWND (R2)
        END

        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA10            // SAMP_CHAT_INFO_OFFSET (DL)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67650             // FUNC_ADDTOCHATWND (DL)
        END

        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8C8            // SAMP_CHAT_INFO_OFFSET (R3)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67460             // FUNC_ADDTOCHATWND (R3)
        END

        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BA0             // FUNC_ADDTOCHATWND (R4) 699D0
        END
      
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
        IF 2@ == -1
        THEN 2@ = 0xFFFFFFFF
        END
        0AA6: call 29@ struct 30@ num_params 5 pop 0 params 0 2@ 0 1@ 8
    END
END
0AB2: 0
 
Last edited:

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
No SAMPFUNCS
Any SAMP


"/msg yourtext"
PHP:
{$CLEO .cs}

0000: 'Author: Parazitas | UGBASE.EU'

WAIT 8500

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    0AC8: 31@ = allocate_memory_size 1024
    0AD3: 31@ = format "msg" // format command
    0AC8: 30@ = allocate_memory_size 1024
    0AD3: 30@ = format "{FF0000}Wrong command {FFFFFF}Use: {0000FF}/msg [message]" // format wrong command message
    0AB1: @Chatmsg 3 SampVersionID 0@ text 4@ color 0xFF00FF00
    IF 0AB1: @ReadCommand 2 Command 31@ WrongCommandMessage 30@ _Returned: CommandParams 29@
    THEN
        0AB1: @Chatmsg 3 SampVersionID 1 text 29@ color 0xFF00FF00
    END
END

END

:ReadCommand
{
    0AB1: @ReadCommand 0
}
IF 0256:   player $PLAYER_CHAR defined
THEN               
    0AB1: @get_samp_version_id 0 _Returned: ID 31@
 
    // Unmute server chat after message ' unknown command ' was blocked
    0AB1: @ReadServerChat 1 SampVersionID 31@ _Returned: NopValue 30@
    IF 30@ == 0xC3 // NOP
    THEN
        IF 33@ > 500
        THEN
            0AB1: @MuteServerChat 2 SampVersionID 31@ State FALSE
            33@ = 0
        END                            
    END
    //
 
    0AB1: @GetLastSentTextFromChatBox 1 SampVersionID 31@ _Returned: Command 29@ Text 28@
    0A8D: 27@ = readMem 29@ sz 1 vp 0
    0A8D: 26@ = readMem 28@ sz 1 vp 0
    IF AND
    27@ > 0
    26@ > 0
    THEN
     
        0AB1: @lowercase 1 29@ // self retrun
        0AB1: @lowercase 1 28@ // self return
     
        IF 0AB1: @cmpString1andString2 2 String1 29@ String2 0@ // compare command
        THEN
            // Mute / Block message ' unknow command ' from server
            0AB1: @MuteServerChat 2 SampVersionID 31@ State TRUE
            33@ = 0 // reset timer
            //
            0AB1: @strlen 1 string 0@ _length 25@ // get command length
            IF 0AB1: @IfTextContains 2 String1 28@ String2 0@ _Returned: Text 24@ // compare command and text
            THEN
                005A: 24@ += 25@ // skip command
                0A8D: 23@ = readMem 24@ sz 1 vp 0
                IF 23@ == 32 // check: is space after command
                THEN
                    24@ += 1  // skip 'space'
                    0A8D: 23@ = readMem 24@ sz 1 vp 0
                    IF NOT 23@ > 0 // check: is any text after 'command and space'
                    THEN       
                        0AB1: @Chatmsg 3 SampVersionID 31@ text 1@ color 0xFF00FF00
                        0A8C: writeMem 28@ sz 1 vl 0 vp 0 // clear last entered text to chatbox
                        0A8C: writeMem 24@ sz 1 vl 0 vp 0 // clear last text
                    ELSE
                        0A8D: 23@ = readMem 24@ sz 1 vp 0
                        IF 23@ > 32 // to check next string isn't empty
                        THEN
                            0AC8: 22@ = allocate_memory_size 1024
                            0AD3: 22@ = format "%s" 24@
                        ELSE       
                            0AB1: @Chatmsg 3 SampVersionID 31@ text 1@ color 0xFF00FF00
                        END
                        0A8C: writeMem 28@ sz 1 vl 0 vp 0 // clear last entered text to chatbox
                        0A8C: writeMem 24@ sz 1 vl 0 vp 0 // clear last text
                    END 
                ELSE
                    0AB1: @Chatmsg 3 SampVersionID 31@ text 1@ color 0xFF00FF00
                    0A8C: writeMem 28@ sz 1 vl 0 vp 0 // clear last entered text to chatbox
                    0A8C: writeMem 24@ sz 1 vl 0 vp 0 // clear last text
                END
            END
        END
    END
END                
0AB2: ret 1 22@
            
:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _Returned: ID 0@
30@ = 0
IF 0AA2: 31@ = "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END
 
    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END
 
    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END
 
    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
 
    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END
 
    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
    IF 29@ == 0x6094ACAB
    THEN // 0.3.7 R4 - v2
        30@ = 6
    END
END
0AB2: ret 1 30@

:GetLastSentTextFromChatBox
{
    0AB1: @GetLastSentTextFromChatBox 1 SampVersionID 5 _Returned: Command 0@ Text 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN   
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E8 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
  
        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0F0 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
  
        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA14 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
  
        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8CC // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
  
        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
     
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        END
    END
END
0AB2: ret 2 29@ 28@

:lowercase
// 0AB1: @lowercase 1 0@ // 0@ - SelfReturn
0AA5: call 0x718740 num_params 1 pop 1 0@
0AB2: ret 0

:cmpString1andString2
{
    Example: 0AB1: @cmpString1andString2 2 String1 1@ String2 2@
    In: 0@, 1@ - strings
    Out: result 0/1
}
FOR 7@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0
    0A8D: 3@ = readMem 1@ sz 1 vp 0
    0@ += 1
    1@ += 1
    IF 003B: 2@ == 3@
    JF break
    IF AND
    2@ == 0
    3@ == 0
    THEN
        0485: return_true
        0AB2: ret 0
    END
END
059A: return_false
0AB2: ret 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
IF 001D:   30@ > 31@  // (int)
THEN
    059A:  return_false
    0AB2: ret 1 0
END

31@ -= 1
26@ = 0 // counter of the same chars in a row
FOR 29@ = 0 TO 31@ // for each char of the main text  (29@ = index)
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = readMem 24@ sz 1 vp 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = readMem 23@ sz 1 vp 0

    IF 003B:   28@ == 27@  // (int)
    THEN
    26@++
        IF 002D:   26@ >= 30@  // (int)
        THEN
            0485:  return_true
            0062: 24@ -= 30@  // (int)
            24@ += 1
            0AB2: ret 1 24@
        END
    ELSE
        IF 26@ > 0
        THEN 29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        END
    26@ = 0
    END
END

059A:  return_false
0AB2: ret 1 0

:strlen
// 0AB1: @strlen 1 string 1@ _return: size 3@
FOR 1@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0
    IF NOT 2@ == 0
    JF break
    0@ += 1
END
0AB2: ret 1 1@

:MuteServerChat
{
    NOPs
    0AB1: @MuteServerChat 2 SampVersionID 0@ State TRUE
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN   
            31@ += 0xC050
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN   
            31@ += 0xC050
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END  
        END
     
        IF 0@ == 3 // 0.3.DL
        THEN   
            31@ += 0xEE60
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END  
        END
     
        IF 0@ == 4 // 0.3.7 R3
        THEN   
            31@ += 0xEC50
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END    
        END
     
        IF 0@ == 5 // 0.3.7 R4
        THEN   
            31@ += 0xEF60
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END     
        END
     
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN   
            31@ += 0xEF90
            0A8D: 30@ = readMem 31@ sz 1 vp 1
            IF 1@ == TRUE
            THEN 0A8C: writeMem 31@ sz 1 vl 0xC3 vp 1
            ELSE 0A8C: writeMem 31@ sz 1 vl 0x55 vp 1
            END     
        END
    END
END
0AB2: ret 0

:ReadServerChat
{
    NOPs
    0AB1: @ReadServerChat 1 SampVersionID 29@ _Returned: NopValue 15@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN   
            31@ += 0xC050
            0A8D: 30@ = readMem 31@ sz 1 vp 1
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN   
            31@ += 0xC050
            0A8D: 30@ = readMem 31@ sz 1 vp 1 
        END
     
        IF 0@ == 3 // 0.3.DL
        THEN   
            31@ += 0xEE60
            0A8D: 30@ = readMem 31@ sz 1 vp 1
        END
     
        IF 0@ == 4 // 0.3.7 R3
        THEN   
            31@ += 0xEC50
            0A8D: 30@ = readMem 31@ sz 1 vp 1  
        END
     
        IF 0@ == 5 // 0.3.7 R4
        THEN   
            31@ += 0xEF60
            0A8D: 30@ = readMem 31@ sz 1 vp 1    
        END
     
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN   
            31@ += 0xEF90
            0A8D: 30@ = readMem 31@ sz 1 vp 1    
        END
    END
END
0AB2: ret 1 30@

:ProcessChatInput
{
    0AB1: @ProcessChatInput 2 SampVersionID 0@ InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN 
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 21@ = 20@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
        
            0A8E: 24@ = 20@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x65D30 // PROCESS_INPUT
        END
 
        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 21@ = 20@ + 0x21A0F0            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
        
            0A8E: 24@ = 20@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x65E00 // PROCESS_INPUT
        END
 
        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 21@ = 20@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
        
            0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT
        END
 
        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 21@ = 20@ + 0x26E8CC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
        
            0A8E: 24@ = 20@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69260 // PROCESS_INPUT
        END
 
        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 21@ = 20@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
        
            0A8E: 24@ = 20@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69990 // PROCESS_INPUT
        END
     
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 21@ = 20@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
        
            0A8E: 24@ = 20@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x699D0 // PROCESS_INPUT
        END
        0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 1@ _retVal 6@
        0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
    END
END
0AB2: 0

:Chatmsg
/*
     0AC8: 4@ = allocate_memory_size 1024
     0AD3: 4@ = format "{FFFFFF}Auto Accept: {00FF00}ON"
     0AB1: @Chatmsg 3 SampVersionID 0@ text 4@ color 0xFF00FF00
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E4            // SAMP_CHAT_INFO_OFFSET (R1)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x64010             // FUNC_ADDTOCHATWND (R1)
        END

        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0EC            // SAMP_CHAT_INFO_OFFSET (R2)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x640E0            // FUNC_ADDTOCHATWND (R2)
        END

        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA10            // SAMP_CHAT_INFO_OFFSET (DL)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67650             // FUNC_ADDTOCHATWND (DL)
        END

        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8C8            // SAMP_CHAT_INFO_OFFSET (R3)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67460             // FUNC_ADDTOCHATWND (R3)
        END

        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BA0             // FUNC_ADDTOCHATWND (R4) 699D0
        END
     
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
        IF 2@ == -1
        THEN 2@ = 0xFFFFFFFF
        END
        0AA6: call 29@ struct 30@ num_params 5 pop 0 params 0 2@ 0 1@ 8
    END
END
0AB2: 0

Thank you, it needs some fixes please if you want. i typed /msg hello whats up and its like this :


Nothing more.

Now, as a fix:

the mod should send that message to the chat's : /wt /pc /c

now the mod uses that script i think : 0AF8: samp add_message_to_chat

but it wont send that message to the chats /c /wt and /pc can u fix that bro?
 

Attachments

  • 1631344897131.png
    1631344897131.png
    5.1 KB · Views: 14

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
@Parazitas lol i found it after 2 days ))) xd thank you

i used this :
IF 0AB1: @ReadCommand 2 Command 31@ WrongCommandMessage 30@ _Returned: CommandParams 29@
THEN
wait 500
say 29@

how can i type where say 29@ is, how can i type /ad /pc /c and /wt?

say "/c %s" 29@

found it <3

how can i add deelay? i used this but the deelay wont work :

IF 0256: player $PLAYER_CHAR defined
THEN
0AC8: 31@ = allocate_memory_size 1024
0AD3: 31@ = format "msg" // format command
0AC8: 30@ = allocate_memory_size 1024
0AD3: 30@ = format "{FF0000}Wrong command {FFFFFF}Use: {0000FF}/msg [message]" // format wrong command message
0AB1: @Chatmsg 3 SampVersionID 0@ text 4@ color 0xFF00FF00
IF 0AB1: @ReadCommand 2 Command 31@ WrongCommandMessage 30@ _Returned: CommandParams 29@
THEN
say 29@
wait 1500
say 29@
wait 1500
say 29@
END
END

END
 
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
hello im trying to make a mod that will read the message after an used command or how can we call it.

let s say You use the command /sendmsj "message".

it will be like /sendmsj "sell car who wants to buy?"

Now the text "sell car who wants to buy" can be a random text so any text i put after the /sendmsj it will be readed and sent to the multiple chats like /c /ad /pc /vip etc.

This is the points if we can send multiple messages to more chat by using a command but the message text should be random

this is an example :

register command "/sendmsj"

if any text was detected after the /sendmsj command then send that text to /c /pc /ad /vip etc.

another example with ss:



as you seee in that ss, after the command /sendmsj u can see i typed the message "i sell car who want to buy"

Now if we press enter, that message will be sent to more chats in game like /r /f /c etc etc.

and that message should be random like i can type whatever i want. so if i type let s say "/sendmsj we are making cmd" it will send the we are making cmd message to other chats. like /r /f /c etc etc.

so the mod should detect the text i typed after the command and sent it to more chats in game after i press enter..

I asked @ajom about that and him gave me some codes but i dont know how to assemble the code i tryed some ways but game crash at start or when i use the command.

This is what ajom gave me hope you can assemble it if you want of course..

Code:
You can initialize an allocated buffer before the main loop using:
PHP:
alloc 31@ 300 // now 31@ can handle up to 299 characters sized string
alloc 30@ 300 // now 30@ can handle up to 299 characters sized string

Then at CMD hook:
PHP:
:cmdhook
0B35: samp 0@ = get_last_command_params
If 0@ > 0
Then format 31@ 0@
End
29@ = True // tell the main loop to make a series of message
cmd_ret

At Main Loop:
PHP:
If 29@ == true
Then
Format 30@ "/c %s " 31@
Say 30@
Wait 500
Format 30@ "/pc %s " 31@
Say 30@
Wait 500
Format 30@ "/ad %s " 31@
Say 30@
Wait 500
Format 30@ "/vip %s " 31@
Say 30@
29@ = false // turn off the message series
End

I Don't know why you still don't know how to construct/assemble a proper script workflow even though I already showed you many script examples with comments of its explanations from your past topics.


Anyway, I can't code it properly since I am using a phone with no Sanny Builder Database(New Phone). The assembly of the code is like this:
PHP:
{$CLEO}
0000:

repeat
    wait 0
until 0AFA:  is_samp_available

const
    MYMESSAGE = 31@
    CMDMESSAGE = 30@
    DO_MSG_SERIES = 29@
    HUMANCHATDELAY = 500 // period to wait for each say in chat. Change this if you want to send message faster/slower
end
alloc MYMESSAGE 300 // now 31@ can handle up to 299 characters sized string
alloc CMDMESSAGE 300 // now 30@ can handle up to 299 characters sized string

0B34: samp register_client_command "sell" to_label @cmdhook

0AF8: samp add_message_to_chat "ad text" color 0xFF00FFFFF

while true
    wait 0
    If DO_MSG_SERIES == true
    Then
        0AD3: CMDMESSAGE = format "/c %s " MYMESSAGE // construct the CMD Message
        Say CMDMESSAGE
        Wait HUMANCHATDELAY
        0AD3: CMDMESSAGE = format "/c %s " MYMESSAGE // construct the CMD Message
        Say CMDMESSAGE
        Wait HUMANCHATDELAY
        0AD3: CMDMESSAGE = format "/c %s " MYMESSAGE // construct the CMD Message
        Say CMDMESSAGE
        Wait HUMANCHATDELAY
        0AD3: CMDMESSAGE = format "/c %s " MYMESSAGE // construct the CMD Message
        Say CMDMESSAGE
        DO_MSG_SERIES = false // turn off the message series
    end
end

:cmdhook
    0B35: samp 0@ = get_last_command_params
    If 0@ > 0
    Then
        0AD3: MYMESSAGE = format 0@ // Save your message
        DO_MSG_SERIES = True // tell the main loop to make a series of message
    End
cmdret
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
I Don't know why you still don't know how to construct/assemble a proper script workflow even though I already showed you many script examples with comments of its explanations from your past topics.


Anyway, I can't code it properly since I am using a phone with no Sanny Builder Database(New Phone). The assembly of the code is like this:
PHP:
{$CLEO}
0000:

repeat
    wait 0
until 0AFA:  is_samp_available

const
    MYMESSAGE = 31@
    CMDMESSAGE = 30@
    DO_MSG_SERIES = 29@
    HUMANCHATDELAY = 500 // period to wait for each say in chat. Change this if you want to send message faster/slower
end
alloc MYMESSAGE 300 // now 31@ can handle up to 299 characters sized string
alloc CMDMESSAGE 300 // now 30@ can handle up to 299 characters sized string

0B34: samp register_client_command "sell" to_label @cmdhook

0AF8: samp add_message_to_chat "ad text" color 0xFF00FFFFF

while true
    wait 0
    If DO_MSG_SERIES == true
    Then
        0AD3: CMDMESSAGE = format "/c %s " MYMESSAGE // construct the CMD Message
        Say CMDMESSAGE
        Wait HUMANCHATDELAY
        0AD3: CMDMESSAGE = format "/c %s " MYMESSAGE // construct the CMD Message
        Say CMDMESSAGE
        Wait HUMANCHATDELAY
        0AD3: CMDMESSAGE = format "/c %s " MYMESSAGE // construct the CMD Message
        Say CMDMESSAGE
        Wait HUMANCHATDELAY
        0AD3: CMDMESSAGE = format "/c %s " MYMESSAGE // construct the CMD Message
        Say CMDMESSAGE
        DO_MSG_SERIES = false // turn off the message series
    end
end

:cmdhook
    0B35: samp 0@ = get_last_command_params
    If 0@ > 0
    Then
        0AD3: MYMESSAGE = format 0@ // Save your message
        DO_MSG_SERIES = True // tell the main loop to make a series of message
    End
cmdret

hello.
i tested it and got that :
idk how to asemble that since you are doing different codes. im not using that style so im 0 in that . Can i fix this in any way?

i typed /sell derrek is here

and see what i got in clan chat..
 

Attachments

  • 1631691919830.png
    1631691919830.png
    27.1 KB · Views: 22

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
Can i fix this in any way?

i typed /sell derrek is here

and see what i got in clan chat..

It seems like the script has an encoding problem. Make sure you have setup the proper sanny builder compiler setting's Case Converting into As Is. Follow this video if you are unsure.
 
Status
Not open for further replies.
Top