Hello
Can someone help me modify this plugin:
PHP Code:
public OnClientConnected(client)
{
if (IsValidPlayer(client) && !IsFakeClient(client))
{
CPrintToChatAll("{olive}%N {default}is {blue}connecting{default} to the server", client);
}
}
static bool:IsValidPlayer(client)
{
if (0 < client <= MaxClients)
return true;
return false;
}
to also show player's average friendly fire damage in L4D2.
I have modified version of Connect Announce that shows player's hours played, it has these code added to it:
PHP Code:
if (StrContains(auth, "STEAM") == 0)
{
SteamWorks_RequestStats(client, 550);
}
and
PHP Code:
if (StrContains(rawmsg, "{HOURS}") != -1)
{
decl String:sGamePlayHours[32];
new iGamePlaySeconds;
if (!SteamWorks_GetStatCell(client, "Stat.TotalPlayTime.Total", iGamePlaySeconds))
{
iGamePlaySeconds = -1;
}
Format(sGamePlayHours, sizeof(sGamePlayHours), "%.01f", iGamePlaySeconds >= 0 ? (float(iGamePlaySeconds) / 3600.0) : -1.0);
ReplaceString(rawmsg, sizeof(rawmsg), "{HOURS}", sGamePlayHours);
}
Name for friendly fire cell is Stat.FFDamageGame.Avg
I think that it's possible to use that code, but my programming knowledge isn't anywhere near that