forward UpdateTime(playerid);
public UpdateTime(playerid)
{
if ( USER[ playerid ][ pLOGADO ] == true )
{
USER[ playerid ][ pSEGUNDOS ] += 1;
if ( USER[ playerid ][ pSEGUNDOS ] >= 60 )
{
USER[ playerid ][ pSEGUNDOS ] = 0;
USER[ playerid ][ pMINUTOS ] += 1;
}
else if ( USER[ playerid ][ pMINUTOS ] >= 59 && USER[ playerid ][ pSEGUNDOS ] >= 59 )
{
USER[ playerid ][ pMINUTOS ] = 0;
USER[ playerid ][ pSEGUNDOS ] = 0;
USER[ playerid ][ pHORAS ] += 1;
}
else if ( USER[ playerid ][ pHORAS ] >= 23 && USER[ playerid ][ pMINUTOS ] >= 59 && USER[ playerid ][ pSEGUNDOS ] >= 59 )
{
USER[ playerid ][ pMINUTOS ] = 0;
USER[ playerid ][ pSEGUNDOS ] = 0;
USER[ playerid ][ pHORAS ] = 0;
USER[ playerid ][ pDIAS ] += 1;
}
}
return 1;
}
|
(horas >= 23 && min >= 59 && seg >= 59) |
forward UpdateTime(playerid);
public UpdateTime(playerid)
{
if ( USER[ playerid ][ pLOGADO ] == true )
{
USER[ playerid ][ pSEGUNDOS ] += 1;
if ( USER[ playerid ][ pHORAS ] >= 23 && USER[ playerid ][ pMINUTOS ] >= 59 && USER[ playerid ][ pSEGUNDOS ] >= 60 )
{
USER[ playerid ][ pHORAS ] = 0;
USER[ playerid ][ pMINUTOS ] = 0;
USER[ playerid ][ pSEGUNDOS ] = 0;
USER[ playerid ][ pDIAS ] += 1;
}
else if ( USER[ playerid ][ pMINUTOS ] >= 59 && USER[ playerid ][ pSEGUNDOS ] >= 60 )
{
USER[ playerid ][ pMINUTOS ] = 0;
USER[ playerid ][ pSEGUNDOS ] = 0;
USER[ playerid ][ pHORAS ] += 1;
}
else if ( USER[ playerid ][ pSEGUNDOS ] >= 60 )
{
USER[ playerid ][ pSEGUNDOS ] = 0;
USER[ playerid ][ pMINUTOS ] += 1;
}
SaveAccount ( playerid );
}
return 1;
}
|
recomendo fazer deste modo mais pratico https://sampforum.blast.hk/showthread.php?tid=479249
|