dx = delta x
dy = delta y
vecx stands for vector x -- it's an array of 4 numbers (0,-1,0,1)
vecy stands for vector y -- also an array of 4 numbers (-1,0,1,0)
Now lets look at vecx(0).
... It would look inside the array (0,-1,0,1); and would grab the FIRST number, because all array's start at 0, not 1. So, vecx(0) would return '0'.
if it was vecx(1), it would return the 2nd number of the arra; which is -1... and so on and so forth...
Test script
NPC Code:
if (created) {
this.dir = 1; // change this number all you want, from 0-3.
setplayerprop #c,vecx: #v(vecx(this.dir)) -- vecy: #v(vecy(this.dir));
}