Gates only open for ID 3 -> EDIT: Only open for Highest ID
#1

Code:
public NearGateairportlv1()
{
	for(new i=-1; i<MAX_PLAYERS; i++)
	{
	  if(IsPlayerConnected(i))
		{
	    if(PlayerToPoint(10.0, i, 1705.8679,1607.8557,10.0156)/* && HasPGP[i] == 1*/)
	    {
	      new hours; new minute;
	      GetPlayerTime(i,hours,minute);
	      if(hours >=6 && hours < 22)
      	{
          //PlayerPlaySound(playerid, 1142, 1705.8679, 1607.8557, 10.0156);
      		MoveObject(pdgateairportlv1, 1707.989258, 1615.723022, 10.051225, 2.2);
	      	MoveObject(pdgateairportlv2, 1703.269165, 1599.882813, 10.061761, 2.2);
	      }
      	else
	      {
					GameTextForPlayer(i, "Gates closed between 22h - 6h", 3000, 5);
				}
    	}
    	else
    	{
    	  //PlayerPlaySound(playerid, 1143, 1705.8679, 1607.8557, 10.0156);
    	  MoveObject(pdgateairportlv1, 1706.410400, 1610.442505, 10.054688, 2.2);
    	  MoveObject(pdgateairportlv2, 1704.878174, 1605.157593, 10.050623, 2.2);
  	  }
		 }
	 }
}

public NearGateairportls1()
{
	for(new i=-1; i<MAX_PLAYERS; i++)
	{
	  if(IsPlayerConnected(i))
		{
	    if(PlayerToPoint(10.0, i, 1961.5934,-2190.3542,13.5469)/* && HasPGP[i] == 1*/)
	    {
	      new hours; new minute;
	      GetPlayerTime(i,hours,minute);
	      if(hours >=6 && hours < 22)
      	{
          //PlayerPlaySound(playerid, 1142, 1705.8679, 1607.8557, 10.0156);
      		MoveObject(pdgateairportls1, 1969.751099, -2189.767822, 13.585938, 2.2);
	      	MoveObject(pdgateairportls2, 1953.447388, -2189.785156, 13.585938, 2.2);
	      }
      	else
	      {
					GameTextForPlayer(i, "Gates closed between 22h - 6h", 3000, 5);
				}
    	}
    	else
    	{
    	  //PlayerPlaySound(playerid, 1143, 1705.8679, 1607.8557, 10.0156);
    	  MoveObject(pdgateairportls1, 1964.340088, -2189.806396, 13.585938, 2.2);
    	  MoveObject(pdgateairportls2, 1958.871216, -2189.825928, 13.585938, 2.2);
  	  }
		 }
	 }
}
This is my code ... both gates only open for the person with id 3 (tested when id 1 2 3 where active so id 0 not tested) what's wrong!??
EDIT: Tried some more and it comes out that only the person with the highest ID can open these gate ... ! :S !! ?? !!
Reply
#2

Well try this: http://pastebin.com/f33d3d8ee - Should open the gates if the time is correct if not it will send the MSG
Also i suggest you add this:
http://pastebin.com/f2362fe32 - This is the Timer to Close the Gater after it Opens
pawn Code:
//Also you need to add:
new pdgateairportlv1status = 1; /*under new pdgateairportlv1status;*/
btw use this website to post your code: www.pastebin.com
Reply
#3

Thnx for all the tips beginner here

Will test this asap

Grts
Reply
#4

Pawno is wining about "undefind symbol "playerid"" and "i" as well..

Any id how i kinda activate these things again ... like "new playerid;" or something but that doesn't work

Grts

Reply
#5

change

for(new i=-1; i<MAX_PLAYERS; i++)

to

for(new i= 0; i<MAX_PLAYERS; i++)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)