Help with Car Fake Speed Sync (problem with delay in RP Server)

kSOSA

Новичок
Автор темы
10
1
Using the cleo everything works as it should be. I use it to avoid the speed limit that the RP server sets.

My problem is this: the code takes a while to pass throw the label, because when I activate the cleo, the speedometer shows 0 km (that's how i set it up)

screenshot_26-11-2019_20-44-28-891.png


When I accelerate it continues showing 0 km, but sometimes it shows the real speed at which I would go without the Cleo and again goes down to 0km.

screenshot_26-11-2019_20-44-35-749.png


0 km > 153 km > 0km again (for example)

screenshot_26-11-2019_20-44-28-891.png


When that change occurs, the server detects my speed and stops the car abruptly and failed to completely avoid the speed limit.

All possible help is welcome
I will look for ways to thank and reward those who help me with this little problem.
First of all, Thanks

Код:
:Fake
wait 0
if
10@ == 1
jf @Fake
if
Actor.Driving($PLAYER_ACTOR)
jf @Error
0@ = Actor.CurrentCar($PLAYER_ACTOR)
4@ = SAMP.GetSAMPVehicleIDByCarHandle(0@)
00AA: store_car 0@ position_to 1@ 2@ 3@
call @SendIncarFakeSpeedSync 4 1@ 2@ 3@ 4@  // 1@ 2@ 3@ are the positions and 4@ being the vehicle id
goto @Fake

:SendIncarFakeSpeedSync
4@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR)
4@ = SAMP.GetPlayerStruct(4@)
4@ += 170
0AC8: 5@ = allocate_memory_size 63
0C10: memcpy destination 5@ source 4@ size 63
0C0D: struct 5@ offset 36 size 4 = 0.0
0C0D: struct 5@ offset 40 size 4 = 0.0 // Speed multiplier (Speedometer shows 0 km)
0C0D: struct 5@ offset 44 size 4 = 0.0
0B3D: raknet 6@ = new_bit_stream
0B40: raknet bit_stream 6@ write 200 type 0 size 1
0B40: raknet bit_stream 6@ write 5@ type 5 size 63
0B42: raknet send bit_stream 6@ priority 1 reliability 7 ordering_channel 0
0B3E: raknet delete_bit_stream 6@
0AC9: free_allocated_memory 5@
0AB2: ret 0
 

Вложения

  • screenshot_26-11-2019_20-44-28-891.png
    screenshot_26-11-2019_20-44-28-891.png
    368 байт · Просмотры: 249
  • screenshot_26-11-2019_20-44-35-749.png
    screenshot_26-11-2019_20-44-35-749.png
    464 байт · Просмотры: 251
Последнее редактирование:

DarkP1xel

Сила воли наше всё.
BH Team
3,635
4,957
That's because you send data. When you send it the real one sends too. This is bad code. If you wanna make it a good one you need to install incoming packet hook on ID_PLAYER_SYNC and rewrite fMoveSpeed[3] offset.
 
  • Нравится
Реакции: kSOSA и Benya

kSOSA

Новичок
Автор темы
10
1
That's because you send data. When you send it the real one sends too. This is bad code. If you wanna make it a good one you need to install incoming packet hook on ID_PLAYER_SYNC and rewrite fMoveSpeed[3] offset.

I recently learned how to install outcoming packet, but I'm still learning and I dont' know how to rewrite offsets, could you help me with that? please

I found this, and it works, but when I accelerate the server kick me out and when I enter to the server again I spawn falling under the ground.

in others game view, when activating the cleo I disappear (I think that's why the server throws me out)

could someone check it out?

CLEO:
{$CLEO .cs}
{$INCLUDE SF}
0000: NOP


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY
0BE4: setup_incoming_packet_hook @CarHook

:CarHook
IF
0@ == true
THEN
    0BE5: raknet 31@ = get_hook_param 1
    IF
    31@ == 200 //PACKET_VEHICLE_SYNC
    THEN
        0BE5: 30@ = get_hook_param 0
        0AC8: 29@ = allocate_memory_size 64
        0BE8: bit_stream 30@ read_array 29@ size 64        
                     
        0C0C: 1@  = struct 29@ offset 0  size 1    //packetid
                         
        0C0C: 12@  = struct 29@ offset 36  size 4 // float fMoveSpeed[3]; + 36
        0C0C: 14@  = struct 29@ offset 40  size 4 // float fMoveSpeed[3]; + 36
        0C0C: 15@  = struct 29@ offset 44  size 4 // float fMoveSpeed[3]; + 36
         
        0C0D: struct 29@ offset 36  size 4 = 0  // float fMoveSpeed[3]; + 36
        0C0D: struct 29@ offset 40  size 4 = 0 // float fMoveSpeed[3]; + 36  
        0C0D: struct 29@ offset 44  size 4 = 0 // float fMoveSpeed[3]; + 36
                                 
        0BEA: raknet bit_stream 30@ reset_write_pointer
        0B40: raknet bit_stream 30@ write 29@ type 5 size 64        
        0AC9: free_allocated_memory 29@
    END
END
0BE0: raknet hook_ret 1
 
Последнее редактирование:

Похожие темы

  1. Ответы
    33
    Просмотры
    13K
  2. Ответы
    1
    Просмотры
    4K
    • Закрыта
    • Вопрос
    Ответы
    4
    Просмотры
    2K