SA-MP Forums Archive
How to make a teleport with button? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make a teleport with button? (/showthread.php?tid=272913)



How to make a teleport with button? - Join7 - 30.07.2011

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


Re: How to make a teleport with button? - eDz0r - 30.07.2011

This + This = What You Want


Re: How to make a teleport with button? - Pooh7 - 30.07.2011

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


EDIT: eDz0r is faster


Re: How to make a teleport with button? - Join7 - 30.07.2011

There was a thread in the forum for this


Re: How to make a teleport with button? - Join7 - 30.07.2011

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"


Re: How to make a teleport with button? - Toreno - 30.07.2011

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;
}



Re: How to make a teleport with button? - Join7 - 30.07.2011

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


Re: How to make a teleport with button? - Toreno - 30.07.2011

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.


Re: How to make a teleport with button? - =WoR=Varth - 30.07.2011

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


Re: How to make a teleport with button? - Toreno - 30.07.2011

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


Re: How to make a teleport with button? - =WoR=Varth - 30.07.2011

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


Re: How to make a teleport with button? - Join7 - 01.08.2011

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


Re: How to make a teleport with button? - =WoR=Varth - 02.08.2011

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