Please help out
#1

Im new and my friend gave me this cool code it works but everyone can use it
I need only skin 120 to be able to use them
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (HOLDING(KEY_CROUCH))
{
if(IsPlayerInRangeOfPoint(playerid,10.0,213.8026,1 876.0151,13.1406))
{
MoveObject(fronthqgate, 226.2012,1875.1792,13.8000, 2.00);
}
}

if (RELEASED(KEY_CROUCH))
{
MoveObject(fronthqgate, 214.2012,1875.1792,13.8000, 2.00);
}

if (HOLDING(KEY_SUBMISSION))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , 1);
}

if (RELEASED(KEY_SUBMISSION))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , 0);
}
return 1;
}
Please help
Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(GetPlayerSkin(playerid)==120)
  {
    if (HOLDING(KEY_CROUCH))
    {
      if(IsPlayerInRangeOfPoint(playerid,10.0,213.8026,1876.0151,13.1406))
      {
        MoveObject(fronthqgate, 226.2012,1875.1792,13.8000, 2.00);
      }
    }

    if (RELEASED(KEY_CROUCH))
    {
      MoveObject(fronthqgate, 214.2012,1875.1792,13.8000, 2.00);
    }

    if (HOLDING(KEY_SUBMISSION))
    {
      LinkVehicleToInterior(GetPlayerVehicleID(playerid), 1);
    }

    if (RELEASED(KEY_SUBMISSION))
    {
      LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    }
  }
  return 1;
}
Reply
#3

Quote:
Originally Posted by Joe Staff
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(GetPlayerSkin(playerid)==120)
  {
    if (HOLDING(KEY_CROUCH))
    {
      if(IsPlayerInRangeOfPoint(playerid,10.0,213.8026,1876.0151,13.1406))
      {
        MoveObject(fronthqgate, 226.2012,1875.1792,13.8000, 2.00);
      }
    }

    if (RELEASED(KEY_CROUCH))
    {
      MoveObject(fronthqgate, 214.2012,1875.1792,13.8000, 2.00);
    }

    if (HOLDING(KEY_SUBMISSION))
    {
      LinkVehicleToInterior(GetPlayerVehicleID(playerid), 1);
    }

    if (RELEASED(KEY_SUBMISSION))
    {
      LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    }
  }
  return 1;
}
I would rather do
pawn Код:
if (HOLDING(KEY_CROUCH)&&GetPlayerSkin(playerid)==120)
Reply
#4

But then you're checking multiple times for each different key (he has multiple key commands there)
Reply
#5

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  new Skin;
  Skin = GetPlayerSkin(playerid);
  if(Skin == 120)
  {
    if (HOLDING(KEY_CROUCH))
    {
      if(IsPlayerInRangeOfPoint(playerid,10.0,213.8026,1876.0151,13.1406))
      {
        MoveObject(fronthqgate, 226.2012,1875.1792,13.8000, 2.00);
      }
    }

    if (RELEASED(KEY_CROUCH))
    {
      MoveObject(fronthqgate, 214.2012,1875.1792,13.8000, 2.00);
    }

    if (HOLDING(KEY_SUBMISSION))
    {
      LinkVehicleToInterior(GetPlayerVehicleID(playerid), 1);
    }

    if (RELEASED(KEY_SUBMISSION))
    {
      LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    }
  }
  return 1;
}
________
Sick from depakote
Reply
#6

Update
I used the first code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)