Teleports.
#1

Teleport's Help


Hello, I'm just wondering instead off using command's to enter a building such as:

Код:
COMMAND:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2, 2045.4803,-1907.7728,13.5469))//DMV
    {
        SetPlayerPos(playerid, -2029.7825,-119.6237,1035.1719);
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 0);
        SetCameraBehindPlayer(playerid);
    }
}
You go to a certain area then it teleport's you there with out clicking a key or with out using a command.

P.S- I have been looking over for SA-MP but nothing seems to work.

Thanks in advanced!
Reply
#2

Use
OnPlayerEnterCheckpoint callback

here is a link that can help you

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

Thanks, I'll test this out right now.
Reply
#4

That would work if you used a timer and you checked if the player is in range so you would teleport that player but.. it's better not to use many timers.

I believe that either with a command or a key is fine.

EDIT: What DarkLored suggested is also nice. Streamed checkpoints* though so it won't show in the minimap if you're not streamed to the checkpoint.

*By Incognito's streamer
Reply
#5

Help:

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 2, 2045.4803,-1907.7728,13.5469))
    {
        SetPlayerPos(playerid, -2029.7825,-119.6237,1035.1719);
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 0);
        SetCameraBehindPlayer(playerid);
    }
}
How would 2045.4803,-1907.7728,13.5469 this location TP them to this location -2029.7825,-119.6237,1035.1719
Please help

P.S- OnPlayerEnterCheckPoint didn't TP me no were.
Reply
#6

i recommend using streamer plugin
Reply
#7

you have to create a checkpoint..

Copied from Wiki SA:MP.
pawn Код:
//In this example, a checkpoint is created for the player when spawning,
//which creates a vehicle and disables the checkpoint.
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 2045.4803,-1907.7728,13.5469, 3.0);
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
     if(IsPlayerInRangeOfPoint(playerid, 2, 2045.4803,-1907.7728,13.5469))
    {
        SetPlayerPos(playerid, -2029.7825,-119.6237,1035.1719);
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 0);
        SetCameraBehindPlayer(playerid);
    }
    return 1;
}
Reply
#8

-I've installed the streamer plugin but it doesn't still work.

EDIT: Ill try it now, one min.
Reply
#9

Quote:
Originally Posted by Death1300
Посмотреть сообщение
-I've installed the streamer plugin but it doesn't still work.

EDIT: Ill try it now, one min.
Include streamer.inc to your script. Use CreateDymanicCP to create the checkpoint.

pawn Код:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
When a player enters any dynamic checkpoint, OnPlayerEnterDynamicCP will be called.
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
Note that you should get the checkpointid while creating the dynamic checkpoint and in the callback to check if the checkpointid is the one you created, so teleport the player.
Reply
#10

Let know if it worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)