Gate-time error
#1

Hi guys,

I'm new at scripting so i came here to learn, i searched allot around here for scripts that would give a good "WorldTime" sow for every player the same time but it needs to be like toggleplayerclock or something

Now i have placed a gate at LV Airport and added a time system, sow the gates will stay closed from 22h - 6h and it does work but only after i forced my time with a command of my admin system ?...? When i join my server (working with "toggleplayerclock") the time is 12 00 and continues ofcourse but when i go to the gate it will give me the message "THE GATES ARE CLOSED FROM 22h-6h" <--- problem so i try to fix this ingame with /setalltime 14 14 (hour= 14:14) ... and IT WORKS

But is there anyone who can spot the bug i made? I like to have this thingy work all the time and not only when i forced my time...

Code behind:
Код:
       if(PlayerToPoint(10.0, i, 1705.8679,1607.8557,10.0156)/* && HasPGP[i] == 1*/)
	    {
	      new hours; new minute;
	      GetPlayerTime(playerid,hours,minute);
	      if(hours > 6 && hours < 22)
      	  {
      		MoveObject(pdgateairport1, 1707.989258, 1615.723022, 10.051225, 2.2);
	      	MoveObject(pdgateairport2, 1703.269165, 1599.882813, 10.061761, 2.2);
	      }
	      else
	      {
			GameTextForPlayer(playerid, "Gates closed between 22h - 6h", 3000, 5);
	      }
    	}
    	else
    	{
    	  MoveObject(pdgateairport1, 1706.410400, 1610.442505, 10.054688, 2.2);
    	  MoveObject(pdgateairport2, 1704.878174, 1605.157593, 10.050623, 2.2);
  	   }
Have tried to make it readable changed a bit off tabs but don't think it will change the output.

Grts Rizzy
Reply
#2

change the && to ||
Reply
#3

Quote:
Originally Posted by hoodline
change the && to ||
bull
Reply
#4

Код:
if(hour >=6 && hour <=22) {
Yours would only work if it was below hour 22 and above hour 6.
This makes it so you can use it at the 6 and 22 hour and in between
Reply
#5

Posting from school now

I'll try the || later thnx for replies!!... i also take another look at the <= and >= sings, u said theres something wrong right?


Grts
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)