12.07.2010, 15:21
(
Последний раз редактировалось V1ceC1ty; 12.07.2010 в 15:42.
)
Edit the appropriate functions to fit your script.
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new gate;
public OnGameModeInit()
{
gate = CreateObject(objectid, objectx, objecty, objectz, xrotation, yrotation, zrotation);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
if(IsPlayerInRangeOfPoint(playerid, range, objectx,objecty,objectz))
{
MoveObject(gate, newx, newy, newz, speed);
}
}
return 1;
}