0x32789
Expert
I'm trying to take the raw text out of game text using RPCs, I've readed all of the parameters (D[font=arial, sans, sans-serif]WORD style, DWORD time, DWORD strLen, char[] msg) as shown here: https://docs.google.com/spreadsheets/d/1iIxEk7yR8r7ZLGiSAL4ndtz_N1k0p3Wt7TE5bei6ztU/[/font]
Now I think my problem is with the char[] msg param, I'm trying to read an array as its a char array and then removing the null character at the end of the message but when I try to print it as 0AF8: it gives nothing, Its like:
"GameText: "
Its just a space, I tried to go in different server with different gametext, same thing. I wonder whats wrong?
This is my code, I took some help from SF tutorials and examples.
@springfield
@0x688
@and all the other pros
Now I think my problem is with the char[] msg param, I'm trying to read an array as its a char array and then removing the null character at the end of the message but when I try to print it as 0AF8: it gives nothing, Its like:
"GameText: "
Its just a space, I tried to go in different server with different gametext, same thing. I wonder whats wrong?
This is my code, I took some help from SF tutorials and examples.
Code:
:IncomingRPC
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if and
0@ == RPC_SCRDISPLAYGAMETEXT // GameText
31@ == 1
then
0BE5: raknet 1@ = get_hook_param PARAM_BITSTREAM
0BE7: raknet -1 = bit_stream_read 1@ type BS_TYPE_INT
0BE7: raknet -1 = bit_stream_read 1@ type BS_TYPE_INT
0BE7: raknet 2@ = bit_stream_read 1@ type BS_TYPE_BYTE
0AC8: 3@ = allocate_memory_size 32
0BE8: raknet bit_stream 1@ read_array 3@ size 2@
0C1E: array 3@ element 2@ el_size 1 = 0
0AF8: samp add_message_to_chat "GameText Got: %s" color -1 params 3@
0AC9: free_allocated_memory 3@
end
0BE0: raknet hook_ret true
@0x688
@and all the other pros