SA-MP Forums Archive
Please help. - 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: Please help. (/showthread.php?tid=81062)



Please help. - L30 - 08.06.2009

RESOLVED


Re: Please help. - Snyper - 08.06.2009

I'm not a pro or anything... but I think that needs to be in "public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)".

Just a suggestion, don't get angry if it wasn't the solution.


Re: Please help. - HuRRiCaNe - 08.06.2009

indeed.


Re: Please help. - Gappy - 08.06.2009

Put this:

pawn Код:
new string[256];
  if (IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
  {
      if(IsPlayerConnected(playerid))
      {
          if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0))
          {
                new sendername[MAX_PLAYER_NAME];
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "  %s has attempted to Start the vehicle", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
                EnterCarTime[playerid] += 1;
                return 1;
            }
            else
            {
              SendClientMessage(playerid, COLOR_GREY, "  You are not in a Vehicle!");
              return 1;
            }
        }
    }
Under OnPlayerKeyStateChange, like this:

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  new string[256];
  if (IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
  {
      if(IsPlayerConnected(playerid))
      {
          if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0))
          {
                new sendername[MAX_PLAYER_NAME];
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "  %s has attempted to Start the vehicle", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
                EnterCarTime[playerid] += 1;
                return 1;
            }
            else
            {
              SendClientMessage(playerid, COLOR_GREY, "  You are not in a Vehicle!");
              return 1;
            }
        }
    }
    return 1;
}



Re: Please help. - L30 - 08.06.2009

Quote:
Originally Posted by Snyper
I'm not a pro or anything... but I think that needs to be in "public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)".

Just a suggestion, don't get angry if it wasn't the solution.
omg I feel dumb lol thanks for catching that, Do you know what it should be for it to press SHIFT? right now its to press F


Re: Please help. - Gappy - 08.06.2009

Quote:
Originally Posted by L30
Quote:
Originally Posted by Snyper
I'm not a pro or anything... but I think that needs to be in "public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)".

Just a suggestion, don't get angry if it wasn't the solution.
omg I feel dumb lol thanks for catching that, Do you know what it should be for it to press SHIFT? right now its to press F
I thinks it's KEY_ACTION