PayDay Problem
#1

Hey i'm back with an other problem with dialogs.

well this are the lines:
Код:
public SyncTime()
{
	new string[64];
	new tmphour;
	new tmpminute;
	new tmpsecond;
	gettime(tmphour, tmpminute, tmpsecond);
	FixHour(tmphour);
	tmphour = shifthour;
	if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
	{
		format(string, sizeof(string), "SERVER: The time is now %d:00 hours",tmphour);
		BroadCast(COLOR_WHITE,string);
		ghour = tmphour;
		PayDay();
		if (realtime)
		{
			SetWorldTime(tmphour);
		}
		format(string, sizeof(string), "~y~Lotto Time!! ~n~~w~Alege un numar ~n~~p~/lotto 1-80 ~g~($100) ~n~~r~Premiu: ~g~$%d", Jackpot);
        if(TD3D == 1)
		{
       		KillTimer(HideTD4Timer);
			TextDrawHideForAll(TD3);
	 		TextDrawSetString(TD3, string);
			TextDrawShowForAll(TD3);
			HideTD4Timer = SetTimer("HideTD4", 8500, false);
		}
		else
		{
			TextDrawSetString(TD3, string);
		   	TextDrawShowForAll(TD3);
		   	TD3D = 1;
		   	HideTD4Timer = SetTimer("HideTD4", 8500, false);
		}
		SetTimer("StartLotto",120000,false);
	}
}
Код:
public PayDay()
{
	new string[128];
	new account,interest;
	new rent = 0;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(PlayerInfo[i][pLevel] > 0)
		    {
			    if(MoneyMessage[i]==1)
				{
				    SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
				    GameTextForPlayer(i, "~r~Busted!", 2000, 1);
				    SetPlayerInterior(i, 10);
				    PlayerInfo[i][pInt] = 10;
			   		SetPlayerPos(i, 224.1168,114.4357,999.0156);
		            PlayerInfo[i][pJailed] = 1;
		            ResetPlayerWeapons(i);
		            ResetPlayerMoney(i);
					WantedPoints[i] = 0;
					PlayerInfo[i][pWanted] = 0;
					PlayerInfo[i][pWantedLevel] = 0;
					PlayerInfo[i][pJailTime] = 240;
					format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[i][pJailTime]);
					SendClientMessage(i, COLOR_WHITE, string);
				}
				new playername2[MAX_PLAYER_NAME];
				GetPlayerName(i, playername2, sizeof(playername2));
				account = PlayerInfo[i][pAccount];
				new key = PlayerInfo[i][pPhousekey];
				if(key != 255)
				{
					rent = HouseInfo[key][hRent];
					if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
					{
						rent = 0;
					}
					else if(rent > GetPlayerMoney(i))
					{
						PlayerInfo[i][pPhousekey] = 255;
						SendClientMessage(i, COLOR_WHITE, "You have been evicted.");
						rent = 0;
					}
					HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
				}
				new tmpintrate;
				if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
				{
				    if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = intrate+4; }
					else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
				}
				else
				{
				    if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; }
					else { tmpintrate = 1; }
				}
				if(PlayerInfo[i][pPayDay] >= 5)
				{
				    Tax += TaxValue;//Should work for every player online
				    PlayerInfo[i][pAccount] -= TaxValue;
					new checks = PlayerInfo[i][pPayCheck] / 5;
					if(PlayerInfo[i][pDonateRank] > 0)
					{
					    new bonus = PlayerInfo[i][pPayCheck] / 10;
					    checks += bonus;
					}
				    new ebill = 100*(PlayerInfo[i][pLevel]);
				    //ConsumingMoney[i] = 1;
				    //SafeGivePlayerMoney(i, checks);
				    account += checks;
				    if(PlayerInfo[i][pPhousekey] != 255)
				    {
				    	PlayerInfo[i][pAccount] -= ebill;
				    	SBizzInfo[4][sbTill] += ebill;
					}
					else
					{
					    ebill = 0;
					}
					interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
					PlayerInfo[i][pExp]++;
					PlayerPlayMusic(i);
					PlayerInfo[i][pAccount] = account+interest;
					new str[1024];
					new h,mi,s;
					gettime(h,mi,s);
					FixHour(h);
					new money=GetPlayerMoney(i);
 					format(str,1024,""#COL_WHITE"_________|"#COL_RED"STATISTICI BANCA"#COL_WHITE"|_________\n\n");
 					format(str,1024,"%s"#COL_WHITE"Bani primiti: "#COL_GRO"%d$\n",str,checks);
 					format(str,1024,"%s"#COL_WHITE"Taxa bani: "#COL_GRO"-%d$\n",str,TaxValue);
 					if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255){format(str,1024,"%s"#COL_WHITE"Electicitate Bill: "#COL_GRO"-%d$\n",str,ebill);}
                    format(str,1024,"%s"#COL_WHITE"Balanta veche: "#COL_GRO"%d$\n",str,account - checks);
                    format(str,1024,"%s"#COL_WHITE"Dobanda: "#COL_GRO"0.%d "#COL_WHITE"percent\n",str,tmpintrate);
                    format(str,1024,"%s"#COL_WHITE"Castig "#COL_GRO"%d$\n",str , interest);
                    format(str,1024,"%s"#COL_WHITE"Bani cont: "#COL_GRO"%d$\n",str , PlayerInfo[i][pAccount]);
                    format(str,1024,"%s"#COL_WHITE"Ora: "#COL_CYAN"%02d:%02d",str,h,mi);
                    format(str,1024,"%s\t\t       "#COL_RED"PayDay\n",str);
                    format(str,1024,"%s\t\t\t\t"#COL_BLUE"PayCheck",str);
					ShowPlayerDialog( i, 29638, DIALOG_STYLE_MSGBOX, " ", str, "Iesi", "" );
					format(string, sizeof(string), "~y~PayDay~n~~w~Check paid into your account");
					GameTextForPlayer(i, string, 5000, 1);
					rent = 0;
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					PlayerInfo[i][pConnectTime] += 1;
					if(FarmerVar[i] == 0)
					{
						FarmerPickup[i][0] = 0;
					}
					if(DrugFarmerVar[i] == 0)
					{
						DrugFarmerPickup[i][0] = 0;
					}
					if(SmugglerWork[i] == 0)
					{
						PayDaySecure[i] = 0;
					}
					if(PlayerInfo[i][pDonateRank] > 0)
					{
					    PlayerInfo[i][pPayDayHad] += 1;
					    if(PlayerInfo[i][pPayDayHad] >= 5)
					    {
					        PlayerInfo[i][pExp]++;
					        PlayerInfo[i][pPayDayHad] = 0;
					    }
					}
				}
				else
				{
				    SendClientMessage(i, COLOR_WHITE, "* You haven't played long enough to obtain a PayDay.");
				}
			}
		}
	}
	SaveAccounts();
	return 1;
}
Код:
synctimer = SetTimer("SyncUp", 60000, 1);
Код:
public SyncUp()
{
	SyncTime();
	DollahScoreUpdate();
}
it show's format(string, sizeof(string), "SERVER: The time is now %d:00 hours",tmphour); and sync's content but doesn't shows payday dialog..why?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)