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
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