PDA

View Full Version : |Source| Source comando /ping



antoniofr
14/04/2015, 12:13 AM
void CMD::InitPing(DWORD aIndex)
{
if(CMD_Config.Ping.Switch != 0)
{
DWORD Time = (GetTickCount() - Player[aIndex].PingDelay) / 1000;

if(CMD_Config.Ping.Level > lpObj[aIndex].Level)
{
MsgSystem::Leftblue(aIndex,SendMsg.Default3,lpObj[aIndex].Name);
}
else if(CMD_Config.Ping.Money > lpObj[aIndex].Money)
{
MsgSystem::Leftblue(aIndex,SendMsg.Default4,lpObj[aIndex].Name);
}
else if(CMD_Config.Ping.Resets > Player[aIndex].Resets)
{
MsgSystem::Leftblue(aIndex,SendMsg.Default6,lpObj[aIndex].Name);
}
else if(CMD_Config.Ping.Vip > Player[aIndex].VipIndex)
{
MsgSystem::Leftblue(aIndex,SendMsg.Default5,lpObj[aIndex].Name);
}
else if(Time < CMD_Config.Ping.Delay)
{
MsgSystem::Leftblue(aIndex,SendMsg.Default7,lpObj[aIndex].Name,CMD_Config.Ping.Delay);
}
else
{
GCSendPing(aIndex);
Player[aIndex].PingDelay = GetTickCount();
}
}
else
{
MsgSystem::Leftblue(aIndex,SendMsg.Default1,lpObj[aIndex].Name);
}
}


Offset[97d]


Offsets.cpp
pGCSendPing GCSendPing = (pGCSendPing)0x00429EE0;

Offsets.h
typedef void (*pGCSendPing)(int aIndex);
extern pGCSendPing GCSendPing;

Protocol.cpp


case 0x71:
{
DWORD V2;
V2 = GetTickCount();
CMD_Config.Result = V2 - lpObj[aIndex].iPingTime;
MsgSystem::Leftblue(aIndex,"[%s]Seu ping é de %d ms",lpObj[aIndex].Name,CMD_Config.Result);
}
break;


Créditos: antonio.fr