Buildings
#1

Hey Everyone, I was wondering if someone could tell me or show me how to make it so you walk up to a door and pop up in a interior and then be able to exit it also. Thanks!
Reply
#2

You can do that with 'checkpoints'.
Reply
#3

Test did it, with Check Point.
Reply
#4

Alright, can you give me a example?
Reply
#5

Quote:
Originally Posted by Tony1337
Alright, can you give me a example?
pawn Code:
public OnPlayerSpawn(playerid)
{
  SetPlayerCheckpoint(playerid, X, Y, Z, 3.0);
  return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
  SetPlayerPos(playerid,X,Y,Z);
  printf("Player %i is now at the building checkpoint!",playerid);
  if (IsPlayerInCheckpoint(playerid))
  {
  SetPlayerPos(playerid,X,Y,Z);
  }
  return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
  printf("Player %i have left a building checkpoint!",playerid);
  return 1;
}
Enjoy !
Reply
#6

Alright thanks you but there is 2 problems.
1) Once your in the building you can't exit.
2) I can only make one because it would just take me to the same place.

can I solve these?
Reply
#7

Use pickups, in cps you cant define chepoint id but in pickups you can so if (pickupid==Buil1) blahblahblah, search wiki!
Reply
#8

True, BUT When you use pickups there is also no way to make a exit?
Reply
#9

You can create check point in the building

For after the player go to the building for exit.

Or if you want just admin can exit it.

You create with a exception.

IfPlayerIsAdmin (Just Example)
Reply
#10

eh......i kinda like the pickup methhood, very easy.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)