if(strcmp(cmd, "/celldoor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if (!PlayerToPoint(100, playerid,322.44, 308.38, 999.15)) // FCPD HQ
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not Inside the FCPD Station ");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /celldoor [Door Number]");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "|_______ CELL CONTROL PANEL _______|");
SendClientMessage(playerid, COLOR_GRAD1, "| 1: INNER CELL DOOR 2: OUTER CELL DOOR");
return 1;
}
new item3 = strval(tmp);
if (item3 == 1)
{
{
if(cellopen1==0)
{
SendClientMessage(playerid, COLOR_GREY,"You have OPENED the inner Cell door");
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000+5, 1.0);
cellopen1 = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"You have CLOSED the inner Cell door");
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000, 2.0);
cellopen1 = 0;
}
return 1;
}
}
if (item3 == 2)
{
{
if(cellopen2==0)
{
SendClientMessage(playerid, COLOR_GREY,"You have OPENED the Outer Cell Door");
MoveObject(celldoor2, 14856,311.10000610,320.70001221,1000.00000000+5, 2.0);
cellopen2 = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"You have CLOSED the Outer Cell Door");
MoveObject(celldoor2, 14856,311.10000610,320.70001221,1000.00000000, 2.0);
cellopen2 = 0;
}
return 1;
}
}
} // Faction
} // Connected
} // First
celldoor1 = CreateObject(14856,312.50000000,320.79998779,1000. 00000000,0.00000000,0.00000000,90.00000000); //object(cellsa) (1)-- INNER CELLS celldoor2 = CreateObject(14856,311.10000610,320.70001221,1000. 00000000,0.00000000,0.00000000,270.00000000); //object(cellsa) (1)-- OUTER CELLS |
if(cellopen1==0)
{
SendClientMessage(playerid, COLOR_GREY,"You have OPENED the inner Cell door");
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000+5, 1.0);
cellopen1 = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"You have CLOSED the inner Cell door");
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000, 2.0);
cellopen1 = 0;
}
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000, 2.0); //You have this code inside when player open the door and when player close the door
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000+5, 1.0);
Actually i don't see the difference here
pawn Код:
pawn Код:
EDIT: hmmm i saw the difference you have +5 in open door and theres no +5 in closed Maybe the problem is in this line pawn Код:
|