SA-MP Forums Archive
Return the object back - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Return the object back (/showthread.php?tid=107118)



Return the object back - worms0 - 08.11.2009

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);




Re: Return the object back - Peter_Corneile - 08.11.2009

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;
   }



Re: Return the object back - Kurence - 08.11.2009

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;
}



Re: Return the object back - worms0 - 08.11.2009

object can not be returned = (

warning 215: expression has no effect

actualpos == 0; on this, he warns




Re: Return the object back - MenaceX^ - 08.11.2009

[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;



Re: Return the object back - Kurence - 08.11.2009

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