Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Russian translate, tabulation fix and small update. #546

Merged
merged 2 commits into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 30 additions & 33 deletions game/addons/sourcemod/scripting/sbpp_checker.sp
Original file line number Diff line number Diff line change
Expand Up @@ -82,42 +82,39 @@ public void OnDatabaseConnected(Database db, const char[] error, any data)

public void OnClientAuthorized(int client, const char[] auth)
{
if (g_DB == null)
return;
/* Do not check bots nor check player with lan steamid. */
if (auth[0] == 'B' || auth[9] == 'L')
return;
char query[512], ip[30];
GetClientIP(client, ip, sizeof(ip));
FormatEx(query, sizeof(query), "SELECT COUNT(bid) FROM %s_bans WHERE ((type = 0 AND authid REGEXP '^STEAM_[0-9]:%s$') OR (type = 1 AND ip = '%s')) UNION SELECT COUNT(bid) FROM %s_comms WHERE authid REGEXP '^STEAM_[0-9]:%s$'", g_DatabasePrefix, auth[8], ip, g_DatabasePrefix,auth[8]);
g_DB.Query(OnConnectBanCheck, query, GetClientUserId(client), DBPrio_Low);
if (g_DB == null)
return;
/* Do not check bots nor check player with lan steamid. */
if (auth[0] == 'B' || auth[9] == 'L')
return;
char query[512], ip[30];
GetClientIP(client, ip, sizeof(ip));
FormatEx(query, sizeof(query), "SELECT COUNT(bid) FROM %s_bans WHERE ((type = 0 AND authid REGEXP '^STEAM_[0-9]:%s$') OR (type = 1 AND ip = '%s')) UNION SELECT COUNT(bid) FROM %s_comms WHERE authid REGEXP '^STEAM_[0-9]:%s$'", g_DatabasePrefix, auth[8], ip, g_DatabasePrefix,auth[8]);
g_DB.Query(OnConnectBanCheck, query, GetClientUserId(client), DBPrio_Low);
}

public void OnConnectBanCheck(Database db, DBResultSet results, const char[] error, any userid)
{
int client = GetClientOfUserId(userid);
if (!client || results == null || !results.FetchRow())
return;

int bancount = results.FetchInt(0);
int commcount = 0;
if(results.FetchRow()){
commcount = results.FetchInt(0);
}
if (bancount > 0 || commcount > 0)
{
if(bancount == 0){
PrintToBanAdmins("%s%t", Prefix, "Comm Warning", client, commcount, ((commcount > 1 || commcount == 0) ? "s":""));
}
else if(commcount == 0){
PrintToBanAdmins("%s%t", Prefix, "Ban Warning", client, bancount, ((bancount > 1 || bancount == 0) ? "s":""));
}
else{
PrintToBanAdmins("%s%t", Prefix, "Ban and Comm Warning", client, bancount, ((bancount > 1 || bancount == 0) ? "s":""), commcount, ((commcount > 1 || commcount == 0) ? "s":""));
}
}
int client = GetClientOfUserId(userid);
if (!client || results == null || !results.FetchRow())
return;

int bancount = results.FetchInt(0);
int commcount = 0;
if(results.FetchRow()){
commcount = results.FetchInt(0);
}
if ( bancount && commcount ) {
PrintToBanAdmins("%s%t", Prefix, "Ban and Comm Warning", client, bancount, ((bancount > 1 || bancount == 0) ? "s":""), commcount, ((commcount > 1 || commcount == 0) ? "s":""));
}
else if ( commcount ) {
PrintToBanAdmins("%s%t", Prefix, "Comm Warning", client, commcount, ((commcount > 1 || commcount == 0) ? "s":""));
}
else if ( bancount ) {
PrintToBanAdmins("%s%t", Prefix, "Ban Warning", client, bancount, ((bancount > 1 || bancount == 0) ? "s":""));
}
}

public Action OnListSourceBansCmd(int client, int args)
Expand Down Expand Up @@ -475,7 +472,7 @@ void PrintListResponse(int userid, int client, const char[] format, any ...)

void PrintToBanAdmins(const char[] format, any ...)
{
char msg[128];
char msg[256];

for (int i = 1; i <= MaxClients; i++)
{
Expand Down
9 changes: 6 additions & 3 deletions game/addons/sourcemod/translations/sbpp_checker.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@
{
"#format" "{1:N},{2:d},{3:s}"
"en" "Warning: Player \"{1:N}\" has {2} previous ban{3}."
"ru" "Внимание: Игрок \"{1:N}\" ранее был забанен {2} раз."
"hu" "Figyelem: Játékosnak \"{1:N}\" van {2} korábbi kitiltása{3}."
"chi" "警告: 玩家 \"{1:N}\" 之前有 {2} 次封禁."
"chi" "警告: 玩家 \"{1:N}\" 之前有 {2} 次封禁."
"pl" "Uwaga: Gracz \"{1:N}\" posiada {2} poprzednie bany{3}."
}
"Comm Warning"
{
"#format" "{1:N},{2:d},{3:s}"
"en" "Warning: Player \"{1:N}\" has {2} previous comm block{3}."
"ru" "Внимание: Игроку \"{1:N}\" ранее отключали чат или микрофрон {2} раз."
"hu" "Figyelem: Játékosnak \"{1:N}\" van {2} korábbi kommunikációs tiltása{3}."
"chi" "警告: 玩家 \"{1:N}\" 之前有 {2} 次禁言."
"chi" "警告: 玩家 \"{1:N}\" 之前有 {2} 次禁言."
"pl" "Uwaga: Gracz \"{1:N}\" posiada {2} poprzednie blokady czatu{3}."

}
"Ban and Comm Warning"
{
"#format" "{1:N},{2:d},{3:s},{4:d},{5:s}"
"en" "Warning: Player \"{1:N}\" has {2} previous ban{3} and {4} previous comm block{5}."
"ru" "Внимание: Игрок \"{1:N}\" ранее был забанен {2} раз и ему отключали чат или микрофон {4} раз."
"hu" "Figyelem: Játékosnak \"{1:N}\" van {2} korábbi kitiltása és {4} korábbi kommunikációs tiltása."
"chi" "警告: 玩家 \"{1:N}\" 之前有 {2} 次封禁和 {4} 次禁言."
"chi" "警告: 玩家 \"{1:N}\" 之前有 {2} 次封禁和 {4} 次禁言."
"pl" "Uwaga: Gracz \"{1:N}\" posiada {2} poprzednie bany{3} oraz {4} poprzednie blokady czatu{5}."
}
}
Loading