Help, Making an expiration time.
#1

Hi,

I have made this money boost system, which doubles the player's earning from their work. I want to make an expiration time for this boost for 30 days. How do i set that?

Is it possible to make a function and start the timer when admin do /setboost then set the boost to 0 when timer runs out?

Here is how the money boost is saved on player's file,
pawn Код:
PlayerFile_Save(playerid)
{
    new file[100], File:PFile, Name[24], LineForFile[100];
    format(Name, sizeof(Name), APlayerData[playerid][PlayerName]); // Get the playername
    format(file, sizeof(file), PlayerFile, Name); // Construct the complete filename for this player's account

    PFile = fopen(file, io_write); // Open the playerfile for writing

    format(LineForFile, 100, "MoneyBoost %i\r\n", APlayerData[playerid][MoneyBoost]); // Construct the line: "MoneyBoost <playermoneyboost>"
    fwrite(PFile, LineForFile); // And save it to the file
   
    //..............
I don't think showing this code is necessary as i just want to know how to set the expiration time. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)