how to make teleport checkpoint ?
#1

how to make teleport like enter the police station by pressing "enter" ?
Reply
#2

You will have to get the coords of the place you want them to use it, and then use OnPlayerKeyStateChange to detect what keys the player is pressing. I would recommend F though, instead of enter. That would be "KEY_SECONDARY" in pawn.
Reply
#3

dude what you want
how to make teleport checkpoint ?
or
how to make teleport like enter the police station by pressing "enter" ?
Reply
#4

One thing I would suggest would be to use 3dlabels as markers instead of checkpoints. Put the setplayerpos under OnPlayerKeyStateChange
Reply
#5

I would suggest using Incognito`s streamer located here https://sampforum.blast.hk/showthread.php?tid=102865 and my sub-streamer include here https://sampforum.blast.hk/showthread.php?tid=423622

Simply do this for any number of areas.

Please note this is intended if you plan on using a lot of teleports which won't really affect performance even with hundreds.

pawn Код:
#include <dynamiccp>

#define POLICE_STATION 0

new CurrCP[MAX_PLAYERS] = { INVALID_CP_ID, ... };

public OnGameModeInit()
{
    AddDynamicCP(1000.0, 1000.0, 1000.0, 2.0, "PoliceStation");
}

OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(CurrCP[playerid] != INVALID_CP_ID)
        {
             switch(CurrCP[playerid])
             {
                  // Teleport code for each check point goes in here
                  case POLICE_STATION:
                  {
                      SetPlayerPos(playerid, 100.0, 100.0, 100.0);
                      SetPlayerFacingAngle(playerid, 90);
                  }
             }
        }
    }
}

OnCheckPoint:PoliceStation(playerid, cpid, cpindex)
{
    CurrCP[playerid] = POLICE_STATION;
}

ExitCheckPoint:PoliceStation(playerid, cpid, cpindex)
{
    CurrCP[playerid] = INVALID_CP_ID;
}

public OnPlayerDisconnect(playerid)
{
    CurrCP[playerid] = INVALID_CP_ID;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)