One way to do it is by monitoring both Outcoming(Uploading) RPCs and Packets:
PHP:
{$CLEO}
0000:
const
SYNCSTATE = 31@
end
repeat
wait 0
until 0AFA: is_samp_available
SYNCSTATE = true
0B34: samp register_client_command "tsync" to_label @togglesync
0BE1: raknet setup_outcoming_rpc_hook @syncmanager
0BE2: raknet setup_outcoming_packet_hook @syncmanager
0BDE: pause_thread 0
:togglesync
0B19: SYNCSTATE ^= true
if SYNCSTATE == true
then 0AF8: samp add_message_to_chat "UpSync: Enabled!" color 0xFF00FF00
else 0AF8: samp add_message_to_chat "UpSync: Disabled!" color 0xFFFF0000
end
0B43: samp cmd_ret
:syncmanager
0BE0: raknet hook_ret SYNCSTATE
Type
/tsync to toggle Sending RPCs and Packets.
Simple high quality and to the point code, always nice to see, a lot to learn from this.
Also, have you ever had problems with declaring constants before waiting for samp to load?
It's kind of a silly question because the constants should be tied to the script and not interfere, but none the less, at some point I was working on a code with some more constants declared some to variables some to constants, and the game used to crash.
After I moved the 'const end' after 'repeat until samp loaded' it stopped crashing.