Hi. I need a forumula that retrives the exact player ping that would show on the scoreboard. This is for silently changing a ping maskers ping on the scoreboard.
There was supposley a stock for this from the smlib project (Client_GetFakePing), although that stock doesn't seem to work anymore.
Code:
GetEntProp(GetPlayerResourceEntity(), Prop_Send, "m_iPing", _, client);
This piece of code will retrive the scoreboard ping, however when a player is ping masking this willl report either 1 or 5ms at all times.
Therefor, I need a formula that caluclates the score-board ping, so I can set the correct m_iPing value on players that are ping-masking. Anyone who can shed some light on this?
Here's a log showing that Client_GetFakePing isn't working when someone is pingmasking.
Example.
Code:
int ResEntity = GetPlayerResourceEntity();
if (ResEntity != -1)
{
PrintToChatAll("Scoreboard ping %d, GetFakePing: %d", GetEntProp(GetPlayerResourceEntity(), Prop_Send, "m_iPing", _, client), Client_GetFakePing(client, true));
}
cl_cmdrate -100 in console.
Result: Scoreboard ping 5, GetFakePing: 5