[Help] Mathematical calculations, to calculate the time in prison.
#1

Someone would have the calculation, to show the player the minutes or hours that he should stay in prison? sorry I am bad in mathematics. :P
Код:
	if(strcmp(cmd, "/time", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
		  new mtext[20];
			new year, month,day;
			getdate(year, month, day);
			if(month == 1) { mtext = "January"; }
			else if(month == 2) { mtext = "February"; }
			else if(month == 3) { mtext = "March"; }
			else if(month == 4) { mtext = "April"; }
			else if(month == 5) { mtext = "May"; }
			else if(month == 6) { mtext = "June"; }
			else if(month == 7) { mtext = "Juli"; }
			else if(month == 8) { mtext = "August"; }
			else if(month == 9) { mtext = "September"; }
			else if(month == 10) { mtext = "October"; }
			else if(month == 11) { mtext = "November"; }
			else if(month == 12) { mtext = "December"; }
		  new hour,minuite,second;
			gettime(hour,minuite,second);
			FixHour(hour);
			hour = shifthour;
			ApplyAnimation(playerid, "PLAYIDLES", "time", 8.0, 0, 0, 0, 0, 0);
			if (minuite < 10)
			{
				if (PlayerInfo[playerid][pJailTime] > 0)
				{
					format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Jail Time Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
				}
				else
				{
					format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
				}
			}
			else
			{
				if (PlayerInfo[playerid][pJailTime] > 0)
				{
					format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Jail Time Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
				}
				else
				{
					format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
				}
			}
			ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_watch", 4.000000, 0, 0, 0, 0, 0);
			GameTextForPlayer(playerid, string, 5000, 1);
		}
		return 1;
	}
Reply


Messages In This Thread
[Help] Mathematical calculations, to calculate the time in prison. - by vinewood - 02.05.2009, 17:00
Re: [Help] Mathematical calculations, to calculate the time in prison. - by yom - 02.05.2009, 17:43
Re: [Help] Mathematical calculations, to calculate the time in prison. - by JaYmE - 02.05.2009, 17:44

Forum Jump:


Users browsing this thread: 1 Guest(s)