19.10.2012, 06:23
Hi , i have a problem with payday system , at paycheck time dosen't work and i don't now how to fix can' you help me ?? i give you the payday and synctime.
payday
At example 12:00 payday dosen't show or go nothing , please help me ...
Код:
public SyncTime() { new tmphour; new tmpminute; new tmpsecond; gettime(tmphour, tmpminute, tmpsecond); FixHour(tmphour); tmphour = shifthour; if ((tmphour > ghour) || (tmphour == 0 && ghour == 23)) { ghour = tmphour; foreach (Player, i) { if(GetPVarInt(i, "PlayerLogged") == 1) { PayDay(i); } } if (realtime) { SetWorldTime(tmphour); } PayDayLoad(1); } for(new b = 0; b < sizeof(WeedInfo); b++) { if(WeedInfo[b][WeedPlanted] == 1 && WeedInfo[b][WeedTime] > 0) { WeedInfo[b][WeedTime] -= 1; if(WeedInfo[b][WeedTime] >= 17 && WeedInfo[b][WeedTime] <= 20) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-2.2,100.0); } if(WeedInfo[b][WeedTime] >= 15 && WeedInfo[b][WeedTime] <= 17) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-2.1,100.0); } if(WeedInfo[b][WeedTime] >= 13 && WeedInfo[b][WeedTime] <= 15) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-2.0,100.0); } if(WeedInfo[b][WeedTime] >= 11 && WeedInfo[b][WeedTime] <= 13) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-1.9,100.0); } if(WeedInfo[b][WeedTime] >= 9 && WeedInfo[b][WeedTime] <= 11) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-1.8,100.0); } if(WeedInfo[b][WeedTime] >= 8 && WeedInfo[b][WeedTime] <= 9) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-1.7,100.0); } if(WeedInfo[b][WeedTime] >= 7 && WeedInfo[b][WeedTime] <= 8) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-1.6,100.0); } if(WeedInfo[b][WeedTime] >= 6 && WeedInfo[b][WeedTime] <= 7) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-1.5,100.0); } if(WeedInfo[b][WeedTime] >= 5 && WeedInfo[b][WeedTime] <= 6) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-1.4,100.0); } if(WeedInfo[b][WeedTime] >= 1 && WeedInfo[b][WeedTime] <= 5) { MoveDynamicObject(weedObject[b],WeedInfo[b][WeedX],WeedInfo[b][WeedY],WeedInfo[b][WeedZ]-1.3,100.0); } } } }
Код:
public PayDay(playerid) { new string[128]; new account,interest; new rent = 0; if(PlayerInfo[playerid][pCellplan] == 2 && PlayerInfo[playerid][pCellphone] == 1) { PlayerInfo[playerid][pCelltime] -= 10; } if(PlayerInfo[playerid][pBreakAllow] > 0) { PlayerInfo[playerid][pBreakAllow]--; } if(GetPVarInt(playerid, "PlayerLogged") == 1) { if(PlayerInfo[playerid][pJailTime] == 0) { if(PlayerInfo[playerid][pJailed] == 0) { account = PlayerInfo[playerid][pAccount]; new key = PlayerInfo[playerid][pHousekey]; HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent; new tmpintrate; switch(PlayerInfo[playerid][pDonateRank]) { case 0: { tmpintrate = 1; } case 1: { tmpintrate = 1; } case 2: { tmpintrate = 2; } case 3: { tmpintrate = 3; } } if(PlayerInfo[playerid][pPayDay] >= 0) { Tax += TaxValue; PlayerInfo[playerid][pAccount] -= TaxValue; new checks; checks = 700; if(PlayerInfo[playerid][pDonateRank] > 0) { new bonus = PlayerInfo[playerid][pPayCheck] / 10; checks += bonus; } new ebill = 125; account += checks; if(PlayerInfo[playerid][pAccount] > 0) { PlayerInfo[playerid][pAccount] -= ebill; SBizzInfo[4][sbTill] += ebill; } else { ebill = 0; } interest = (PlayerInfo[playerid][pAccount]/1000)*(tmpintrate); PlayerInfo[playerid][pExp]++; PlayerInfo[playerid][pAccount] = account+interest; SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________"); SendClientMessage(playerid,COLOR_LIGHTYELLOW5," Paycheck Statement: "); format(string, 128, "[INFO]: Paycheck: $%d | Tax Money: -$%d", checks, TaxValue); SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string); format(string, 128, "[INFO]: Int Rate: 0.%d percent | Int Gained $%d",tmpintrate,interest); SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string); if(PlayerInfo[playerid][pHousekey] != 255 || PlayerInfo[playerid][pPbiskey] != 255) { format(string, 128, "[INFO]: Electricity Bill: -$%d | Rent: -$%d", ebill,rent); SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string); } else if(PlayerInfo[playerid][pHousekey] == 255 || PlayerInfo[playerid][pPbiskey] == 255) { format(string, 128, "[INFO]: Rent: -$%d", rent); SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string); } if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pMember] == 14) { switch (PlayerInfo[playerid][pRank]) { case 0: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $300"); PlayerInfo[playerid][pAccount] += 300; } case 1: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $300"); PlayerInfo[playerid][pAccount] += 300; } case 2: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $300"); PlayerInfo[playerid][pAccount] += 300; } case 3: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $300"); PlayerInfo[playerid][pAccount] += 300; } case 4: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $400"); PlayerInfo[playerid][pAccount] += 400; } case 5: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } case 6: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } } } else if(PlayerInfo[playerid][pMember] == 6) { switch (PlayerInfo[playerid][pRank]) { case 0: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $200"); PlayerInfo[playerid][pAccount] += 200; } case 1: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $200"); PlayerInfo[playerid][pAccount] += 200; } case 2: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $200"); PlayerInfo[playerid][pAccount] += 200; } case 3: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $350"); PlayerInfo[playerid][pAccount] += 350; } case 4: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $375"); PlayerInfo[playerid][pAccount] += 375; } case 5: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $400"); PlayerInfo[playerid][pAccount] += 400; } case 6: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $425"); PlayerInfo[playerid][pAccount] += 425; } case 7: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $450"); PlayerInfo[playerid][pAccount] += 450; } case 8: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $475"); PlayerInfo[playerid][pAccount] += 475; } case 9: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } case 10: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } case 11: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } case 12: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } case 13: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } case 14: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } case 15: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } case 16: { SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500"); PlayerInfo[playerid][pAccount] += 500; } } } if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS) { new carkey = PlayerInfo[playerid][pCarkey]; if(CarInfo[carkey][cInsur] == 1) { new amount = VehiclePrice(carkey); format(string, 128, "[INFO]: Insurance Vehicle 1: -$%d", amount); SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string); PlayerInfo[playerid][pAccount] -= amount; } } if(PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS) { new carkey2 = PlayerInfo[playerid][pCarkey2]; if(CarInfo[carkey2][cInsur] == 1) { new amount = VehiclePrice(carkey2); format(string, 128, "[INFO]: Insurance Vehicle 2: -$%d", amount); SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string); PlayerInfo[playerid][pAccount] -= amount; } } if(PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS) { new carkey3 = PlayerInfo[playerid][pCarkey3]; if(CarInfo[carkey3][cInsur] == 1) { new amount = VehiclePrice(carkey3); format(string, 128, "[INFO]: Insurance Vehicle 3: -$%d", amount); SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string); PlayerInfo[playerid][pAccount] -= amount; } } format(string, 128, "[INFO]: Old Balance: $%d | New Balance: $%d", account - checks, PlayerInfo[playerid][pAccount]); SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string); SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________"); format(string, 128, "~g~PayDay~n~~w~Check paid into your account"); GameTextForPlayer(playerid, string, 5000, 1); rent = 0; PlayerPlayMusic(playerid); PlayerInfo[playerid][pPayDay] = 0; PlayerInfo[playerid][pPayCheck] = 0; PlayerInfo[playerid][pConnectTime] += 1; if((4+(PlayerInfo[playerid][pLevel]*8)) == PlayerInfo[playerid][pConnectTime]) { PlayerInfo[playerid][pConnectTime] += 1; } new LevScore; LevScore = PlayerInfo[playerid][pConnectTime]; SetPlayerScore(playerid,LevScore); if(ConnectUpgrade(PlayerInfo[playerid][pConnectTime])) { PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2; } } else { SendClientMessage(playerid, COLOR_WHITE, "* You haven't played long enough to obtain a PayDay."); } } } } for(new h = 0; h < sizeof(HouseInfo); h++) { if(HouseInfo[h][hBreakTime] > 0) { HouseInfo[h][hBreakTime]--; } } TelePos[playerid][0] = 0.0; TelePos[playerid][1] = 0.0; return 1; }
Код:
forward PayDayLoad(type); public PayDayLoad(type) { if(type == 1) { SaveCars(); SaveTrunk(); SaveSafe(); SaveFamilies(); OnPropUpdate(); SaveIRC(); new RandomWeth; RandomWeth = random(7); switch(RandomWeth) { case 0: { DefaultWeather = 0; } case 1: { DefaultWeather = 2; } case 2: { DefaultWeather = 3; } case 3: { DefaultWeather = 4; } case 4: { DefaultWeather = 5; } case 5: { DefaultWeather = 9; } case 6: { DefaultWeather = 11; } } SetWeather(DefaultWeather); for(new h = 0; h < sizeof(CarInfo); h++) { if(CarInfo[h][cOwned] == 1) { new player = ReturnUser(CarInfo[h][cOwner]); if(IsPlayerConnected(player)) { if(CarInfo[h][cTime] > 0) { CarInfo[h][cTime]--; } } else if(!IsPlayerConnected(player)) { CarInfo[h][cTime]++; if(CarInfo[h][cTime] == 730) { CarInfo[h][cTime]=0; CarInfo[h][cOwned] = 0; } } } } } return 1; }