[CS: Source] Небольшой фикс basebans.

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
47
Реакции
3
Что нужно переделать в исходнике, чтобы при бане писало не просто причину, а в формате:
Вы были забанены.
Причина бана: причина
Время бана: время
Я так понимаю переделать нужно тут ?
C-подобный:
	if (reason[0] == '\0')
	{
		BanClient(target, time, BANFLAG_AUTO, "Banned", "Banned", "sm_ban", client);
	}
	else
	{
		BanClient(target, time, BANFLAG_AUTO, reason, reason, "sm_ban", client);
	}
Но у меня не получается
 

gibs

Фитиль народного волненья
Сообщения
722
Реакции
407
Мошенник
Отформатируйте строку reason
 
Сообщения
47
Реакции
3
AlmazON,
PrepareBan(client, target, time, const String:reason[])
{
new originalTarget = GetClientOfUserId(g_BanTargetUserId[client]);

if (originalTarget != target)
{
if (client == 0)
{
PrintToServer("[SM] %t", "Player no longer available");
}
else
{
PrintToChat(client, "[SM] %t", "Player no longer available");
}

return;
}

new String:name[32];
GetClientName(target, name, sizeof(name));

if (!time)
{
if (reason[0] == '\0')
{
ShowActivity(client, "%t", "Permabanned player", name);
} else {
ShowActivity(client, "%t", "Permabanned player reason", name, reason);
}
} else {
if (reason[0] == '\0')
{
ShowActivity(client, "%t", "Banned player", name, time);
} else {
ShowActivity(client, "%t", "Banned player reason", name, time, reason);
}
}

LogAction(client, target, "\"%L\" banned \"%L\" (minutes \"%d\") (reason \"%s\")", client, target, time, reason);
Format(reason, sizeof(reason), "Вы были забанены.\nПричина бана: %s\nВремя бана: %i", reason, time);
if (reason[0] == '\0')
{
BanClient(target, time, BANFLAG_AUTO, "Banned", "Banned", "sm_ban", client);
}
else
{
BanClient(target, time, BANFLAG_AUTO, reason, reason, "sm_ban", client);
}
}
 

AlmazON

Не путать с самим yand3xmail
Сообщения
5,099
Реакции
2,755
Алексей Дубравин, скорее так:
PHP:
PrepareBan(client, target, time, const String:reason[])
{
	new originalTarget = GetClientOfUserId(g_BanTargetUserId[client]);
	
	if (originalTarget != target)
	{
		if (client == 0)
		{
			PrintToServer("[SM] %t", "Player no longer available");
		}
		else
		{
			PrintToChat(client, "[SM] %t", "Player no longer available");
		}
		
		return;
	}
	
	new String:name[32];
	GetClientName(target, name, sizeof(name));
	
	if (!time)
	{
		if (reason[0] == '\0')
		{
			ShowActivity(client, "%t", "Permabanned player", name);
			} else {
			ShowActivity(client, "%t", "Permabanned player reason", name, reason);
		}
		} else {
		if (reason[0] == '\0')
		{
			ShowActivity(client, "%t", "Banned player", name, time);
			} else {
			ShowActivity(client, "%t", "Banned player reason", name, time, reason);
		}
	}
	
	LogAction(client, target, "\"%L\" banned \"%L\" (minutes \"%d\") (reason \"%s\")", client, target, time, reason); 
	if (reason[0] == '\0')
	{
		BanClient(target, time, BANFLAG_AUTO, "Banned", "Banned", "sm_ban", client);
	}
	else
	{
		decl String:message[150];
		FormatEx(message, sizeof(message), "Вы были забанены.\nПричина бана: %s\nВремя бана: %i", reason, time);
		BanClient(target, time, BANFLAG_AUTO, reason, message, "sm_ban", client);
	}
}
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу