[SNIPPET] Write in chat without SFUNCS (0AF8/0AF9)

Code:
const
SAMP_CHAT_INFO_OFFSET = 0x212A6C
SAMP_CHAT_INFO_OFFSET_R2 = 0x212AA4 

FUNC_ADDTOCHATWND = 0x7A4F0
FUNC_ADDTOCHATWND_R2 = 0x61AB0

FUNC_SAY = 0x4CA0
FUNC_SAY_R2 = 0x4C30
end

0AF9(SFUNCS) Sends a message in chat

Code:
//0AB1: @SAY 1 $text

:SAY
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += FUNC_SAY
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0


0AF8(SFUNCS) Add a message to chat(not synched)

Code:
//0AB1: @addMsgToChatWnd 2 $color $text

:addMsgToChatWnd
IF 0AA2: 2@ = "samp.dll"
THEN 
    0085: 3@ = 2@
    3@ += SAMP_CHAT_INFO_OFFSET
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += FUNC_ADDTOCHATWND    
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0

Simple example;
{$CLEO .cs}
0000:
wait 3000

const
SAMP_CHAT_INFO_OFFSET = 0x212A6C
SAMP_CHAT_INFO_OFFSET_R2 = 0x212AA4

FUNC_ADDTOCHATWND = 0x7A4F0
FUNC_ADDTOCHATWND_R2 = 0x61AB0

FUNC_SAY = 0x4CA0
FUNC_SAY_R2 = 0x4C30
end


alloc 0@ = 260
alloc 1@ = 260
format 0@ = "this is a {FF0000}green {FFFFFF}message"
format 1@ = "hellaw bla bla bla"


WHILE TRUE
WAIT 0   
    IF 0AB0: 49 //key 1
    THEN
        0AB1: @addMsgToChatWnd 2 0xFF00FF00 0@
    END
   
    IF 0AB0: 50 //key 2
    THEN
        0AB1: @SAY 1 1@
    END
END

:SAY
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += FUNC_SAY_R2
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0


:addMsgToChatWnd
IF 0AA2: 2@ = "samp.dll"
THEN
    0085: 3@ = 2@
    3@ += SAMP_CHAT_INFO_OFFSET_R2
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += FUNC_ADDTOCHATWND_R2 
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0
   
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,488
Reaction score
231
Location
( ͡° ͜ʖ ͡°)
Re: Write in chat without SFUNCS (0AF8/0AF9)

If you dont know howto add  params to addchatmessage:

    0AA2: 31@ = load_library "kernel32.dll" // IF and SET
    0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ // IF and SET
    0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
    0A8E: 1@ = 0@ + 0x212A6C // _cSampChatInfo
    0A8D: 2@ = read_memory 1@ size 4 virtual_protect 1 //_cSampChatInfo
    0A8E: 1@ = 0@ + 0x7A4F0 //addDebugMessage
    0AA5: call 1@ num_params 4 pop 4 params 64 48 "This text is created without SAMPFUNCS!: %d + %d" 2@ 
 

Grubitsh

Active member
Joined
Jul 28, 2014
Messages
104
Reaction score
0
Re: Write in chat without SFUNCS (0AF8/0AF9)

I don't understand how to use it. Could you help me ?


I tried to put it at the begining of my thread but I crash. I downloaded kernel32.

Help.
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: Write in chat without SFUNCS (0AF8/0AF9)

good job
 

PopandaulX

Active member
Joined
Jul 15, 2013
Messages
189
Reaction score
1
Re: Write in chat without SFUNCS (0AF8/0AF9)

Isn't easier to get sampBase with this?
0AA2: 0@ = load_library "samp.dll"
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Re: Write in chat without SFUNCS (0AF8/0AF9)

memory addresses for 0.3.7

Code:
const
SAMP_CHAT_INFO_OFFSET = 0x21A0E4
FUNC_ADDTOCHATWND = 0x64010
FUNC_SAY = 0x57F0
end
 

Fu$10N

Expert
Joined
Mar 5, 2014
Messages
1,101
Reaction score
10
Re: Write in chat without SFUNCS (0AF8/0AF9)

0B36 link said:
memory addresses for 0.3.7

Code:
const
SAMP_CHAT_INFO_OFFSET = 0x21A0E4
FUNC_ADDTOCHATWND = 0x64010
FUNC_SAY = 0x57F0
end
Thx :urtheman: Now I can finally update my auto_getmats.cs to 0.3.7.
 

ThewarII

Member
Joined
Mar 28, 2016
Messages
18
Reaction score
0
RE: Write in chat without SFUNCS (0AF8/0AF9)

0B36 said:
memory addresses for 0.3.7

Code:
const
SAMP_CHAT_INFO_OFFSET = 0x21A0E4
FUNC_ADDTOCHATWND = 0x64010
FUNC_SAY = 0x57F0
end

How can i run it ?
Code:
thread "ChatTest"
const
SAMP_CHAT_INFO_OFFSET = 0x21A0E4
SAMP_CHAT_INFO_OFFSET_R2 = 0x212AA4 

FUNC_ADDTOCHATWND = 0x64010
FUNC_ADDTOCHATWND_R2 = 0x61AB0

FUNC_SAY = 0x57F0
FUNC_SAY_R2 = 0x4C30
end
2@ = 0
:ChatTest_100
wait 10
if
  0ADC:   test_cheat "rr1" 
else_jump @ChatTest_100 
0AA2: 31@ = load_library "kernel32.dll" // IF and SET
    0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ // IF and SET
    0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
    0A8E: 1@ = 0@ + 0x212A6C // _cSampChatInfo
    0A8D: 2@ = read_memory 1@ size 4 virtual_protect 1 //_cSampChatInfo
    0A8E: 1@ = 0@ + 0x7A4F0 //addDebugMessage
    0AA5: call 1@ num_params 4 pop 4 params 64 48 "This text: %d + %d" 2@
    //0AA3: free_library 0@
wait 500 
jump @ChatTest_100
i got crashed in game with this code. (key is rr1)
i want it can run without SAMPFUNCS
is 2@ send in chatbox ?
Can i read something in ini file then save in 2@ and use this code for send ?


How can i show a text i want with it ?

Code:
    0AA2: 0@ = load_library "samp.dll" 
    0085: 1@ = 0@ 
    1@ += 2203876 
    0A8D: 3@ = read_memory 1@ size 4 virtual_protect 1 
    0085: 2@ = 0@ 
    2@ += 409616
    0AA6: call_method 2@ struct 3@ num_params 5 pop 0 0 -4129023 0 "This text: %d" 8 // -4129023 is color or use {6 number hex} before a text and in Quotation marks.
    0AA3: free_library 0@

i have this code but i don't know how to send custom i want. I want send custom like read file ini & send in chatbox of samp.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.DL

Simple example .:
PHP:
{$CLEO .cs}
0000:

wait 10000 /// wait 10sec until samp is redy

const
SAMP_CHAT_INFO_OFFSET_03DL = 0x2ACA10
FUNC_ADDTOCHATWND_03DL = 0x67650
FUNC_SAY_03DL = 0x5860
FUNC_SEND_CMD_03DL = 0x69340
end

0AC8: 0@ = allocate_memory_size 260
0AD3: 0@ = format "Hi say"
0AC8: 1@ = allocate_memory_size 260
0AD3: 1@ = format "Hi chatmsg"
0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = format "/pm 21 hello"


WHILE TRUE
    WAIT 0
  
wait 60000  
0AB1: @SAY 1 text 0@
wait 60000
0AB1: @Chatmsg 2 color 0xFF00FF00 text 1@
wait 60000
0AB1: @SEND_CMD 1 text 2@
  
END

:SAY
//0AB1: @SAY 1 $text
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += FUNC_SAY_03DL
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0


:Chatmsg
//0AB1: @Chatmsg 2 $color $text
IF 0AA2: 2@ = "samp.dll"
THEN
    0085: 3@ = 2@
    3@ += SAMP_CHAT_INFO_OFFSET_03DL
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += FUNC_ADDTOCHATWND_03DL  
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0

:SEND_CMD
//0AB1: @SEND_CMD 1 $text
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += FUNC_SEND_CMD_03DL
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0

Snippets.:
PHP:
:SAY
//0AB1: @SAY 1 $text
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += FUNC_SAY_03DL
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0


:Chatmsg
//0AB1: @Chatmsg 2 $color $text
IF 0AA2: 2@ = "samp.dll"
THEN
    0085: 3@ = 2@
    3@ += SAMP_CHAT_INFO_OFFSET_03DL
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += FUNC_ADDTOCHATWND_03DL 
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0

:SEND_CMD
//0AB1: @SEND_CMD 1 $text
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += FUNC_SEND_CMD_03DL
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0
 
Last edited:

veysileth

Active member
Joined
Mar 23, 2017
Messages
85
Reaction score
6
Now i can delete 100+ lines of code for virtualkey pushing for every letter.
Love ya.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.7 R3

Simple example .:
PHP:
{$CLEO .cs}
0000:

wait 10000 /// wait 10sec until samp is redy

const
SAMP_CHAT_INFO_OFFSET_037r3 = 0x26E8C8
FUNC_ADDTOCHATWND_037r3 = 0x67460
FUNC_SAY_037r3 = 0x5820
FUNC_SEND_CMD_037r3 = 0x69190
end

0AC8: 0@ = allocate_memory_size 260
0AD3: 0@ = format "Hi say"
0AC8: 1@ = allocate_memory_size 260
0AD3: 1@ = format "Hi chatmsg"
0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = format "/pm 21 hello"


WHILE TRUE
    WAIT 0
  
if
0ab0: 90 // Z
then
    0AB1: @SAY 1 text 0@
end
if
0ab0: 76 // L
then
    0AB1: @Chatmsg 2 color 0xFF00FF00 text 1@
end

if
0ab0: 76 // L
then
    0AB1: @SEND_CMD 1 text 2@
end
  
END

:SAY
{
    0AB1: @SAY 1 $text
    0.3.7 - R3
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += FUNC_SAY_037r3
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0


:Chatmsg
{
    0AB1: @Chatmsg 2 $color $text
    0.3.7 - R3
}
IF 0AA2: 2@ = "samp.dll"
THEN
    0085: 3@ = 2@
    3@ += SAMP_CHAT_INFO_OFFSET_037r3
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += FUNC_ADDTOCHATWND_037r3  
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0

:SEND_CMD
{
    0AB1: @SEND_CMD 1 $text
    0.3.7 - R3
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += FUNC_SEND_CMD_037r3
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.7 R4

Simple example .:
PHP:
{$CLEO .cs}

0000:

wait 8500 // wait until samp is redy

0AC8: 0@ = allocate_memory_size 260
0AD3: 0@ = format "Hi say"
0AC8: 1@ = allocate_memory_size 260
0AD3: 1@ = format "Hi chatmsg"
0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = format "/pm 21 hello"


WHILE TRUE
    WAIT 0

if
0ab0: 90 // Z
then
    0AB1: @SAY 1 text 0@
end

if
0ab0: 49 // 1
then
    0AB1: @Chatmsg 2 color 0xFF00FF00 text 1@
end

if
0ab0: 76 // L
then
    0AB1: @SEND_CMD 1 text 2@
end

END

:SAY
{
    0AB1: @SAY 1 $text
    0.3.7 - R3
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x5A00
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0


:Chatmsg
{
    0AB1: @Chatmsg 2 $color $text
    0.3.7 - R4
}
IF 0AA2: 2@ = "samp.dll"
THEN
    0085: 3@ = 2@
    3@ += 0x26E9F8
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += 0x67BA0
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0

:SEND_CMD
{
    0AB1: @SEND_CMD 1 $text
    0.3.7 - R4
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x698C0
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0
 
Last edited:

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
0.3.7 R4 - v2
PHP:
:SEND_CMD
{
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "/cmds"
    0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
}
IF 0AA2: 2@ = "samp.dll"
THEN
    IF NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN     
            0A8E: 3@ = 2@ + 0x65C60
            0AA5: call 3@ num_param 1 pop 0 1@
        END
        
        IF 0@ == 2 // 0.3.7 R2
        THEN     
            0A8E: 3@ = 2@ + 0x65D30
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 3 // 0.3.DL
        THEN     
            0A8E: 3@ = 2@ + 0x69340
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 4 // 0.3.7 R3
        THEN      
            0A8E: 3@ = 2@ + 0x69190
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 5 // 0.3.7 R4
        THEN     
            0A8E: 3@ = 2@ + 0x698C0
            0AA5: call 3@ num_param 1 pop 0 1@
        END
        
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN     
            0A8E: 3@ = 2@ + 0x69900
            0AA5: call 3@ num_param 1 pop 0 1@
        END        
    END
END
0AB2: 0
Example
PHP:
{$CLEO}
0000:

WHILE TRUE
WAIT 0

IF AND
0AB0:   is_key_pressed 79 {O}
0AB0:   is_key_pressed 80 {P}
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 0@
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "/cmds"
    0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
    WAIT 137
END

END

: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@
 
Top