Advertisement
Zupalicious

trade

Jun 2nd, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1.  
  2.  
  3. r_interrupt = false;
  4.  
  5. r_doLoop = true;
  6. _started = false;
  7. _finished = false;
  8.  
  9.  
  10. //////////////
  11.  
  12. _position = getPos player; // gets the position [x,y,z]
  13. _posX = _position select 0; // 1th element -> x
  14. _posY = _position select 1; // 2nd element -> y
  15.  
  16. _counter = 0.0; // animation duration checker
  17.  
  18. while {r_doLoop} do {
  19. _positionCheck = getPos player;
  20. _newX = _positionCheck select 0; // 1th element -> x
  21. _newY = _positionCheck select 1; // 2nd element -> y
  22.  
  23. _counter = _counter + 0.1; // same as the sleep timer: 0.1 sec
  24.  
  25. if (_counter > 1.5) then { // amount of secs the animation takes estimated ? 2 secs?
  26. r_doLoop = false;
  27. _counter = 0.0;
  28. _finished = true;
  29.  
  30. };
  31. if (_newX != _posX || _newY != _posY) then {
  32.  
  33. r_doLoop = false;
  34. };
  35. sleep 0.1;
  36. };
  37. r_doLoop = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement