24.04.2012, 03:02
So here's my Code
IF i do type the Command, Example /celldoor 1 once, it says i OPENED it but it never moved the Object but instead kinda deleted it, then when i type celldoor1 again, it ssays i CLOSED it but nothing happens..
This is in an Interior
Help Plox
PHP код:
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
This is in an Interior
Help Plox