29.08.2015, 21:06
Hey guys, I made a command (/door) to open/close doors, however, when I do /door next to the object, the door opens however when I do /door again, it doesn't close :[
Anyone know how to fix this? Here is the command:
Anyone know how to fix this? Here is the command:
Код:
CMD:door(playerid,params[]) { if(IsLaw(playerid)) { if(IsPlayerInRangeOfPoint(playerid, 2.0,1487.00000000,-1762.42504883,3284.23608398)) { MoveObject(door0,1487.00000000,-1762.42504883+1.25,3284.23608398,0.50); } else if(IsPlayerInRangeOfPoint(playerid, 2.0,1487.00000000,-1762.42504883,3284.23608398)) { MoveObject(door0,1487.00000000,-1762.42504883,3284.23608398,0.50); } if(IsPlayerInRangeOfPoint(playerid, 2.0, 1483.79003906,-1762.42504883,3284.23608398)) { MoveObject(door1,1483.79003906,-1762.42504883+1.25,3284.23608398,0.50); } else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1483.79003906,-1762.42504883,3284.23608398)) { MoveObject(door1,1483.79003906,-1762.42504883,3284.23608398,0.50); } if(IsPlayerInRangeOfPoint(playerid, 2.0, 1479.85998535,-1758.31994629,3284.23388672)) { MoveObject(door2,1479.85998535-1.25,-1758.31994629,3284.23388672,0.50); } else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1479.85998535,-1758.31994629,3284.23388672)) //Door 2 { MoveObject(door2,1479.85998535,-1758.31994629,3284.23388672,0.50); } if(IsPlayerInRangeOfPoint(playerid, 2.0, 1467.06701660,-1758.31994629,3284.23388672)) { MoveObject(door3,1467.06701660-1.25,-1758.31994629,3284.23388672,0.50); } else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1467.06701660,-1758.31994629,3284.23388672)) { MoveObject(door3,1467.06701660,-1758.31994629,3284.23388672,0.50); } } return 1; }