[SNIPPET] Sync Car with Packets

Wanna make a iTroll mod without using "put_actor_in_car"? Wanna make Car Teleport hacks so everyone can see it? Here you go:


Code:
const
PACKET_VEHICLE_SYNC = 219
BS_TYPE_BYTE = 0
BS_TYPE_ARRAY = 5
end

//0AB1: @SYNC_VEHICLE 1 HANDLE 0@
:SYNC_VEHICLE
IF
0B2C: 1@ = get_vehicle_id_by_car_handle 0@
THEN  
    0AC8: 31@ = allocate_memory_size 63 // struct stInCarData ( size = 63 )
    0C0D: struct 31@ offset 0 size 2 = 1@ // sVehicleID;
    0C0D: struct 31@ offset 2 size 2 = 0 // sLeftRightKeys; 
    0C0D: struct 31@ offset 4 size 2 = 0 // sUpDownKeys;
    0C0D: struct 31@ offset 6 size 2 = 0 // sKeys;        
    0A97: 17@ = car 0@ struct  
    17@ += 0x14
    0A8D: 17@ = read_memory 17@ size 4 virtual_protect 0
    0AB1: call_scm_func @Quaternion_get 1 matrix_pointer 17@ Quat_x 18@ Quat_y 19@ Quat_z 20@ Quat_w 21@        
    0C0D: struct 31@ offset 8  size 4   = 18@
    0C0D: struct 31@ offset 12 size 4   = 19@
    0C0D: struct 31@ offset 16 size 4   = 20@
    0C0D: struct 31@ offset 20 size 4   = 21@ 
    0407: store_coords_to 24@ 23@ 22@ from_car 0@ with_offset 0.0 0.0 0.0
    0C0D: struct 31@ offset 24 size 4   = 24@
    0C0D: struct 31@ offset 28 size 4   = 23@
    0C0D: struct 31@ offset 32 size 4   = 22@    
    0A97: 22@ = car 0@ struct
    22@ += 68   //Snippet by OpcodeXe
    0A8D: 21@ = read_memory 22@ size 4 virtual_protect 0
    22@ += 0x4
    0A8D: 20@ = read_memory 22@ size 4 virtual_protect 0
    22@ += 0x4
    0A8D: 19@ = read_memory 22@ size 4 virtual_protect 0
    0C0D: struct 31@ offset 36  size 4   = 21@
    0C0D: struct 31@ offset 40  size 4   = 20@
    0C0D: struct 31@ offset 44  size 4   = 19@    
    0227: 18@ = car 0@ health
    0093: 17@ = integer 18@ to_float    
    0C0D: struct 31@ offset 48  size 4   = 17@  // car hp
    0226: 17@ = actor $PLAYER_ACTOR health
    0C0D: struct 31@ offset 52  size 1   = 17@   // PLAYER
    04DD: 16@ = actor $PLAYER_ACTOR armour
    0C0D: struct 31@ offset 53  size 1   = 16@   // ARMOUR
    0C0D: struct 31@ offset 54  size 1   = 0   // weapon    
    0C0D: struct 31@ offset 55  size 1   = 0   // siren
    0C0D: struct 31@ offset 56  size 1   = 0   
    0C0D: struct 31@ offset 57  size 2   = 0   
    0C0D: struct 31@ offset 59  size 4   = 0.0 // train speed    
    0B3D: raknet 29@ = new_bit_stream
    0B40: raknet bit_stream 29@ write PACKET_VEHICLE_SYNC type BS_TYPE_BYTE size 1
    0B40: raknet bit_stream 29@ write 31@ type BS_TYPE_ARRAY size 63
    0B8B: raknet send bit_stream 29@
    0B3E: raknet delete_bit_stream 29@
    0AC9: free_allocated_memory 31@
END
0AB2: 0


:Quaternion_get 
0C0C: 1@ = struct 0@ offset 0 size 4
0C0C: 2@ = struct 0@ offset 4 size 4
0C0C: 3@ = struct 0@ offset 8 size 4
0C0C: 4@ = struct 0@ offset 16 size 4
0C0C: 5@ = struct 0@ offset 20 size 4
0C0C: 6@ = struct 0@ offset 24 size 4
0C0C: 7@ = struct 0@ offset 32 size 4
0C0C: 8@ = struct 0@ offset 36 size 4
0C0C: 9@ = struct 0@ offset 40 size 4
 
005B: 10@ = 1@
005B: 10@ += 5@
005B: 10@ += 9@
 
if 0021: 10@ > 0.0
then
0007: 0@ = 0.5
000B: 10@ += 1.0
01FB: sqrt 10@ store_to 10@
0073: 0@ /= 10@  //s
0007: 15@ = 0.25
0073: 15@ /= 0@ //w
005B: 16@ = 8@  //x
0063: 16@ -= 6@
006B: 16@ *= 0@
005B: 17@ = 3@  //y
0063: 17@ -= 7@
006B: 17@ *= 0@
005B: 18@ = 4@  //z
0063: 18@ -= 2@
006B: 18@ *= 0@
else if and
    0025: 1@ > 5@
    0025: 1@ > 9@
    then
    0007: 0@ = 2.0
    0007: 10@ = 1.0
    005B: 10@ += 1@
    0063: 10@ -= 5@
    0063: 10@ -= 9@
    01FB: sqrt 10@ store_to 10@
    006B: 0@ *= 10@ //s
    005B: 15@ = 8@ //w
    0063: 15@ -= 6@
    0073: 15@ /= 0@
    0007: 16@ = 0.25 //x
    006B: 16@ *= 0@
    005B: 17@ = 2@
    005B: 17@ += 4@
    0073: 17@ /= 0@
    005B: 18@ = 3@
    005B: 18@ += 7@
    0073: 18@ /= 0@
    else if 0025: 5@ > 9@
        then
        0007: 0@ = 2.0
        0007: 10@ = 1.0
        005B: 10@ += 5@
        0063: 10@ -= 1@
        0063: 10@ -= 9@
        01FB: sqrt 10@ store_to 10@
        006B: 0@ *= 10@ //s
        005B: 15@ = 3@ //w
        0063: 15@ -= 7@
        0073: 15@ /= 0@
        005B: 16@ = 2@ //x
        005B: 16@ += 4@
        0073: 16@ /= 0@
        0007: 17@ = 0.25 //y
        006B: 17@ *= 0@
        005B: 18@ = 6@  //z
        005B: 18@ += 8@
        0073: 18@ /= 0@
        else
        0007: 0@ = 2.0
        0007: 10@ = 1.0
        005B: 10@ += 9@
        0063: 10@ -= 1@
        0063: 10@ -= 5@
        01FB: sqrt 10@ store_to 10@
        006B: 0@ *= 10@ //s
        005B: 15@ = 4@ //w
        0063: 15@ -= 2@
        0073: 15@ /= 0@
        005B: 16@ = 3@ //x
        005B: 16@ += 7@
        0073: 16@ /= 0@
        005B: 17@ = 6@  //y
        005B: 17@ += 8@
        0073: 17@ /= 0@
        0007: 18@ = 0.25 //z
        006B: 18@ *= 0@
        end
    end
end           
0AB2: ret 4 15@ 16@ 17@ 18@
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Re: Sync Car with Packets

Does it kick the driver out?
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
Re: Sync Car with Packets

TH3RM4L link said:
Does it kick the driver out?

If you troll someones car onfoot, YES.

If you're inside a car and troll another one, NO.


Its just like Put_actor_in_car just with packets^^
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
Re: Sync Car with Packets

Hidend link said:
Is like pizdarvanka?

What?  :no:

This has NOTHING to do with pizdarvanka.
Maybe only the style: In your view = nothing; others = see u in a car.
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Re: Sync Car with Packets

    0B40: raknet bit_stream 29@ write PACKET_VEHICLE_SYNC type BS_TYPE_BYTE size 1
    0B40: raknet bit_stream 29@ write 31@ type BS_TYPE_ARRAY size 63
Shouldn't those words be numbers?
 

DzkAy

Well-known member
Joined
Feb 20, 2014
Messages
472
Reaction score
1
Re: Sync Car with Packets

Can we do something to get the specify vehicle ? I mean closest , selected , etc. .. vehicle ?
0@ in this case mean the vehicle handle of what ? closest ?
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
Re: Sync Car with Packets

D.Kay link said:
Can we do something to get the specify vehicle ? I mean closest , selected , etc. .. vehicle ?
0@ in this case mean the vehicle handle of what ? closest ?

Do you even CLEO?

You get the car handle by yourself...
 

DzkAy

Well-known member
Joined
Feb 20, 2014
Messages
472
Reaction score
1
Re: Sync Car with Packets

Opcode.eXe link said:
Do you even CLEO?

You get the car handle by yourself...
aw ok , i get it , i thought it get the car handle itself..
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
Re: Sync Car with Packets

Opcode.eXe link said:
What?  :no:

This has NOTHING to do with pizdarvanka.
Maybe only the style: In your view = nothing; others = see u in a car.
Ooooh, now i understand
 

m1zg4rd_PL

Well-known member
Joined
Jul 19, 2013
Messages
222
Reaction score
0
Re: Sync Car with Packets

I wonder if it could be possible to fix kicking victim from his car and burn it etc.  :computer_guy:
Maybe if we put actor in that car as passenger first and then do the magic, victim will stay in car?
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
Re: Sync Car with Packets

m1zg4rd link said:
I wonder if it could be possible to fix kicking victim from his car and burn it etc.  :computer_guy:
Maybe if we put actor in that car as passenger first and then do the magic, victim will stay in car?

Its possible. There's an Passenger Sync Packet. We just have to first send the passanger sync, then driver sync. I dont wanna make a passenger sync function now: i dont need it^^
 

verkov

Member
Joined
May 19, 2014
Messages
17
Reaction score
0
Re: Sync Car with Packets

I made a cleo script that controls a player's vehicle (actually it was a script from TH3RMAL, I just removed and add some codes to it. So, I thank you very much TH3RMAL. :stoned:) and if the driver get outs of his car because he/she can't control it, then he/she and the other players will see the vehicle still move but no driver. It's like an invisible driver cleo, but you must also be in a car. It was really more fun with a bike than a car  :trollface:

It was really fun because the admins can't ban me because they don't know who the hell is driver it and when they spec me, they see me driving another car. But the problem is that when I get too far other players can then see me :(

But now I stopped scripting and playing gta samp because of school  :eek:key:
 

MaryKate

Active member
Joined
Feb 7, 2014
Messages
28
Reaction score
0
Re: Sync Car with Packets

Whenever i try to compile i get the error message

"Not enough actual parameters. Expected 4 params."

for the line

Code:
0B40: raknet bit_stream 29@ write PACKET_VEHICLE_SYNC type BS_TYPE_BYTE size 1

anyone know how i fix that?
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Re: Sync Car with Packets

Steezus link said:
Whenever i try to compile i get the error message

"Not enough actual parameters. Expected 4 params."

for the line

Code:
0B40: raknet bit_stream 29@ write PACKET_VEHICLE_SYNC type BS_TYPE_BYTE size 1

anyone know how i fix that?

add in your script

Code:
const
PACKET_VEHICLE_SYNC = 219
BS_TYPE_BYTE = 0
BS_TYPE_ARRAY = 5
end

or just replace text with numbers
 
Top