Page 1 of 1

0x21 Packet

Posted: Mon Feb 21, 2011 10:35 am
by RusseL
i wanna hook move rejection packet 0x21
if character cmdlevel > 1 - little freewalk system for staff
but i don't know how i can disable this packet. if character = staffmember - server should not send 0x21

Code: Select all

Packet 0x21
{
  Length 8
  SendFunction movehook:movehook
}

Code: Select all

exported function movehook(who, byref pkt)

if (who.cmdlevel > 1)
    return 1;
else
    return 0;
endif

endfunction
isn't work for me

Re: 0x21 Packet

Posted: Mon Feb 21, 2011 10:37 am
by RusseL

Code: Select all

exported function movehook(who, byref pkt)
 
if (who.cmdlevel > 1)
    var newpacket := CreatePacket( 0x22, 3);
    newpacket.SetInt8(1, pkt.GetInt8(1));
    newpacket.SendPacket( who );
    return 1;
endif
it looks great with this code, but only in client...
server thinks that character still staying for the wall )

Re: 0x21 Packet

Posted: Mon Feb 21, 2011 2:08 pm
by Turley
Never ever hook a pkt involved in movement stuff. Just a little performance advise.:) ok back to your question of cause this will work only work for clients and not for the server. The pkt is just a response after some intern stuff. With a pkthook you cannot tell the server that you changed something. You only interface is the pushthrough hook or walkonscript