public SyncTime() { //new string[64]; new tmphour; new tmpminute; new tmpsecond; new query[1000]; new query2[1000]; gettime(tmphour, tmpminute, tmpsecond); FixHour(tmphour); tmphour = shifthour; if ((tmphour > ghour) || (tmphour == 0 && ghour == 23)) { ghour = tmphour; PayDay(); if (realtime) { SetWorldTime(tmphour); } } if(tmphour == 22 && tmpminute == 58) { mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `playerDonateTime` = `playerDonateTime`+1"); mysql_tquery(handle, query2); mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `pZileAmanet` = `pZileAmanet`+1"); mysql_tquery(handle, query2); } if(tmphour == 22 && tmpminute == 55) { mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `playerCar1Days` = `playerCar1Days`+1"); mysql_tquery(handle, query2); mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `playerCar2Days` = `playerCar2Days`+1"); mysql_tquery(handle, query2); mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `playerCar3Days` = `playerCar3Days`+1"); mysql_tquery(handle, query2); mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `playerCar4Days` = `playerCar4Days`+1"); mysql_tquery(handle, query2); mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `playerCar5Days` = `playerCar5Days`+1"); mysql_tquery(handle, query2); } if(tmphour == 22 && tmpminute == 59) { for(new xf = 0; xf < MAX_GROUPS; xf++) { mysql_format(handle, query, 500, "UPDATE `playeraccounts` SET `playerDays` = `playerDays`+1 WHERE `playerGroup` = '%d'", xf); mysql_tquery(handle, query); mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `player24` = `player24`+1"); mysql_tquery(handle, query2); } } if(tmphour == 23 && tmpminute == 0) { for(new c = 0; c < MAX_CLANS; c++) { mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `playerClanDays` = `playerClanDays`+1 WHERE `playerClan` = '%d'", c); mysql_tquery(handle, query2); } mysql_format(handle, query2, 500, "UPDATE `houses` SET `houseLastOn` = `houseLastOn`+1"); mysql_tquery(handle, query2); mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `playerAnuntat` = `playerAnuntat`+1"); mysql_tquery(handle, query2); mysql_format(handle, query2, 500, "UPDATE `playeraccounts` SET `samposcop` = `samposcop`+1"); mysql_tquery(handle, query2); mysql_format(handle, query2, 500, "UPDATE `clans` SET `clanDays` = `clanDays`+1"); mysql_tquery(handle, query2); } }
WHERE playerGroup IS NOT NULL
Use mysql_query not mysql_tquery.
mysql_tquery only use for callbacks. |
public OnPlayerConnect(playerid) { new query[128], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); mysql_format(MySQL, query, sizeof(query), "SELECT * FROM `players` WHERE `Name` = '%e'", pname); mysql_tquery(MySQL, query, "OnPlayerDataLoaded", "d", playerid); return 1; } public OnPlayerDataLoaded(playerid) { //Query processed, you can now execute cache functions (like cache_get_row) here. new NumRows = cache_num_rows(); printf("There are %d players with the same name.", NumRows); return 1; }
Use mysql_query not mysql_tquery.
mysql_tquery only use for callbacks. |