Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:payday(playerid, params[]) {
- new string[128];
- new interest,account[MAX_PLAYERS];
- new rent[MAX_PLAYERS];
- SetTimer("ScadeLicentele", 4000, false);
- foreach(Player,i) {
- if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
- new key = PlayerInfo[i][pHouse];
- if(key != 999)
- {
- rent[i] = HouseInfo[key][hRent];
- HouseInfo[key][hTakings] += rent[i];
- }
- new tmpintrate;
- SendClientMessage(i, COLOR_SERVER, "------------------------------------------------------------------------------------------------");
- if(PlayerInfo[i][pPremiumAccount] == 1)
- {
- tmpintrate = 2;
- PlayerInfo[i][pPayDayHad] += 1;
- if(PlayerInfo[i][pPayDayHad] >= 5) {
- PlayerInfo[i][pExp]++;
- PlayerInfo[i][pPayDayHad] = 0;
- }
- new bonus = PlayerInfo[i][pPayCheck] / 2;
- PlayerInfo[i][pPayCheck] += bonus;
- }
- else
- {
- tmpintrate = 1;
- }
- account[i] = PlayerInfo[i][pAccount];
- Tax += TaxValue;
- //PlayerInfo[i][pAccount] -= TaxValue;
- new checks = PlayerInfo[i][pLevel]*2500+random(3000);
- if(PlayerInfo[i][pDailyLogin] == 0) checks = checks*2;
- GivePlayerCash(i, checks);
- interest = (PlayerInfo[i][pAccount]/5000)*(tmpintrate);
- if(PlayerInfo[i][pDailyLogin] == 0) interest = interest*2;
- if(PlayerInfo[i][pDailyLogin] == 0) PlayerInfo[i][pExp] += 2;
- else PlayerInfo[i][pExp] += 1;
- UpdateProgress(i, 0);
- PlayerInfo[i][pAccount] += interest+1000;
- SCM(i, COLOR_WHITE, "Salariul tau a sosit! Viziteaza banca pentru a retrage banii.");
- format(string, sizeof(string), "Ai primit %0.2f ore jucate. (%.0f minute)", PlayerInfo[i][pSeconds]/3600, PlayerInfo[i][pSeconds]/60);
- SendClientMessage(i, COLOR_WHITE, string);
- PlayerInfo[i][pConnectTime] += PlayerInfo[i][pSeconds]/3600;
- if(PlayerInfo[i][pSeconds] >= 1800) {
- new query[180];
- format(query, sizeof(query), "UPDATE `users` SET `DayHours`=`DayHours`+1 WHERE `ID`='%d'", PlayerInfo[i][pSQLID]);
- mysql_query(SQL, query);
- format(query, sizeof(query), "UPDATE `users` SET `HoursMonth`=`HoursMonth`+1 WHERE `ID`='%d'", PlayerInfo[i][pSQLID]);
- mysql_query(SQL, query);
- if(PlayerInfo[i][pGiftPoints] < 5) {
- PlayerInfo[i][pGiftPoints] ++;
- Update(i, pGiftPointsx);
- }
- }
- PlayerInfo[i][pSeconds] = 0;
- if(PlayerInfo[i][pDailyLogin] == 0) {
- PlayerInfo[i][pDailyLogin] = 1;
- UpdateVar(i, "DailyLogin", 1);
- SCM(i, COLOR_LIGHTBLUE, "Ai primit de doua ori mai multe respect points si bani pentru primul tau payday de astazi.");
- }
- if(PlayerInfo[i][pHouse] != 999) {
- format(string, sizeof(string), "Paycheck: $%s | Tax: -$%d | Rent: -$%d | Old Balance: $%s", FormatNumber(checks), FormatNumber(TaxValue), HouseInfo[PlayerInfo[i][pHouse]][hRent], FormatNumber(account[i]));
- SendClientMessage(i, COLOR_GREY, string);
- format(string, sizeof(string), "Interest rate: 0.%d% | Interest: $%s | New balance: $%s", tmpintrate, FormatNumber(interest), FormatNumber(PlayerInfo[i][pAccount]));
- SendClientMessage(i, COLOR_GREY, string);
- }
- else {
- format(string, sizeof(string), "Paycheck: $%s | Tax: -$%d | Rent: -$0 | Old Balance: $%s", FormatNumber(checks), FormatNumber(TaxValue), FormatNumber(account[i]));
- SendClientMessage(i, COLOR_GREY, string);
- format(string, sizeof(string), "Interest rate: 0.%d% | Interest: $%s | New balance: $%s", tmpintrate, FormatNumber(interest), FormatNumber(PlayerInfo[i][pAccount]));
- SendClientMessage(i, COLOR_GREY, string);
- }
- PlayerInfo[i][pPayDay] = 0;
- PlayerInfo[i][pPayCheck] = 0;
- SendClientMessage(i, COLOR_SERVER, "------------------------------------------------------------------------------------------------");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement