ok hello
here is the thing- i am trying for alot of time to do the moving...but i cant
its bot mocing exacly to the place...but it moves
so i need your help making it currect...please?
here is the code for the moving:
please help me...its driving me crazy...i spent hours to solve it and i cant
please...help me to fix the code ^^? thanks
here is the thing- i am trying for alot of time to do the moving...but i cant
its bot mocing exacly to the place...but it moves
so i need your help making it currect...please?
here is the code for the moving:
PHP Code:
DWORD itemid,x,y;
memcpy((void*)&itemid,(void*)((DWORD)buf2+5),4);
memcpy((void*)&x,(void*)((DWORD)buf2+5+4),4);
memcpy((void*)&y,(void*)((DWORD)buf2+5+4+4),4);
int difx=x-Player[0].X;
int dify=y-Player[0].Y;
float range=(difx*difx+dify*dify)*1.0;
int timex=difx/20,timey=dify/20;
if(sqrt(range)<500000000.0&&sqrt(range)>-500000000.0)
{
if(difx<0)
{
for(int i=0;i>timex;i--)
{
SendPacket(0x15,"bbb",-20,0,0);
SendPacket(0x14,"bbb",-20,0,0);
}
}
if(difx>0)
{
for(int i=0;i<timex;i++)
{
SendPacket(0x15,"bbb",20,0,0);
SendPacket(0x14,"bbb",20,0,0);;
}
}
if(dify<0)
{
for(int i=0;i>timey;i--)
{
SendPacket(0x15,"bbb",0,-20,0);
SendPacket(0x14,"bbb",0,-20,0);
}
}
if(dify>0)
{
for(int i=0;i<timey;i++)
{
SendPacket(0x15,"bbb",0,20,0);
SendPacket(0x14,"bbb",0,20,0);
}
}
SendPacket(0x20,"ddd",itemid,x/32,y/32);
}
please...help me to fix the code ^^? thanks