SA-MP Forums Archive
moving objects - 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: moving objects (/showthread.php?tid=137611)



moving objects - Freddy Z - 29.03.2010

How can i do when a player stands on an object (or a platform), this object will go up just like a lift?


Re: moving objects - XRVX - 29.03.2010

https://sampwiki.blast.hk/wiki/MoveObject


Re: moving objects - aircombat - 29.03.2010

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/MoveObject


Re: moving objects - Freddy Z - 30.03.2010

is there a way to make the object go back once it gets there and create a sort of perpetual motion? i hope you know what i mean...


Re: moving objects - aircombat - 30.03.2010

here is the code (not proper)
if(IsPlayerInRangeOfPoint(etc....))
{
MoveObject(etc...); coords of opened
}
else
{
MoveObject(etc...); coords of closed
}


Re: moving objects - Freddy Z - 01.04.2010

// somewhere top of script

new obj;


// under OnGameModeInIt

obj = CreateObject(3115, 994.28308105469, 1051.5045166016, 48.017349243164, 0, 0, 0);
CreateObject(16093, 1006.2313232422, 1025.3850097656, 47, 0, 0, 0);

// under OnPlayerCommandText


if(!strcmp("/t",cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 5.0,1006.2313232422, 1025.3850097656, 47))

MoveObject(obj,994.28308105469, 1051.5045166016, 48.017349243164,15.0);
}
else
{
MoveObject(obj,978.1339,2299.8567,49.3317,5);
return 1;
}
return 0;
}




I get no errors, but when i go in the place where i want to type /t, the object doesn't move...




Re: moving objects - Rand_Omar - 01.04.2010

Copy & Replace:

pawn Код:
if(!strcmp("/t",cmdtext))
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0,1006.2313232422, 1025.3850097656, 47))
        {
            MoveObject(obj,994.28308105469, 1051.5045166016, 48.017349243164,15.0);
        }
        else
        {
            MoveObject(obj,978.1339,2299.8567,49.3317,5);
            return 1;
        }
    }



Re: moving objects - Freddy Z - 01.04.2010

It didn't work... i tryed to do something and i got this

pawn Код:
if(!strcmp("/activate",cmdtext))
{
  if(IsPlayerInRangeOfPoint(playerid,1, 1006.2309,1027.5194,48.1328))
  {
        PlayerPlaySound(playerid, 1020, 0.0, 0.0, 0.0);
        SendClientMessage(playerid,0x33AA33AA,"Platform will start moving in a few seconds");
        MoveObject(obj,994.28308105469, 1051.5045166016, 48.0, 15.00);
        }
        else
        {
        MoveObject(obj,994.28308105469, 1051.5045166016, 357.8299, 15.00);
       }
       return 1;
}

    return 0;
}

I get no errors when i compile, but when i press /activate, the object doesn't move.


If i reverse the coordinate like this

pawn Код:
MoveObject(obj,994.28308105469, 1051.5045166016, 357.8299, 15.00);
      }
      else
      {
      MoveObject(obj,994.28308105469, 1051.5045166016, 48.0, 15.00);

The object moves, but only for one time (this means it doesn't go down once it's gone up)


Re: moving objects - Freddy Z - 02.04.2010

Why does this happen? can you help me?