SA-MP Forums Archive
Press " T " to enter/exit - 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: Press " T " to enter/exit (/showthread.php?tid=490773)



Press " T " to enter/exit - AhmedMohamed - 27.01.2014

How can I make button " T " enter to buildings with /enter and /exit ??
enter:
Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 1368.8760,-1279.8350,13.5469))
    {
        SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625); //ammu1
        SetPlayerInterior(playerid, 1);
    }
    if(IsPlayerInRangeOfPoint(playerid, 5, 1833.7809,-1842.6556,13.5781))
    {
        SetPlayerPos(playerid, -26.691598,-55.714897,1003.546875); //shop1
        SetPlayerInterior(playerid, 6);
    }
    if(IsPlayerInRangeOfPoint(playerid, 5, 1154.7290,-1457.8655,15.7969))
    {
        SetPlayerPos(playerid, 6.091179,-29.271898,1003.549438); //shop2
        SetPlayerInterior(playerid, 10);
    }
return 1;
}
and exit??:
Код:
CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 286.148986,-40.644397,1001.515625))
    {
        SetPlayerPos(playerid, 1368.8760,-1279.8350,13.5469);//ammu1
        SetPlayerInterior(playerid, 0);
    }

    if (IsPlayerInRangeOfPoint(playerid, 5,-26.691598,-55.714897,1003.546875))
    {
        SetPlayerPos(playerid, 1833.7809,-1842.6556,13.5781); //shop1
        SetPlayerInterior(playerid, 0);
    }
    if (IsPlayerInRangeOfPoint(playerid, 5,6.091179,-29.271898,1003.549438))
    {
        SetPlayerPos(playerid, 1154.7290,-1457.8655,15.7969); //shop2
        SetPlayerInterior(playerid, 0);
    }
return 1;
}



Re: Press " T " to enter/exit - Verth - 27.01.2014

OnPlayerKeyStateChange is what you are searching for.


Re: Press " T " to enter/exit - AhmedMohamed - 27.01.2014

type what in it??


Re: Press " T " to enter/exit - Misiur - 27.01.2014

You can't use T key. https://sampwiki.blast.hk/wiki/Keys - this is the list of available keys. The T is for opening chatbox, and not available to pawn script.


Re: Press " T " to enter/exit - AhmedMohamed - 27.01.2014

How can i use " Y " button then ??
((I need the code please))


Re: Press " T " to enter/exit - AhmedMohamed - 27.01.2014

please help me i wanna make " Y " button to enter/exit buildings how??


Re: Press " T " to enter/exit - dannyk0ed - 27.01.2014

pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
     if(newkeys == 65536)
     {
          cmd_enter(playerid);
          return 1;
      }
}
Under OnPlayerKeyStateChange



Re: Press " T " to enter/exit - AhmedMohamed - 28.01.2014

thanks danny it work well expect it gave me warnings but nevermind