06.04.2011, 22:30
On top :
Код:
static gTeam[MAX_PLAYERS]; #define MAX_STRING 255 forward SyncTime(); forward SyncUp(); forward PayDay(); new News[hNews]; enum pInfo { pPayDay, pPayDayHad, };
Код:
public OnPlayerConnect(playerid) { PlayerInfo[playerid][pPayDay]= 0; PlayerInfo[playerid][pPayDayHad]= 0; return 1; }
Код:
public PayDay() { new string[128]; new account,interest; new rent = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pLevel] > 0) { if(MoneyMessage[i]==1) { SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time."); GameTextForPlayer(i, "~r~Busted!", 2000, 1); //SetPlayerInterior(i, 6); //SetPlayerPos(i,264.6288,77.5742,1001.0391); SetPlayerInterior(i, 0); TogglePlayerControllable(i,false); SetTimerEx("freezejail", 2000,0,"d",i); new pcell = random(3); switch(pcell) { case 0: { SetPlayerPos(i,1778.6156,-1583.5420,1734.9430); SetPlayerFacingAngle(i,2.6243); } case 1: { SetPlayerPos(i,1774.1909,-1583.0372,1734.9430); SetPlayerFacingAngle(i,357.4647); } case 2: { SetPlayerPos(i,1770.1483,-1583.1619,1734.9430); SetPlayerFacingAngle(i,3.0212); } } PlayerInfo[i][pJailed] = 1; 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); } 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 > GetPlayerMoney(i)) { PlayerInfo[i][pPhousekey] = 255; SendClientMessage(i, COLOR_WHITE, "You have been evicted."); rent = 0; } HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent; } new tmpintrate; if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0) { if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = intrate+4; } else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel] } else { if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; } else { tmpintrate = 1; } } if(PlayerInfo[i][pPayDay] >= 5) { Tax += TaxValue;//Should work for every player online PlayerInfo[i][pAccount] -= TaxValue; if(PlayerInfo[i][pDonateRank] > 0) { new bonus = PlayerInfo[i][pPayCheck] / 2; PlayerInfo[i][pPayCheck] += bonus; } new checks = PlayerInfo[i][pPayCheck]; new ebill = (PlayerInfo[i][pAccount]/8000)*(PlayerInfo[i][pLevel]); ConsumingMoney[i] = 1; GivePlayerMoney(i, checks); if(PlayerInfo[i][pAccount] > 0) { PlayerInfo[i][pAccount] -= ebill; SBizzInfo[4][sbTill] += ebill; } else { ebill = 0; } interest = (PlayerInfo[i][pAccount]/800)*(tmpintrate); PlayerInfo[i][pExp]++; PlayerPlayMusic(i); PlayerInfo[i][pAccount] = account+interest; SendClientMessage(i, COLOR_LIGHTGREEN, "_______________________"); format(string, sizeof(string), "• Paycheck: $%d", checks); SendClientMessage(i, 0xEBEBEBAA, string); format(string, sizeof(string), "• Tax Money: -$%d", TaxValue); SendClientMessage(i, 0xEBEBEBAA, string); if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255) { format(string, sizeof(string), "• Electricity: -$%d", ebill); SendClientMessage(i, 0xEBEBEBAA, string); } format(string, sizeof(string), "• Balance: $%d", account); SendClientMessage(i, 0xEBEBEBAA, string); format(string, sizeof(string), "• Interest Rate: 0.%d percent",tmpintrate); SendClientMessage(i, 0xEBEBEBAA, string); format(string, sizeof(string), "• Interest Gained $%d", interest); SendClientMessage(i, 0xEBEBEBAA, string); SendClientMessage(i, COLOR_LIGHTGREEN, "_______________________"); format(string, sizeof(string), "• New Balance: $%d", PlayerInfo[i][pAccount]); SendClientMessage(i, 0xEBEBEBAA, string); format(string, sizeof(string), "• Rent: -$%d", rent); SendClientMessage(i, 0xEBEBEBAA, string); //SendClientMessage(i, COLOR_LIGHTGREEN, "_______________________"); format(string, sizeof(string), "~r~~h~PayDay~n~~w~Paycheck"); PlayerInfo[i][pPoint] += 500; GameTextForPlayer(i, string, 5000, 1); rent = 0; PlayerInfo[i][pPayDay] = 0; PlayerInfo[i][pPayCheck] = 0; PlayerInfo[i][pConnectTime] += 1; if(PlayerInfo[i][pDonateRank] > 0) { PlayerInfo[i][pPayDayHad] += 1; if(PlayerInfo[i][pPayDayHad] >= 5) { PlayerInfo[i][pExp]++; PlayerInfo[i][pPayDayHad] = 0; } } } else { SendClientMessage(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a PayDay."); } } } } Checkprop(); return 1; }
Код:
public SyncTime() { new string[64]; 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), "Este Ora %d:00 Fix",tmphour); BroadCast(COLOR_LIGHTGREEN,string); ghour = tmphour; PayDay(); if (realtime) { SetWorldTime(tmphour); } format(string, sizeof(string), "~y~Lotto Time!! ~n~~w~Select Your Number ~n~~p~/lotto 1-80 ~g~($100) ~n~~r~Prize: ~g~$%d", Jackpot); if(TD3D == 1) { KillTimer(HideTD4Timer); TextDrawHideForAll(TD3); TextDrawSetString(TD3, string); TextDrawShowForAll(TD3); HideTD4Timer = SetTimer("HideTD4", 8500, false); } else { TextDrawSetString(TD3, string); TextDrawShowForAll(TD3); TD3D = 1; HideTD4Timer = SetTimer("HideTD4", 8500, false); } SetTimer("StartLotto",20000,false); } }