Larsalex
♂
- Сообщения
- 812
- Реакции
- 404
C-подобный:
#include <sourcemod>
#include <sdktools>
#include <csgo_colors>
public OnPluginStart()
{
HookEvent("player_disconnect", Event_PlayerDisconnect, EventHookMode_Pre);
HookEvent("player_team", Event_PlayeTeam, EventHookMode_Pre);
}
public OnClientPostAdminCheck(client)
{
if(client<1) return;
new String:name[MAX_NAME_LENGTH];
GetClientName(client, name, sizeof(name));
CGOPrintToChatAll("{OLIVE}[{GREEN}+{OLIVE}] {GRAY}%s {RED}подключился", name);
}
public OnClientDisconnect(client)
{
if(client<1) return;
new String:name[MAX_NAME_LENGTH];
GetClientName(client, name, sizeof(name));
CGOPrintToChatAll("{OLIVE}[{RED}-{OLIVE}] {GRAY}%s {RED}отключился", name);
}
public Action:Event_PlayerDisconnect(Handle:event, const String:name[], bool:dontBroadcast)
{
if(!dontBroadcast) SetEventBroadcast(event, true);
{
SetEventBroadcast(event, true)
}
}
public Action:Event_PlayeTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
new client=GetClientOfUserId(GetEventInt(event, "userid"));
if (!dontBroadcast && !GetEventBool(event,"disconnect") && !GetEventBool(event,"silent") && IsClientInGame(client))
{
SetEventBroadcast(event, true);
if(GetClientTeam(client) == 1)
{
CGOPrintToChatAll("{GREEN}%N {DEFAULT}зашёл(ла) за {BLUE}наблюдателей", client);
}
if(GetClientTeam(client) == 2)
{
CGOPrintToChatAll("{GREEN}%N {DEFAULT}стал(а) {RED}маньяком", client);
}
else if(GetClientTeam(client) == 3)
{
CGOPrintToChatAll("{GREEN}%N {DEFAULT}присоединился к команде {LIGHTBLUE}выживших", client);
}
}
}