Код:
if(PRESSED(16))
{
if(IsPlayerConnected(playerid))
{
for(new c;c<MAX_CELLS;c++)
{
if(IsPlayerInRangeOfPoint(playerid,MAX_DISTANCE_TO_CELL, CellInfo[c][cOutside][0],CellInfo[c][cOutside][1],CellInfo[c][cOutside][2]))
{
if(CellInfo[c][cLocked] == 1)
{
MSG(playerid,RED,"[Cell] This cell is locked.");
}
else
{
SetPlayerPos(playerid, CellInfo[c][cInside][0],CellInfo[c][cInside][1],CellInfo[c][cInside][2]);
SetPlayerFacingAngle(playerid,CellInfo[c][cOutsideA]);
}
}
else if(IsPlayerInRangeOfPoint(playerid,MAX_DISTANCE_TO_CELL, CellInfo[c][cInside][0],CellInfo[c][cInside][1],CellInfo[c][cInside][2]))
{
if(CellInfo[c][cLocked] == 1)
{
MSG(playerid,RED,"[Cell] This cell is locked.");
}
else
{
SetPlayerPos(playerid, CellInfo[c][cOutside][0],CellInfo[c][cOutside][1],CellInfo[c][cOutside][2]);
SetPlayerFacingAngle(playerid,CellInfo[c][cInsideA]);
}
}
}
}
}