Enter in interior animation
#1

Is it possible to enter/ exit from interior with animation like in singleplayer?
How is it possible?
Can you give me code example?
Thanks, +1 REP!
Reply
#2

Depends what you want to do exactly. You can create a door object, along with a pickup marker (looks like yellow icon). When they pick up the pick up, you can apply the animation (whichever is used) and rotate the object accordingly. If you use the streamer plugin, you can use extra IDs to better manage pick up IDs. You can also set their position on OnObjectMoved directly, time it with the speed param.

Using extra ID arrays, you could also have: pickup type (use this for different pickup functions: money pickups, these, etc), an extra type (is it an entrance, or an exit?), the ID in relation to however it is stored).

Quick example using two extra IDs solely:

Код:
public OnPlayerPickUpDynamicPickUp(playerid, pickupid)
{
       new extraid[2];
       Streamer_GetArrayData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, extraid[2], 2);
       
       if(extraid[0] == PICKUP_TYPE_ENTRANCE)
       {
               ApplyAnimation(playerid...
               MoveObject(EntranceDoors[extraid[1]]...
  
               PlayerEnteringEntrance[playerid] = extraid[1];
       }

       return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)