Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(hour == 22 && minute == 20)
- {
- new query[300],var100[300],string[256],qqerry[256];
- format(query, sizeof(query), "SELECT * FROM `users` WHERE `Member` > '0' ORDER BY `id`");
- new Cache: stringresult9 = mysql_query(SQL, query);
- if(cache_get_row_count() > 0)
- {
- new rank,faction,name[50],sqlid,raport1,raport2,raport3,raport4,complete,raportincomplet,factionjoin,fwarn,removefw,completer5,test4;
- cache_get_field_content(0, "name", name, SQL, sizeof(name));
- rank = cache_get_field_content_int(0, "Rank");
- faction = cache_get_field_content_int(0, "Member");
- sqlid = cache_get_field_content_int(0, "id");
- raport1 = cache_get_field_content_int(0, "Raport1");
- raport2 = cache_get_field_content_int(0, "Raport2");
- raport3 = cache_get_field_content_int(0, "Raport3");
- raport4 = cache_get_field_content_int(0, "Raport4");
- factionjoin = cache_get_field_content_int(0, "FactionJoin");
- fwarn = cache_get_field_content_int(0, "FWarn");
- test4 = cache_get_field_content_int(0, "FactionJoin");
- if(GetDaysFromTimestamp(test4) < 3)
- {
- foreach(new id : Player)
- {
- if(PlayerInfo[id][pSQLID] == sqlid)
- {
- PlayerInfo[id][Raport1] = 0;
- PlayerInfo[id][Raport2] = 0;
- PlayerInfo[id][Raport3] = 0;
- PlayerInfo[id][Raport4] = 0;
- }
- }
- format(string,sizeof(string),"%s was reset raport faction.",name);
- Factionlog(faction,sqlid,0,string);
- SendFamilyMessage(faction, COLOR_GENANNOUNCE, string);
- mysql_format(SQL,var100, sizeof(var100), "UPDATE `users` SET `Raport1`='0',`Raport2`='0',`Raport3`='0',`Raport4`='0' WHERE `id`='%d'",sqlid);
- mysql_tquery(SQL,var100,"","");
- mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
- mysql_tquery(SQL, qqerry, "", "");
- }
- else if(faction == 1)
- {
- if(rank == 1)
- {
- if(raport2+raport3 < 24 || raport1 < 5)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 25 || raport1 >= 6))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 25 || raport1 >= 6))
- {
- removefw = 1;
- }
- }
- if(rank == 2)
- {
- if(raport2+raport3 < 19 || raport1 < 4 || raport4 < 1 )
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 20 || raport1 >= 5 || raport4 >= 2))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 20 || raport1 >= 5 || raport4 >= 2))
- {
- removefw = 1;
- }
- }
- if(rank == 3)
- {
- if(raport2+raport3 < 14 || raport1 < 3 || raport4 < 1 )
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 15 || raport1 >= 4 || raport4 >= 2))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 15 || raport1 >= 4 || raport4 >= 2))
- {
- removefw = 1;
- }
- }
- if(rank == 4)
- {
- if(raport2+raport3 < 9 || raport1 < 2 || raport4 < 1 )
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 10 || raport1 >= 3 || raport4 >= 2))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 10 || raport1 >= 3 || raport4 >= 2))
- {
- removefw = 1;
- }
- }
- if(rank == 5)
- {
- if(raport2+raport3 < 4 || raport1 < 1 || raport4 < 1 )
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 5 || raport1 >= 2 || raport4 >= 2))
- {
- completer5 = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 5 || raport1 >= 2 || raport4 >= 2))
- {
- removefw = 1;
- }
- }
- }
- else if(faction == 2 || faction == 3)
- {
- if(rank == 1)
- {
- if(raport2+raport3 < 29)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 30))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 30))
- {
- removefw = 1;
- }
- }
- if(rank == 2)
- {
- if(raport2+raport3 < 24)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 25))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 25))
- {
- removefw = 1;
- }
- }
- if(rank == 3)
- {
- if(raport2+raport3 < 19)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 20))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 20))
- {
- removefw = 1;
- }
- }
- if(rank == 4)
- {
- if(raport2+raport3 < 14)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 15))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 15))
- {
- removefw = 1;
- }
- }
- if(rank == 5)
- {
- if(raport2+raport3 < 9)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport3 >= 10))
- {
- completer5 = 1;
- }
- else if(fwarn >= 1 && (raport2+raport3 >= 10))
- {
- removefw = 1;
- }
- }
- }
- else if(faction == 4 || faction == 5 || faction == 6 || faction == 10)
- {
- if(rank == 1)
- {
- if(raport2+raport1 < 19)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport1 >= 20))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport1 >= 20))
- {
- removefw = 1;
- }
- }
- if(rank == 2)
- {
- if(raport2+raport1 < 19)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport1 >= 20))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport1 >= 20))
- {
- removefw = 1;
- }
- }
- if(rank == 3)
- {
- if(raport2+raport3 < 19)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport1 >= 20))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport1 >= 20))
- {
- removefw = 1;
- }
- }
- if(rank == 4)
- {
- if(raport2+raport3 < 14)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport1 >= 15))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport2+raport1 >= 15))
- {
- removefw = 1;
- }
- }
- if(rank == 5)
- {
- if(raport2+raport1 < 9)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport2+raport1 >= 10))
- {
- completer5 = 1;
- }
- else if(fwarn >= 1 && (raport2+raport1 >= 10))
- {
- removefw = 1;
- }
- }
- }
- else if(faction == 9)
- {
- if(rank == 1)
- {
- if(raport1 < 24)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 25))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 25))
- {
- removefw = 1;
- }
- }
- if(rank == 2)
- {
- if(raport1 < 24)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 25))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 25))
- {
- removefw = 1;
- }
- }
- if(rank == 3)
- {
- if(raport1 < 19 || raport4 < 2)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 20 || raport4 >= 3))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 20 || raport4 >= 3))
- {
- removefw = 1;
- }
- }
- if(rank == 4)
- {
- if(raport1 < 14 || raport4 < 2)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 15 || raport4 >= 3))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 15 || raport4 >= 3))
- {
- removefw = 1;
- }
- }
- if(rank == 5)
- {
- if(raport1 < 9 || raport4 < 2)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 10 || raport4 >= 3))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 10 || raport4 >= 3))
- {
- removefw = 1;
- }
- }
- }
- else if(faction == 11 || faction == 13 || faction == 14)
- {
- if(rank == 1)
- {
- if(raport1 < 24)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 25))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 25))
- {
- removefw = 1;
- }
- }
- if(rank == 2)
- {
- if(raport1 < 19)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 20))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 20))
- {
- removefw = 1;
- }
- }
- if(rank == 3)
- {
- if(raport1 < 14)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 15))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 15))
- {
- removefw = 1;
- }
- }
- if(rank == 4)
- {
- if(raport1 < 9)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 10))
- {
- complete = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 10))
- {
- removefw = 1;
- }
- }
- if(rank == 5)
- {
- if(raport1 < 4)
- {
- raportincomplet = 1;
- }
- else if(fwarn == 0 && (raport1 >= 5))
- {
- completer5 = 1;
- }
- else if(fwarn >= 1 && (raport1 >= 5))
- {
- removefw = 1;
- }
- }
- }
- if(completer5 == 1)
- {
- foreach(new id : Player)
- {
- if(PlayerInfo[id][pSQLID] == sqlid)
- {
- PlayerInfo[id][Raport1] = 0;
- PlayerInfo[id][Raport2] = 0;
- PlayerInfo[id][Raport3] = 0;
- PlayerInfo[id][Raport4] = 0;
- }
- }
- format(string,sizeof(string),"%s was complete raport faction rank %d.",name,rank);
- Factionlog(faction,sqlid,0,string);
- SendFamilyMessage(faction, COLOR_GENANNOUNCE, string);
- mysql_format(SQL,var100, sizeof(var100), "UPDATE `users` SET `Raport1`='0',`Raport2`='0',`Raport3`='0',`Raport4`='0' WHERE `id`='%d'",sqlid);
- mysql_tquery(SQL,var100,"","");
- mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
- mysql_tquery(SQL, qqerry, "", "");
- }
- if(complete == 1)
- {
- foreach(new id : Player)
- {
- if(PlayerInfo[id][pSQLID] == sqlid)
- {
- PlayerInfo[id][pRank] = rank+1;
- PlayerInfo[id][Raport1] = 0;
- PlayerInfo[id][Raport2] = 0;
- PlayerInfo[id][Raport3] = 0;
- PlayerInfo[id][Raport4] = 0;
- format(string, sizeof(string), "Your rank was changed from %d to %d.",rank,rank+1);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- }
- }
- format(string,sizeof(string),"%s faction rank was changed from %d to %d.",name,rank,rank+1);
- Factionlog(faction,sqlid,0,string);
- SendFamilyMessage(faction, COLOR_GENANNOUNCE, string);
- mysql_format(SQL,var100, sizeof(var100), "UPDATE `users` SET `Rank`='%d',`Raport1`='0',`Raport2`='0',`Raport3`='0',`Raport4`='0' WHERE `id`='%d'", rank+1,sqlid);
- mysql_tquery(SQL,var100,"","");
- mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
- mysql_tquery(SQL, qqerry, "", "");
- }
- if(removefw == 1)
- {
- foreach(new id : Player)
- {
- if(PlayerInfo[id][pSQLID] == sqlid)
- {
- PlayerInfo[id][pFACWarns] = fwarn-1;
- PlayerInfo[id][Raport1] = 0;
- PlayerInfo[id][Raport2] = 0;
- PlayerInfo[id][Raport3] = 0;
- PlayerInfo[id][Raport4] = 0;
- format(string, sizeof(string), "Your faction warn was changed from %d to %d.",fwarn,fwarn-1);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- }
- }
- format(string,sizeof(string),"%s faction warn was changed from %d to %d.",name,fwarn,fwarn-1);
- Factionlog(faction,sqlid,0,string);
- SendFamilyMessage(faction, COLOR_GENANNOUNCE, string);
- mysql_format(SQL,var100, sizeof(var100), "UPDATE `users` SET `FWarn`='%d',`Raport1`='0',`Raport2`='0',`Raport3`='0',`Raport4`='0' WHERE `id`='%d'", fwarn-1,sqlid);
- mysql_tquery(SQL,var100,"","");
- mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
- mysql_tquery(SQL, qqerry, "", "");
- }
- if(raportincomplet == 1)
- {
- format(string, sizeof(string), "You was uninvited from faction %s (rank %d) after %d days. Reason: Raport incomplet.",NumeFactiune(faction),rank,GetDaysFromTimestamp(factionjoin));
- mysql_format(SQL, qqerry, sizeof(qqerry), "INSERT INTO `emails` (`playerid`,`Message`) VALUES ('%d','%s')", sqlid, string);
- mysql_tquery(SQL, qqerry, "", "");
- foreach(new id : Player)
- {
- if(PlayerInfo[id][pSQLID] == sqlid)
- {
- PlayerInfo[id][pMember] = 0;
- PlayerInfo[id][pLeader] = 0;
- PlayerInfo[id][pRank] = 0;
- PlayerInfo[id][pFACWarns] = 0;
- PlayerInfo[id][pFactionJoin] = 0;
- PlayerInfo[id][pModel] = 250;
- gTeam[id] = 3;
- PlayerInfo[id][pTeam] = 3;
- OnDuty[id] = 0;
- tazer[id] = 0;
- SetPlayerArmourEx(id, 0);
- SetPlayerSkin(id,PlayerInfo[id][pModel]);
- SetPlayerToTeamColor(id);
- SendClientMessage(id, COLOR_LIGHTRED, string);
- }
- }
- new str[256];
- mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Member`='0',`Leader`='0',`Rank`='0',`Model`='250',`FWarn`='0',`FPunish`='0',`Team`='3', `FactionJoin`='0' WHERE `name`='%s'",name);
- mysql_tquery(SQL,str,"","");
- format(string, sizeof(string), "%s was uninvited from faction %s (rank %d) after %d days. Reason: Raport incomplet.",name,NumeFactiune(faction),rank,GetDaysFromTimestamp(factionjoin));
- Factionlog(faction,sqlid,0,string);
- mysql_format(SQL, query, sizeof(query), "INSERT INTO `faction_logs` (`text`,`player`,`leader`) VALUES ('%s','%d','%d')", string, sqlid, 0);
- mysql_tquery(SQL,query,"","");
- }
- }
- cache_delete(stringresult9);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement