16.10.2013, 13:54
Hum, I had used both options and worked.
Code:
Code:
pawn Код:
new
door0, door1, door2, door3;
door0 = CreateDynamicObject(1495,1487.00000000,-1762.42504883,3284.23608398,0.00000000,0.00000000,270.00000000); //object(gen_doorext01) (1)
door1 = CreateDynamicObject(1495,1483.79003906,-1762.42504883,3284.23608398,0.00000000,0.00000000,270.00000000); //object(gen_doorext01) (2)
door2 = CreateDynamicObject(1495,1479.85998535,-1758.31994629,3284.23388672,0.00000000,0.00000000,0.00000000); //object(gen_doorext01) (2)
door3 = CreateDynamicObject(1495,1467.06701660,-1758.31994629,3284.23388672,0.00000000,0.00000000,0.00000000); //object(gen_doorext01) (2)
if (strcmp("/open", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0,1487.00000000,-1762.42504883,3284.23608398)) //Door 0
{
MoveObject(door0,1487.00000000,-1762.42504883+1.25,3284.23608398,0.50);
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: unlocks and opens the door");
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1483.79003906,-1762.42504883,3284.23608398)) //Door 1
{
MoveObject(door1,1483.79003906,-1762.42504883+1.25,3284.23608398,0.50);
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: unlocks and opens the door");
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1479.85998535,-1758.31994629,3284.23388672)) //Door 2
{
MoveObject(door2,1479.85998535-1.25,-1758.31994629,3284.23388672,0.50);
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: unlocks and opens the door");
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1467.06701660,-1758.31994629,3284.23388672)) //Door 3
{
MoveObject(door3,1467.06701660-1.25,-1758.31994629,3284.23388672,0.50);
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: unlocks and opens the door");
}
return 1;
}