Posts: 501
Threads: 175
Joined: Jan 2014
Reputation:
0
I want to do when player press H near the object it's will open it.... and if it's open it's will close it...
someone can give me example with explain please?
Posts: 1,219
Threads: 51
Joined: Jul 2012
And i you don't want to read try this :P
PHP код:
#define GATE_KEY KEY_CTRL_BACK
//in onPlayerKeyStateChange
if (newkeys & GATE_KEY)
{
if(IsPlayerInRangeOfPoint(playerid,Range,X,Y,Z);
{
MoveObject(Object(The Gate),X,Y,Z,Closing Speed);
}
}
Posts: 1,219
Threads: 51
Joined: Jul 2012
sry forgot it
Posts: 556
Threads: 17
Joined: Mar 2014
Reputation:
0
Lirbo, you need to add "LSPPDGG = CreateObject(3037, 1589.6, -1638.3, 14.26, 0, 0, 90);" Under your OnGameModeInIt, not under the place of OnPlayerKeyStateChange.
MoveObject to the "closed" gate position. If player is not in the IsPlayerInRangeOfPoint.