Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task SyncUp[60000]() {
- new tmphour,tmpminute,tmpsecond,hour,minn,sec,da,mo,ye,minute,second;
- gettime(hour,minn,sec);
- gettime(tmphour, tmpminute, tmpsecond);
- getdate(ye, mo, da);
- FixHour(tmphour);
- tmphour = shifthour;
- gString[0] = (EOS);
- if ((tmphour > ghour) || (tmphour == 0 && ghour == 23)) {
- ghour = tmphour;
- PayDay();
- if(hour == 23) {
- mysql_tquery(SQL,"UPDATE cars SET Inscarprice = Inscarprice+50","","");
- foreach(new i : Player) {
- for(new v; v < MAX_PERSONAL_VEHICLES; v++) {
- if(PlayerInfo[i][pCar][v] != -1) PlayerInfo[i][pCarInsPrice][v] += 50;
- }
- }
- mysql_tquery(SQL,"UPDATE `users` SET `OnlineToday` = '0'","","");
- foreach( new i : Player) {
- if(IsPlayerConnected(i)) {
- mysql_format(SQL,gString,256,"UPDATE `users` SET `OnlineToday` = '1' WHERE `name`='%s' LIMIT 1",PlayerInfo[i][pNormalName]);
- mysql_tquery(SQL,gString,"","");
- }
- }
- mysql_tquery(SQL,"UPDATE users SET ClanTime = ClanTime+1 WHERE Clan > 0","","");
- }
- if(hour == 7) {
- mysql_tquery( SQL, "UPDATE `users` SET `FactionTime` = `FactionTime` + '1' WHERE `Member` > '0'" );
- mysql_tquery( SQL, "UPDATE `users` SET `QuestOne` = '0', `QuestTwo` = '0', `QuestProgressOne` = '0', `QuestProgressTwo` = '0', `QuestCompletedOne` = '0', `QuestCompletedTwo` = '0'");
- foreach( new x : Player ) {
- SCM(x, -1, "");
- giveDailyQuests( x );
- }
- }
- if(GetWeekDay() == 2 && hour == 23) {
- mysql_format(SQL,gString,256,"UPDATE `users` SET `OnlineLastWeek` = '1', `OnlineThisWeek` = '0' WHERE `OnlineThisWeek`='1'");
- mysql_tquery(SQL,gString,"","");
- foreach( new i : Player) {
- if(IsPlayerConnected(i)) {
- mysql_format(SQL,gString,256,"UPDATE `users` SET `OnlineThisWeek` = '1' WHERE `name`='%s'",PlayerInfo[i][pNormalName]);
- mysql_tquery(SQL,gString,"","");
- }
- }
- }
- if(hour == 19 || hour == 20 || hour == 21 || hour == 22) SetWorldTime(hour);
- else SetWorldTime(hour);
- }
- gettime(hour, minute, second);
- return true; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement