28.07.2010, 20:28
(
Последний раз редактировалось mihaitza55; 28.07.2010 в 20:49.
)
Hey everyone, I got a little question, actualy i`m trying to figure a thing out:
So here`s the plan... You know a medium populated server like mine (70-80 players) can always have problems with the scriptfiles folder, like you know, some noob admin banning players or someone setting players skins to 123456 and making their game crash and sh^t like that, well i am trying to make some kind of a Scriptfiles backup system, like backup-ing the scriptfiles folder at every PayDay (yes, i`m using a GF edit)
So, under :
public PayDay() , we have :
SendClientMessage(i, COLOR_GREEN, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Paycheck: $%d Tax Money: -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(string, sizeof(string), " Electricity Bill: -$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, string);
}
format(string, sizeof(string), " Balance: $%d", account - checks);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, 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_GRAD5, string);
format(string, sizeof(string), " Rent: -$%d", rent);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Check paid into your account");
GameTextForPlayer(i, string, 5000, 1);
PlayerHasRobbedBank[i] = 0;
Now, what i`m trying to do is to make a new public function, like let`s say
public SaveAccounts()
{
new File:file;
bla bla..
}
And this SaveAccounts(); will be added under PlayerHasRobbedBank[i] = 0; , you know? So that the accounts are always saved in some kind of a Backup folder INSIDE the scriptfiles folder, every hour.
So, what i`m asking here: Give me an idea, how to make the SaveAccounts(); function save ALL the accounts and everything that is inside the scriptfiles folder. I just have no freaking idea how to do that! I`m good with timers and crap, but i got noooo idea about saving files outside the script.
Anticipated thanx
So here`s the plan... You know a medium populated server like mine (70-80 players) can always have problems with the scriptfiles folder, like you know, some noob admin banning players or someone setting players skins to 123456 and making their game crash and sh^t like that, well i am trying to make some kind of a Scriptfiles backup system, like backup-ing the scriptfiles folder at every PayDay (yes, i`m using a GF edit)
So, under :
public PayDay() , we have :
SendClientMessage(i, COLOR_GREEN, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Paycheck: $%d Tax Money: -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(string, sizeof(string), " Electricity Bill: -$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, string);
}
format(string, sizeof(string), " Balance: $%d", account - checks);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, 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_GRAD5, string);
format(string, sizeof(string), " Rent: -$%d", rent);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Check paid into your account");
GameTextForPlayer(i, string, 5000, 1);
PlayerHasRobbedBank[i] = 0;
Now, what i`m trying to do is to make a new public function, like let`s say
public SaveAccounts()
{
new File:file;
bla bla..
}
And this SaveAccounts(); will be added under PlayerHasRobbedBank[i] = 0; , you know? So that the accounts are always saved in some kind of a Backup folder INSIDE the scriptfiles folder, every hour.
So, what i`m asking here: Give me an idea, how to make the SaveAccounts(); function save ALL the accounts and everything that is inside the scriptfiles folder. I just have no freaking idea how to do that! I`m good with timers and crap, but i got noooo idea about saving files outside the script.
Anticipated thanx