I make an object but the problems come here.. i want when a player is near that gate it opeen.. but the problem is i move x!! but the object have a rotation so move to a place y dont want.. if i use y dont move correctly too.. but if i use x and y i think it move correctly where i want.. the problems come here :S.. if i change the movee X or gthe move Y.. that dont change the gate moveee to the same wrong place and dont stop! here is my code
Код:
public OnPlayerUpdate(playerid)
{
new cpbancolv = 0;
new pnombre[MAX_PLAYER_NAME];
GetPlayerName(playerid, pnombre, sizeof(pnombre));
new Float:h;
GetPlayerHealth(playerid, h);
new sdinero = GetPlayerMoney(playerid);
MysqlUpdateCampoInt("jugadores", "nombre", pnombre, "dinero", sdinero);
MysqlUpdateCampoFloat("jugadores", "nombre", pnombre, "vida", h);
GuardarPos(playerid);
//Puertas Automaticas
if(IsPlayerInRangeOfPoint(playerid,20.0,1022.235107, 1161.766357, 11.638715)) //--- Reja Banco LV
{
if(cpbancolv == 1)
{
cpbancolv = 0;
}
else
{
MoveObject(pbancolv, 0, -100, 0, 5.0);
cpbancolv = 1;
}
}
}