Teleporting to Custom Interior
#1

I created a Custom Interior and I want to be able to walk to a door and automatically teleport to that location. I just made an interior up in the sky somewhere and I want to teleport there. Help?
Reply
#2

IsPlayerInRangeOfPoint
SetPlayerPos
(SetPlayerInterior)
Reply
#3

ok? care to show alittle more details?
Reply
#4

If you look up the syntax of those functions, you'll get your details.
Reply
#5

Ok thanks
Reply
#6

Ok, I tried to create this code but it didn't work. Can anyone help?

Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 2737.0888671875, -2799.9736328125, 23.703699111938))
    {
    SetPlayerPos(playerid, 2738.8181152344, -2875.5883789063, 308.98538208008);
    return 1;
	}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 2738.8181152344, -2871.5883789063, 308.98538208008))
	{
	SetPlayerPos(playerid, 2737.0888671875, -2805.9736328125, 23.703699111938);
	return 1;
	}
return 1;
}
Reply
#7

OnPlayerSpawn is only called .. surprise surpsise .. when the player spawns.
You need to put your stuff somewhere else.
Maybe in a public function that is called, say every second.

look for SetTimer on the wiki to see how it works.

pawn Код:
public YourCustomFunctionForYourTeleport()
{
     if(IsPlayerInRangeOfPoint( ... ))
     {
        SetPlayerPos( ... );
        SetPlayerInterior( ... );
        SetPlayerVirtualWorld( ... );
        return 1;
      }
      return 1;
}
you could also use CreatePickup() and OnPlayerPickupPickup() to do this, again check the wiki.
Also, if you use an object streamer, remeber to update the streamer before teleporting the player.
Sometimes there are issues with objects created at high altitude, it might be better to add your objects to a pre-existing interior in an alternate vitrual world.

good luck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)