Lock/Unlock
#1

Код:
	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]);
						}
					}
			}
		}
	}
What's wrong with the code? it always enters even if the variable is 1.
Reply
#2

Nevermind, figured it out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)