Sniper0770
Участник
- Сообщения
- 58
- Реакции
- 6
Декомпилировал ареновский nosteambans addon kac, и что то не пойму, я верно оставил основную часть самого бана ? Если нет, помогите пожалуйста с исходником, мне нужна сама процедура бана.
PHP:
#include <sourcemod>
new Handle:g_hKeyValues;
new Handle:g_hDataPack;
new String:g_sKeyValues[192];
public Plugin:myinfo =
{
name = "No-Steam Bans",
description = "No-Steam Bans",
author = "GoDtm666",
version = "1.0.3",
url = "www.SourceTM.com"
};
public ClientBan(QueryCookie:cookie, client, ConVarQueryResult:result, String:cvarName[], String:cvarValue[])
{
if (g_hDataPack)
{
decl owner;
decl iBanTime;
decl String:sReason[64];
ResetPack(g_hDataPack, false);
owner = ReadPackCell(g_hDataPack);
iBanTime = ReadPackCell(g_hDataPack);
ReadPackString(g_hDataPack, sReason, 64);
CloseHandle(g_hDataPack);
g_hDataPack = MissingTAG:0;
decl String:sDate[32];
if (!iBanTime)
{
strcopy(sDate, 32, "0");
}
else
{
new iTimeStamp = GetTime({0,0});
iTimeStamp = iBanTime * 60 + iTimeStamp;
FormatTime(sDate, 32, "%d.%m %H.%M", iTimeStamp);
}
if (client && IsClientInGame(client))
{
if (!IsFakeClient(client))
{
new String:sBuffer[128];
KvRewind(g_hKeyValues);
if (KvJumpToKey(g_hKeyValues, cvarValue, true))
{
if (!GetClientName(client, sBuffer, 128))
{
strcopy(sBuffer, 128, "Unknown");
}
KvSetString(g_hKeyValues, "Player", sBuffer);
GetClientAuthString(client, sBuffer, 128);
KvSetString(g_hKeyValues, "SteamID", sBuffer);
KvSetString(g_hKeyValues, "Status", "Banned");
if (!GetClientName(owner, sBuffer, 128))
{
strcopy(sBuffer, 128, "Unknown");
}
KvSetString(g_hKeyValues, "Banned By Admin", sBuffer);
PrintToChat(owner, "%t \x03[no-Steam Bans]\x01 %t", "KAC_Tag", "KAC_PlayerBannedNsb", sBuffer);
KvSetString(g_hKeyValues, "Ban Reason", sReason);
if (StrEqual(sDate, "0", false))
{
strcopy(sDate, 32, "Permanent");
}
KvSetString(g_hKeyValues, "Elapse", sDate);
}
KvRewind(g_hKeyValues);
KeyValuesToFile(g_hKeyValues, g_sKeyValues);
}
}
}
return 0;
}