23.08.2015, 22:35
hope it work:
PHP код:
new keypad;
public OnGameModeInit()
{
keypad = CreateObject(2886,-3293.315429,-888.127258,20.019216,0,0,-90.000);
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:X,Float:Y,Float:Z;
GetObjectPos(keypad,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid, 10.0, X, Y, Z )) {
MoveObject(keypad,X,Y,Z-8,2.00);
} else {
MoveObject(keypad, X,Y,Z+8,2.00);
}
return 1;
}