What I'm looking for is a more efficient and faster way to open and close the same door object but with any of them, for example door 1496, which I use on my server in almost any building, I would like to use / open it to set that door to -90 in such a way that it opens (whatever door 1496 is opening) and with / close it is placed again at 0.0 so that it closes (whatever door 1496 is closing) The problem is that it does not work, any way to solve it?
What I do not want is to have to do a door-to-door function by pulling out the coordinates of those doors 1 by 1 because in the end it would take too long
What I do not want is to have to do a door-to-door function by pulling out the coordinates of those doors 1 by 1 because in the end it would take too long
Code:
//==============
if (!strcmp(cmdtext, "/open", true))
{
new Float:x, Float:y, Float:z;
GetObjectPos(1496, x, y, z);
if (IsPlayerInRangeOfPoint(playerid, 1.0, x, y, z))
{
MoveObject(1496, x, y, z, 5.00,0.0,0.0,-90.0);
}
return 1;
}
//==============
if (!strcmp(cmdtext, "/close", true))
{
new Float:x, Float:y, Float:z;
GetObjectPos(1496, x, y, z);
if (IsPlayerInRangeOfPoint(playerid, 1.0, x, y, z))
{
MoveObject(1496, x, y, z, 5.00,0.0,0.0,0.0);
}
return 1;
}