moving objects
#1

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

https://sampwiki.blast.hk/wiki/MoveObject
Reply
#3

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/MoveObject
Reply
#4

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...
Reply
#5

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

// 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...

Reply
#7

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;
        }
    }
Reply
#8

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)
Reply
#9

Why does this happen? can you help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)