04.11.2014, 11:43
I would like to make a system where you will enter automattly into a door/house or once you press a certain button, can someone give me an example on how to do it?
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED( KEY_FIRE )) // If pressed KEY_FIRE (LMB)
{
if(IsPlayerInRangeOfPoint(playerid, RANGE, X,Y,Z)) // Range = Distance when he can press KEY_FIRE, X,Y,Z : Checkpoint/Pick-up/Door position !
SetPlayerInterior(playerid, 15); // Will set his interior 15, example !
}
return 1;
}
pawn Код:
|