Всем привет, попробовал убрать любое упоминание о ip, плагин скомпилился, но с этими ошибками
А в консоли сервера начинает этим спамить
#include <sourcemod>
new String:teams[3][] = {"\x04 Спостерігачів","\x04 Терористів \x01","\x04 Спецназ \x01"}
public Plugin:myinfo =
{
name = "[KDLP] Game Events",
author = "KorDen",
description = "",
version = "1.0",
url = "css32.ru"
}
public OnPluginStart()
{
HookEvent("player_disconnect", event_PlayerConn, EventHookMode_Pre);
HookEvent("player_connect", event_PlayerConn, EventHookMode_Pre);
HookEvent("player_team", event_PlayerTeam, EventHookMode_Pre);
}
//GameEvents Begin
public Action:event_PlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
new client=GetClientOfUserId(GetEventInt(event, "userid"))
if (!dontBroadcast && !GetEventBool(event,"disconnect") && !GetEventBool(event,"silent") && IsClientConnected(client))
{
SetEventBroadcast(event, true);
PrintToChatAll("\x04[\x01UA\x04] \x04%N \x01зайшов за \x04%s ",client,teams[GetEventInt(event,"team")-1]);
}
}
public Action:event_PlayerConn(Handle:event, const String:name[], bool:dontBroadcast)
{
if (!dontBroadcast)
SetEventBroadcast(event, true);
decl String:rawmsg[255];
decl String:rawadmmsg[255];
decl String:steam[24];
decl String:nick[48];
decl String:reason[192];
GetEventString(event, "networkid", steam, sizeof(steam));
GetEventString(event, "name", nick, sizeof(nick));
if (strcmp(name,"player_connect"))
{
new client=GetClientOfUserId(GetEventInt(event,"userid"))
if(client<1) return;
GetEventString(event, "reason", reason, sizeof(reason));
ReplaceString(reason, sizeof(reason), "\n", " ");
Format(rawadmmsg,sizeof(rawadmmsg),"\x04[\x01UA\x04] \x04%s \x03| \x04%s \x01відключився", nick);
Format(rawmsg,sizeof(rawmsg),"\x04[\x01UA\x04] \x04%s \x03| \x04%s \x01 відключився - \x04%s", nick, reason);
}
else
{
Format(rawadmmsg,sizeof(rawadmmsg), "\x04[\x01UA\x04] \x04%s \x03| \x04%s \x01підключився", nick);
Format(rawmsg,sizeof(rawmsg), "\x04[\x01UA\x04] \x04%s \x03вступає в гру", nick)
}
for (new i = 1; i <= MaxClients; i++)
if(IsClientConnected(i) && IsClientInGame(i))
if (GetUserFlagBits(i))
PrintToChat(i, "%s", rawadmmsg);
else
PrintToChat(i, "%s", rawmsg);
}
Можете пожалуйста посмотреть что я упустил, хотя плагин работает нормально, но этот спам в консоли пугает