Jump to content

Question

Posted

Problema intalnita (descriere): Nu face update in DB chiar daca in server_log imi arata debug-ul...
Ero(area / rile) / warning-(ul / urile): Nu sunt erori cred
Liniile de cod / sursa / script-ul(obligatoriu): 

function ExpireWithDay()
{
	new time[3], str[255];
	gettime(time[0], time[1], time[2]);
	foreach(Player, i)
	{
	    if(time[0] == 23 && time[1] == 59)
	    {
	        if(PlayerInfo[i][pClan] != 0)
	        {
	            ClanInfo[PlayerInfo[i][pClan]][cClanExpire]--;
				mysql_format(SQL, str, sizeof(str), "UPDATE `clans` SET `clanExpire`='%d' WHERE `clanID`='%d' AND `clanActive`='1'",ClanInfo[PlayerInfo[i][pClan]][cClanExpire], PlayerInfo[i][pClan]);
				mysql_tquery(SQL, str, "", "");
			}

			if(PlayerInfo[i][pPremiumAccount] != 0)
			{
			    PlayerInfo[i][pExpireAccount]--;
				mysql_format(SQL, str, sizeof(str), "UPDATE `users` SET `Expire`='%d' WHERE `name`='%s'", PlayerInfo[i][pExpireAccount], GetName(i));
				mysql_tquery(SQL, str, "", "");
			}

			if(PlayerInfo[i][pDDCar1] != 0 && PlayerInfo[i][pDDCar1Key] != 0)
			{
			    CarInfo[PlayerInfo[i][pDDCar1Key]][cTimed]++;
				mysql_format(SQL, str, sizeof(str), "UPDATE `cars` SET `Timed`='%d' WHERE `ID`='%d' AND `Owner`='%s'", CarInfo[PlayerInfo[i][pDDCar1Key]][cTimed], PlayerInfo[i][pDDCar1Key], GetName(PlayerInfo[i][pNormalName]));
				mysql_tquery(SQL, str, "", "");
			}

			if(PlayerInfo[i][pDDCar2] != 0 && PlayerInfo[i][pDDCar2Key] != 0)
			{
			    CarInfo[PlayerInfo[i][pDDCar2Key]][cTimed]++;
				mysql_format(SQL, str, sizeof(str), "UPDATE `cars` SET `Timed`='%d' WHERE `ID`='%d' AND `Owner`='%s'",CarInfo[PlayerInfo[i][pDDCar2Key]][cTimed], PlayerInfo[i][pDDCar2Key], GetName(PlayerInfo[i][pNormalName]));
				mysql_tquery(SQL, str, "", "");
			}

			if(PlayerInfo[i][pDDCar3] != 0 && PlayerInfo[i][pDDCar3Key] != 0)
			{
			    CarInfo[PlayerInfo[i][pDDCar3Key]][cTimed]++;
				mysql_format(SQL, str, sizeof(str), "UPDATE `cars` SET `Timed`='%d' WHERE `ID`='%d' AND `Owner`='%s'",CarInfo[PlayerInfo[i][pDDCar3Key]][cTimed], PlayerInfo[i][pDDCar3Key], GetName(PlayerInfo[i][pNormalName]));
				mysql_tquery(SQL, str, "", "");
			}

			if(PlayerInfo[i][pDDBuy] > 0)
			{
			    PlayerInfo[i][pDDTime]--;
				mysql_format(SQL, str, sizeof(str), "UPDATE `users` SET `DDTime`='%d' WHERE `name`='%s'", PlayerInfo[i][pDDTime], GetName(i));
				mysql_tquery(SQL, str, "", "");
			}
			printf("Update all field!");
		}
	}
	printf("Update x3 !");
	return 1;
}


Imagini / Video (optional): -- 
Ati incercat sa rezolvati singur?:  Da, ma chinui de 2 zile

2 answers to this question

Recommended Posts

  • 0
Posted

In primul rand nu se pune in veci '%d' pentru ca %d nu e string sa-l pui intre '' ;) Puneti mana si pe un tutorial de MySQL inainte sa deveniti "scripteri".

  • Upvote 1

Sinner.png

  • 0
Posted

Multumesc de raspuns.

Acum 20 ore, SoNNy.sys a spus:

Puneti mana si pe un tutorial de MySQL inainte sa deveniti "scripteri".

Nu sunt scripter, doar incerc sa invat, nici tu cand ai inceput nu ai fost expert ;)

 

T/C

  • Upvote 1
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.