Teleport on keypress?
#1

I'm currently working on a private server of my own, probably not going to release the script, but I need help.
I made a 'fake interior', and I need to make it when a player is it at the door, when they press F to make them teleport to this fake interior I made.

Not so important, but how to make a triangle appear at the door like it does in the original game?

REP+ for helping.
Reply
#2

Do you mean the yellow triangle, animated, which can be disabled ?? I NEED it too !
Reply
#3

Quote:
Originally Posted by coool
Посмотреть сообщение
Do you mean the yellow triangle, animated, which can be disabled ?? I NEED it too !
That's optional. My main need is the script that teleports you when you're at a certain spot and you press 'F'.
Reply
#4

Use OnPlayerKeyPressed, check if is player in range of point, and teleport it to wherever you want. Understood?
Reply
#5

You mean like this ?

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if (PRESSED(KEY_SECONDARY_ATTACK))
        {
                if(IsPlayerInRangeOfPoint(playerid, 2.0, Your coordinates)) //Is near doors for enter
                {
                        SetPlayerPos(playerid, Your coordinates); //Set player position inside interior
                }
                if(IsPlayerInRangeOfPoint(playerid, 2.0, Your coordinates)) //Is near interior exit doors
                {
                        SetPlayerPos(playerid, Your coordinates); //Set player position to enter doors
                }
        }
        return 1;
}
Reply
#6

Quote:
Originally Posted by Bolex_
Посмотреть сообщение
You mean like this ?

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if (PRESSED(KEY_SECONDARY_ATTACK))
        {
                if(IsPlayerInRangeOfPoint(playerid, 2.0, Your coordinates)) //Is near doors for enter
                {
                        SetPlayerPos(playerid, Your coordinates); //Set player position inside interior
                }
                if(IsPlayerInRangeOfPoint(playerid, 2.0, Your coordinates)) //Is near interior exit doors
                {
                        SetPlayerPos(playerid, Your coordinates); //Set player position to enter doors
                }
        }
        return 1;
}
You are officially my savior.
<3
REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)