SA-MP Forums Archive
Check if mouse fire button has been clicked 5 times - 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: Check if mouse fire button has been clicked 5 times (/showthread.php?tid=84266)



Check if mouse fire button has been clicked 5 times - Yoyoyo - 29.06.2009

How can i check if the playerid has pressed the default fire button (Left Mouse Button) 5 times?

Thanks



Re: Check if mouse fire button has been clicked 5 times - James_Alex - 29.06.2009

easy
pawn Код:
new press[MAX_PLAYERS]; // put this in the tp of the script
public OnStateKeyChange(playerid, newkeys, oldkeys)
{
  if(newkeys == KEY_FIRE)
  {
    press[playerid] += 1;
    return 1;
  }
  if(press[playerid] == 5)
  {
    // your action...
  }
}
// script




Re: Check if mouse fire button has been clicked 5 times - Yoyoyo - 29.06.2009

thx a hole bunch =]