23.03.2015, 13:24
Hello SA-MPers
I recently discovered something strange happening with moving dynamic objects. When I try to move a dynamic object, it just floats away and dissapears after a few seconds. I cannot find anything wrong with my code, I even had someone else doublecheck it for me. Searching ****** and the forum had no results. My code is this. All the coordinates are correct.
Notice the debug text shown in the picture. Some very strange coordinates show up.
Has anyone seen this before? How do I fix this? Helpful comments are rewarded with reps.
I recently discovered something strange happening with moving dynamic objects. When I try to move a dynamic object, it just floats away and dissapears after a few seconds. I cannot find anything wrong with my code, I even had someone else doublecheck it for me. Searching ****** and the forum had no results. My code is this. All the coordinates are correct.
Код:
if(sMap[id][MAP_OBJECT_DB][ide] == m_objid) { if(sMoves[i][MOVE_CURPOS] == 0) { new Float:opos[3], m_debug[128]; GetDynamicObjectPos(sMap[id][MAP_OBJECT_ID][ide],opos[0],opos[1],opos[2]); format(m_debug,sizeof(m_debug),"FROM %f, %f, %f",opos[0],opos[1],opos[2]); SendClientMessageToAll(-1,m_debug); format(m_debug,sizeof(m_debug),"TO %f, %f, %f",sMoves[i][MOVE_NEWPOS][0], sMoves[i][MOVE_NEWPOS][1], sMoves[i][MOVE_NEWPOS][2]); SendClientMessageToAll(-1,m_debug); sMoves[i][MOVE_CURPOS] = 1; if(sMoves[i][MOVE_NEWPOS][3] == 0.0 && sMoves[i][MOVE_NEWPOS][4] == 0.0 && sMoves[i][MOVE_NEWPOS][5] == 0.0) SendClientMessageToAll(-1,"No rotation"), MoveDynamicObject(sMap[id][MAP_OBJECT_ID][ide], sMoves[i][MOVE_NEWPOS][0], sMoves[i][MOVE_NEWPOS][1], sMoves[i][MOVE_NEWPOS][2],sMoves[i][MOVESPEED]); else MoveDynamicObject(sMap[id][MAP_OBJECT_ID][ide], sMoves[i][MOVE_NEWPOS][0], sMoves[i][MOVE_NEWPOS][1], sMoves[i][MOVE_NEWPOS][2],sMoves[i][MOVESPEED],sMoves[i][MOVE_NEWPOS][3],sMoves[i][MOVE_NEWPOS][4],sMoves[i][MOVE_NEWPOS][5]); } else { sMoves[i][MOVE_CURPOS] = 0; if(sMoves[i][MOVE_OLDPOS][3] == 0.0 && sMoves[i][MOVE_OLDPOS][4] == 0.0 && sMoves[i][MOVE_OLDPOS][5] == 0.0) MoveDynamicObject(sMap[id][MAP_OBJECT_ID][ide], sMoves[i][MOVE_OLDPOS][0], sMoves[i][MOVE_OLDPOS][1], sMoves[i][MOVE_OLDPOS][2],sMoves[i][MOVESPEED]); else MoveDynamicObject(sMap[id][MAP_OBJECT_ID][ide], sMoves[i][MOVE_OLDPOS][0], sMoves[i][MOVE_OLDPOS][1], sMoves[i][MOVE_OLDPOS][2],sMoves[i][MOVESPEED],sMoves[i][MOVE_OLDPOS][3],sMoves[i][MOVE_OLDPOS][4],sMoves[i][MOVE_OLDPOS][5]); } return 1; }
Has anyone seen this before? How do I fix this? Helpful comments are rewarded with reps.