each time when ph recive packet from client/server script betwen "begin" and "end." executes.
be4 executing ph sets next global script variables.
var pck: string; - current packet. you can modify or simple drop it (pck := '';)
you can read values from it by calling readX functions.
also
pck[1] means 1st char in string (string = array of char).
pck[1] = id of packet
#$48 (char with 48 scancode in hex)
= #72 (char with 72 scancode dec)
= chr(72) = id of ValidatePosition packet
const fromserver, fromclient :boolean; //dirrection of current packet (true/false)
const ConnectName :string; //name of the connection (character name)
const ConnectID : integer; //id of connection.
var buf:string; as default its contain zerro string.
this variable contains writeX function result.
it's will be sended to client/server by calling sendto functions.
there
a thread in the forum about build in ph functions. (its in russian)
also. you can see it by pressink ctrl+space in code editor.