Press " T " to enter/exit
#1

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;
}
Reply
#2

OnPlayerKeyStateChange is what you are searching for.
Reply
#3

type what in it??
Reply
#4

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.
Reply
#5

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

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)