PDA

View Full Version : Streamer smooth MoveDObject


RakeDW
28/11/2016, 07:08 PM
Hi, I have problem with smooth moving object. Here is my code:
CMD:operate(playerid, params[]) {
if (sscanf(params, "d", params[0])) return 1;
if (params[0] == 1) {
for(new i = 0; i < sizeof wwin; i ++) {
if (IsValidDynamicObject(wwin[i]))
MoveDynamicObject(wwin[i], pravapoz[i][0], pravapoz[i][1], pravapoz[i][2], random(10000), pravapoz[i][3], pravapoz[i][4], pravapoz[i][5]);
}
}
else {
for(new i = 0; i < sizeof wwin; i ++) {
new Float: x,
Float: y,
Float: z,
Float: rx,
Float: ry,
Float: rz;

GetDynamicObjectPos(wwin[i], x, y, z);
GetDynamicObjectRot(wwin[i], rx, ry, rz);

pravapoz[i][0] = x;
pravapoz[i][1] = y;
pravapoz[i][2] = z;
pravapoz[i][3] = rx;
pravapoz[i][4] = ry;
pravapoz[i][5] = rz;

SetDynamicObjectPos(wwin[i], x+random(15), y+random(15), z+random(15));
SetDynamicObjectRot(wwin[i], rx+random(15), ry+random(15), rz+random(15));
}
}
return 1;
}

When I type /operate 0 than /operate 1 it automatically set my object pos. Same without "random(10000)" -> 10000.0