Jump to content
  • 0

problema system premium pe timp


vlady100

Question

Problema intalnita (descriere): nu se duce timp-ul la payday din cont-ul premium
Ero(area / rile) / warning-(ul / urile): nu apar errori....
Liniile de cod / sursa / script-ul(obligatoriu): payday-ul e cam așa:

function PayDay()
{
	new interest, hour, minutes, seconds;
	gettime(hour, minutes, seconds);
 	foreach(new i : Player)
	{
		if(gLogged[i] == 1)
		{
			if(PlayerInfo[i][pPayDay] < 20 && PlayerInfo[i][pPremiumAccount] == 0)
			{
				format(gString,sizeof(gString),"Nu ai jucat destul pentru a primii payday-ul.(%d/20)",PlayerInfo[i][pPayDay]);
				SendClientMessage(i, COLOR_LIGHTRED, gString);
				continue;
			}
			else if(PlayerInfo[i][pPayDay] < 10 && PlayerInfo[i][pPremiumAccount] == 1)
			{
				format(gString,sizeof(gString),"Nu ai jucat destul pentru a primii payday-ul.(%d/10)",PlayerInfo[i][pPayDay]);
				SendClientMessage(i, COLOR_LIGHTRED, gString);
				continue;
			}

			if(PlayerInfo[i][pPremiumAccount] == 1) { interest = 2; }
			else { interest = 1; }

   			if(AFK[i] == 1) PlayerInfo[i][pPayCheck] /= 4;

			if(PlayerInfo[i][pPremiumAccount] == 1) PlayerInfo[i][pPayCheck] = PlayerInfo[i][pPayCheck] + PlayerInfo[i][pPayCheck]/2;

			new house = PlayerInfo[i][pRentKey];
			new rent;
			if(house != 0)
			{
				rent = HouseInfo[house][hRent];
				HouseInfo[house][hSafe] += rent;
				hUpdate(house, hSafex);
			}

			new paycheck = PlayerInfo[i][pPayCheck];
			new bankacc = PlayerInfo[i][pAccount];
			new interestm = bankacc*interest/100;
			if(interestm > 1500) interestm = 1500;
			if(AFK[i] == 1) interestm /= 4;
			new stateimposit;
			if(PlayerInfo[i][pBizzKey]) stateimposit += BizzInfo[PlayerInfo[i][pBizzKey]][bLevel] * 200;
			if(PlayerInfo[i][pHouseKey]) stateimposit += HouseInfo[PlayerInfo[i][pHouseKey]][hLevel] * 200;
			stateimposit += interestm/100;

			PlayerInfo[i][pAccount] = bankacc + paycheck + interestm - stateimposit- rent - Tax;
			Update(i,pAccountx);

			//PlayAudioStreamForPlayer(i,"http://dimi-sa-mp.weebly.com/uploads/7/0/2/3/7023626/jingle_bells_lyrics.mp3",0.0,0.0,0.0,350.0,0);
			format(gString, sizeof(gString), "{ff0000}|________________ {ffffff}%s PayDay {ff0000}________________|", GetName(i));
			SendClientMessage(i, -1, gString);
			format(gString, sizeof(gString), "{ff0000}Balanta veche: {ffffff}$%s", FormatNumber(bankacc));
			SendClientMessage(i, -1, gString);
			format(gString, sizeof(gString), "{ff0000}Salariu: {ffffff}$%s    {ff0000}Banii din dobanda: {ffffff}$%s (0.%d%s)", FormatNumber(paycheck), FormatNumber(interestm), interest, "%%");
			SendClientMessage(i, -1, gString);
			format(gString, sizeof(gString), "{ff0000}Taxa: {ffffff}-$%s    {ff0000}Impozite: {ffffff}-$%s", FormatNumber(Tax), FormatNumber(stateimposit));
			SendClientMessage(i, -1, gString);
			format(gString, sizeof(gString), "{ff0000}Balanta noua: {ffffff}$%s", FormatNumber(PlayerInfo[i][pAccount]));
			SendClientMessage(i, -1, gString);
			SendClientMessage(i, -1, "{B22222}S{ffffff}a{2E8B57}r{B22222}b{ffffff}a{2E8B57}t{B22222}o{ffffff}r{B22222}i {2E8B57}F{ffffff}e{B22222}r{2E8B57}i{ffffff}c{B22222}i{2E8B57}t{ffffff}e{B22222}!{ffffff}!{2E8B57}!");
			PlayerInfo[i][pColindator] = 1;
			mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET PremiumAccountHours = PremiumAccountHours - 1 WHERE PremiumAccountHours != 0 AND Status = 0");
			mysql_query(handle, gQuery);

			if(house != 0)
			{
			    format(gString, sizeof(gString), "{ff0000}Pret rent: {ffffff}$%s", FormatNumber(rent));
				SendClientMessage(i, -1, gString);
			}
			if(PlayerInfo[i][pLeader] + PlayerInfo[i][pMember] == 11)
			{
				PlayerInfo[i][pCiord] += 10;
				Update(i, pCiordx);
				SendClientMessage(i, COLOR_WHITE, "{ff0000}Factiune: {ffffff}Ai primit 10 puncte pentru ciordit.");
			}
			if(PlayerInfo[i][pCLeader] + PlayerInfo[i][pCMember] != 0 && ClanInfo[PlayerInfo[i][pCLeader] + PlayerInfo[i][pCMember]][cBest] == 1) GivePlayerCash(i,5000), SendClientMessage(i, -1, "{BABABA}Clan turf: $5,000");
			if(AFK[i] == 1) SendClientMessage(i, -1, "{ff0000}Server: {ffffff}Ai primit doar 25 procente din dobanzi si 25 procente de la payday pentru ca ai stat cu /sleep.");
			if(PlayerInfo[i][pRPBoost] > 0)
			{
			    PlayerInfo[i][pRPBoost] -= 1;
				Update(i,pRPBoostx);
			    PlayerInfo[i][pRespect] += 1;
				Update(i,pRespectx);
				SendClientMessage(i, -1, "{ff0000}Server: {ffffff}Respect boost a fost folosit. (+1 RP)");
			}
		    if(HappyDayHour == hour && HappyDay == 0)
			{
				PlayerInfo[i][pRespect] += 1;
				Update(i,pRespectx);
				SendClientMessage(i,COLOR_LIGHTBLUE,"{ff0000}Server: {ffffff}Ai primit un RP deoarece este ziua ta norocoasa.");
				HappyDay = 1;
			}

			CharityMoney += Tax;

			PlayerInfo[i][pPayDay] = 0;
			Update(i, pPayDayx);
			PlayerInfo[i][pPayCheck] = 0;
			Update(i, pPayCheckx);

			PlayerInfo[i][pRespect] += 1;
			Update(i,pRespectx);

	        if(AFK[i] == 0)
			{
				PlayerInfo[i][pHoursPlayed] += 1;
				Update(i,pHoursPlayedx);

			}

			if(PlayerInfo[i][pFPunish] > 0) PlayerInfo[i][pFPunish] -= 1;
			Update(i, pFPunishx);

			if(PlayerInfo[i][pPremiumAccount] == 1)
			{
				PlayerInfo[i][pPayDayHad] += 1;
				Update(i,pPayDayHadx);
				if(PlayerInfo[i][pPayDayHad] >= 3)
				{
					PlayerInfo[i][pRespect] += 1;
					Update(i,pRespectx);
					PlayerInfo[i][pPayDayHad] = 0;
					Update(i,pPayDayHadx);
					if(PlayerInfo[i][pFPunish] > 0) PlayerInfo[i][pFPunish] -= 1;
					Update(i, pFPunishx);
				}
			}
			BuyLevelMsg(i);

			if(PlayerInfo[i][pMember] + PlayerInfo[i][pLeader] == 6)
			{
			    new points;
			    if(PlayerInfo[i][pRank] == 1) points = 5;
			    else if(PlayerInfo[i][pRank] == 2) points = 6;
			    else if(PlayerInfo[i][pRank] == 3) points = 7;
			    else if(PlayerInfo[i][pRank] == 4) points = 8;
			    else if(PlayerInfo[i][pRank] == 5) points = 9;
			    else if(PlayerInfo[i][pRank] == 6) points = 10;
			    else if(PlayerInfo[i][pRank] == 7) points = 10;

			    new maxpct = PlayerInfo[i][pRank] * 5 + points;
				if(PlayerInfo[i][pTowPoints] < maxpct) PlayerInfo[i][pTowPoints] += points;
				Update(i, pTowPointsx);
			}

			if(PlayerInfo[i][pRob] < 10)PlayerInfo[i][pRob] += 1;
			Update(i, pRobx);
			if(PlayerInfo[i][pFreePoints] < 3 && IsACop(i))PlayerInfo[i][pFreePoints] += 1;
			Update(i, pFreePointsx);
			if(PlayerInfo[i][pDrivingLic] > 0) { PlayerInfo[i][pDrivingLic] -= 1; if(PlayerInfo[i][pDrivingLic] == 0) SendClientMessage(i, 0x359AFFFF, "Licenta ta de condus a expirat."); }
			else if(PlayerInfo[i][pDrivingLic] < 0) PlayerInfo[i][pDrivingLic] += 1;
			Update(i, pDrivingLicx);
			if(PlayerInfo[i][pFlyingLic] > 0) { PlayerInfo[i][pFlyingLic] -= 1; if(PlayerInfo[i][pFlyingLic] == 0) SendClientMessage(i, 0x359AFFFF, "Licenta ta de zburat a expirat."); }
			else if(PlayerInfo[i][pFlyingLic] < 0) PlayerInfo[i][pFlyingLic] += 1;
			Update(i, pFlyingLicx);
			if(PlayerInfo[i][pSailLic] > 0) { PlayerInfo[i][pSailLic] -= 1; if(PlayerInfo[i][pSailLic] == 0) SendClientMessage(i, 0x359AFFFF, "Licenta ta de navigat a expirat."); }
			else if(PlayerInfo[i][pSailLic] < 0) PlayerInfo[i][pSailLic] += 1;
			Update(i, pSailLicx);

			if(PlayerInfo[i][pGunLic] > 0)
			{
			    if(PlayerInfo[i][pGunLic]-1 <= 0) ResetPlayerWeapons(i);
				PlayerInfo[i][pGunLic] -= 1;
				if(PlayerInfo[i][pGunLic] == 0) SendClientMessage(i, 0x359AFFFF, "Licenta ta de arme a expirat.");
			}
			else if(PlayerInfo[i][pGunLic] < 0) PlayerInfo[i][pGunLic] += 1;
			Update(i, pGunLicx);

		}
	}

	for(new i = 1; i < sizeof(ZoneInfo); i++)
	{
	    if(ZoneInfo[i][zHours] > 0)
	    {
		    ZoneInfo[i][zHours] -= 1;
			zUpdate(i, zHoursx);
		}
	}

	if(NightOn == 0) SetWorldTime(hour);
	else SetWorldTime(0);

	gQuery[0] = (EOS);
	mysql_format(handle, gQuery, sizeof(gQuery),"UPDATE `others` SET `Charity`=%d WHERE `ID`='1'", CharityMoney);
	mysql_query(handle, gQuery);
	gQuery[0] = (EOS);
	mysql_format(handle, gQuery, sizeof(gQuery), "SELECT * FROM `bans` WHERE `Days` > '0'");
	mysql_tquery(handle, gQuery, "BanCheck", "");
	return 1;
}
forward PayDayCheck();
public PayDayCheck()
{
  	foreach(new i : Player)
	{
		if(gLogged[i] == 0) continue;
		new level = PlayerInfo[i][pLevel];
		if(level >= 1 && level <= 5) { PlayerInfo[i][pPayCheck] += 200; }
		else if(level >= 6 && level <= 10) { PlayerInfo[i][pPayCheck] += 300; }
		else if(level >= 11 && level <= 15) { PlayerInfo[i][pPayCheck] += 400; }
		else if(level >= 16 && level <= 20) { PlayerInfo[i][pPayCheck] += 500; }
		else if(level >= 21 && level <= 25) { PlayerInfo[i][pPayCheck] += 600; }
		else if(level >= 26 && level <= 30) { PlayerInfo[i][pPayCheck] += 700; }
		else if(level >= 31) { PlayerInfo[i][pPayCheck] += 800; }
		Update(i,pPayCheckx);

		PlayerInfo[i][pPayDay] += 1;
		Update(i, pPayDayx);
		if(PlayerInfo[i][pPremiumAccount] != 0)
		{
			PlayerInfo[i][pPremiumAccountHours] --;
			if(PlayerInfo[i][pPremiumAccountHours] < 1)
			{
 				SendClientMessage(i, COLOR_WHITE, "{C7C7C7}* Pachetul tau premium a expirat.");
   				PlayerInfo[i][pPremiumAccount] = 0;
			}
		}
		if(PlayerInfo[i][pContractTime] > 0)
		{
			PlayerInfo[i][pContractTime] --;
			Update(i, pContractTimex);
		}
		if(PlayerInfo[i][pMoneyBoost] > 0)
		{
			PlayerInfo[i][pMoneyBoost] --;
			Update(i, pMoneyBoostx);
		}

		new Float: health;
		GetPlayerHealthEx(i, health);
		if(AFK[i] == 0) SetPlayerHealthEx(i, health - 1);
	}
	return 1;
}


Imagini / Video (optional): -
Ati incercat sa rezolvati singur?:  am încercat să mă uit prin el, e luat din alt gamemod, anume bladex. am copiat tot .....nu știu ce să îi mai fac. 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Posibil sa nu fi pus bine timer-ul pentru premium la connect 

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.