Gate problem
#1

Hello I have a problem with gates, whener I press Y it shows me the text but it's not moving it's just there not moving. Please help, I can't find the reason of this problem.

Код:
enum _gates
{
	gID,
	gFactionID,

	gModelID,

	gOpen,

	Float:closeX, Float:closeY, Float:closeZ, Float: rotX, Float: rotY, Float: rotZ,

	Float:openX, Float:openY, Float:openZ, Float: openrotX, Float: openrotY, Float: openrotZ,
}
Код:
{ 0, -1, 3037, 0, 1589.20276, -1638.26514, 14.48878,0.00000000,0.00000000,-90.00000, 1589.20276, -1638.26514, 8.05993,0.00000000,0.00000000,-90.00000 }
Код:
if((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
    {
        for(new h=0; h<=MAX_GATES; h++)
    	{
		if(GateInfo[h][gModel] && IsPlayerInRangeOfPoint(playerid, 8, GateInfo[h][gCX], GateInfo[h][gCY], GateInfo[h][gCZ]))
		if(PlayerInfo[playerid][playerteam]==GateInfo[h][gFaction])
		{
			if(!GateInfo[h][gStatus])
			{
         		MoveObject(GateInfo[h][gGate], GateInfo[h][gCX], GateInfo[h][gCY], GateInfo[h][gCZ], GateInfo[h][gSpeed]);
				GateInfo[h][gStatus]=1;
				SendClientInfo(playerid, "Done, Good day ! TEST OPEN");
			}
			else
			{
         		MoveObject(GateInfo[h][gGate], GateInfo[h][gCX], GateInfo[h][gCY], GateInfo[h][gCZ], GateInfo[h][gSpeed]);
                GateInfo[h][gStatus]=0;
                SendClientInfo(playerid, "Done, Good day ! ");
			}
			return 1;
		}
	}
	return 1;
    }
Reply
#2

Nevermind it fixed it.
Reply
#3

Quote:
Originally Posted by xdarren
Посмотреть сообщение
Nevermind it fixed it.
Rule of thumb:
Whenever you have a problem and you fix it, post in the thread how you did so others don't have to create the same thread as you.

And the problem with this code was that he set both if and else checks to set the gate position to the same one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)