SA-MP Forums Archive
[Help] Aim - 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: [Help] Aim (/showthread.php?tid=86658)



[Help] Aim - borisblat - 15.07.2009

How can i do that if some player aim on some specific intrior he will get killed?.
example: for not killing in the bank ..




Re: [Help] Aim - borisblat - 15.07.2009

no one knows?..
sorry for double post it was on 2nd page.


Re: [Help] Aim - yom - 15.07.2009

AllowInteriorWeapons(false);


Re: [Help] Aim - borisblat - 15.07.2009

and it gives me what?...
it does that the weapons will not appear in the interiors,
but i want that they will appear, but you will can't aim.


Re: [Help] Aim - yom - 15.07.2009

Then just set player's health to 0 if he press his Aim key while in an interior.


Re: [Help] Aim - borisblat - 15.07.2009

and this is my question, how can i do it?..


Re: [Help] Aim - yom - 15.07.2009

What have you tried? That's as easy as this, basically:

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (newkeys & <aim key here>)
  {
    if (GetPlayerInterior(playerid)) //any interiors but outside.
    {
      if (GetPlayerWeapon(playerid)) //any weapons but fists.
      {
        SetPlayerHealth(playerid, 0.0); //kill
        return true;
      }
    }
  }
  return false;
}



Re: [Help] Aim - saiberfun - 15.07.2009

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (newkeys & /*don't kno what that the tightmousebuttonkey is key is*/)
  {
    if (GetPlayerInterior(playerid) > 0) //any interiors but outside.
    {
      if (GetPlayerWeapon(playerid) > 0) //any weapons but fists.
      {
        SetPlayerHealth(playerid, 0.0); //kill
        return true;
      }
    }
  }
  return false;
}