17.09.2011, 16:25
here is the code
PHP код:
public OnGameModeInit
gate = CreateObject(980, 2287.30004883, 605.29998779, 12.50,0.0, 0.0, 359.98901367); //
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Open", cmdtext, true, 10) == 0)
{
MoveObject(gate,2287.30004883, 605.29998779, 6.50, 7);// 7 is thespeed of opening the gate
return 1;
}
if (strcmp("/ohouse", cmdtext, true,10) == 0)
{
SetPlayerPos(playerid,837.1106, -1875.3643, 13.4764);
return 1;
}
return 0;
}
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,5, here the coords of the position where you will the gate starts to close))//5 is the range!
{
MoveObject(gate, 2287.30004883, 605.29998779, 12.50, 7);//7 is thespeed of opening the gate
}
return 1;
}