Return the object back
#1

I've made an object that is moving, but back to the original location is not returned, help me how to return him to reproduce all over again and again ...

new 1;
1 = CreateStreamedObject(354, 1840.1729,568.8357,25.3803,0,0,0);
MoveStreamedObject(1,1840.1729,568.8357,1.3803, 1.5);

Reply
#2

pawn Код:
if(strcmp("/open",cmdtext,true,5) == 0)
  {
   MoveStreamedObject(1,1840.1729,568.8357,1.3803, 1.5);
   return 1;
   }

if(strcmp("/close",cmdtext,true,6) == 0)
  {
   MoveStreamedObject(1,1840.1729,568.8357,25.3803, 1.5);
   return 1;
   }
Reply
#3

This may be moving him without commands
Код:
new actualpos = 1;
new object1; // i don't recommend to use number as variable i used object1
object1 = CreateStreamedObject(354, 1840.1729,568.8357,25.3803,0,0,0); 
MoveStreamedObject(object1,1840.1729,568.8357,1.3803, 1.5);
public OnObjectMoved(objectid){
if(objectid == object1){
if(actualpos == 1 ){
actualpos == 0;
MoveObject(object1,1840.1729,568.8357,25.3803,1.5);
}
else{
actualpos = 1;
MoveObject(object1,1840.1729,568.8357,1.3803, 1.5);
}
}
return 1;
}
Reply
#4

object can not be returned = (

warning 215: expression has no effect

actualpos == 0; on this, he warns

Reply
#5

[quote=worms0 ]
object can not be returned = (

warning 215: expression has no effect

actualpos == 0; on this, he warns


pawn Код:
// It's not an if statement...
actualpos = 0;
Reply
#6

Quote:
Originally Posted by worms0
object can not be returned = (

warning 215: expression has no effect

actualpos == 0; on this, he warns

Yes there must be only 1 "="
I m making that mistake every day
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)