MoveDynamicObject - Help. -
Chrillzen - 16.10.2013
Hey, this is from Wennicke's police interior map. The command seems to work but the doors do not move? I get the PlayerActionMessage but nothing else happens. I use Incognito's streamer and changed to MoveDynamicObject from MoveObject but it's still not working.
pawn Код:
CMD:dooropen(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0,1487.00000000,-1762.42504883,3284.23608398)) //Door 0
{
MoveDynamicObject(door0, 1487.00000000,-1762.42504883+1.25,3284.23608398, 0.50);
PlayerActionMessage(playerid, 20.0, "unlocks and opens the door.");
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1483.79003906,-1762.42504883,3284.23608398)) //Door 1
{
MoveDynamicObject(door1,1483.79003906,-1762.42504883+1.25,3284.23608398,0.50);
PlayerActionMessage(playerid, 20.0, "unlocks and opens the door.");
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1479.85998535,-1758.31994629,3284.23388672)) //Door 2
{
MoveDynamicObject(door2,1479.85998535-1.25,-1758.31994629,3284.23388672,0.50);
PlayerActionMessage(playerid, 20.0, "unlocks and opens the door.");
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1467.06701660,-1758.31994629,3284.23388672)) //Door 3
{
MoveDynamicObject(door3,1467.06701660-1.25,-1758.31994629,3284.23388672,0.50);
PlayerActionMessage(playerid, 20.0, "unlocks and opens the door.");
} else return SCM(playerid, COLOR_LIGHTRED, "[Error]: You're not by any door.");
return 1;
}
Re: MoveDynamicObject - Help. -
BadFella - 16.10.2013
Did you trade the CreateDynamicObject for CreateObject?
Re: MoveDynamicObject - Help. -
Chrillzen - 16.10.2013
Yep..
pawn Код:
CreateDynamicObject(1495,1487.0000000,-1762.4250488,3284.2360840,0.0000000,0.0000000,270.0000000); //object(gen_doorext01)(1)
CreateDynamicObject(1495,1483.7900391,-1762.4250488,3284.2360840,0.0000000,0.0000000,270.0000000); //object(gen_doorext01)(2)
CreateDynamicObject(1495,1479.8599853,-1758.3199463,3284.2338867,0.0000000,0.0000000,0.0000000); //object(gen_doorext01)(2)
CreateDynamicObject(1495,1467.0670166,-1758.3199463,3284.2338867,0.0000000,0.0000000,0.0000000); //object(gen_doorext01)(2)
CreateDynamicObject(1567,1491.2148438,-1764.9000244,3284.2504883,0.0000000,0.0000000,0.0000000); //object(gen_wardrobe)(2)
CreateDynamicObject(1567,1494.4121094,-1764.9000244,3284.2504883,0.0000000,0.0000000,0.0000000); //object(gen_wardrobe)(3)
CreateDynamicObject(1567,1497.6113281,-1764.9000244,3284.2504883,0.0000000,0.0000000,0.0000000); //object(gen_wardrobe)(4)
CreateDynamicObject(1567,1500.8144531,-1764.9000244,3284.2504883,0.0000000,0.0000000,0.0000000); //object(gen_wardrobe)(6)
CreateDynamicObject(1567,1500.8199463,-1761.5100098,3284.2504883,0.0000000,0.0000000,0.0000000); //object(gen_wardrobe)(7)
CreateDynamicObject(1567,1491.2209473,-1761.5000000,3284.2504883,0.0000000,0.0000000,0.0000000); //object(gen_wardrobe)(8)
CreateDynamicObject(1567,1494.4189453,-1761.5100098,3284.2504883,0.0000000,0.0000000,0.0000000); //object(gen_wardrobe)(9)
CreateDynamicObject(1567,1497.6199951,-1761.5100098,3284.2504883,0.0000000,0.0000000,0.0000000); //object(gen_wardrobe)(10)
Re: MoveDynamicObject - Help. -
BadFella - 16.10.2013
Use CreateObject instead of CreateDynamicObject.
Also, tell me which are the door1,door2,door3, I'll test here myself.
Download the map and tried it here, it does work well.
Re: MoveDynamicObject - Help. -
Chrillzen - 16.10.2013
Still not working.
pawn Код:
new
door0, door1, door2, door3;
pawn Код:
CreateObject(1495,1487.0000000,-1762.4250488,3284.2360840,0.0000000,0.0000000,270.0000000); //object(gen_doorext01)(1)
CreateObject(1495,1483.7900391,-1762.4250488,3284.2360840,0.0000000,0.0000000,270.0000000); //object(gen_doorext01)(2)
CreateObject(1495,1479.8599853,-1758.3199463,3284.2338867,0.0000000,0.0000000,0.0000000); //object(gen_doorext01)(2)
CreateObject(1495,1467.0670166,-1758.3199463,3284.2338867,0.0000000,0.0000000,0.0000000); //object(gen_doorext01)(2)
Re: MoveDynamicObject - Help. -
BadFella - 16.10.2013
Hum, I had used both options and worked.
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;
}
Re: MoveDynamicObject - Help. -
Chrillzen - 16.10.2013
Oh. I forgot to define the objects by door = etc. Thanks!
Re: MoveDynamicObject - Help. -
BadFella - 16.10.2013
No problem, we need to help eachother