SA-MP Forums Archive
About 3d label entrance - 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)
+--- Thread: About 3d label entrance (/showthread.php?tid=291997)



About 3d label entrance - Artie_Scorpion - 22.10.2011

Hi I need help. I want to create 3d label, then if ill press ENTER near the 3d label, ill be teleported to interior. But ill need entrance from interior (to back...).
I hope you understood. Somebody can do this for me please?


Re: About 3d label entrance - AeroBlast - 22.10.2011

pawn Код:
//On the top of your script
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

//Under OnGameModeInit
Create3DTextLabel("Enter!",0x008080FF,Xpos,Ypos,Zpos,30,0,1);  //Insert the X-, Y- and Zpos of the entrance here
Create3DTextLabel("Exit!",0x008080FF,Xpos,Ypos,Zpos,30,0,1);   //Insert the X-, Y- and Zpos of the exit here

//Under OnPlayerKeyStateChange

if(PRESSED(16))
{
    if(IsPlayerInRangeOfPoint(playerid,5,Xpos,Ypos,Zpos)) //Insert the X-, Y- and Zpos of the entrance here
    {
        SetPlayerPos(playerid,Xpos,Ypos,Zpos); //Insert the X-, Y- and Zpos of the exit here
        SetPlayerInterior(playerid,Int); //Insert the Interior of the exit here
    }
    if(IsPlayerInRangeOfPoint(playerid,5,Xpos,Ypos,Zpos)) //Insert the X-, Y- and Zpos of the exit here
    {
        SetPlayerPos(playerid,Xpos,Ypos,Zpos); //Insert the X-, Y- and Zpos of the entrance here
        SetPlayerInterior(playerid,Int); //Insert the Interior of the entrance here
    }
}