problem with noping packets

praiki

Новичок
Автор темы
19
0
CLEO:
call @NOPVehicleData 0

:NOPVehicleData
0BE2: raknet setup_outcoming_packet_hook @NOPVehicleData
0BE5: raknet 1@ = get_hook_param 1
IF
1@ == 200
THEN
0BE0: raknet hook_ret false
END
0BE0: raknet hook_ret true
0AB2: ret 0


this is my snippet, when i call it my game freezes and gaves me error warnings. what's the problem?
 

F11GAR0.

Потрачен
0
57
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
upload_2019-4-7_12-49-39.png
 

asdzxcjqwe

¯\_(ツ)_/¯
Друг
621
704
1) the 0BE2 opcode should be called right after the script is initialized (at the beginning of the code)
2) you don't have to call the label that is used for hooking

for example:
CLEO:
{$CLEO}
0000: NOP // we use this instead of 03A4
$nop = false // would it be enabled(true) or disabled(false) by default

// waiting for samp to be initialized
while not SAMP.Available()
    wait 0
end

0BE2: raknet setup_outcoming_packet_hook @hook
0B34: samp register_client_command "toggle" to_label @cmd_toggle
chatmsg "The script is initialized" -1 // just to be sure, you don't actually have to use it

// infinite loop
while true
    wait 0
    // a part of the code that is executing non-stop, it's never going to end unless a BREAK is called
end

:hook
0BE5: raknet 1@ = get_hook_param 1
if and
    1@ == 200
    $nop == true
then
    0BE0: raknet hook_ret false // if enabled, hook this
end
0BE0: raknet hook_ret true // if disabled, skip hooking

:cmd_toggle
0B12: $nop = $nop XOR 1
if $nop == true
then chatmsg "NOP \"Vehicle Data\" is turned {00dd00}on" -1
else chatmsg "NOP \"Vehicle Data\" is turned {dd0000}off" -1
end
SAMP.CmdRet()


see also these examples so you can completely make it out (these are decompiled scripts that use hooking as well)
 

Вложения

  • TrollSkin (decrypted).txt
    2.3 KB · Просмотры: 11
  • AutoAction (decrypted).txt
    5.1 KB · Просмотры: 6
  • new_train_bot (decrypted).txt
    4.6 KB · Просмотры: 5
  • TPNuBORP (decrypted).txt
    4.3 KB · Просмотры: 6
  • tpv (decrypted).txt
    18.9 KB · Просмотры: 8
Последнее редактирование:
  • Нравится
Реакции: praiki, atizoff и Snagg