getting a players' FPS
#1

pawn Код:
/ Calculate FPS
    if ( iDrunkLevel < 100 ) SetPlayerDrunkLevel( playerid, 2000 );
    else
    {
        if ( playerDrunkLevel[ playerid ] != iDrunkLevel )
        {
            new iFPS = playerDrunkLevel[ playerid ] - iDrunkLevel;

            if ( ( iFPS > 0 ) && ( iFPS < 200 ) )
                playerFPS[ playerid ] = iFPS;

            playerDrunkLevel[ playerid ] = iDrunkLevel;
        }
    }

    return 1;
}
I put this code on my game mode but it isn't getting a players' FPS when I type this command:-
pawn Код:
CMD:pinfo( playerid, params[ ] )
{
    if ( playerData[ playerid ][ playerLevel ] < 1 )
        return SendClientMessage(playerid, COLOR_WHITE, "{F81414}[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command." );

    new szString[ 144 ], otherid;

    if ( sscanf( params, "u", otherid ) )
        return SendClientMessage( playerid, COLOR_WHITE, "{FFAF00}[USAGE]{FFFFFF} /pinfo [PLAYER_ID]" );

    if ( ! IsPlayerConnected( otherid ) )
        return SendClientMessage( playerid, COLOR_WHITE, "{FF0404}[ERROR] {FFFFF}Invalid Player ID." );
    format( szString, sizeof( szString ), "{FF0770}[ADMIN] {FFFFFF} %s(%d), %.2f PL, %d ms, %d FPS", playerData[otherid][playerNamee], otherid, NetStats_PacketLossPercent( otherid ), GetPlayerPing( otherid ), GetPlayerFPS( otherid ) );
    SendClientMessage( playerid, -1, szString );
    return 1;
}
Reply
#2

Your function returns no value except "true", either create a global FPS variable or return a value to the function.
Reply
#3

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Your function returns no value except "true", either create a global FPS variable or return a value to the function.
can u do it for me '-'?
Reply
#4

Replace "return 1;" by "return playerFPS[playerid];" execute command twice in order to get it to work as the player's drunk level will be lower than 100
Reply
#5

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Replace "return 1;" by "return playerFPS[playerid];" execute command twice in order to get it to work as the player's drunk level will be lower than 100
thanks hope this would do the trick
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)