How to make a teleport with button?
#1

How to make a teleport with button? For example: Going to 3D text "Click or CTRL example SCROLL, to enter" and you teleport inside the building

Sorry for my bad english
Reply
#2

This + This = What You Want
Reply
#3

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange


EDIT: eDz0r is faster
Reply
#4

There was a thread in the forum for this
Reply
#5

I do not understand. I want this: there is a TextDraw somewhere that says "Press CTRL to enter" and when clicking the mouse button CTRL, they can teleport to the house and inside is where they teleport to write to Textdraw "Press CTRL to go"
Reply
#6

When player presses F / ENTER, I think, take this and learn more.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
    if((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK)) {
        if(IsPlayerInRangeOfPoint(playerid, 2.5, X, Y, Z)) { // You need to change X, Y, Z to the entrance..
            // Here you teleports the player to the specific location with interior ID.
            return 1;
        }
    }
    return 1;
}
Reply
#7

Can you do it with a teleport button mouse SCROLL, for example, and teleport from place to place exactly where your coordinates
Reply
#8

I don't think you can use mouse scroll, but this one I gave you is when a player presses F / ENTER, then you need to teleport the player by using these.
pawn Код:
SetPlayerInterior(playerid, ID) // Set up Interior ID !
SetPlayerPos(playerid, x, y, z); // You need to change x, y, z !
You must have a bit of a knowledge, I suggest you to read some tutorials.
Reply
#9

Actually you can use any (Normal) button as long as you use it in your GTA configuration.
Reply
#10

Mouse scroll is not a button, isn't it? -.-
Reply
#11

By default, mouse scroll is used for weapon scroll. But yeah, it's not a button.
Reply
#12

I mean when I go on TextDraw "BUTTON Click the mouse to teleport", not only when button clicked, but to go to there position and clicking the button
Reply
#13

You can use https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange and https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint. Set the coordinate same as the pickup.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)