legend2360
Участник
- Сообщения
- 16
- Реакции
- 1
Здравствуйте! Я решил перевести плагин с помощью .phrases .
Плагин который я хотел русифицировать: http://hlmod.ru/forum/showthread.php?t=8330
_______________
Вот что я сделал в исходнике:
А в noblocktrigger.phrases.txt:
В /ru/noblocktrigger.phrases.txt:
Но {2} (секунды) не пишутся.
Получается на сервере так:
[SM] NoBlock включен на секунд.
Может я что-то неправильно сделал? Помогите, пожалуйста.
Плагин который я хотел русифицировать: http://hlmod.ru/forum/showthread.php?t=8330
_______________
Вот что я сделал в исходнике:
PHP:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.01"
#define SM "\x04[SM]\x01"
public Plugin:myinfo =
{
name = "Noblock Trigger",
author = "Heartless",
description = "Allows players to enable noblock on everyone in the server for x seconds",
version = PLUGIN_VERSION,
url = "http://www.badnetwork.net/"
};
new g_CollisionOffset;
new TimerActive;
new Handle:sm_noblock_time = INVALID_HANDLE;
public OnPluginStart()
{
RegConsoleCmd("sm_noblock", Command_NoBlock);
g_CollisionOffset = FindSendPropInfo("CBaseEntity", "m_CollisionGroup");
sm_noblock_time = CreateConVar("sm_noblock_time", "5", "Sets the noblock timer value");
AutoExecConfig(true, "sm_noblock");
LoadTranslations("noblocktrigger.phrases");
}
public Action:Command_NoBlock(client, args)
{
if (IsClientInGame(client) && IsPlayerAlive(client) && TimerActive == 0)
{
new Float:Time;
Time = GetConVarFloat(sm_noblock_time);
PrintToChatAll("%t", "Enable", SM, Time);
TimerActive = 1;
CreateTimer(Time, Timer_UnBlockPlayer, client);
// enable noblock on every client in the server
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && IsPlayerAlive(i))
{
EnableNoBlock(i);
}
}
}
else if (TimerActive == 1)
{
PrintToChat(client, "%t", "Arleady", SM);
}
else
{
PrintToChat(client, "%t", "Alive", SM);
}
return Plugin_Handled;
}
public Action:Timer_UnBlockPlayer(Handle:timer, any:client)
{
TimerActive = 0;
PrintToChatAll("%t", "Disable", SM);
// enable block on every client in the server
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && IsPlayerAlive(i))
{
EnableBlock(i);
}
}
return Plugin_Continue;
}
EnableBlock(client)
{
// CAN NOT PASS THRU ie: Players can jump on each other
SetEntData(client, g_CollisionOffset, 5, 4, true);
}
EnableNoBlock(client)
{
// Noblock active ie: Players can walk thru each other
SetEntData(client, g_CollisionOffset, 2, 4, true);
}
PHP:
"Phrases"
{
"Enable"
{
"#format" "{1:s},{2:s}"
"en" "{1} Noblock enabled for {2} seconds"
}
"Arleady"
{
"#format" "{1:s}"
"en" "{1} Command is already in use"
}
"Alive"
{
"#format" "{1:s}"
"en" "{1} You must be alive to use this command"
}
"Disable"
{
"#format" "{1:s}"
"en" "{1} Noblock is Disabled"
}
}
PHP:
"Phrases"
{
"Enable"
{
"ru" "{1} NoBlock включен на {2} секунд."
}
"Arleady"
{
"ru" "{1} Команда уже используется!"
}
"Alive"
{
"ru" "{1} Ты должен быть живым, чтобы использовать эту команду!"
}
"Disable"
{
"ru" "{1} Noblock отключен."
}
}
Получается на сервере так:
[SM] NoBlock включен на секунд.
Может я что-то неправильно сделал? Помогите, пожалуйста.
Последнее редактирование модератором: