29.08.2015, 23:49
Or you can write code like this:
PHP код:
#define MAX_DOORS (4)
CMD:door(playerid,params[])
{
if(IsLaw(playerid))
{
static
bool:door_state[MAX_DOORS]
;
// Door #1
if(IsPlayerInRangeOfPoint(playerid, 2.0,1487.00000000,-1762.42504883,3284.23608398))
{
if (!door_state[0]) {
MoveObject(door0,1487.00000000,-1762.42504883+1.25,3284.23608398,0.50);
door_state[0] = true;
} else {
MoveObject(door0,1487.00000000,-1762.42504883,3284.23608398,0.50);
door_state[0] = false;
}
}
// Door #2
// Etc... (Do the same with the other doors)
}
return 1;
}