CLEO Help RPC

CLEO related
Status
Not open for further replies.

Kelsi235

Active member
Joined
Jun 2, 2019
Messages
53
Reaction score
4
Any1 knows why not all packets trigger the hook?
Code:
0BE3: raknet setup_incoming_rpc_hook @hook

hook:
0BE5: raknet 28@ = get_hook_param PARAM_PACKETID
format 26@ "%d" 28@
0AF8: samp add_message_to_chat 26@

I never see any RPC_ScrShowDialog ( 61 ) even after I join the server and register

https://hastebin.com/medumeqajo.makefile < chatlog
 

cheetahftw1

Active member
Joined
Aug 31, 2018
Messages
39
Reaction score
0
Why you need a RPC for dialogs when you can do it simple with opcodes.
Try:

while true
wait 0

if SAMP.IsDialogActive(-1)
then
0B4E: samp 1@ = get_current_dialog_id
log "Dialog id %d" 1@ //SF console
wait 1000
end
END
 

Kelsi235

Active member
Joined
Jun 2, 2019
Messages
53
Reaction score
4
Why you need a RPC for dialogs when you can do it simple with opcodes.
Try:

while true
wait 0

if SAMP.IsDialogActive(-1)
then
0B4E: samp 1@ = get_current_dialog_id
log "Dialog id %d" 1@ //SF console
wait 1000
end
END
Yea I know but I'd like to hook so I can instantly hide the dialog and send a button press
 

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
I tried the same server as you did with the code below, and I managed to catch the RPC everytime.

Try my code:
PHP:
{$CLEO}
{$INCLUDE SF}
0000: NOP

repeat
wait 50
until 0AFA:

0BE3: raknet setup_incoming_rpc_hook @in_rpc

while true
wait 0
end

:in_rpc
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if
    0@ == RPC_ScrShowDialog
then
alloc 1@ 256
    0BF8: raknet 1@ = get_rpc_name 0@
    0AF8: "%s" -1 1@
    free 1@
end 
0BE0: raknet hook_ret true
 
Status
Not open for further replies.
Top