Felton
Участник
- Сообщения
- 799
- Реакции
- 59
Доброго времени суток .Вырежте с этого плагина
Игра Counter-Strike Source v.34
Вышел с Сервера
Заходит на Сервер
Игра Counter-Strike Source v.34
Вышел с Сервера
Заходит на Сервер
C-подобный:
#include <sourcemod>
#include <colors>
new String:teams[3][] = {"\x03Наблюдателей \x04✔","\x03Террористов \x04✔","\x03Контр-Террористов \x04✔"}
public Plugin:myinfo =
{
name = "Game Joing",
author = "GuDMan / RuskyDubl",
description = "",
version = "1.0",
url = "N/A"
}
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[\x03DM\x04] \x01%N \x04Зашёл за \x07%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:ip[16];
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));
GetClientIP(client, ip, sizeof(ip)); // В player_disconnect нет address
ReplaceString(reason, sizeof(reason), "\n", " ");
Format(rawadmmsg,sizeof(rawadmmsg),"\x04%s \x01Вышел с \x04Сервера \x03✔", nick, reason);
Format(rawmsg,sizeof(rawmsg),"\x04%s \x01Вышел с \x04Сервера \x03✔", nick, reason);
}
else
{
GetEventString(event, "address", ip, sizeof(ip));
SplitString(ip,":",ip,sizeof(ip));
Format(rawmsg,sizeof(rawmsg), "\x04%s \x01Заходит на \x04Сервер \x03✔", nick);
Format(rawadmmsg,sizeof(rawadmmsg), "\x04%s \x01Заходит на \x04Сервер \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);
}
public OnClientPostAdminCheck(client)
{
if (client)
{
PrintToChatAll("",client);
}
}