Problem with syntax "TIME" on MySQL.
#8

Quote:
Originally Posted by MouseBreaker
Посмотреть сообщение
You can use SetTimer();

pawn Код:
forward MinuteTimer();
new pTime[MAX_PLAYERS]
pawn Код:
public OnGameModeInit()
{
    SetTimer("MinuteTimer", 1000 * 60, 1);
    return 1;
}
pawn Код:
public MinuteTimer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && pInfo[i][pLogged] == 1)
        {
            pTime[i]++;
        }
    }
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new query[128];
    format(query, sizeof(query), "UPDATE users SET times = '%d'", pTime[playerid]);
    mysql_query(query);
    pTime[playerid] = 0;
    return 1;
}
Yeah, 1 more timer for anything ... )

@irinel, thanks for your help I forgot about TotalTime Now i know how to do the top.
Reply


Messages In This Thread
Problem with syntax "TIME" on MySQL. - by Edvin - 04.11.2012, 11:48
Re: Problem with syntax "TIME" on MySQL. - by Edvin - 04.11.2012, 12:10
Re: Problem with syntax "TIME" on MySQL. - by [DOG]irinel1996 - 04.11.2012, 12:21
Re: Problem with syntax "TIME" on MySQL. - by Vince - 04.11.2012, 12:40
Re: Problem with syntax "TIME" on MySQL. - by Edvin - 04.11.2012, 12:45
Re: Problem with syntax "TIME" on MySQL. - by [DOG]irinel1996 - 04.11.2012, 12:49
AW: Problem with syntax "TIME" on MySQL. - by Skimmer - 04.11.2012, 12:50
Re: AW: Problem with syntax "TIME" on MySQL. - by Edvin - 04.11.2012, 12:59
AW: Problem with syntax "TIME" on MySQL. - by Skimmer - 04.11.2012, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)