GetTickCount
#1

pawn Код:
CMD:usercp ( playerid, params[] )
{
    new count = GetTickCount();
   
    switch ( CPActive [ playerid ] )
    {
        case 0:
        {
            // It's not active - enable it.
            TextDrawShowForPlayer ( playerid, UserCP_Title );
            TextDrawShowForPlayer ( playerid, UserCP_TopLine );
            TextDrawShowForPlayer ( playerid, UserCP_ChangePW );
            TextDrawShowForPlayer ( playerid, UserCP_ChangeUsername );
            TextDrawShowForPlayer ( playerid, UserCP_Resync );
            TextDrawShowForPlayer ( playerid, UserCP_ViewMap );
            TextDrawShowForPlayer ( playerid, UserCP_ViewAccInfo );
            TextDrawShowForPlayer ( playerid, UserCP_BottomLine );
           
            SelectTextDraw ( playerid, 0x7EBA1EFF );
            CPActive [ playerid ] = 1;
           
            SendClientMessage ( playerid, -1, ""#INT_CONSOLE"~ "#INT_SILVER"Type "#INT_YELLOW"/usercp "#INT_SILVER"again to disable the User Control Panel!" );
        }
       
        case 1:
        {
            // It's active - disable it.
            TextDrawHideForPlayer ( playerid, UserCP_Title );
            TextDrawHideForPlayer ( playerid, UserCP_TopLine );
            TextDrawHideForPlayer ( playerid, UserCP_ChangePW );
            TextDrawHideForPlayer ( playerid, UserCP_ChangeUsername );
            TextDrawHideForPlayer ( playerid, UserCP_Resync );
            TextDrawHideForPlayer ( playerid, UserCP_ViewMap );
            TextDrawHideForPlayer ( playerid, UserCP_ViewAccInfo );
            TextDrawHideForPlayer ( playerid, UserCP_BottomLine );
           
            CancelSelectTextDraw ( playerid );
            CPActive [ playerid ] = 0;
           
            SendClientMessage ( playerid, -1, ""#INT_CONSOLE"~ "#INT_SILVER"Type "#INT_YELLOW"/usercp "#INT_SILVER"again to enable the User Control Panel!" );
        }
    }
   
    printf("Time taken to execute /usercp: %d", GetTickCount() - count);
    return true;
}
Does anyone see anything wrong with this? I'm messing around with GetTickCount just to figure out how it works, and the result is always 0.
Reply


Messages In This Thread
GetTickCount - by 2KY - 15.02.2013, 15:42
Re: GetTickCount - by Da_Noob - 15.02.2013, 16:40
Re: GetTickCount - by 2KY - 15.02.2013, 16:50
Re: GetTickCount - by Babul - 15.02.2013, 19:41

Forum Jump:


Users browsing this thread: 2 Guest(s)