How to detect when someone is clicking a button? / Command Zones?
#2

How to detect a button being pressed:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
Here's a link to all of the KEY_'s
https://sampwiki.blast.hk/wiki/GetPlayerKeys#Key_List

To detect if a command made in an area / zone:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, RANGE, PosX, PosY, PosZ))
{
      .... // code
}
Replace RANGE with the max distance from player to points ( PosX, Y and Z).

Good luck! REP if I helped
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)