Help Local Animation

UnknownGrl

New member
Joined
Nov 3, 2018
Messages
4
Reaction score
0
Location
Rusia
This cleo does a "piss" animation while you hold down the "R" key. Is it possible to make it only visible locally?
Code:
{$CLEO .cs}

nop

:Noname_2
wait 0
0AFA:
goto_if_false @Noname_2
wait 0
if and
  is_key_pressed 82
8B8C:   not
goto_if_false -66
0AFD:
hex
 04 44
end

:Noname_40
  is_key_pressed 82
goto_if_false @Noname_62
wait 0
goto @Noname_40

:Noname_62
0AFD:
hex
 04 00 02 00 01 F1 FF FF FF
end
 

Expl01T3R

Active member
Joined
Nov 20, 2022
Messages
81
Reaction score
9
Location
Czech Republic
My solution would be:
1. HOOK OUTGOING PACKET
2. Catch ID_PLAYER_SYNC
3. Read packet
4. if (packet.cur_anim == piss && holding_key(r)) packet.cur_anim = 0
5. Rewrite with modified value
6. Send

Should work.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,165
Solutions
6
Reaction score
895
Location
Lithuania
This code will make " Piss " animation visible only for you..
You Must Have SAMPFUNCS.asi

PHP:
{$CLEO .cs}
{$INCLUDE SF}

0000:

REPEAT
WAIT 0
UNTIL 0AFA:

0BE2: raknet setup_outcoming_packet_hook @Out_Packets

WHILE TRUE
WAIT 0
END

:Out_Packets
0BE5: raknet 10@ = get_hook_param PARAM_PACKETID
IF 10@ == PACKET_PLAYER_SYNC // PACKET_PLAYER_SYNC = 207
THEN
    0BE5: 30@ = get_hook_param PARAM_BITSTREAM
    0AC8: 29@ = allocate_memory_size 69
    0BE8: bit_stream 30@ read_array 29@ size 69
    
    // uint8_t byteSpecialAction ; + 37 
    0C0C: 6@ = struct 29@ offset 38 size 1
    IF 6@ == 68 // SPECIAL_ACTION_PISSING 
    THEN 0C0D: struct 29@ offset 38 size 1 = 0 
    END
    // uint16_t iCurrentAnimationID ; + 64      
    0C0C: 0@ = struct 29@ offset 65 size 2 
    IF OR 
    0@ == 983 // piss in 
    0@ == 984 // piss loop
    0@ == 985 // piss out
    THEN 0C0D: struct 29@ offset 65 size 2 = 0  
    END 
    0BEA: raknet bit_stream 30@ reset_write_pointer
    0B40: raknet bit_stream 30@ write 29@ type BS_TYPE_ARRAY size 69         
    0AC9: free_allocated_memory 29@  
END
0BE0: raknet hook_ret true
 

Attachments

  • LocalPiss.cs
    18.4 KB · Views: 7
Top