Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public SyncUp()
- {
- new string[128],
- tmphour,
- tmpminute,
- tmpsecond,
- hour,
- minn,
- sec,
- da,
- mo,
- ye;
- gettime(hour,minn,sec);
- gettime(tmphour, tmpminute, tmpsecond);
- getdate(ye, mo, da);
- FixHour(tmphour);
- tmphour = shifthour;
- if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
- {
- format(string, sizeof(string), "SERVER: The time is now %d:00 hours",hour);
- BroadCast(COLOR_WHITE,string);
- ghour = tmphour;
- PayDay();
- if(da == 1 && hour == 1)
- {
- mysql_tquery(SQL,"UPDATE `users` SET `Connected` = '0'","","");
- new string1[300];
- new query[300],result[300];
- new test[300];
- format(string1, sizeof(string1), "SELECT * FROM `users` WHERE Connected < 11 AND House < 999");
- new Cache: membresult = mysql_query(SQL, string1);
- for(new i, j = cache_get_row_count (); i != j; ++i)
- {
- cache_get_field_content(i, "name", result); format(query, 30, result);
- cache_get_field_content(i, "House", result); format(test, 300, result);
- new id = GetPlayerID(query);
- if(id != INVALID_PLAYER_ID)
- {
- HouseInfo[test][hHel] = 0;
- HouseInfo[test][hLicitatie] = 1;
- HouseInfo[test][hArm] = 0;
- HouseInfo[test][hLock] = 0;
- HouseInfo[test][hOwned] = 0;
- PlayerInfo[id][pRented] = 0;
- strmid(HouseInfo[test][hOwner], "The State", 0, strlen("The State"), 255);
- PlayerInfo[id][pPhousekey] = 999;
- PlayerInfo[id][pRented] = -1;
- if(PlayerInfo[id][pLocal] == test)
- {
- SetPlayerInterior(id,0);
- SetPlayerPosEx(id,HouseInfo[test][hEntrancex],HouseInfo[test][hEntrancey],HouseInfo[test][hEntrancez]);
- PlayerInfo[id][pInt] = 0;
- }
- Update(id,pRentedx);
- Update(id,pPhousekeyx);
- new str2[256];
- mysql_format(SQL,str2,sizeof(str2),"UPDATE `houses` SET `Hel`='0',`Licitatie`='1',`Arm`='0',`Lockk`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",HouseInfo[test][hID]);
- mysql_tquery(SQL,str2,"","");
- OnPropTextdrawUpdate(1,test);
- }
- else
- {
- HouseInfo[test][hHel] = 0;
- HouseInfo[test][hArm] = 0;
- HouseInfo[test][hLock] = 0;
- HouseInfo[test][hLicitatie] = 1;
- HouseInfo[test][hOwned] = 0;
- PlayerInfo[id][pRented] = 0;
- strmid(HouseInfo[test][hOwner], "The State", 0, strlen("The State"), 255);
- new str2[256];
- new str3[256];
- mysql_format(SQL,str3,sizeof(str3),"UPDATE `users` SET `House`='999' WHERE `name`='%s'",query);
- mysql_tquery(SQL,str3,"","");
- mysql_format(SQL,str2,sizeof(str2),"UPDATE `houses` SET `Hel`='0',`Licitatie`='1',`Arm`='0',`Lockk`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",HouseInfo[test][hID]);
- mysql_tquery(SQL,str2,"","");
- OnPropTextdrawUpdate(1,test);
- }
- }
- cache_delete(membresult);
- }
Advertisement
Add Comment
Please, Sign In to add comment