29.01.2011, 22:28
pawn Код:
#define MAX_INTEGER (2147483647)
#define ceil(%0) (floatround((%0),floatround_ceil))
#define TickRemaining(%0,%1) ((((%1)>=(GetTickCount()))?((MAX_INTEGER)-(%1)+(GetTickCount())):((GetTickCount())-(%1)))<(%0))
#define TickTimeDiff(%0,%1) (((%1)>=(GetTickCount()))?(((%0)/1000)-ceil(((MAX_INTEGER)-(%1)+(GetTickCount()))/1000)):(((%0)/1000)-ceil(((GetTickCount())-(%1))/1000)))
pawn Код:
if ( TickRemaining( 20000, LastShout[ playerid ] ) )
{
format( string, sizeof ( string ), "You have to wait %i seconds before shouting again!", TickTimeDiff( 20000, LastShout[ playerid ] ) );
return SendClientMessage( playerid, Red, string );
}