new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
txtAnimHelper = TextDrawCreate(610.0, 400.0,
"~r~~k~~PED_SPRINT~ ~w~to stop the animation");
TextDrawUseBox(txtAnimHelper, 0);
TextDrawFont(txtAnimHelper, 2);
TextDrawSetShadow(txtAnimHelper,0);
TextDrawSetOutline(txtAnimHelper,1);
TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
TextDrawColor(txtAnimHelper,0xFFFFFFFF);
TextDrawAlignment(txtAnimHelper,3);
lottotimer = SetTimer("LottoTime0", 57600000, 1); // 16 Hours
synctimer = SetTimer("SyncUp", 60000, 1);
savechartimer = SetTimer("SaveChars", 1200000, 1); // 20 mins
unjailtimer = SetTimer("SetPlayerUnjail", 1000, 1);
othtimer = SetTimer("OtherTimer", 1000, 1);
cartimer = SetTimer("CarCheck", 30000, 1);
pickuptimer = SetTimer("CustomPickups", 5000, 1); // 5 seconds
autokicktimer = SetTimer("AutoKick", 5000, 1); // 5 seconds
idletimer = SetTimer("IdleKick", idletime, 1);
productiontimer = SetTimer("Production", 300000, 1); // 5 mins
checkgastimer = SetTimer("CheckGas", 15000, 1);
public PayDay()
{
new string[128];
new sendername[MAX_PLAYER_NAME];
new account,interest;
new rent = 0;
new playername2[MAX_PLAYER_NAME];
if(RobStatus[BankReload] == 1)
{
RobStatus[BankReload] = 0;
}
if(RobStatus[BankReload] == 2)
{
RobStatus[BankReload] = 1;
}
for(new i = 0; i<MAX_PLAYERS; i++)
{
new housekey = PlayerInfo[i][pPhousekey];
new bizkey = PlayerInfo[i][pPbiskey];
if(IsPlayerConnected(i))
{
if(UsingWeed[i] == 1)
{
SetPlayerWeather(i, -66);
SetPlayerTime(i, 12, 0);
}
if(UsingExtacy[i] == 1)
{
SetPlayerWeather(i, -66);
SetPlayerTime(i, 23, 0);
}
if(UsingCrack[i] == 1)
{
SetPlayerWeather(i, 45);
SetPlayerTime(i, 12, 0);
}
if(MoneyMessage[i] == 1 && PlayerInfo[i][pJailed] == 0)
{
SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail Time.");
SetPlayerInterior(i, 10);
SetPlayerPos(i, 227.5729,109.9228,1000.2934);
ResetPlayerWeapons(i);
ClearGuns(i);
TogglePlayerControllable(i, 1);
PlayerInfo[i][pWantedLevel] = 0;
PlayerInfo[i][pJailed] = 1;
PlayerInfo[i][pJailTime] = 600;
format(string, sizeof(string), "* You are jailed for %d seconds, Bail: Unavailable.", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
}
if(PlayerInfo[i][pLevel] > 0)
{
new tmpintrate;
if(PlayerInfo[i][pDonateRank] == 0){ tmpintrate = 1; }
else if(PlayerInfo[i][pDonateRank] == 1) { tmpintrate = 2; }
else if(PlayerInfo[i][pDonateRank] == 2) { tmpintrate = 3; }
else if(PlayerInfo[i][pDonateRank] == 3) { tmpintrate = 4; }
else if(PlayerInfo[i][pDonateRank] == 4) { tmpintrate = 5; }
if(PlayerInfo[i][pPhousekey] == 1) { tmpintrate = 2; }
if(PlayerInfo[i][pPbiskey] == 1) { tmpintrate = 2; }
if(PlayerInfo[i][pPhousekey] >= 1 && PlayerInfo[i][pPbiskey] >= 1) { tmpintrate = 3; }
if(PlayerInfo[i][pPhousekey] >= 1 && PlayerInfo[i][pPbiskey] >= 1 && PlayerInfo[i][pDonateRank] == 1) { tmpintrate = 3; }
else if(PlayerInfo[i][pPhousekey] >= 1 && PlayerInfo[i][pPbiskey] >= 1 && PlayerInfo[i][pDonateRank] == 2) { tmpintrate = 4; }
else if(PlayerInfo[i][pPhousekey] >= 1 && PlayerInfo[i][pPbiskey] >= 1 && PlayerInfo[i][pDonateRank] == 3) { tmpintrate = 5; }
else if(PlayerInfo[i][pPhousekey] >= 1 && PlayerInfo[i][pPbiskey] >= 1 && PlayerInfo[i][pDonateRank] == 4) { tmpintrate = 6; }
GetPlayerName(i, sendername, sizeof(sendername));
account = PlayerInfo[i][pAccount];
if(PlayerInfo[i][pPayDay] >= 5)
{
GetPlayerName(i, playername2, sizeof(playername2));
if(housekey != 0)
{
rent = HouseInfo[housekey][hRent];
if(strcmp(playername2, HouseInfo[housekey][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > GetPlayerMoney(i))
{
PlayerInfo[i][pPhousekey] = 0;
SendClientMessage(i, COLOR_LIGHTRED, "You have been evicted from the House owner.");
rent = 0;
}
HouseInfo[housekey][hCash] = HouseInfo[housekey][hCash]+rent;
SaveHouse(housekey);
}
new checks = PlayerInfo[i][pPayCheck]; //paycheck amount
new incometax = PlayerInfo[i][pPayCheck] / 100 * Tax; //income tax amount
// House Electricity Bills
new randomv1 = random(1000);
new ebill1 = (randomv1*HouseInfo[housekey][hLevel])/2;
if(PlayerInfo[i][pPhousekey] >= 1)
{
PlayerInfo[i][pCash] = PlayerInfo[i][pCash]-ebill1;
GivePlayerMoney(i, -ebill1);
}
// Business Electricity Bills
new randomv2 = random(1000);
new ebill2 = (randomv2*BizzInfo[bizkey][bLevelNeeded])/2;
if(PlayerInfo[i][pPbiskey] >= 1)
{
PlayerInfo[i][pCash] = PlayerInfo[i][pCash]-ebill2;
GivePlayerMoney(i, -ebill2);
}
PlayerInfo[i][pCash] = PlayerInfo[i][pCash]+checks-incometax;
GivePlayerMoney(i, checks-incometax);
//TAX MONEY
TaxValue = TaxValue+incometax;
//INTEREST
interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate); //bank interest
PlayerInfo[i][pAccount] = account+interest; //add interest money to bank
//EXP
PlayerInfo[i][pExp]++; //experience points
SendClientMessage(i, COLOR_YELLOW, "|___ Statement ___|");
format(string, sizeof(string), " Paycheck: $%d", checks);
SendClientMessage(i, COLOR_PINK, string);
format(string, sizeof(string), " Income Tax: -$%d", incometax);
SendClientMessage(i, COLOR_GRAD1, string);
if(PlayerInfo[i][pPhousekey] >= 1)
{
format(string, sizeof(string), " House Electricity Bill: -$%d", ebill1);
SendClientMessage(i, COLOR_GRAD1, string);
}
if(PlayerInfo[i][pPbiskey] >= 1)
{
format(string, sizeof(string), " Business Electricity Bill: -$%d", ebill2);
SendClientMessage(i, COLOR_GRAD1, string);
}
format(string, sizeof(string), " Rent: -$%d", rent);
SendClientMessage(i, COLOR_GRAD1, string);
format(string, sizeof(string), " Balance: $%d", account);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pDonateRank] == 0)
{
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_ORANGE, string);
}
else if(PlayerInfo[i][pDonateRank] == 1)
{
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_ORANGE, string);
}
else if(PlayerInfo[i][pDonateRank] == 2)
{
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_ORANGE, string);
}
else if(PlayerInfo[i][pDonateRank] == 3)
{
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_ORANGE, string);
}
else if(PlayerInfo[i][pDonateRank] == 4)
{
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_ORANGE, string);
}
format(string, sizeof(string), " Interest Gained $%d", interest);
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, COLOR_GREEN, "|------------------------------------------|");
format(string, sizeof(string), " New Balance: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "~y~[Legendary Gaming Network]~n~~w~+1 Experience!");
GameTextForPlayer(i, string, 5000, 1);
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
}
else
{
SendClientMessage(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a Paycheck.");
}
}
}
}
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), "SERVER: The time is now %d:00 hours",tmphour);
SendClientMessageToAll(COLOR_WHITE,string);
ghour = tmphour;
PayDay();
pointtimer = SetTimer("PointCheck", 300000, 0); //5 minutes
for(new p = 0; p < sizeof(PointInfo); p++) { if(PointInfo[p][PointTime] > 0) { PointInfo[p][PointTime]--; } }
if(realtime)
{
SetWorldTime(tmphour);
}
}
}
SetTimer("PayDayTimer", 30*60*1000, true); |
forward PayDayTimer(); public PayDayTimer() { PayDay(); } |
You need to search the SetTimer function. Probably at OnGameModeInit.
|
public OnGameModeInit()
{
djson_GameModeInit();
print("Stage 1");
SetNameTagDrawDistance(30.0);
EnableStuntBonusForAll(0);
DisableInteriorEnterExits();
RobStatus[BeingRobbed] = 0;
RobStatus[RobberID1] = 255;
RobStatus[RobberID2] = 255;
RobStatus[RobberID3] = 255;
RobStatus[RobberID4] = 255;
RobStatus[RobberID5] = 255;
RobStatus[BankReload] = 0;
RobStatus[Setup] = 0;
LEOOnline = 0;
for(new i = 0; i < MAX_VEHICLES; i++)
{
Gas[i] = 100;
}
LoadBuildings();
LoadBizz();
LoadHouses();
print("Stage 2");
LoadBoxer();
print("Stage 3");
LoadStuff();
print("Stage 4");
LoadIRC();
print("Stage 6");
LoadPoints();
LoadFamilies();
print("Stage 7");
LoadTaxi();
IRCInfo[0][iPlayers] = 0; IRCInfo[1][iPlayers] = 0; IRCInfo[2][iPlayers] = 0;
IRCInfo[3][iPlayers] = 0; IRCInfo[4][iPlayers] = 0; IRCInfo[5][iPlayers] = 0;
IRCInfo[6][iPlayers] = 0; IRCInfo[7][iPlayers] = 0; IRCInfo[8][iPlayers] = 0;
IRCInfo[9][iPlayers] = 0;
gettime(ghour, gminute, gsecond);
FixHour(ghour);
ghour = shifthour;
if(!realtime)
{
SetWorldTime(wtime);
}
AllowInteriorWeapons(1);
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
txtAnimHelper = TextDrawCreate(610.0, 400.0,
"~r~~k~~PED_SPRINT~ ~w~to stop the animation");
TextDrawUseBox(txtAnimHelper, 0);
TextDrawFont(txtAnimHelper, 2);
TextDrawSetShadow(txtAnimHelper,0);
TextDrawSetOutline(txtAnimHelper,1);
TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
TextDrawColor(txtAnimHelper,0xFFFFFFFF);
TextDrawAlignment(txtAnimHelper,3);
lottotimer = SetTimer("LottoTime0", 57600000, 1); // 16 Hours
synctimer = SetTimer("SyncUp", 60000, 1);
savechartimer = SetTimer("SaveChars", 1200000, 1); // 20 mins
unjailtimer = SetTimer("SetPlayerUnjail", 1000, 1);
othtimer = SetTimer("OtherTimer", 1000, 1);
cartimer = SetTimer("CarCheck", 30000, 1);
pickuptimer = SetTimer("CustomPickups", 5000, 1); // 5 seconds
autokicktimer = SetTimer("AutoKick", 5000, 1); // 5 seconds
idletimer = SetTimer("IdleKick", idletime, 1);
productiontimer = SetTimer("Production", 300000, 1); // 5 mins
checkgastimer = SetTimer("CheckGas", 15000, 1);
ok,delete PayDay(); from this callback,
and under ongamemodeinit put : callback is |