Help With MySqL
#1

Guys , Can Anyone help me With Automatic Save Stats With 15 Mins

my Code Are SaveStats(playerid);


i need a Timer to make it SaveStats Automatic becoz player do /savestats kind boring please help
Reply
#2

pawn Код:
//Under OnGamemodeInt
SetTimer("FifteenMinuteTimer", 900000, true);

forward FifteenMinuteTimer();
public FifteenMinuteTimer()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SaveStats(i);
        }
    }
}
Reply
#3

can i make it each 10 seconds ?
Reply
#4

Yes you can, but its probably not recomended. I would make it so it saves player stats when they disconnect or get killed.

change
pawn Код:
SetTimer("FifteenMinuteTimer", 900000, true);
to
pawn Код:
SetTimer("FifteenMinuteTimer", 10000, true);
Reply
#5

ya can you make is whent day get killed or Disconnect please that what i wanted


and also please help with this

https://sampforum.blast.hk/showthread.php?tid=482825
Reply
#6

Very demanding.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    SaveStats(playerid);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SaveStats(playerid);
    SaveStats(killerid);
    return 1;
}
Reply
#7

Ty you Are Greet i gonna add your credits in my server
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)