Форум Pawn-Wiki.Ru - Воплоти мечту в реальность!: Система достижений - Форум Pawn-Wiki.Ru - Воплоти мечту в реальность!

Перейти к содержимому

Страница 1 из 1
  • Вы не можете создать новую тему
  • Вы не можете ответить в тему

[ Pawn ]
Система достижений Помогите поставлю +

#1
Пользователь онлайн   Vladislav_King 

  • Новичок
  • Вставить ник
  • Раскрыть информацию
Хотел сделать так чтобы за отыгровку 5ч на сервере выдавались призы, но что то не так подскажите пж
case 4837:
	    {
	        if(response)
	        {
                if(hour[playerid] >= 5)
                {
                    SendClientMessage(playerid, COLOR_BLUE, !"Вы успешно забрали награду!");
                    GiveItem(playerid, ITEM_YCOIN);
                    hour[playerid] = 0;
				}
  	 		}
		}
		case 4838:
		{
	        if(response)
	        {
	            new hour[40];
				if(hour[playerid] >= 5) hour = "{42B02C}[Выполнено]";
				else hour = "{be2d2d}[Не выполнено]";
				format(string, 1200, "{FFFFFF}Название\t{32ff02}Награда\t{808080}Прогресс\n {AFEEEE}Отыграть 5 часов\t{32ff02}10 Y-coin\t{c0c0c0}%d {808080}из 5", hour);
				ShowPlayerDialogEx(playerid, 4837, DIALOG_STYLE_TABLIST_HEADERS, !"Квесты", string, "Принять", "Отмена");
			}
		}

Сообщение отредактировал Vladislav_King: 13 мая 2022 - 17:13

0

#2
Пользователь офлайн   habarov228 

  • Знаток
  • Вставить ник
  • Раскрыть информацию
5ч по PAYDAY или по 300 минут?

Сообщение отредактировал habarov228: 14 мая 2022 - 11:07

0

#3
Пользователь онлайн   Vladislav_King 

  • Новичок
  • Вставить ник
  • Раскрыть информацию
Типо пришёл PayDay и + 1, потом опять PayDay и ещё +1 и так далее
0

#4
Пользователь офлайн   habarov228 

  • Знаток
  • Вставить ник
  • Раскрыть информацию
весь таймер PAYDAY показывай че ещё делать
0

#5
Пользователь офлайн   ILST 

  • Пользователь
  • Вставить ник
  • Раскрыть информацию

Просмотр сообщенияhabarov228 (14 мая 2022 - 12:38) писал:

весь таймер PAYDAY показывай че ещё делать

stock PayDay()
{
	new string[900];
	SaveInforamtion();

	k1 = RandomEx(1,5);
	k2 = RandomEx(1,5);
	k3 = RandomEx(1,5);

  	for(new i = 0; i < total_players; i++)
	{
	    if(!IsPlayerConnected(i)) continue;
	    if(IsPlayerLogged[i])
	    {
			if(PI[i][pAdmin])
				UpdatePlayerData(i, "AdminTime", PI[i][pAdminTime]);

   			new temp_pd_message;
   			if(pl_afk_time[i] >= 60)
			{
			 	SendClientMessage(i, COLOR_GREY, !"Âû íå ïîëó÷èëè PayDay, ïîòîìó ÷òî áûëè â ÀÔÊ");
			 	PI[i][pPlayed] = 0;
	 			continue;
			}
			if(!payday_admin)
			{
		        if(PI[i][pPlayed] < 1200)
				{
				 	SendClientMessage(i, COLOR_GREY, !"Äëÿ ïîëó÷åíèÿ PayDay âû äîëæíû îòûãðàòü ìèíèìóì 25 ìèíóò.");
				 	PI[i][pPlayed] = 0;
		 			continue;
				}
			}

   			if(PI[i][pDaysExp] > 0 || exp_x2 == 1)
   			    PI[i][pExp] += 2;

   			else
	        	PI[i][pExp]++;


	        new money, salary;
	        SendClientMessage(i, COLOR_WHITE, !"      Áàíêîâñêèé ÷åê");
	        SendClientMessage(i, COLOR_WHITE, !"---------------------------------");
	        /*if(GetTeamID(i) > 0)
	        {
	        	money += OrgSalary[GetTeamID(i)][PI[i][pRank]];
	        	format(string,sizeof(string),"     Çàðïëàòà: {42B02C}%d$",OrgSalary[GetTeamID(i)][PI[i][pRank]]);
	        	SendClientMessage(i, COLOR_WHITE, string);
	        }*/
	        if(!pTemp[i][pTempLeader])
	        {
		        if(PI[i][pFraction] && PI[i][pCard])
		        {
					PI[i][pPointsOrg] += 2;
		        }
		        if(IsAGang(i))
		        {
					money += gangzone_total[IsAGang(i)]*70;
					format(string, sizeof string, "     Çàðïëàòà: {42B02C}%d$", gangzone_total[IsAGang(i)]*70);
					SendClientMessage(i, COLOR_WHITE, string);
		        }
		        else if(IsAMafia(i))
				{
					money += gFractionSalary[PI[i][pFraction]-1][PI[i][pRank]-1];
					format(string, sizeof string, "     Çàðïëàòà: {42B02C}%d$", gFractionSalary[PI[i][pFraction]-1][PI[i][pRank]-1]);

					SendClientMessage(i, COLOR_WHITE, string);
				}
				else if(PI[i][pFraction] == 1 || PI[i][pFraction] == 7 || PI[i][pFraction] == 8 || PI[i][pFraction] == 9 || PI[i][pFraction] == 10 || PI[i][pFraction] == 11)
				{
				    if(OrgInfo[PI[i][pFraction]-1][oMoney] > gFractionSalary[PI[i][pFraction]-1][PI[i][pRank]-1])
				    {
				        new
							nalog;

				        if(PI[i][pBonus] > 0)
				            salary += PI[i][pBonus];

						if(gSalaryNalog > 0)
						{
						    nalog = (gFractionSalary[PI[i][pFraction]-1][PI[i][pRank]-1]/
100)*gSalaryNalog;
						    salary += gFractionSalary[PI[i][pFraction]-1][PI[i][pRank]-1]-nalog;

						    OrgInfo[9][oMoney] += nalog;
						}

						else
							salary += gFractionSalary[PI[i][pFraction]-1][PI[i][pRank]-1];

			        	format(string, sizeof string, "     Çàðïëàòà: {42B02C}%d$", salary);
			        	SendClientMessage(i, COLOR_WHITE, string);
			        	OrgInfo[PI[i][pFraction]-1][oMoney] -= gFractionSalary[PI[i][pFraction]-1][PI[i][pRank]-1];
			        	PI[i][pBonus] = 0;
				    }
				    else
					{
				        money += 500;
			        	SendClientMessage(i, COLOR_WHITE, !"     Çàðïëàòà: {42B02C}500$");
				        temp_pd_message = true;
					}
				}
			}
			if(PI[i][pSalary])
			{
				money += PI[i][pSalary];
				format(string, sizeof string, "     Çàðïëàòà: {42B02C}%d$", PI[i][pSalary]);
				SendClientMessage(i, COLOR_WHITE, string);
				PI[i][pSalary] = 0;
			}
			if(PI[i][pAdmin])
			{
				new
					money_admin;

				if(PI[i][pAdmin] >= 2)
				    money_admin += 5000+(PI[i][pAdmin]*2000);

				else if(PI[i][pAdmin] == 1)
				    money_admin += 5000;

			    money += money_admin;
	        	format(string,sizeof(string),"     Àäìèí. ÇÏ: {42B02C}%d$", money_admin);
	        	SendClientMessage(i, COLOR_WHITE, string);
			}

			if(PI[i][pTester])
			{
			    money += 2000;
	        	SendClientMessage(i, COLOR_WHITE, "     Çàðïëàòà òåñòåðà: {42B02C}2000$");
			}
			if(PI[i][pLevel] >= gPensionAge)
			{
			    money += gPension;
			    OrgInfo[9][oMoney] -= gPension;
	        	format(string,sizeof(string),"     Ïåíñèÿ: {42B02C}%d$", gPension);
	        	SendClientMessage(i, COLOR_WHITE, string);
			}

	        money += salary;

	        //GiveBankMoney(i, money);
	        PI[i][pBank] += money;
	        format(string,sizeof(string),"     Ñ÷¸ò: {42B02C}%d$\n",PI[i][pBank]);
	        SendClientMessage(i, COLOR_WHITE, string);
	        if(PI[i][pWanted] > 0)
	        {
	            PI[i][pWanted]--;
	            SetPlayerWantedLevel(i, PI[i][pWanted]);
	        }
	        else
			{
			    if(PI[i][pZKP] < 100)
					PI[i][pZKP]++;
			}
			//SaveAccount(i);
	        SCM(i, COLOR_WHITE, !"---------------------------------");
	        format(string, sizeof(string), "~y~PAYDAY");
	        PI[i][pPlayed] = 0;
			GameTextForPlayer(i, string, 3000, 1);

	        CheckNextLevel(i);
	   		if(PI[i][pFraction] == 7)
			{
				if(PI[i][pRank] != PI[i][pArmyRank])
				{
					PI[i][pArmyTime]++;
					if(PI[i][pArmyTime] >= 5)
					{
						PI[i][pArmyTime] = 0;
						PI[i][pArmyRank] = PI[i][pRank];
						SendClientMessage(i, COLOR_GREEN, !"Âàøå òåêóùåå çâàíèå â àðìèè áûëî âíåñåíî â âîèíñêèé ó÷åò");
					}
				}
				else PI[i][pArmyTime] = 0;
				UpdatePlayerData(i, "ArmyTime", PI[i][pArmyTime]);
				UpdatePlayerData(i, "ArmyRank", PI[i][pArmyRank]);
			}
			if(PI[i][pMesDisease] && PI[i][pAdmin] == 0)
			{
				switch(random(3))
				{
				    case 2:
					{
						new
						    disease = RandomEx(1, 6),
							frmt_disease[128];

				    	if(PI[i][pVaccine][disease] == 0)
						{
						    PI[i][pDisease] = disease;
						    PI[i][pMesDisease] = 0;
						    format(frmt_disease, sizeof frmt_disease, "Âû çàáîëåëè áîëåçíüþ {FF0000}%s", gDiseaseName[disease-1]);
						    SendClientMessage(i, COLOR_WHITE, frmt_disease);
						    SendClientMessage(i, COLOR_WHITE, !"{FFC800}[Ïîäñêàçêà] {FFFFFF}Îòïðàâëÿéòåñü â áëèæàéøóþ áîëüíèöó äëÿ ëå÷åíèÿ");
						    if(PI[i][pDisease] == 2 || PI[i][pDisease] == 3 || PI[i][pDisease] == 6)
						        temp_disease_timer[i] = 180;
						}
					}

			    }
			}
			if(temp_pd_message)
			    SendClientMessage(i, COLOR_GREY, !" áþäæåòå îðãàíèçàöèè íåäîñòàòî÷íî ñðåäñòâ äëÿ âûïëàòû çàðïëàòû");

			new
				query_save_payday[450];

			format(query_save_payday, sizeof query_save_payday, "UPDATE `accounts` SET `Exp` = '%d', `Level` = '%d', `Age` = '%d', `ZKP` = '%d', `Bonus` = '%d', `Salary` = '%d', `Disease` = '%d', `MesDisease` = '%d', `Wanted` = '%d', `PointsOrg` = '%d', `Bank` = '%d' WHERE `ID` = '%d'",
			PI[i][pExp], PI[i][pLevel], PI[i][pAge], PI[i][pZKP], PI[i][pBonus], PI[i][pSalary], PI[i][pDisease], PI[i][pMesDisease], PI[i][pWanted], PI[i][pPointsOrg], PI[i][pBank], PI[i][pID]);
			mysql_tquery(mysql, query_save_payday, "", "");


	    }
		else SendClientMessage(i, COLOR_GREY, !"Âû íå àâòîðèçèðîâàíû äëÿ ïîëó÷åíèÿ çàðïëàòû");
	}

	new
	    frmt_balance[128], query_money_upt[80];

	format(frmt_balance, sizeof frmt_balance, "Íà ñ÷åòó îðãàíèçàöèè: {BD4D4D}%d$", OrgInfo[0][oMoney]);
	UpdateDynamic3DTextLabelText(gFractionMoney[0], 0xFFFFFFFF, frmt_balance);

	format(frmt_balance, sizeof frmt_balance, "Íà ñ÷åòó îðãàíèçàöèè: {BD4D4D}%d$", OrgInfo[6][oMoney]);
	UpdateDynamic3DTextLabelText(gFractionMoney[6], 0xFFFFFFFF, frmt_balance);

	format(frmt_balance, sizeof frmt_balance, "Íà ñ÷åòó îðãàíèçàöèè: {BD4D4D}%d$", OrgInfo[7][oMoney]);
	UpdateDynamic3DTextLabelText(gFractionMoney[7], 0xFFFFFFFF, frmt_balance);

	format(frmt_balance, sizeof frmt_balance, "Íà ñ÷åòó îðãàíèçàöèè: {BD4D4D}%d$", OrgInfo[8][oMoney]);
	UpdateDynamic3DTextLabelText(gFractionMoney[8], 0xFFFFFFFF, frmt_balance);

	format(frmt_balance, sizeof frmt_balance, "Áþäæåò øòàòà: {BD4D4D}%d$", OrgInfo[9][oMoney]);
	UpdateDynamic3DTextLabelText(gFractionMoney[9], 0xFFFFFFFF, frmt_balance);

	format(frmt_balance, sizeof frmt_balance, "Íà ñ÷åòó îðãàíèçàöèè: {BD4D4D}%d$", OrgInfo[10][oMoney]);
	UpdateDynamic3DTextLabelText(gFractionMoney[10], 0xFFFFFFFF, frmt_balance);

	format(query_money_upt, sizeof query_money_upt, "UPDATE `orginfo` SET `money` = '%d' WHERE `id` = 1", OrgInfo[0][oMoney]);
	mysql_tquery(mysql, query_money_upt);

	format(query_money_upt, sizeof query_money_upt, "UPDATE `orginfo` SET `money` = '%d' WHERE `id` = 7", OrgInfo[6][oMoney]);
	mysql_tquery(mysql, query_money_upt);
	format(query_money_upt, sizeof query_money_upt, "UPDATE `orginfo` SET `money` = '%d' WHERE `id` = 8", OrgInfo[7][oMoney]);
	mysql_tquery(mysql, query_money_upt);
	format(query_money_upt, sizeof query_money_upt, "UPDATE `orginfo` SET `money` = '%d' WHERE `id` = 9", OrgInfo[8][oMoney]);
	mysql_tquery(mysql, query_money_upt);
	format(query_money_upt, sizeof query_money_upt, "UPDATE `orginfo` SET `money` = '%d' WHERE `id` = 10", OrgInfo[9][oMoney]);
	mysql_tquery(mysql, query_money_upt);
	format(query_money_upt, sizeof query_money_upt, "UPDATE `orginfo` SET `money` = '%d' WHERE `id` = 11", OrgInfo[10][oMoney]);
	mysql_tquery(mysql, query_money_upt);

	for(new tx; tx < 5; tx++)
	{
		new
			money = gangzone_total[tx]*200;

	    gGangStorage[tx][3] += money;

		format(query_money_upt, sizeof query_money_upt, "UPDATE `gangs` SET `money` = '%d' WHERE `id` = %d", gGangStorage[tx][3], tx+1);
		mysql_tquery(mysql, query_money_upt);
	}
	UpdateTextGang();

	new hours, minutes, seconds;
	gettime(hours, minutes, seconds);
	if(hours == 0)
	{
	    for(new hid; hid < OWNABLEHOUSES; hid++)
		{
		    new str[256];

		    if(GetString(HouseInfo[hid][hOwner],"The State") || HouseInfo[hid][hSeal] == 1)
				continue;

			if(HouseInfo[hid][hDays] > 1)
			    HouseInfo[hid][hDays]--;

	     	else
	     	{
	     		new
				 	ownerid = -1,
			 		rent = -1;

		        foreach(new p: Player)
		        {
		            for(new i;i < 3;i ++)
					{
					    if(GetString(HRoomOwner[hid][i], PN(p)))
						{
						    if(IsPlayerLogged[p] && IsPlayerConnected(p))
							{
								PI[p][pSpawn] = 0;
								UpdatePlayerData(p, "Spawn",0);
		                        PI[p][pHouseKey]=0;
		                        UpdatePlayerData(p, "HouseKey", PI[p][pHouseKey]);
		                        rent = p;
							}
						}

					}
					if(GetString(HouseInfo[hid][hOwner], PN(p)) && HouseInfo[hid][hSeal] == 0 && IsPlayerConnected(p))
					{
					    if(IsPlayerLogged[p] && IsPlayerConnected(p))
						{
						    PI[p][pReturnHouse] += HouseInfo[hid][hCost]/100*80;
						    PI[p][pHouseKey] = 0;
						    UpdatePlayerData(p, "HouseKey", PI[p][pHouseKey]);

							if(PI[p][pCars] != 0)
							{
							    new
							        carid = GetCarSlot(PI[p][pCars]),
									vehicleid = CarInfo[carid][cVehID];

								new
									query_car[256];

								format(query_car, sizeof query_car, "DELETE FROM `cars` WHERE `cID` = '%d'", PI[p][pCars]);

								mysql_tquery(mysql, query_car);

								CarInfo[carid][cID] = 0;

								CarInfo[carid][cColor_1] = 0;
								CarInfo[carid][cColor_2] = 0;
								CarInfo[carid][cOwnerID] = 0;
								strdel(CarInfo[carid][cNumber], 0, 12);
								strdel(CarInfo[carid][cDate], 0, 20);
								CarInfo[carid][cFuel] = 0.0;
								CarInfo[carid][cHealth] = 0.0;
								CarInfo[carid][cMilage] = 0.0;
								CarInfo[carid][cSignal] = 0;
								CarInfo[carid][cPaintJob] = 5;
								CarInfo[carid][cSignal] = 0;

								for(new tn; tn < 14; tn++)
									if(CarInfo[carid][cTuning][tn] != 0) RemoveVehicleComponent(CarInfo[carid][cVehID], CarInfo[carid][cTuning][tn]), CarInfo[carid][cTuning][tn] = 0;

								ChangeVehiclePaintjob(CarInfo[carid][cVehID], 5);


                                VehicleInfo[carid][vLock] = 0;

					            if(CarInfo[carid][cVehID] != INVALID_VEHICLE_ID)
									DestroyVehicle(vehicleid), VehicleInfo[vehicleid][vLock] = 0;

								CarInfo[carid][cVehID] = INVALID_VEHICLE_ID;
					            PI[p][pCars] = 0;
					            UpdatePlayerData(p, "Cars", PI[p][pCars]);
					            PI[p][pPTS] = 0;
					            UpdatePlayerData(p, "PTS", PI[p][pPTS]);
					            temp_car_num_get[p] = 0;

					            PI[p][pReturnHouse] += Transport[CarInfo[carid][cModelID]][trPrice]/100*80;
					            printf("Return online [HID = %d], [carid = %d], car=%d, house=%d, Owner(sys): %s, Owner(get) %s", hid, carid, Transport[CarInfo[carid][cModelID]][trPrice]/100*80, HouseInfo[hid][hCost]/100*80, HouseInfo[hid][hOwner], PN(p));
					            CarInfo[carid][cModelID] = 0;

				            }


							if(IsValidDynamic3DTextLabel(HintStoreText[hid]))
							    DestroyDynamic3DTextLabel(HintStoreText[hid]);

							if(IsValidDynamic3DTextLabel(HintSafeText[hid]))
							    DestroyDynamic3DTextLabel(HintSafeText[hid]);

							if(IsValidDynamicObject(HintStoreObject[hid]))
							    DestroyDynamicObject(HintStoreObject[hid]);

							if(IsValidDynamicObject(HintSafeObject[hid]))
							    DestroyDynamicObject(HintSafeObject[hid]);

				            new
				                improve;

							for(new i; i < 4; i++)
							{
							    if(HouseInfo[hid][hImprove][i])
							    {
									HouseInfo[hid][hImprove][i] = 0;
									improve += HouseImprovePrice[i];
								}
							}

							if(improve)
							    PI[p][pReturnHouse] += improve/100*80;

                            UpdatePlayerData(p, "ReturnHouse", PI[p][pReturnHouse]);
				     		for(new i;i<8;i++)
				     		{
				     		    HouseInfo[hid][hGun][i] = 0;
								DestroyDynamicObject(HouseGunObject[hid][i]);
								HouseGunObject[hid][i] = 0;
							}
					        ownerid = p;
					        SendClientMessage(p, COLOR_WHITE, !"{FFFF66}[BANK] {FFFFFF}Âàø äîì áûë ïðîäàí ãîñóäàðñòâó çà íåóïëàòó!");
					        SendClientMessage(p, COLOR_WHITE, !"{FFFF66}[BANK] {FFFFFF}Åñëè ó Âàñ áûë òðàíñïîðò, îí òîæå áûë ïðîäàí");
					        SendClientMessage(p, COLOR_WHITE, !"{FFC800}[Ïîäñêàçêà] {FFFFFF}Ïîëó÷èòü 80 ïðîöåíòîâ îò ñòîèìîñòè ñïèñàííîãî èìóùåñòâà âû ìîæåòå â áàíêå");
					        HouseInfo[hid][hSeal] = 1;
					        SaveHouse(hid);
					        break;

						}
					}
				}
	            if(rent == -1)
				{
				    for(new i;i < 3;i ++)
					{
					    if(!GetString(HRoomOwner[hid][i],"The State"))
						{
						    format(str, sizeof(str), "UPDATE `accounts` SET `HouseKey` = '0' WHERE `NickName` = '%s'", HRoomOwner[hid][i]);
							mysql_tquery(mysql, str);
						}
					}
				}
	            for(new i;i < 3;i ++)
					SetString(HRoomOwner[hid][i], "The State");

				if(ownerid == -1 && HouseInfo[hid][hSeal] == 0)
				{
					new
					    query_carid[60 + MAX_PLAYER_NAME],
						id = strval(MySQLGetPlayerParam(HouseInfo[hid][hOwner], "ID"));

					format(query_carid, sizeof query_carid, "SELECT * FROM `cars` WHERE `cOwnerID` = '%d' ", id);

					new
						Cache:result = mysql_query(mysql, query_carid),
						carid,
						modelid;

					if(cache_get_row_count(mysql))
					{
					    carid = cache_get_row_int(0, 0);
						modelid = cache_get_row_int(0, 2);
						new refund = Transport[modelid][trPrice]/100*80;


					    format(str, sizeof(str), "UPDATE `accounts` SET `Cars` = '0', `ReturnHouse` = `ReturnHouse`+'%d' WHERE `NickName` = '%s'", refund, HouseInfo[hid][hOwner]);
						mysql_tquery(mysql, str);

						printf("Return offline [HID = %d], [carid = %d], car=%d, house=%d, modelid = %d, Owner(sys): %s", hid, carid, refund, HouseInfo[hid][hCost]/100*80, modelid, HouseInfo[hid][hOwner]);

						new
							query_car[256];

						format(query_car, sizeof query_car, "DELETE FROM `cars` WHERE `cID` = '%d'", carid);

						mysql_tquery(mysql, query_car);
					}

					cache_delete(result, mysql);

					new refund = HouseInfo[hid][hCost]/100*80;

				    format(str, sizeof(str), "UPDATE `accounts` SET `HouseKey` = '0', `Cars` = '0', `ReturnHouse` = `ReturnHouse`+'%d' WHERE `NickName` = '%s'", refund, HouseInfo[hid][hOwner]);
					mysql_tquery(mysql, str);

					printf("Return offline [HID = %d], house=%d, Owner(sys): %s", hid, HouseInfo[hid][hCost]/100*80, HouseInfo[hid][hOwner]);

					if(IsValidDynamic3DTextLabel(HintStoreText[hid]))
					    DestroyDynamic3DTextLabel(HintStoreText[hid]);

					if(IsValidDynamic3DTextLabel(HintSafeText[hid]))
					    DestroyDynamic3DTextLabel(HintSafeText[hid]);

					if(IsValidDynamicObject(HintStoreObject[hid]))
					    DestroyDynamicObject(HintStoreObject[hid]);

					if(IsValidDynamicObject(HintSafeObject[hid]))
					    DestroyDynamicObject(HintSafeObject[hid]);

		            new
		                improve;

					for(new i; i < 4; i++)
					{
					    if(HouseInfo[hid][hImprove][i])
					    {
							HouseInfo[hid][hImprove][i] = 0;
							improve += HouseImprovePrice[i];
						}
					}

					if(improve)
					    PI[hid][pReturnHouse] += improve/100*80;

		     		for(new i;i<8;i++)
		     		{
		     		    HouseInfo[hid][hGun][i] = 0;
						DestroyDynamicObject(HouseGunObject[hid][i]);
						HouseGunObject[hid][i] = 0;
					}

					HouseInfo[hid][hSeal] = 1;
				}

				//SetString(HouseInfo[hid][hOwner],"The State");

			    //UpdateHouse(hid);
	     	}
			SaveHouse(hid);
		}

		for(new bizid; bizid < OWNABLEBIZES; bizid++)
		{
		    if(GetString(BizInfo[bizid][bOwner],"The State") || BizInfo[bizid][bSeal] == 1)
				continue;

	        BizInfo[bizid][bNum]=0;
	        BizInfo[bizid][bVisit]=0;
	        BizInfo[bizid][bWin]=0;

		    if(BizInfo[bizid][bDays] > 1)
		        BizInfo[bizid][bDays]--;

		    else
		    {
		        new
					str[256],
		        	ownerid = -1;

		        for(new p = 0, j = GetPlayerPoolSize(); p <= j; p++)
		        {
					if(GetString(BizInfo[bizid][bOwner], PN(p)) && BizInfo[bizid][bSeal] == 0 && IsPlayerConnected(p))
					{
					    if(IsPlayerLogged[p] && IsPlayerConnected(p))
						{
						    PI[p][pBizKey] = 0;
							UpdatePlayerData(p, "BizKey", PI[p][pBizKey]);
							PI[p][pReturnBusiness] += BizInfo[bizid][bCost]/100*80;
							UpdatePlayerData(p, "ReturnBusiness", PI[p][pReturnBusiness]);
					        ownerid = p;

					        SendClientMessage(p, COLOR_WHITE, !"{FFFF66}[BANK] {FFFFFF}Âàø áèçíåñ áûë ïðîäàí ãîñóäàðñòâó çà íåóïëàòó!");
					        SendClientMessage(p, COLOR_WHITE, !"{FFC800}[Ïîäñêàçêà] {FFFFFF}Ïîëó÷èòü 80 ïðîöåíòîâ îò ñòîèìîñòè ñïèñàííîãî èìóùåñòâà âû ìîæåòå â áàíêå");
					        BizInfo[bizid][bSeal] = 1;
					        printf("[SELLBIZ ONLINE] ID: %d, Owner(system): %s, Owner(get): %s", bizid, BizInfo[bizid][bOwner], PN(p));
					        break;

						}
					}
				}

				if(ownerid == -1 && BizInfo[bizid][bSeal] == 0)
				{
				    format(str, sizeof(str), "UPDATE `accounts` SET `BizKey` = 0, `ReturnBusiness`=`ReturnBusiness`+'%d' WHERE `NickName` = '%s'; ",BizInfo[bizid][bCost]/100*80, BizInfo[bizid][bOwner]);
					mysql_tquery(mysql, str);
					BizInfo[bizid][bSeal] = 1;
					printf("[SELLBIZ OFFLINE] ID: %d, Owner: %s", bizid, BizInfo[bizid][bOwner]);
				}
				//SetString(BizInfo[bizid][bOwner], "The State");

		    }
		    SaveBiz(bizid);
		}
		for(new fid; fid < MAX_FILLING; fid++)
		{
		    if(GetString(gFillings[fid][fillingOwner], "The State") || gFillings[fid][fillingSeal] == 1)
				continue;

		    if(gFillings[fid][fillingDay] > 1)
		        gFillings[fid][fillingDay]--;

		    else
		    {
		        new
					str[256],
		        	ownerid = -1;

		        for(new p = 0, j = GetPlayerPoolSize(); p <= j; p++)
		        {
					if(GetString(gFillings[fid][fillingOwner], PN(p)) && gFillings[fid][fillingSeal] == 0 && IsPlayerConnected(p))
					{
					    if(IsPlayerLogged[p] && IsPlayerConnected(p))
						{
						    PI[p][pBizKey] = 0;
						    UpdatePlayerData(p, "BizKey", PI[p][pBizKey]);
							PI[p][pReturnFilling] += gFillings[fid][fillingPrice]/100*80;
							UpdatePlayerData(p, "ReturnFilling", PI[p][pReturnFilling]);
					        ownerid = p;

					        SendClientMessage(p, COLOR_WHITE, !"{FFFF66}[BANK] {FFFFFF}Âàøà ÀÇÑ áûëà ïðîäàíî ãîñóäàðñòâó çà íåóïëàòó!");
					        SendClientMessage(p, COLOR_WHITE, !"{FFC800}[Ïîäñêàçêà] {FFFFFF}Ïîëó÷èòü 80 ïðîöåíòîâ îò ñòîèìîñòè ñïèñàííîãî èìóùåñòâà âû ìîæåòå â áàíêå");
					        gFillings[fid][fillingSeal] = 1;
					        break;

						}
					}
				}

				if(ownerid == -1 && gFillings[fid][fillingSeal] == 0)
				{
				    format(str, sizeof(str), "UPDATE `accounts` SET `BizKey` = 0, `ReturnFilling`=`ReturnFilling`+'%d' WHERE `NickName` = '%s'; ", gFillings[fid][fillingPrice]/100*80, gFillings[fid][fillingOwner]);
					mysql_tquery(mysql, str);
					gFillings[fid][fillingSeal] = 1;
				}

				//SetString(gFillings[fid][fillingOwner], "The State");

		    }
		    SaveFilling(fid);
		}

        for(new p = 0, j = GetPlayerPoolSize(); p <= j; p++)
        {
		    if(IsPlayerLogged[p] && IsPlayerConnected(p))
			{
				if(PI[p][pLevel] < 3)
				    break;

				if(PI[p][pAdmin])
				    break;

	            if(!PI[p][pDisease] && PI[p][pLastEat] < 4 && !PI[p][pMesDisease] && !PI[p][pMesDisease])
				{
				    PI[p][pLastEat]++;
				    UpdatePlayerData(p, "LastEat", PI[p][pLastEat]);
				    if(!PI[p][pVaccine][0] || !PI[p][pVaccine][1] || !PI[p][pVaccine][2] || !PI[p][pVaccine][3] || !PI[p][pVaccine][4] || !PI[p][pVaccine][5])
				    	SendClientMessage(p, COLOR_WHITE, !"{FFC800}[Ïîäñêàçêà] {FFFFFF}Ñîâñåì ñêîðî âû ìîæåòå çàáîëåòü, íå çàáûâàéòå ïîñåùàòü çàêóñî÷íûå, áàðû èëè ðåñòîðàíû");
				}
				else if(!PI[p][pDisease] && PI[p][pLastEat] == 4 && !PI[p][pMesDisease])
				{
				    PI[p][pLastEat] = 0;
				    UpdatePlayerData(p, "LastEat", PI[p][pLastEat]);

				    PI[p][pMesDisease] = 1;
				    UpdatePlayerData(p, "MesDisease", PI[p][pMesDisease]);

				    if(!PI[p][pVaccine][0] || !PI[p][pVaccine][1] || !PI[p][pVaccine][2] || !PI[p][pVaccine][3] || !PI[p][pVaccine][4] || !PI[p][pVaccine][5])
				    	SendClientMessage(p, COLOR_WHITE, !"{FFC800}[Ïîäñêàçêà] {FFFFFF}Ñîâñåì ñêîðî âû ìîæåòå çàáîëåòü, íå çàáûâàéòå ïîñåùàòü çàêóñî÷íûå, áàðû èëè ðåñòîðàíû");

				}
			}
		}
		mysql_tquery(mysql, "UPDATE `accounts` SET `LastEat` = `LastEat`+1 WHERE `Disease` = 0 AND `LastEat` < 4 AND `MesDisease` = 0 AND `Level` > 3");
		mysql_tquery(mysql, "UPDATE `accounts` SET `MesDisease` = 1, `LastEat` = 0 WHERE `Disease` = 0 AND `LastEat` = 4 AND `MesDisease` = 0 AND `Level` > 3");


        for(new p = 0, j = GetPlayerPoolSize(); p <= j; p++)
        {
		    if(!IsPlayerLogged[p] || !IsPlayerConnected(p))
		        continue;

			for(new i; i < 6; i++)
			{
			    if(PI[p][pVaccine][i] > 0)
			    {
			        PI[p][pVaccine][i]--;

					new
					    query_vac[120];

					format(query_vac, sizeof query_vac, "UPDATE `accounts` SET `Vaccine[%d]` = '%d', `VaccineCheck` = '1' WHERE `ID` = '%d'", i, PI[p][pVaccine][i], PI[p][pID]);
					mysql_tquery(mysql, query_vac);
				}
			}

		}

		mysql_tquery(mysql, !"UPDATE `accounts` SET `Vaccine[0]` = `Vaccine[0]`-1 WHERE `Vaccine[0]` > 0 AND `VaccineCheck` = 0");
		mysql_tquery(mysql, !"UPDATE `accounts` SET `Vaccine[1]` = `Vaccine[1]`-1 WHERE `Vaccine[1]` > 0 AND `VaccineCheck` = 0");
		mysql_tquery(mysql, !"UPDATE `accounts` SET `Vaccine[2]` = `Vaccine[2]`-1 WHERE `Vaccine[2]` > 0 AND `VaccineCheck` = 0");
		mysql_tquery(mysql, !"UPDATE `accounts` SET `Vaccine[3]` = `Vaccine[3]`-1 WHERE `Vaccine[3]` > 0 AND `VaccineCheck` = 0");
		mysql_tquery(mysql, !"UPDATE `accounts` SET `Vaccine[4]` = `Vaccine[4]`-1 WHERE `Vaccine[4]` > 0 AND `VaccineCheck` = 0");
		mysql_tquery(mysql, !"UPDATE `accounts` SET `Vaccine[5]` = `Vaccine[5]`-1 WHERE `Vaccine[5]` > 0 AND `VaccineCheck` = 0");
        mysql_tquery(mysql, !"UPDATE `accounts` SET `VaccineCheck` = 0");

	    mysql_tquery(mysql, !"UPDATE `ban` SET `time` = `time`-1 WHERE `time` > 0 && `status` = 1");
    	mysql_tquery(mysql, !"UPDATE `accounts` SET `Ban` = `Ban`-1 WHERE `Ban` > 0 && `BanActivate` = 1");

        for(new p = 0, j = GetPlayerPoolSize(); p <= j; p++)
        {
	    	if(PI[p][pWarns] && PI[p][pWarnTime] >= 0)
			{
	            PI[p][pWarnTime] -= 1;
	            UpdatePlayerData(p, "WarnTime", PI[p][pWarnTime]);

	            if(PI[p][pWarns] == 7)
	            {
	                PI[p][pWarns] = 1;
	                UpdatePlayerData(p, "Warns", PI[p][pWarns]);
	            }
	            else if(PI[p][pWarns] == 0)
	            {
	                PI[p][pWarns] = 0;
	                UpdatePlayerData(p, "Warns", PI[p][pWarns]);
	                SendClientMessage(p, COLOR_WHITE, !"{FFC800}[Ïîäñêàçêà] {FFFFFF}Ñðîê âñåõ Âàøèõ ïðåäóïðåæäåíèé èñòåê");
	            }

	            UpdatePlayerData(p, "WarnCheck", 1);
			}
		}
	    mysql_tquery(mysql, !"UPDATE `accounts` SET `WarnTime` = `WarnTime`-1 WHERE `WarnTime` >= 0 AND `WarnCheck` = 0");
	    mysql_tquery(mysql, !"UPDATE `accounts` SET `Warns` = 1 WHERE `WarnTime` = 7 AND `WarnCheck` = 0");
	    mysql_tquery(mysql, !"UPDATE `accounts` SET `Warns` = 0, `WarnMessage` = 1 WHERE `WarnTime` = 0 AND `WarnCheck` = 0");
	    mysql_tquery(mysql, !"UPDATE `accounts` SET `WarnCheck` = 0");


    	mysql_tquery(mysql, "UPDATE `bizstats` SET `day_1` = `day_2`, `day_2` = `day_3`, `day_3` = `day_4`, `day_4` = `day_5`, `day_5` = `day_6`, `day_6` = `day_7`, `day_7` = `day_8`, `day_8` = `day_9`, `day_9` = `day_10`, `day_10` = 0");
	}
	new year, month, day;
	getdate(year, month, day);
	new week = weekday(day, month, year);
	if(hours == 18 && week == 7)
	{
	    new
	        nickname[MAX_PLAYER_NAME];

	    new Cache:result = mysql_query(mysql, "SELECT `NickName`, `AlleyDays` FROM `accounts` WHERE `Alley` = 1 AND `AlleyDays` > 0 ORDER BY `AlleyDays` DESC LIMIT 3");
	    if(cache_get_row_count(mysql) > 0)
	    {
			for(new i; i < 3; i++)
			{
	   			cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 250000;

				else if(i == 1)
					win = 150000;

				else if(i == 2)
					win = 100000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[90];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà íàõîæäåíèå íà Àëëåå Ñëàâû", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
    		}
	    }
	    cache_delete(result, mysql);

		new Cache:rLvl = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `Level` >= 15 AND `Card` = 1 ORDER BY `Level` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Äîëãîæèòåëü", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rLvl, mysql);

		new Cache:rCharity = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `Charity` >= 1 AND `Card` = 1 ORDER BY `Charity` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Áëàãîòâîðèòåëü", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}


		cache_delete(rCharity, mysql);

		new Cache:rBestPD = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsOrg` >= 1 AND `Card` = 1 AND `Fraction` = 8 ORDER BY `PointsOrg` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ëó÷øèé ñîòðóäíèê", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}


		cache_delete(rBestPD, mysql);

		new Cache:rBestArmy = mysql_query(mysql, "SELECT `NickName`FROM `accounts` WHERE `PointsOrg` >= 1 AND `Card` = 1 AND `Fraction` = 7 ORDER BY `PointsOrg` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ëó÷øèé ñîòðóäíèê", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestArmy, mysql);

		new Cache:rBestMedia = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsOrg` >= 1 AND `Card` = 1 AND `Fraction` = 9 ORDER BY `PointsOrg` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ëó÷øèé ñîòðóäíèê", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestMedia, mysql);

		new Cache:rBestMafia = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsOrg` >= 1 AND `Card` = 1 AND `Fraction` >= 12 AND `Fraction` <= 14 ORDER BY `PointsOrg` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ëó÷øèé Ìàôèîçè", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestMafia, mysql);

		new Cache:rBestLoader = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsLoader` >= 1 AND `Card` = 1 ORDER BY `PointsLoader` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ãðóç÷èê", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestLoader, mysql);

		new Cache:rBusiness = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsBusiness` >= 1 AND `Card` = 1 ORDER BY `PointsBusiness` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Áèçíåñìåí", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}
		cache_delete(rBusiness, mysql);

		new Cache:rMoney = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsMoney` >= 1 AND `Card` = 1 ORDER BY `PointsMoney` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ñàìûé Áîãàòûé", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rMoney, mysql);


		new Cache:rBestDonate = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `TotalDon` >= 1 AND `Card` = 1 ORDER BY `TotalDon` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ìåöåíàò øòàòà", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestDonate, mysql);


		new Cache:rBestMeria = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsOrg` >= 1 AND `Card` = 1 AND `Fraction` = 10 ORDER BY `PointsOrg` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ëó÷øèé ñîòðóäíèê", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestMeria, mysql);

		new Cache:rBestFBI = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsOrg` >= 1 AND `Card` = 1 AND `Fraction` = 11 ORDER BY `PointsOrg` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ëó÷øèé ñîòðóäíèê", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestFBI, mysql);

		new Cache:rBestHeal = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsOrg` >= 1 AND `Card` = 1 AND `Fraction` = 1 ORDER BY `PointsOrg` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ëó÷øèé ñîòðóäíèê", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestHeal, mysql);

		new Cache:rBestGang = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsOrg` >= 1 AND `Card` = 1 AND `Fraction` >= 2 AND `Fraction` <= 6 ORDER BY `PointsOrg` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ëó÷øèé Áàíäèò", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

        cache_delete(rBestGang, mysql);

		new Cache:rBestRoad = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsRoad` >= 1 AND `Card` = 1 ORDER BY `PointsRoad` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ñòðîèòåëü äîðîã", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}

		cache_delete(rBestRoad, mysql);

		new Cache:rBestFactory = mysql_query(mysql, "SELECT `NickName` FROM `accounts` WHERE `PointsFactory` >= 1 AND `Card` = 1 ORDER BY `PointsFactory` DESC LIMIT 3");

		if(cache_get_row_count(mysql) > 0)
		{
			for(new i; i < 3; i++)
			{
				cache_get_row(i, 0, nickname, mysql, 24);

	   			if(GetString(nickname, "NULL"))
	   			    continue;

				new	win;

				if(i == 0)
					win = 150000;

				else if(i == 1)
					win = 100000;

				else if(i == 2)
					win = 50000;

	    		if(GetPlayerID(nickname) != INVALID_PLAYER_ID)
	    		{
	    		    new
	    		        frmt_alley_message[130];

					format(frmt_alley_message, sizeof frmt_alley_message, "{FFC800}[Ïîäñêàçêà] {FFFFFF}Âû ïîëó÷èëè {33AA33}%d${FFFFFF} çà ÒÎÏ 3 â íîìèíàöèè Ðàáîòíèê çàâîäà", win);
	                SendClientMessage(GetPlayerID(nickname), COLOR_WHITE, frmt_alley_message);
	                GiveMoney(GetPlayerID(nickname), win, "àëëåÿ ñëàâû");
	    		}
				else
				{
				    new
						query_alley_updt[150];

					format(query_alley_updt, sizeof query_alley_updt, "UPDATE `accounts` SET `Money` = `Money`+%d WHERE `NickName` = '%s'", win, nickname);
				    mysql_tquery(mysql, query_alley_updt);
				}
			}
		}
		cache_delete(rBestFactory, mysql);

	}
    payday_admin = false;
	return true;
}

0

#6
Пользователь офлайн   NiceXPlayer 

  • Пользователь
  • Вставить ник
  • Раскрыть информацию
Что за вырезка? Полный код хотя бы напиши

Сообщение отредактировал NiceXPlayer: 14 мая 2022 - 13:46

0

#7
Пользователь офлайн   ILST 

  • Пользователь
  • Вставить ник
  • Раскрыть информацию

Просмотр сообщенияNiceXPlayer (14 мая 2022 - 13:46) писал:

Что за вырезка? Полный код хотя бы напиши

Это полный!
0

#8
Пользователь офлайн   habarov228 

  • Знаток
  • Вставить ник
  • Раскрыть информацию
Где собственно вызов диалога под номером 4838 please
0

#9
Пользователь офлайн   ILST 

  • Пользователь
  • Вставить ник
  • Раскрыть информацию

Просмотр сообщенияhabarov228 (14 мая 2022 - 18:33) писал:

Где собственно вызов диалога под номером 4838 please

cmd:kvests(playerid)
{
	ShowPlayerDialogEx(playerid, 4838, DIALOG_STYLE_LIST, !"Задания", "{FFFFFF}Посмотреть все {239FB2}ежедневные бонусы\n{FFFFFF}Посмотреть все {72CEA2}глобальные достижения\n", "Принять", "Отмена");
	return true;
}

Вот
0

#10
Пользователь офлайн   habarov228 

  • Знаток
  • Вставить ник
  • Раскрыть информацию
Интересная логика в самом начале ведь тебе нужен приз при payday - а команда сама не умеет вводиться в чат с помощью сервера.

Упаковка кстати единственной строки "Задания" не несёт за собой оптимизации, тогда следует паковать всё и вся

В PAYDAY

if(hour[playerid] < 5) hour[playerid]++;
else ShowPlayerDialogEx(playerid, 4838, DIALOG_STYLE_LIST, !"Задания", "{FFFFFF}Посмотреть все {239FB2}ежедневные бонусы\n{FFFFFF}Посмотреть все {72CEA2}глобальные достижения\n", "Принять", "Отмена");


case 4387
{
    new gangsta = 0;
    if(!response) return gangsta;
    SendClientMessage(playerid, COLOR_BLUE, !"Вы успешно забрали награду!");
    GiveItem(playerid, ITEM_YCOIN);
    hour[playerid] = 0;
}


Сообщение отредактировал habarov228: 14 мая 2022 - 20:48

0

Поделиться темой:


Страница 1 из 1
  • Вы не можете создать новую тему
  • Вы не можете ответить в тему

1 человек читают эту тему
0 пользователей, 1 гостей, 0 скрытых пользователей


Яндекс.Метрика