SA-MP Forums Archive
Lock/Unlock - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Lock/Unlock (/showthread.php?tid=477296)



Lock/Unlock - Beckett - 23.11.2013

Код:
	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.


Re: Lock/Unlock - Beckett - 23.11.2013

Nevermind, figured it out.