Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function LocalTimer() {
- new string[200], query[200];
- // licitatii automate
- new year, month, day;
- getdate(year, month, day);
- new days[180];
- format(days, sizeof(days), GetWeekDay(day, month, year));
- new hour,minute,second;
- gettime(hour,minute,second);
- if(strcmp(days,"Monday",true) == 0 && hour == 00 && second == 0) {
- format(query, sizeof(query), "UPDATE `users` SET `HelpedPlayersToday`='0' WHERE `Admin`>='1'");
- mysql_query(SQL ,query);
- foreach(Player, i) {
- if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
- if(PlayerInfo[i][pAdmin] != 0) PlayerInfo[i][pHelpedPlayersToday] = 0;
- }
- }
- }
- if(strcmp(days,"Saturday",true) == 0 || strcmp(days,"Sunday",true) == 0 || strcmp(days,"Friday",true) == 0) {
- if(ServerSystem[10] == 0) {
- if(hour == 20 && Licitatie == 0 || hour == 21 && Licitatie == 0) {
- if(FreeBusinesses() > 0) {
- new id = GetBizzID();
- Licitatie = 1;
- TipLicitatie = 2;
- TimpLicitatie = 5*60;
- TotalBani = 0;
- foreach(Player, i) {
- if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) TotalMoney[i] = 0;
- }
- IDLicitatie = id;
- LastPlayer = -1;
- foreach(Player, i) {
- if(IsPlayerConnected(i) && toglicitatie[i] == 0) {
- SCM(i, COLOR_YELLOW, "O licitatie tocmai a inceput. Optiunea de a vedea mesajele de la licitatie este dezactivata.");
- SCM(i, COLOR_YELLOW, "Daca vrei sa vezi mesajele, foloseste comanda /tog iar daca vrei sa vezi pentru ce se liciteaza, foloseste /info.");
- }
- }
- MesajLicitatie(0x7A45FFFF, "O noua licitatie tocmai a inceput!");
- switch(TipLicitatie) {
- case 1: format(string, sizeof(string), "De data aceasta, se liciteaza pentru casa cu ID-ul %d. (/findhouse %d). ", id, id);
- case 2: format(string, sizeof(string), "De data aceasta, se liciteaza pentru afacerea cu ID-ul %d. (/findbiz %d). ", id, id);
- }
- MesajLicitatie(0x7A45FFFF, string);
- format(string, sizeof(string), "Ai la dispozitie 5 minute pentru a licita.");
- MesajLicitatie(0x7A45FFFF, string);
- MesajLicitatie(0x7A45FFFF, "Comenzi disponibile: (/bid - licitezi), (/info - informatii)");
- }
- else if(FreeHouses() > 0) {
- new id = GetHouseID();
- Licitatie = 1;
- TipLicitatie = 1;
- TimpLicitatie = 5*60;
- TotalBani = 0;
- foreach(Player, i) {
- if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) TotalMoney[i] = 0;
- }
- IDLicitatie = id;
- LastPlayer = -1;
- foreach(Player, i) {
- if(IsPlayerConnected(i) && toglicitatie[i] == 0) {
- SCM(i, COLOR_YELLOW, "O licitatie tocmai a inceput. Optiunea de a vedea mesajele de la licitatie este dezactivata.");
- SCM(i, COLOR_YELLOW, "Daca vrei sa vezi mesajele, foloseste comanda /tog iar daca vrei sa vezi pentru ce se liciteaza, foloseste /info.");
- }
- }
- MesajLicitatie(0x7A45FFFF, "O noua licitatie tocmai a inceput!");
- switch(TipLicitatie) {
- case 1: format(string, sizeof(string), "De data aceasta, se liciteaza pentru casa cu ID-ul %d. (/findhouse %d). ", id, id);
- case 2: format(string, sizeof(string), "De data aceasta, se liciteaza pentru afacerea cu ID-ul %d. (/findbiz %d). ", id, id);
- }
- MesajLicitatie(0x7A45FFFF, string);
- format(string, sizeof(string), "Ai la dispozitie 5 minute pentru a licita.");
- MesajLicitatie(0x7A45FFFF, string);
- MesajLicitatie(0x7A45FFFF, "Comenzi disponibile: (/bid - licitezi), (/info - informatii)");
- }
- else if(minute == 0 && second == 0) SendAdminMessage(COLOR_WHITE, "AdmBot: Nu sunt proprietati ce poti fi scoase la licitatie.", 1);
- }
- }
- }
- // CS Arena
- if(GameStep == 1) {
- if(RoundTime > 0) {
- RoundTime --;
- if(RoundTime == 120) {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && InGame[i] == 1) {
- TogglePlayerControllable(i, 1);
- Freezed[i] = 0;
- GameTextForPlayer(i, "~y~GO! GO! GO!", 1500, 4);
- }
- }
- }
- if(UsedBomb == 1) format(string, sizeof(string), "~r~%s", CalculeazaTimp2(RoundTime));
- else if(RoundTime >= 120) format(string, sizeof(string), "~y~%s", CalculeazaTimp2(RoundTime));
- else if(RoundTime < 10) format(string, sizeof(string), "~r~%s", CalculeazaTimp2(RoundTime));
- else format(string, sizeof(string), "%s", CalculeazaTimp2(RoundTime));
- TextDrawSetString(GameTD[4], string);
- if(RoundTime == 0) {
- if(UsedBomb == 1) {
- UsedBomb = 0;
- foreach(Player, i) {
- if(HaveDef[i] == 1) {
- DefBomb = 0;
- KillTimer(DefTimer[i]);
- SCM(i, COLOR_LGREEN, "Dezamorsarea a esuat!");
- }
- }
- SendGameMessage(COLOR_WARNING, "Bomba a explodat! Teroristii au castigat aceasta runda.");
- CreateExplosion(BombPos[0], BombPos[1], BombPos[2], 3, 0.0);
- CreateExplosion(BombPos[0], BombPos[1]+1, BombPos[2], 3, 0.0);
- CreateExplosion(BombPos[0]+2, BombPos[1]-1, BombPos[2], 3, 0.0);
- CreateExplosion(BombPos[0], BombPos[1]+3, BombPos[2]+1, 3, 0.0);
- CreateExplosion(BombPos[0], BombPos[1]+4, BombPos[2], 3, 0.0);
- CreateExplosion(BombPos[0], BombPos[1]+5, BombPos[2], 3, 0.0);
- CreateExplosion(BombPos[0]+2, BombPos[1], BombPos[2]+3, 3, 0.0);
- CreateExplosion(BombPos[0], BombPos[1]+3, BombPos[2]+5, 3, 0.0);
- WonRound(TEAM_TERRORIST);
- DestroyPickup(BombPickup);
- }
- else WonRound(TEAM_CTERRORIST);
- }
- }
- }
- // War deelay
- for(new i = 0; i < 17; i++) {
- if(FactionDeelay[i] >= 1) {
- FactionDeelay[i] --;
- if(FactionDeelay[i] == 0) {
- SendFactionMessage(i, COLOR_MONEY, "[WAR] Acum mafia ta poate ataca un teritoriu!");
- }
- }
- }
- // Record players
- if(PlayersOnline() > MaxPlayers) {
- MaxPlayers = PlayersOnline();
- SaveInfo();
- format(string, sizeof(string), "Warning: Noul record de playeri conectati este acum %d.", MaxPlayers);
- SendAdminMessage(COLOR_WARNING, string, 1);
- }
- // Race Arena
- if(RaceStarted == 1 && PlayersInRace() == 0) RaceStarted = 0;
- if(RaceTime > 0) {
- RaceTime --;
- format(string, sizeof(string), "~y~%d", RaceTime);
- GameTextForRace(string);
- if(RaceTime == 0) {
- StartRaceArena();
- format(string, sizeof(string), "~y~GO! GO! GO!");
- GameTextForRace(string);
- }
- }
- // Paintball arena
- if(painttime > 0) painttime--;
- if(PaintText[0] != 0) {
- PaintText[0] --;
- if(PaintText[0] == 0) format(string, sizeof(string), "~w~Runda a inceput~n~Succes tuturor!");
- else format(string, sizeof(string), "~w~Runda incepe in ~n~~b~%d secunde", PaintText[0]);
- GameTextForPaint(string, 0);
- }
- if(PaintText[1] != 0) {
- PaintText[1] --;
- if(PaintText[1] == 0) format(string, sizeof(string), "~w~Runda a inceput~n~Succes tuturor!");
- else format(string, sizeof(string), "~w~Runda incepe in ~n~~b~%d secunde", PaintText[1]);
- GameTextForPaint(string, 1);
- }
- if(PaintText[2] != 0) {
- PaintText[2] --;
- if(PaintText[2] == 0) format(string, sizeof(string), "~w~Runda a inceput~n~Succes tuturor!");
- else format(string, sizeof(string), "~w~Runda incepe in ~n~~b~%d secunde", PaintText[2]);
- GameTextForPaint(string, 2);
- }
- if(PlayersOnPaint(0) >= 2 && PaintTime[0] > 0) {
- PaintTime[0] --;
- if(PaintTime[0] == 0) {
- SendPaintMessage(1, COLOR_YELLOW, "Runda va incepe peste un minut. Pentru a vota o mapa, folositi comanda /votemap.");
- PaintVote[0] = 1;
- if(PaintTimer[0] != 0) KillTimer(PaintTimer[0]), PaintTimer[0] = 0;
- PaintTimer[0] = SetTimerEx("CalculateVote", 60000, 0, "i", 0);
- }
- }
- if(PlayersOnPaint(1) >= 2 && PaintTime[1] > 0) {
- PaintTime[1] --;
- if(PaintTime[1] == 0) {
- SendPaintMessage(1+1, COLOR_YELLOW, "Runda va incepe peste un minut. Pentru a vota o mapa, folositi comanda /votemap.");
- PaintVote[1] = 1;
- if(PaintTimer[1] != 0) KillTimer(PaintTimer[1]), PaintTimer[1] = 0;
- PaintTimer[1] = SetTimerEx("CalculateVote", 60000, 0, "i", 1);
- }
- }
- if(PlayersOnPaint(2) >= 2 && PaintTime[2] > 0) {
- PaintTime[2] --;
- if(PaintTime[2] == 0) {
- SendPaintMessage(2+1, COLOR_YELLOW, "Runda va incepe peste un minut. Pentru a vota o mapa, folositi comanda /votemap.");
- PaintVote[2] = 1;
- if(PaintTimer[2] != 0) KillTimer(PaintTimer[2]), PaintTimer[2] = 0;
- PaintTimer[2] = SetTimerEx("CalculateVote", 60000, 0, "i", 2);
- }
- }
- // Restart Server
- if(RestartTime >= 1) {
- RestartTime--;
- if(RestartTime <= 60) {
- format( string, sizeof(string), "~w~Urmeaza un restart in~n~~r~%d secunde", RestartTime);
- GameTextForAll( string, 1100, 4 );
- }
- if(RestartTime == 3) {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1 && PlayerInfo[i][pAdmin] < 7) KickEx(i);
- }
- }
- if(RestartTime == 0) GameModeExit();
- }
- // Dynamic Event
- if(ActiveEvent == 1 && EventTime == 0) {
- if(EventType == 3) {
- format(string, sizeof(string), "~r~Teroristi: ~w~~h~%d~n~~b~Politisti: ~w~~h~%d", GetTeamMembers(1), GetTeamMembers(2));
- TextDrawSetString(EventCS, string);
- }
- else if(EventType == 6) {
- format(string, sizeof(string), "~p~Zombies: ~w~~h~%d~n~~w~Humans: ~w~~h~%d", GetTeamMembers(1), GetTeamMembers(2));
- TextDrawSetString(EventCS, string);
- }
- else {
- format(string, sizeof(string), "~p~Alive: ~w~~h~%d", GetPlayersOnEvent());
- TextDrawSetString(EventCS, string);
- }
- if(EventType == 3) {
- if(GetTeamMembers(1) == 0) {
- format(string, sizeof(string), "(( AdmBot: Echipa {5AAFFA}Politistilor{A9C4E4} a castigat evenimentul si a primit $%s. Felicitari! ))", FormatNumber(EventMoney));
- SCMTA(COLOR_CLIENT, string);
- foreach(Player, i) {
- if(Team[i] == 2 && IsPlayerConnected(i)) GivePlayerCash(i, EventMoney), SpawnPlayer(i);
- if(InEvent[i]) InEvent[i] = 0;
- }
- ActiveEvent = 0;
- }
- else if(GetTeamMembers(2) == 0) {
- format(string, sizeof(string), "(( AdmBot: Echipa {FA5A5A}Teroristilor{A9C4E4} a castigat evenimentul si a primit $%s. Felicitari! ))", FormatNumber(EventMoney));
- SCMTA(COLOR_CLIENT, string);
- foreach(Player, i) {
- if(Team[i] == 1 && IsPlayerConnected(i)) GivePlayerCash(i, EventMoney), SpawnPlayer(i);
- if(InEvent[i]) InEvent[i] = 0;
- }
- ActiveEvent = 0;
- }
- }
- else if(EventType == 6) {
- if(GetTeamMembers(2) == 0) {
- format(string, sizeof(string), "(( AdmBot: Echipa {B366FF}Zombie{A9C4E4} a castigat evenimentul si a primit $%s. Felicitari! ))", FormatNumber(EventMoney));
- SCMTA(COLOR_CLIENT, string);
- foreach(Player, i) {
- if(Team[i] == 1 && IsPlayerConnected(i)) GivePlayerCash(i, EventMoney), SpawnPlayer(i);
- if(InEvent[i]) InEvent[i] = 0;
- }
- ActiveEvent = 0;
- }
- else if(GetTeamMembers(1) == 0) {
- format(string, sizeof(string), "(( AdmBot: Echipa {FFFFFF}Human{A9C4E4} a castigat evenimentul si a primit $%s. Felicitari! ))", FormatNumber(EventMoney));
- SCMTA(COLOR_CLIENT, string);
- foreach(Player, i) {
- if(Team[i] == 2 && IsPlayerConnected(i)) GivePlayerCash(i, EventMoney), SpawnPlayer(i);
- if(InEvent[i]) InEvent[i] = 0;
- }
- ActiveEvent = 0;
- }
- }
- else CheckEventWinner();
- }
- // Licitatie
- if(Licitatie == 1) {
- TimpLicitatie --;
- if(TimpLicitatie == 0) {
- Licitatie = 0;
- if(LastPlayer == -1) SCMTA(COLOR_YELLOW, "Licitatia a fost anulata deoarece nu s-a licitat nicio suma.");
- else {
- if(!IsPlayerConnected(LastPlayer) || TotalMoney[LastPlayer] == 0) SCMTA(COLOR_YELLOW, "Licitatia a fost anulata deoarece ultimul jucator care a licitat nu mai este conectat.");
- else {
- SCMTA(0x7A45FFFF, "Licitatia s-a terminat.");
- format(string, sizeof(string), "Cel mai mult a licitat %s(%d) cu suma de $%s.", GetName(LastPlayer), LastPlayer, FormatNumber(TotalMoney[LastPlayer]));
- SCMTA(0x7A45FFFF, string);
- GivePlayerCash(LastPlayer, -TotalBani);
- switch(TipLicitatie) {
- case 1: {
- format(string, sizeof(string), "Ai pierdut casa (%d) deoarece a fost licitata din cauza inactivitatii tale.", IDLicitatie);
- InsertEmail(HouseInfo[IDLicitatie][hOwner], "AdmBot", string, 0);
- format(string, sizeof(string), "Ai primit casa %d cu succes. Felicitari!", IDLicitatie);
- SCM(LastPlayer, COLOR_YELLOW, string);
- finishAchievement(LastPlayer, 3);
- format(query, sizeof(query), "UPDATE `users` SET `House`='999' WHERE `House`='%d'", IDLicitatie);
- mysql_query(SQL, query);
- foreach(Player, i) {
- if(IsPlayerConnected(i) && PlayerInfo[i][pHouse] == IDLicitatie) {
- SCM(i, COLOR_YELLOW, "Ai ramas fara casa deoarece a fost luata la licitatie. Motivul: probabil ai fost inactiv.");
- PlayerInfo[i][pHouse] = 999;
- Update(i,pHousex);
- }
- }
- PlayerInfo[LastPlayer][pHouse] = IDLicitatie;
- PlayerInfo[LastPlayer][pRented] = -1;
- HouseInfo[IDLicitatie][hOwned] = 1;
- HouseInfo[IDLicitatie][hValue] = 0;
- strmid(HouseInfo[IDLicitatie][hOwner], GetName(LastPlayer), 0, strlen(GetName(LastPlayer)), 255);
- Update(LastPlayer,pHousex);
- format(query, sizeof(query),"UPDATE `houses` SET `Owned`='1',`Owner`='%s',`Value`='0' WHERE `ID`='%d'",GetName(LastPlayer),IDLicitatie);
- mysql_query(SQL,query);
- UpdateLabel(1,IDLicitatie);
- }
- case 2: {
- format(string, sizeof(string), "Ai pierdut afacerea (%d) deoarece a fost licitata din cauza inactivitatii tale.", IDLicitatie);
- InsertEmail(BizzInfo[IDLicitatie][bOwner], "AdmBot", string, 0);
- format(string, sizeof(string), "Ai primit afacerea %d cu succes. Felicitari!", IDLicitatie);
- SCM(LastPlayer, COLOR_YELLOW, string);
- finishAchievement(LastPlayer, 2);
- format(query, sizeof(query), "UPDATE `users` SET `Bizz`='255' WHERE `Bizz`='%d'", IDLicitatie);
- mysql_query(SQL, query);
- foreach(Player, i) {
- if(IsPlayerConnected(i) && PlayerInfo[i][pBizz] == IDLicitatie) {
- SCM(i, COLOR_YELLOW, "Ai ramas fara afacere deoarece a fost luata la licitatie. Motivul: probabil ai fost inactiv.");
- PlayerInfo[i][pBizz] = 255;
- Update(i,pBizzx);
- }
- }
- PlayerInfo[LastPlayer][pBizz] = IDLicitatie;
- BizzInfo[IDLicitatie][bOwned] = 1;
- BizzInfo[IDLicitatie][bBuyPrice] = 0;
- strmid(BizzInfo[IDLicitatie][bOwner], GetName(LastPlayer), 0, strlen(GetName(LastPlayer)), 255);
- format(query, sizeof(query),"UPDATE users SET `Money`='%d',`Bizz`='%d' WHERE `ID`='%d'",GetPlayerCash(LastPlayer),PlayerInfo[LastPlayer][pBizz],PlayerInfo[LastPlayer][pSQLID]);
- mysql_query(SQL,query);
- format(query, sizeof(query),"UPDATE `bizz` SET `Owned`='1',`Owner`='%s',`BuyPrice`='0' WHERE `ID`='%d'",BizzInfo[IDLicitatie][bOwner],IDLicitatie);
- mysql_query(SQL,query);
- UpdateLabel(2,IDLicitatie);
- }
- }
- }
- }
- }
- }
- if(GameTime > 0) {
- GameTime --;
- if(GameTime == 0) MapResult();
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement