Raised This Month: $51 Target: $400
 12% 

Ways getting ping?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
- Billy The Kid -
Member
Join Date: Oct 2006
Old 11-14-2006 , 10:30   Ways getting ping?
Reply With Quote #1

Is the code of get_user_ping function available?

Anyway I have few other questions, that I think are not related to module coding, but are related to this question, so I'm putting link to that topic:

http://forums.alliedmods.net/showthr...171#post403171

Thx in advance ;)
__________________
- Billy The Kid - is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-14-2006 , 13:42   Re: Ways getting ping?
Reply With Quote #2

Quote:
Is the code of get_user_ping function available?
Yes http://svn.tcwonline.org/viewvc.cgi/...xmodx&view=log
Code:
static cell AMX_NATIVE_CALL get_user_ping(AMX *amx, cell *params) /* 3 param */
{
    int index = params[1];

    if (index < 1 || index > gpGlobals->maxClients)
        return 0;

    CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);

    if (pPlayer->ingame)
    {
        cell *cpPing = get_amxaddr(amx, params[2]);
        cell *cpLoss = get_amxaddr(amx, params[3]);
        int ping, loss;
        PLAYER_CNX_STATS(pPlayer->pEdict, &ping, &loss);
        *cpPing = ping;
        *cpLoss = loss;

        return 1;
    }

    return 0;
}
Where PLAYER_CNX_STATS is an engine function
Quote:
Originally Posted by HLSDK
#define PLAYER_CNX_STATS ( *g_engfuncs.pfnGetPlayerStats )
Quote:
Originally Posted by HLSDK
void (*pfnGetPlayerStats) ( const edict_t *pClient, int *ping, int *packet_loss );
VEN is offline
- Billy The Kid -
Member
Join Date: Oct 2006
Old 11-14-2006 , 15:00   Re: Ways getting ping?
Reply With Quote #3

Thx man, really helpfull ;) Too bad karma up is limited to 1
__________________
- Billy The Kid - is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode