Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //tajmer jednominutni
- public Pay()
- {
- new string[256];
- new tmphour;
- new tmpminute;
- new tmpsecond;
- gettime(tmphour, tmpminute, tmpsecond);
- FixHour(tmphour);
- tmphour = shifthour;
- if((tmphour > ghour) || (tmphour == 0 && ghour == 23))
- {
- format(string, sizeof(string), "{0A9DC9}Zara Gaming RolePlay: {FFFFFF}Sada je {0A9DC9}%d:00 {FFFFFF}sati.",tmphour);
- BroadCast(WHITE,string);
- ghour = tmphour;
- PayDay();
- if (realtime)
- {
- SetWorldTime(tmphour);
- }
- }
- }
- //PayDay
- public PayDay()
- {
- new string[128];
- new coordstring[128];
- new coordstring1[128];
- new coordstring2[128];
- new coordstring3[128];
- new coordstring4[180];
- new coordstring5[128];
- new coordstring6[128];
- new coordstring7[128];
- new coordstring8[128];
- new coordstring9[128];
- new coordstring10[128];
- new coordstring17[128];
- new coordstring11[128];
- new coordstring12[128];
- new coordstring13[128];
- new coordstring15[128];
- new coordstring16[128];
- new payday[1000];
- new account;
- new rent = 0;
- foreach (new i : Player)
- {
- new nxtlevel = PlayerInfo[i][pLevel]+1;
- new expamount = nxtlevel*levelexp;
- new infostring[128];
- if(PlayerInfo[i][pLevel] > 0)
- {
- if(PlayerInfo[i][pKredit] > 0)
- {
- PlayerInfo[i][pKredit] -= 500;
- AC_GivePlayerMoneyMinus(i,500);
- account -= 500;
- SCM(i, COLOR_LIGHTRED, "Odplatili ste 500$ kredita (/kreditinfo)");
- }
- if(MoneyMessage[i]==1)
- {
- if(PlayerInfo[i][pJailed] >= 1)
- {
- SCM(i, COLOR_LIGHTRED, "Niste odplatili ratu za kredit, produzuje vam se zatvorska kazna.");
- PlayerInfo[i][pJailTime] += 240;
- }
- else if(PlayerInfo[i][pJailed] == 0)
- {
- new rand1 = random(sizeof(gPrisonSpawn));
- SCM(i, COLOR_LIGHTRED, "Niste odplatili ratu za kredit, idete u zatvor.");
- GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
- SetPlayerInterior(i, 0);
- PlayerInfo[i][pInt] = 0;
- SetPlayerPos(i, gPrisonSpawn[rand1][0], gPrisonSpawn[rand1][1], gPrisonSpawn[rand1][2]);
- PlayerInfo[i][pJailed] = 2;
- AC_ResetPlayerWeapons(i);
- WantedLevel[i] = 0;
- PlayerInfo[i][pJailTime] = 240;
- format(string, sizeof(string), "Uhapseni ste na %d sekundi. Kaucija: Nedostupna", PlayerInfo[i][pJailTime]);
- SendClientMessage(i, SVETLOPLAVA, string);
- }
- }
- new playername2[MAX_PLAYER_NAME];
- GetPlayerName(i, playername2, sizeof(playername2));
- account = PlayerInfo[i][pAccount];
- new key = PlayerInfo[i][pPhousekey];
- if(key != 255)
- {
- rent = HouseInfo[key][hRent];
- if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
- {
- rent = 0;
- }
- else if(rent > PlayerInfo[i][pCash])
- {
- PlayerInfo[i][pPhousekey] = 255;
- SendClientMessage(i, COLOR_WHITE, "Iseljeni ste.");
- rent = 0;
- }
- else
- {
- HouseInfo[key][hMoney] = HouseInfo[key][hMoney]+rent;
- }
- }
- if(PlayerInfo[i][pPayDay] >= 5)
- {
- Tax += TaxValue;//Should work for every player online
- PlayerInfo[i][pAccount] -= TaxValue;
- new struja, voda, komunalije, promotersupporterplaca, drzavnaplaca, umirovljenikplaca;
- if(PlayerInfo[i][pPhousekey] != 255)
- {
- struja = 200 + (random(20));
- voda = 100 + (random(20));
- komunalije = 50 + (random(20));
- }
- if(PlayerInfo[i][pPbiskey] != 255)
- {
- struja = struja + (50 + (random(34)));
- voda = voda + (35 + (random(21)));
- komunalije = komunalije + (50 + (random(33)));
- }
- if(PlayerInfo[i][pPhousekey] == 255)
- {
- struja = 0;
- voda = 0;
- komunalije = 0;
- }
- new kamatnastopa, interes;
- if(PlayerInfo[i][pVip] == 4 || PlayerInfo[i][pAdministrator] >= 1 || CFG[0][cHappy] == 1)
- {
- PlayerInfo[i][pExp]++;
- }
- if(PlayerInfo[i][pPromoter] >= 1 || PlayerInfo[i][pSupporter] >= 1)
- {
- promotersupporterplaca = 5000;
- }
- if(PlayerInfo[i][pUmirovljenik] == 1)
- {
- umirovljenikplaca = 10000;
- }
- if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pLeader] == 2 || PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pLeader] == 3 || PlayerInfo[i][pMember] == 3 || PlayerInfo[i][pMember] == 4 || PlayerInfo[i][pLeader] == 4 ||
- PlayerInfo[i][pMember] == 7 || PlayerInfo[i][pLeader] == 7 || PlayerInfo[i][pMember] == 8 || PlayerInfo[i][pLeader] == 8 || PlayerInfo[i][pMember] == 9 || PlayerInfo[i][pLeader] == 9 || PlayerInfo[i][pMember] == 10 || PlayerInfo[i][pLeader] == 10 ||
- PlayerInfo[i][pMember] == 18 || PlayerInfo[i][pLeader] == 18 || PlayerInfo[i][pMember] == 24 || PlayerInfo[i][pLeader] == 24)
- {
- drzavnaplaca = 2000;
- }
- if(PlayerInfo[i][pVip] == 4 || PlayerInfo[i][pAdministrator] >= 1)
- {
- kamatnastopa = 5;
- }
- else
- {
- kamatnastopa = 2;
- }
- interes = (PlayerInfo[i][pAccount]/1000)*(kamatnastopa);
- account += promotersupporterplaca;
- account += drzavnaplaca;
- account += umirovljenikplaca;
- account += 700;
- account += interes;
- account -= struja;
- account -= voda;
- account -= komunalije;
- PlayerInfo[i][pAccount] = account;
- PlayerInfo[i][pExp]++;
- format(coordstring, sizeof(coordstring)," {0A9DC9}|___BANKARSKI IZVJESTAJ___|");
- format(coordstring1, sizeof(coordstring1),"\n{FFFFFF}Placa: $700");
- format(coordstring2, sizeof(coordstring2),"\n{FFFFFF}Stecen interes od novca u banci: $%d",interes);
- format(coordstring3, sizeof(coordstring3),"\n{FFFFFF}Kamatna stopa: 0.%d %",kamatnastopa);
- format(coordstring4, sizeof(coordstring4),"\n{0A9DC9}|---------- Racuni ----------|");
- format(coordstring5, sizeof(coordstring5), "\n{FFFFFF}Racun za struju: $%d",struja);
- format(coordstring6, sizeof(coordstring6),"\n{FFFFFF}Racun za vodu(Vodovod): $%d",voda);
- format(coordstring7, sizeof(coordstring7),"\n{FFFFFF}Racun za komunalije(Gradska Cistoca): $%d",komunalije);
- format(coordstring8, sizeof(coordstring8),"\n\n{0A9DC9}|--------------------|");
- format(coordstring9, sizeof(coordstring9),"\n{FFFFFF}Ukoliko ste Promoter/Supporter primate dodatnih 5000$ na placu");
- format(coordstring10, sizeof(coordstring10),"\n{FFFFFF}Ukoliko ste clan Departmenta primate dodatnih 2000$ na placu");
- format(coordstring17, sizeof(coordstring17),"\n{FFFFFF}Ukoliko ste Umirovljenik primate dodatnih 10.000$ na placu");
- format(coordstring11, sizeof(coordstring11),"\n{0A9DC9}|------------------------|");
- format(coordstring12, sizeof(coordstring12),"\n{FFFFFF}Staro Stanje: $%d", account - 700 - interes + (struja + voda + komunalije + rent));
- format(coordstring13, sizeof(coordstring13),"\n{FFFFFF}Novo Stanje: $%d",PlayerInfo[i][pAccount]);
- format(coordstring15, sizeof(coordstring15),"\n{0A9DC9}|----------------------------------------|");
- format(coordstring16, sizeof(coordstring16),"\n");
- format(payday, 1000," %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",coordstring,coordstring1,coordstring2,coordstring3,coordstring4,coordstring5,coordstring6,coordstring7,coordstring8,coordstring9,coordstring10,coordstring17,coordstring11,coordstring12,coordstring13,coordstring15,coordstring16);
- ShowPlayerDialog(i, 900, DIALOG_STYLE_MSGBOX, "{0A9DC9}PAYDAY - PLACA", payday , "OK", "OK");
- format(string, sizeof(string), "~b~Placa~n~~w~je stigla na vas racun");
- GameTextForPlayer(i, string, 5000, 1);
- rent = 0;
- PlayerInfo[i][pPayDay] = 0;
- PlayerInfo[i][pConnectTime] += 1;
- if (PlayerInfo[i][pExp] >= expamount)
- {
- PlayerInfo[i][pLevel]++;
- PlayerInfo[i][pExp] = 0;
- format(infostring, 256, "{0A9DC9}ZG Level Up: {FFFFFF}Cestitamo! Sada ste level {0A9DC9}%d", nxtlevel);
- SCM(i, WHITE, infostring);
- }
- }
- else
- {
- SendClientMessage(i,WHITE, "{FF0000}#Error: {FFFFFF}Nazalost niste igrali dovoljno dugo da biste dobili placu!");
- }
- }
- }
- SaveAccounts();
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement