05.07.2012, 14:00
Well here is a small test:
Firstly you should Create a Gate:
Now, we can do a stock, where the function can find the nearest Object, or just hold a Key...
If you use the Key-variant you should use the Variable or typing /pos to get the Position.
//edit failed at ||
Firstly you should Create a Gate:
Quote:
public OnGameModeInit() { new i = CreateObject(MODEL, POSITION X- Y- Z); } |
If you use the Key-variant you should use the Variable or typing /pos to get the Position.
Quote:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_CROUCH) || IsPlayerInRangeOfPoint(playerid, Position))// press c { MoveObject(Position); SCM(playerid, 0xFFFFFF, "Object 1 Open."); } if (PRESSED(KEY_JUMP) || IsPlayerInRangeOfPoint(playerid, Position))// press jump { MoveObject(Position); SCM(playerid, 0xFFFFFF, "Object 2 Close."); } return 1; |