- 0
Problema nu se salveaza rob points la payday.
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
SpriteTV
Salut am si eu problema urmatoare nu mi-se salveaza rob points-ul si nu inteleg care ar fi problema daca se poate sa ma ajute cineva.
public PayDay() { new string[128], str[256], string3[256], interest, account[MAX_PLAYERS], hour, minn, sec, ye, mo, da, rent[MAX_PLAYERS], hourscount; gettime(hour,minn,sec); getdate(ye, mo, da); if(RestartTimer == 1) { SendClientMessageToAll(COLOR_YELLOW, "---- SERVER RESTART ----"); SendClientMessageToAll(COLOR_RED2, "The server will be restarted in 60 seconds."); foreach(new x : Player) { Update(x, pPayDayx); Update(x, pPayCheckx); Update(x, pFpunishx); Update(x, pConnectTimex); Update(x, pBank); Update(x, pCashx); Update(x, pExpx); Update(x, pJailTimex); Update(x, pLevelx); Update(x, pRob); } iGMXTick = 60; iGMXTimer = SetTimer("restartTimer", 1000, true); RestartTimer = 0; } foreach(new i : Player) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pLevel] >= 0) { new wakaname[25]; GetPlayerName(i,wakaname,sizeof(wakaname)); if(MoneyMessage[i]==1) { SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time."); new rand; rand = random(sizeof(gRandomJailSpawns)); SetPlayerInterior(i, 6); SetPlayerPosEx(i,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]); PlayerInfo[i][pJailed] = 1; ResetPlayerWeaponsEx(i); ResetPlayerWeapons(i); WantedPoints[i] = 0; PlayerInfo[i][pJailTime] = 240; format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[i][pJailTime]); SendClientMessage(i, COLOR_LIGHTBLUE, string); ResetPlayerCash(i); GivePlayerCash(i, 10000); Update(i, pCashx); Update(i,pJailedx); Update(i,pJailTimex); TogglePlayerControllable(i, 0); SetTimerEx("UnFreezeStation", 1000, false, "i", i); } new key = PlayerInfo[i][pPhousekey]; if(key != 999) { rent[i] = HouseInfo[key][hRent]; if(rent[i] > GetPlayerCash(i) && strcmp(PlayerInfo[i][pNormalName], HouseInfo[key][hOwner], false) == 0) { PlayerInfo[i][pPhousekey] = 999; Update(i,pPhousekeyx); } HouseInfo[key][hTakings] += rent[i]; mysql_format(SQL,str,sizeof(str),"UPDATE `houses` SET `Takings`='%d' WHERE `ID`='%d'",HouseInfo[key][hTakings],key); mysql_tquery(SQL,str,"",""); } new tmpintrate; if(PlayerInfo[i][pPremiumAccount] > 0) { tmpintrate = 2; 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][pPayCheck]; PlayerInfo[i][pAccount] += checks; interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate); new finalinterest,stringore[128]; new Float:timee,Float:timee2; SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------"); SendClientMessage(i, COLOR_WHITE, "Your paycheck has arrived; please visit the bank to withdraw your money."); PlayerInfo[i][pConnectTime] += PlayerInfo[i][pPayDay] / 3600.0; timee = PlayerInfo[i][pPayDay] / 3600.0; timee2 = PlayerInfo[i][pPayDay] / 60.0; finalinterest = interest; if(PlayerInfo[i][pPayDay] > 1801) { PlayerInfo[i][pGiftTime] += 40; Update(i, pGiftTimex); SS(i,COLOR_LIGHTBLUE, "Ai primit 40 gift points pentru ca ai jucat 1801 secunde.","You recieved 40 gift points because you played 1801 seconds."); } else { PlayerInfo[i][pGiftTime] += 20; Update(i, pGiftTimex); SS(i,COLOR_LIGHTBLUE, "Ai primit 20 gift points pentru ca nu ai jucat 1801 secunde.","You recieved 20 gift points because you not played 1801 seconds."); } if(PlayerInfo[i][pMember] != 0) { PlayerInfo[i][pPaydayON]++; Update(i, pPaydayONx); } if(PlayerInfo[i][pLeader] > 0) { GivePlayerCash(i, 50000); format(string, sizeof(string), "Ai primit salariul de leader ($50000)."); format(stringore, sizeof(stringore), "You recieved the leader salary ($50000)."); SS(i, COLOR_LIGHTBLUE, string, stringore); } if(PlayerInfo[i][pHelper] > 0) { GivePlayerCash(i, 50000); format(string, sizeof(string), "Ai primit salariul de helper ($50000)."); format(stringore, sizeof(stringore), "You recieved the helper salary ($50000)."); SS(i, COLOR_LIGHTBLUE, string, stringore); } Update(i, pCashx); PlayerInfo[i][pPayDay] = 0; hourscount++; if(PlayerInfo[i][pLanguage] == 1) { format(stringore, sizeof(stringore), "You received %.2f hours played (%d minutes).",timee,floatround(timee2)); } else { format(stringore, sizeof(stringore), "Ai primit %.2f ore jucate (%d minute).",timee,floatround(timee2)); } SendClientMessage(i, COLOR_WHITE, stringore); if(PlayerInfo[i][pRob] < 20) { PlayerInfo[i][pRob]++; Update(i, pRob); } else { SS(i, COLOR_WHITE, "Nu ai primit niciun rob/free point pentru ca ai deja 20 rob/free points.", "No rob points for you! You have too many rob/free points. You can't store more than 20 rob/free points."); Update(i, pRob); } PlayerInfo[i][pExp] += 1; PlayerInfo[i][pAccount] += finalinterest; /*format(string, sizeof(string), "Paycheck: $%s | Bank balance: $%s | Bank interest: $%s | Tax: $%s (10 percent)", FormatNumber(checks), FormatNumber(PlayerInfo[i][pAccount]), FormatNumber(finalinterest), FormatNumber(TaxValue)); SendClientMessage(i, COLOR_GREY, string); format(string3, sizeof(string3), "Rent: $%s | Total earnings: $%d", FormatNumber(rent[i]), checks-TaxValue); SendClientMessage(i, COLOR_GREY, string3); SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");*/ //PayDaYTD {2b87ff} format(string3, sizeof(string3), "PAYDAY:~n~Minute jucate: +%d~n~Paycheck: $%s ~n~ Bank balance: $%s ~n~ Bank interest: $%s ~n~ Tax: $%s (10 percent)~n~Rent: $%s | Total earnings: $%d",PlayerInfo[i][pPayDay]/60+1, FormatNumber(checks), FormatNumber(PlayerInfo[i][pAccount]), FormatNumber(finalinterest), FormatNumber(TaxValue), FormatNumber(rent[i]), checks-TaxValue); PlayerTextDrawSetString(i, PayDayTD, string3); PlayerTextDrawShow(i, PayDayTD); format(string, sizeof(string), "~y~payday"); GameTextForPlayer(i, string, 5000, 1); format(string, sizeof(string), "~g~payday"); GameTextForPlayer(i, string, 5000, 1); if(PlayerInfo[i][pRollPoints] < 100) PlayerInfo[i][pRollPoints] +=20, Update(i, pRollPointsx); format(string, sizeof(string), "Roll Points: %d/100", PlayerInfo[i][pRollPoints]); SCM(i, COLOR_LIGHTGREEN3, string); if(PlayerInfo[i][pCarLicT] > 0) { PlayerInfo[i][pCarLicT] -= 1; if(PlayerInfo[i][pCarLicT] == 0) SS(i, COLOR_YELLOW, "* Licenta ta de condus a expirat, poti merge la DMV pentru a obtine alta.","* Your driving licence was expired, you can go to the DMV to get another."); } if(PlayerInfo[i][pFlyLicT] > 0) { PlayerInfo[i][pFlyLicT] -= 1; if(PlayerInfo[i][pFlyLicT] == 0) SS(i, COLOR_YELLOW, "* Licenta ta de zburat a expirat, poti obtine alta contactand un instructor [/instructors].","* Your flying licence was expired, you can get antoher contacting a instructor [/instructors]."); } if(PlayerInfo[i][pBoatLicT] > 0) { PlayerInfo[i][pBoatLicT] -= 1; if(PlayerInfo[i][pBoatLicT] == 0) SS(i, COLOR_YELLOW, "* Licenta ta de barci a expirat, poti obtine alta contactand un instructor [/instructors].","* Your boat licence was expired, you can get antoher contacting a instructor [/instructors]."); } if(PlayerInfo[i][pGunLicT] > 0) { PlayerInfo[i][pGunLicT] -= 1; if(PlayerInfo[i][pGunLicT] == 0) SS(i, COLOR_YELLOW, "* Licenta ta de arme a expirat, poti obtine alta contactand un instructor [/instructors].","* Your weapon licence was expired, you can get antoher contacting a instructor [/instructors]."); } if(PlayerInfo[i][pFpunish] > 0) { PlayerInfo[i][pFpunish]--; } if(PlayerInfo[i][pFpunish] < 0) { PlayerInfo[i][pFpunish] = 0; } if(PlayerInfo[i][pCarLicSuspend] > 0) { PlayerInfo[i][pCarLicSuspend]--; Update(i, pCarLicSuspendx); if(PlayerInfo[i][pCarLicSuspend] == 0) SS(i, COLOR_YELLOW, "* Licenta ta de condus a fost confiscata recent, acum poti merge iar la DMV pentru a obtine alta.","* Your driving licence was confiscated recently, now you can go to the DMV to get another."); } if(PlayerInfo[i][pGunLicSuspend] > 0) { PlayerInfo[i][pGunLicSuspend]--; Update(i, pGunLicSuspendx); if(PlayerInfo[i][pGunLicSuspend] == 0) SS(i, COLOR_YELLOW, "* Licenta ta de arme a fost confiscata recent, acum poti contacta un instructor pentru a obtine alta [/instructors].","* Your weapon licence was confiscated recently, now you can get antoher contacting a instructor [/instructors]."); } PlayerInfo[i][pPayCheck] = 0; new month, day, inserted, dx; format(str, sizeof(str), "SELECT * FROM `timeplayed` WHERE `pid`='%d'", PlayerInfo[i][pSQLID]); new Cache: xd = mysql_query(SQL, str); if(cache_get_row_count() > 0) { for(new d, js = cache_get_row_count (); d != js; ++d) { month = cache_get_field_content_int(d, "month"); day = cache_get_field_content_int(d, "day"); if(day == da && month == mo) { inserted = 1; } } } else { mysql_format(SQL, str, sizeof(str), "INSERT INTO `timeplayed` (`pid`,`time`,`month`,`day`,`year`,`unixtime`) VALUES ('%d','%d','%s%d','%s%d','%d','%d')", PlayerInfo[i][pSQLID], OnlineTimeToday[i], ((mo < 10) ? ("0") : ("")), mo, ((da < 10) ? ("0") : ("")), da, ye, gettime()); mysql_tquery(SQL, str, "", ""); dx = 1; OnlineTimeToday[i] = 0; Update(i, pOnlineTimeTodayx); } cache_delete(xd); if(dx == 0) { if(inserted == 1) { mysql_format(SQL, str, sizeof(str), "UPDATE timeplayed SET time = time+%d WHERE month = %d AND day = %d AND pid = %d", OnlineTimeToday[i], mo, da, PlayerInfo[i][pSQLID]); mysql_tquery(SQL, str, "", ""); OnlineTimeToday[i] = 0; Update(i, pOnlineTimeTodayx); } else { mysql_format(SQL, str, sizeof(str), "INSERT INTO `timeplayed` (`pid`,`time`,`month`,`day`,`year`,`unixtime`) VALUES ('%d','%d','%s%d','%s%d','%d','%d')", PlayerInfo[i][pSQLID], OnlineTimeToday[i], ((mo < 10) ? ("0") : ("")), mo, ((da < 10) ? ("0") : ("")), da, ye, gettime()); mysql_tquery(SQL, str, "", ""); OnlineTimeToday[i] = 0; Update(i, pOnlineTimeTodayx); } } UpdateProgressBar(i); } } } format(str, sizeof(str), "INSERT INTO `toph` (`ponline`,`hour`) VALUES ('%d','%s%d:00')", GetOnLinePlayers(), ((hour < 10) ? ("0") : ("")), hour); mysql_query(SQL, str); mysql_query(SQL, "DELETE FROM `toph` ORDER BY `id` ASC limit 1"); format(str, sizeof(str), "SELECT * FROM `timeonline` WHERE m = %d AND y = %d",mo,ye); new Cache: result = mysql_query(SQL, str); if(cache_get_row_count() >= 1) { mysql_format(SQL,str,sizeof(str),"UPDATE timeonline SET hoursplayed = hoursplayed+%d WHERE m = %d AND y = %d",hourscount,mo,ye); mysql_tquery(SQL,str,"",""); } cache_delete(result); SetTimer("hidePayDay", 10000, false); return 1; }
Edited by SpriteTV2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now