This function is not working like it should...
#3

First..
pawn Код:
new OneSecondUpdateTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid);
{
    OneSecondUpdatetimer[playerid] = SetTimerEx("OneSecondUpdate", 1000, true, "i", playerid);
    return 1;
}
You should do that timer like this:
pawn Код:
forward OneSecondUpdate(playerid);
public OneSecondUpdate(playerid)
{
    PlayerInfo[playerid][pSeconds] ++;
    if(PlayerInfo[playerid][pSeconds] == 60)
    {
        PlayerInfo[playerid][pSeconds] = 0;
        PlayerInfo[playerid][pMinutes] ++;
        if(PlayerInfo[playerid][pMinutes] == 60)
        {
            PlayerInfo[playerid][pMinutes] = 0;
            PlayerInfo[playerid][pHours] ++;
            if(PlayerInfo[playerid][pHours] == 4)
            {
                PlayerInfo[playerid][pHours] = 0;
                PlayerInfo[playerid][pDays]++;
            }
        }
    }
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid)
{
    KillTimer(OneSecondUpdateTimer[playerid]);
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)