PHP Code:
public void OnPluginStart()
{
for(int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
OnClientPostAdminCheck(i);
}
}
public void OnClientPostAdminCheck(int client)
{
/*
* https://github.com/alliedmodders/hl2sdk/blob/98fe5b5a34b3721fe4d60ec7ba3a28ade3512560/game/server/EventLog.cpp#L63-L75
*
*/
char sIPPort[25];
GetClientIP(client,sIPPort,sizeof(sIPPort),false);
Event ConnectLogEvent;
ConnectLogEvent = CreateEvent("player_connect",true);
char szClientName[MAX_NAME_LENGTH];
GetClientName(client,szClientName,MAX_NAME_LENGTH);
char szAuthID[25];
GetClientAuthId(client,AuthId_Engine,szAuthID,sizeof(szAuthID))
ConnectLogEvent.SetInt("userid",GetClientUserId(client))
ConnectLogEvent.SetString("address",sIPPort);
ConnectLogEvent.SetString("name",szClientName);
ConnectLogEvent.SetString("networkid",szAuthID);
ConnectLogEvent.Fire();
}
Maybe we can use sourcepawn