The following code used to work before the recent CS:S update.
It suppressed the message "Player <name> has joined the game" but it doesn't work anymore.
Any ideas on how to fix this?
PHP Code:
HookEvent("player_connect", Event_PlayerConnect, EventHookMode_Pre);
public Action:Event_PlayerConnect(Handle:event, const String:name[], bool:dontBroadcast)
{
if (!dontBroadcast) {
decl String:clientName[64], String:networkID[25], String:address[32];
GetEventString(event, "name", clientName, sizeof(clientName));
GetEventString(event, "networkid", networkID, sizeof(networkID));
GetEventString(event, "address", address, sizeof(address));
for (new i = 1; i <= MaxClients; i++) {
if (!IsClientInGame(i) || IsFakeClient(i)) continue;
PrintToConsole(i, "[Connect] %s %s", clientName, networkID);
}
new Handle:newEvent = CreateEvent("player_connect", true);
SetEventString(newEvent, "name", clientName);
SetEventInt(newEvent, "index", GetEventInt(event, "index"));
SetEventInt(newEvent, "userid", GetEventInt(event, "userid"));
SetEventString(newEvent, "networkid", networkID);
SetEventString(newEvent, "address", address);
FireEvent(newEvent, true);
return Plugin_Handled;
}
return Plugin_Continue;
}