помогите найти ошибку

Smailik

Участник
Сообщения
46
Реакции
1
ребята помогите найти мою ошибку!!! я решил изменить стандартный цвет чата на свой цвет! после долгого общения мне скинулили файлы sp и txt
"Phrases"
{
"Minimal Players Not Met"
{
"ru" "Не набрано минимальное количество необходимых игроков."
}

"Already Nominated"
{
"ru" "Вы уже предложили карту."
}

"Changing Maps"
{
"ru" "Голосование состоялось! Смена карты на {1}!"
}

"Current Map Stays"
{
"ru" "Голосование состоялось! Текущая карта продолжается! "
}

"Map Already In Vote"
{
"ru" "Карта '{1}' уже в списке голосования по смене карты."
}

"Map Inserted"
{
"ru" "Карта '{1}' добавлена в список голосования по смене карты."
}

"Map Nominated"
{
"ru" "Игрок {1} предложил {2} для голосование по смене карты."
}

"No Votes"
{
"ru" "Никто не учавствовал в голосовании, остается текущая карта."
}

"RTV Ended"
{
"ru" "Голосование уже завершено, нельзя запустить его снова или предложить карту."
}

"RTV Not Allowed"
{
"ru" "{aliceblue}Голосование по смене карты еще недоступно."
}

"RTV Requested"
{
"ru" "{aliceblue}Игрок {fullred}{1} {aliceblue}хочет сменить карту.({aqua}{2} {aliceblue}голосов из {aqua}{3} {aliceblue}необходимых)"
}

"RTV Started"
{
"ru" "Голосование по смене карты уже началось."
}

"RTV Vote Ready"
{
"ru" "Голосование по смене карты!"
}

"Rock The Vote"
{
"ru" "Голосование по смене карты:"
}

"Don't Change"
{
"ru" "Оставить текущую карту"
}

"Map Already Nominated"
{
"ru" "Выбранная вами карта уже была предложена."
}

"Nominate Title"
{
"ru" "Предложение карты:"
}

"Max Nominations"
{
"ru" "Достигнут максимум разрешенных предложений."
}

"Selected Map"
{
"ru" "Игрок {1} выбрал {2}"
}

"Already Voted"
{
"ru" "Вы уже проголосовали за смену карты. ({1} голосов из {2} необходимых)"
}

}
твой фаил.jpg
все работает! цвет поменялся в чате как я и хотел! решил добавить в других стороках цвета
все делал через нотепад кодировки без бом !вот мой txt
"Already Voted"
{
"ru" "{aliceblue}Вы уже проголосовали за смену карты. ({aqua}{1} {aliceblue}голосов из {aqua}{2} {aliceblue}необходимых)"
}
и вот что с этого выходит
вот что выходит.jpg
подскажите в чем моя ошибка! делаю все через фаил зилу! уже пробовал через сайт на май арене тоже самое! твой фаил.jpg вот что выходит.jpg
 

msl1

Участник
Сообщения
162
Реакции
20
Добавь в плагин #include <morecolors> и измени все PrintToChatAll на CPrintToChatAll .
 

Smailik

Участник
Сообщения
46
Реакции
1
Добавь в плагин #include <morecolors> и измени все PrintToChatAll на CPrintToChatAll .
вот мой исходник будь добр глянь
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod Rock The Vote Plugin
* Creates a map vote when the required number of players have requested one.
*
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <Licenses - GNU Project - Free Software Foundation>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <SourceMod: Half-Life 2 Scripting>.
*
* Version: $Id$
*/

#include <sourcemod>
#include <morecolors>
#include <mapchooser>
#include <nextmap>

#pragma semicolon 1

public Plugin:myinfo =
{
name = "Rock The Vote",
author = "AlliedModders LLC",
description = "Provides RTV Map Voting",
version = SOURCEMOD_VERSION,
url = "SourceMod: Half-Life 2 Scripting"
};

ConVar g_Cvar_Needed;
ConVar g_Cvar_MinPlayers;
ConVar g_Cvar_InitialDelay;
ConVar g_Cvar_Interval;
ConVar g_Cvar_ChangeTime;
ConVar g_Cvar_RTVPostVoteAction;

new bool:g_CanRTV = false; // True if RTV loaded maps and is active.
new bool:g_RTVAllowed = false; // True if RTV is available to players. Used to delay rtv votes.
new g_Voters = 0; // Total voters connected. Doesn't include fake clients.
new g_Votes = 0; // Total number of "say rtv" votes
new g_VotesNeeded = 0; // Necessary votes before map vote begins. (voters * percent_needed)
new bool:g_Voted[MAXPLAYERS+1] = {false, ...};

new bool:g_InChange = false;

public OnPluginStart()
{
LoadTranslations("common.phrases");
LoadTranslations("rockthevote.phrases");

g_Cvar_Needed = CreateConVar("sm_rtv_needed", "0.60", "Percentage of players needed to rockthevote (Def 60%)", 0, true, 0.05, true, 1.0);
g_Cvar_MinPlayers = CreateConVar("sm_rtv_minplayers", "0", "Number of players required before RTV will be enabled.", 0, true, 0.0, true, float(MAXPLAYERS));
g_Cvar_InitialDelay = CreateConVar("sm_rtv_initialdelay", "30.0", "Time (in seconds) before first RTV can be held", 0, true, 0.00);
g_Cvar_Interval = CreateConVar("sm_rtv_interval", "240.0", "Time (in seconds) after a failed RTV before another can be held", 0, true, 0.00);
g_Cvar_ChangeTime = CreateConVar("sm_rtv_changetime", "0", "When to change the map after a succesful RTV: 0 - Instant, 1 - RoundEnd, 2 - MapEnd", _, true, 0.0, true, 2.0);
g_Cvar_RTVPostVoteAction = CreateConVar("sm_rtv_postvoteaction", "0", "What to do with RTV's after a mapvote has completed. 0 - Allow, success = instant change, 1 - Deny", _, true, 0.0, true, 1.0);

RegConsoleCmd("sm_rtv", Command_RTV);

AutoExecConfig(true, "rtv");
}

public OnMapStart()
{
g_Voters = 0;
g_Votes = 0;
g_VotesNeeded = 0;
g_InChange = false;

/* Handle late load */
for (new i=1; i<=MaxClients; i++)
{
if (IsClientConnected(i))
{
OnClientConnected(i);
}
}
}

public OnMapEnd()
{
g_CanRTV = false;
g_RTVAllowed = false;
}

public OnConfigsExecuted()
{
g_CanRTV = true;
g_RTVAllowed = false;
CreateTimer(g_Cvar_InitialDelay.FloatValue, Timer_DelayRTV, _, TIMER_FLAG_NO_MAPCHANGE);
}

public OnClientConnected(client)
{
if(IsFakeClient(client))
return;

g_Voted[client] = false;

g_Voters++;
g_VotesNeeded = RoundToFloor(float(g_Voters) * g_Cvar_Needed.FloatValue);

return;
}

public OnClientDisconnect(client)
{
if(IsFakeClient(client))
return;

if(g_Voted[client])
{
g_Votes--;
}

g_Voters--;

g_VotesNeeded = RoundToFloor(float(g_Voters) * g_Cvar_Needed.FloatValue);

if (!g_CanRTV)
{
return;
}

if (g_Votes &&
g_Voters &&
g_Votes >= g_VotesNeeded &&
g_RTVAllowed )
{
if (g_Cvar_RTVPostVoteAction.IntValue == 1 && HasEndOfMapVoteFinished())
{
return;
}

StartRTV();
}
}

public OnClientSayCommand_Post(client, const String:command[], const String:sArgs[])
{
if (!g_CanRTV || !client)
{
return;
}

if (strcmp(sArgs, "rtv", false) == 0 || strcmp(sArgs, "rockthevote", false) == 0)
{
new ReplySource:old = SetCmdReplySource(SM_REPLY_TO_CHAT);

AttemptRTV(client);

SetCmdReplySource(old);
}
}

public Action:Command_RTV(client, args)
{
if (!g_CanRTV || !client)
{
return Plugin_Handled;
}

AttemptRTV(client);

return Plugin_Handled;
}

AttemptRTV(client)
{
if (!g_RTVAllowed || (g_Cvar_RTVPostVoteAction.IntValue == 1 && HasEndOfMapVoteFinished()))
{
ReplyToCommand(client, "[SM] %t", "RTV Not Allowed");
return;
}

if (!CanMapChooserStartVote())
{
ReplyToCommand(client, "[SM] %t", "RTV Started");
return;
}

if (GetClientCount(true) < g_Cvar_MinPlayers.IntValue)
{
ReplyToCommand(client, "[SM] %t", "Minimal Players Not Met");
return;
}

if (g_Voted[client])
{
ReplyToCommand(client, "[SM] %t", "Already Voted", g_Votes, g_VotesNeeded);
return;
}

new String:name[64];
GetClientName(client, name, sizeof(name));

g_Votes++;
g_Voted[client] = true;

CPrintToChatAll("[SM] %t", "RTV Requested", name, g_Votes, g_VotesNeeded);

if (g_Votes >= g_VotesNeeded)
{
StartRTV();
}
}

public Action:Timer_DelayRTV(Handle:timer)
{
g_RTVAllowed = true;
}

StartRTV()
{
if (g_InChange)
{
return;
}

if (EndOfMapVoteEnabled() && HasEndOfMapVoteFinished())
{
/* Change right now then */
new String:map[65];
if (GetNextMap(map, sizeof(map)))
{
CPrintToChatAll("[SM] %t", "Changing Maps", map);
CreateTimer(5.0, Timer_ChangeMap, _, TIMER_FLAG_NO_MAPCHANGE);
g_InChange = true;

ResetRTV();

g_RTVAllowed = false;
}
return;
}

if (CanMapChooserStartVote())
{
new MapChange:when = MapChange:g_Cvar_ChangeTime.IntValue;
InitiateMapChooserVote(when);

ResetRTV();

g_RTVAllowed = false;
CreateTimer(g_Cvar_Interval.FloatValue, Timer_DelayRTV, _, TIMER_FLAG_NO_MAPCHANGE);
}
}

ResetRTV()
{
g_Votes = 0;

for (new i=1; i<=MAXPLAYERS; i++)
{
g_Voted = false;
}
}

public Action:Timer_ChangeMap(Handle:hTimer)
{
g_InChange = false;

LogMessage("RTV changing map manually");

new String:map[65];
if (GetNextMap(map, sizeof(map)))
{
ForceChangeLevel(map, "RTV after mapvote");
}

return Plugin_Stop;
}


там вроде все норм если менять строки PrintToChatAll на CPrintToChatAll то где именно! подскажи пожалуйста!

--- Добавлено позже ---
вот мой исходник будь добр глянь
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod Rock The Vote Plugin
* Creates a map vote when the required number of players have requested one.
*
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <Licenses - GNU Project - Free Software Foundation>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <SourceMod: Half-Life 2 Scripting>.
*
* Version: $Id$
*/

#include <sourcemod>
#include <morecolors>
#include <mapchooser>
#include <nextmap>

#pragma semicolon 1

public Plugin:myinfo =
{
name = "Rock The Vote",
author = "AlliedModders LLC",
description = "Provides RTV Map Voting",
version = SOURCEMOD_VERSION,
url = "SourceMod: Half-Life 2 Scripting"
};

ConVar g_Cvar_Needed;
ConVar g_Cvar_MinPlayers;
ConVar g_Cvar_InitialDelay;
ConVar g_Cvar_Interval;
ConVar g_Cvar_ChangeTime;
ConVar g_Cvar_RTVPostVoteAction;

new bool:g_CanRTV = false; // True if RTV loaded maps and is active.
new bool:g_RTVAllowed = false; // True if RTV is available to players. Used to delay rtv votes.
new g_Voters = 0; // Total voters connected. Doesn't include fake clients.
new g_Votes = 0; // Total number of "say rtv" votes
new g_VotesNeeded = 0; // Necessary votes before map vote begins. (voters * percent_needed)
new bool:g_Voted[MAXPLAYERS+1] = {false, ...};

new bool:g_InChange = false;

public OnPluginStart()
{
LoadTranslations("common.phrases");
LoadTranslations("rockthevote.phrases");

g_Cvar_Needed = CreateConVar("sm_rtv_needed", "0.60", "Percentage of players needed to rockthevote (Def 60%)", 0, true, 0.05, true, 1.0);
g_Cvar_MinPlayers = CreateConVar("sm_rtv_minplayers", "0", "Number of players required before RTV will be enabled.", 0, true, 0.0, true, float(MAXPLAYERS));
g_Cvar_InitialDelay = CreateConVar("sm_rtv_initialdelay", "30.0", "Time (in seconds) before first RTV can be held", 0, true, 0.00);
g_Cvar_Interval = CreateConVar("sm_rtv_interval", "240.0", "Time (in seconds) after a failed RTV before another can be held", 0, true, 0.00);
g_Cvar_ChangeTime = CreateConVar("sm_rtv_changetime", "0", "When to change the map after a succesful RTV: 0 - Instant, 1 - RoundEnd, 2 - MapEnd", _, true, 0.0, true, 2.0);
g_Cvar_RTVPostVoteAction = CreateConVar("sm_rtv_postvoteaction", "0", "What to do with RTV's after a mapvote has completed. 0 - Allow, success = instant change, 1 - Deny", _, true, 0.0, true, 1.0);

RegConsoleCmd("sm_rtv", Command_RTV);

AutoExecConfig(true, "rtv");
}

public OnMapStart()
{
g_Voters = 0;
g_Votes = 0;
g_VotesNeeded = 0;
g_InChange = false;

/* Handle late load */
for (new i=1; i<=MaxClients; i++)
{
if (IsClientConnected(i))
{
OnClientConnected(i);
}
}
}

public OnMapEnd()
{
g_CanRTV = false;
g_RTVAllowed = false;
}

public OnConfigsExecuted()
{
g_CanRTV = true;
g_RTVAllowed = false;
CreateTimer(g_Cvar_InitialDelay.FloatValue, Timer_DelayRTV, _, TIMER_FLAG_NO_MAPCHANGE);
}

public OnClientConnected(client)
{
if(IsFakeClient(client))
return;

g_Voted[client] = false;

g_Voters++;
g_VotesNeeded = RoundToFloor(float(g_Voters) * g_Cvar_Needed.FloatValue);

return;
}

public OnClientDisconnect(client)
{
if(IsFakeClient(client))
return;

if(g_Voted[client])
{
g_Votes--;
}

g_Voters--;

g_VotesNeeded = RoundToFloor(float(g_Voters) * g_Cvar_Needed.FloatValue);

if (!g_CanRTV)
{
return;
}

if (g_Votes &&
g_Voters &&
g_Votes >= g_VotesNeeded &&
g_RTVAllowed )
{
if (g_Cvar_RTVPostVoteAction.IntValue == 1 && HasEndOfMapVoteFinished())
{
return;
}

StartRTV();
}
}

public OnClientSayCommand_Post(client, const String:command[], const String:sArgs[])
{
if (!g_CanRTV || !client)
{
return;
}

if (strcmp(sArgs, "rtv", false) == 0 || strcmp(sArgs, "rockthevote", false) == 0)
{
new ReplySource:old = SetCmdReplySource(SM_REPLY_TO_CHAT);

AttemptRTV(client);

SetCmdReplySource(old);
}
}

public Action:Command_RTV(client, args)
{
if (!g_CanRTV || !client)
{
return Plugin_Handled;
}

AttemptRTV(client);

return Plugin_Handled;
}

AttemptRTV(client)
{
if (!g_RTVAllowed || (g_Cvar_RTVPostVoteAction.IntValue == 1 && HasEndOfMapVoteFinished()))
{
ReplyToCommand(client, "[SM] %t", "RTV Not Allowed");
return;
}

if (!CanMapChooserStartVote())
{
ReplyToCommand(client, "[SM] %t", "RTV Started");
return;
}

if (GetClientCount(true) < g_Cvar_MinPlayers.IntValue)
{
ReplyToCommand(client, "[SM] %t", "Minimal Players Not Met");
return;
}

if (g_Voted[client])
{
ReplyToCommand(client, "[SM] %t", "Already Voted", g_Votes, g_VotesNeeded);
return;
}

new String:name[64];
GetClientName(client, name, sizeof(name));

g_Votes++;
g_Voted[client] = true;

CPrintToChatAll("[SM] %t", "RTV Requested", name, g_Votes, g_VotesNeeded);

if (g_Votes >= g_VotesNeeded)
{
StartRTV();
}
}

public Action:Timer_DelayRTV(Handle:timer)
{
g_RTVAllowed = true;
}

StartRTV()
{
if (g_InChange)
{
return;
}

if (EndOfMapVoteEnabled() && HasEndOfMapVoteFinished())
{
/* Change right now then */
new String:map[65];
if (GetNextMap(map, sizeof(map)))
{
CPrintToChatAll("[SM] %t", "Changing Maps", map);
CreateTimer(5.0, Timer_ChangeMap, _, TIMER_FLAG_NO_MAPCHANGE);
g_InChange = true;

ResetRTV();

g_RTVAllowed = false;
}
return;
}

if (CanMapChooserStartVote())
{
new MapChange:when = MapChange:g_Cvar_ChangeTime.IntValue;
InitiateMapChooserVote(when);

ResetRTV();

g_RTVAllowed = false;
CreateTimer(g_Cvar_Interval.FloatValue, Timer_DelayRTV, _, TIMER_FLAG_NO_MAPCHANGE);
}
}

ResetRTV()
{
g_Votes = 0;

for (new i=1; i<=MAXPLAYERS; i++)
{
g_Voted = false;
}
}

public Action:Timer_ChangeMap(Handle:hTimer)
{
g_InChange = false;

LogMessage("RTV changing map manually");

new String:map[65];
if (GetNextMap(map, sizeof(map)))
{
ForceChangeLevel(map, "RTV after mapvote");
}

return Plugin_Stop;
}
там вроде все норм если менять строки PrintToChatAll на CPrintToChatAll то где именно! подскажи пожалуйста!
Добавь в плагин #include <morecolors> и измени все PrintToChatAll на CPrintToChatAll .
суть в том что как мне изночально скинули txt и только в той строке если меняю цвета то они работают в других меняю ! получается то что на скрине! вот эта строка только работает! как так то по суть весь документ работать должен!
"RTV Requested"
{
"ru" "{aliceblue}Игрок {fullred}{1} {aliceblue}хочет сменить карту.({aqua}{2} {aliceblue}голосов из {aqua}{3} {aliceblue}необходимых)"
}

"RTV Started"
More Colors тут беру цвета!
 
Последнее редактирование:

msl1

Участник
Сообщения
162
Реакции
20
вот мой исходник будь добр глянь
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod Rock The Vote Plugin
* Creates a map vote when the required number of players have requested one.
*
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <Licenses - GNU Project - Free Software Foundation>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <SourceMod: Half-Life 2 Scripting>.
*
* Version: $Id$
*/

#include <sourcemod>
#include <morecolors>
#include <mapchooser>
#include <nextmap>

#pragma semicolon 1

public Plugin:myinfo =
{
name = "Rock The Vote",
author = "AlliedModders LLC",
description = "Provides RTV Map Voting",
version = SOURCEMOD_VERSION,
url = "SourceMod: Half-Life 2 Scripting"
};

ConVar g_Cvar_Needed;
ConVar g_Cvar_MinPlayers;
ConVar g_Cvar_InitialDelay;
ConVar g_Cvar_Interval;
ConVar g_Cvar_ChangeTime;
ConVar g_Cvar_RTVPostVoteAction;

new bool:g_CanRTV = false; // True if RTV loaded maps and is active.
new bool:g_RTVAllowed = false; // True if RTV is available to players. Used to delay rtv votes.
new g_Voters = 0; // Total voters connected. Doesn't include fake clients.
new g_Votes = 0; // Total number of "say rtv" votes
new g_VotesNeeded = 0; // Necessary votes before map vote begins. (voters * percent_needed)
new bool:g_Voted[MAXPLAYERS+1] = {false, ...};

new bool:g_InChange = false;

public OnPluginStart()
{
LoadTranslations("common.phrases");
LoadTranslations("rockthevote.phrases");

g_Cvar_Needed = CreateConVar("sm_rtv_needed", "0.60", "Percentage of players needed to rockthevote (Def 60%)", 0, true, 0.05, true, 1.0);
g_Cvar_MinPlayers = CreateConVar("sm_rtv_minplayers", "0", "Number of players required before RTV will be enabled.", 0, true, 0.0, true, float(MAXPLAYERS));
g_Cvar_InitialDelay = CreateConVar("sm_rtv_initialdelay", "30.0", "Time (in seconds) before first RTV can be held", 0, true, 0.00);
g_Cvar_Interval = CreateConVar("sm_rtv_interval", "240.0", "Time (in seconds) after a failed RTV before another can be held", 0, true, 0.00);
g_Cvar_ChangeTime = CreateConVar("sm_rtv_changetime", "0", "When to change the map after a succesful RTV: 0 - Instant, 1 - RoundEnd, 2 - MapEnd", _, true, 0.0, true, 2.0);
g_Cvar_RTVPostVoteAction = CreateConVar("sm_rtv_postvoteaction", "0", "What to do with RTV's after a mapvote has completed. 0 - Allow, success = instant change, 1 - Deny", _, true, 0.0, true, 1.0);

RegConsoleCmd("sm_rtv", Command_RTV);

AutoExecConfig(true, "rtv");
}

public OnMapStart()
{
g_Voters = 0;
g_Votes = 0;
g_VotesNeeded = 0;
g_InChange = false;

/* Handle late load */
for (new i=1; i<=MaxClients; i++)
{
if (IsClientConnected(i))
{
OnClientConnected(i);
}
}
}

public OnMapEnd()
{
g_CanRTV = false;
g_RTVAllowed = false;
}

public OnConfigsExecuted()
{
g_CanRTV = true;
g_RTVAllowed = false;
CreateTimer(g_Cvar_InitialDelay.FloatValue, Timer_DelayRTV, _, TIMER_FLAG_NO_MAPCHANGE);
}

public OnClientConnected(client)
{
if(IsFakeClient(client))
return;

g_Voted[client] = false;

g_Voters++;
g_VotesNeeded = RoundToFloor(float(g_Voters) * g_Cvar_Needed.FloatValue);

return;
}

public OnClientDisconnect(client)
{
if(IsFakeClient(client))
return;

if(g_Voted[client])
{
g_Votes--;
}

g_Voters--;

g_VotesNeeded = RoundToFloor(float(g_Voters) * g_Cvar_Needed.FloatValue);

if (!g_CanRTV)
{
return;
}

if (g_Votes &&
g_Voters &&
g_Votes >= g_VotesNeeded &&
g_RTVAllowed )
{
if (g_Cvar_RTVPostVoteAction.IntValue == 1 && HasEndOfMapVoteFinished())
{
return;
}

StartRTV();
}
}

public OnClientSayCommand_Post(client, const String:command[], const String:sArgs[])
{
if (!g_CanRTV || !client)
{
return;
}

if (strcmp(sArgs, "rtv", false) == 0 || strcmp(sArgs, "rockthevote", false) == 0)
{
new ReplySource:old = SetCmdReplySource(SM_REPLY_TO_CHAT);

AttemptRTV(client);

SetCmdReplySource(old);
}
}

public Action:Command_RTV(client, args)
{
if (!g_CanRTV || !client)
{
return Plugin_Handled;
}

AttemptRTV(client);

return Plugin_Handled;
}

AttemptRTV(client)
{
if (!g_RTVAllowed || (g_Cvar_RTVPostVoteAction.IntValue == 1 && HasEndOfMapVoteFinished()))
{
ReplyToCommand(client, "[SM] %t", "RTV Not Allowed");
return;
}

if (!CanMapChooserStartVote())
{
ReplyToCommand(client, "[SM] %t", "RTV Started");
return;
}

if (GetClientCount(true) < g_Cvar_MinPlayers.IntValue)
{
ReplyToCommand(client, "[SM] %t", "Minimal Players Not Met");
return;
}

if (g_Voted[client])
{
ReplyToCommand(client, "[SM] %t", "Already Voted", g_Votes, g_VotesNeeded);
return;
}

new String:name[64];
GetClientName(client, name, sizeof(name));

g_Votes++;
g_Voted[client] = true;

CPrintToChatAll("[SM] %t", "RTV Requested", name, g_Votes, g_VotesNeeded);

if (g_Votes >= g_VotesNeeded)
{
StartRTV();
}
}

public Action:Timer_DelayRTV(Handle:timer)
{
g_RTVAllowed = true;
}

StartRTV()
{
if (g_InChange)
{
return;
}

if (EndOfMapVoteEnabled() && HasEndOfMapVoteFinished())
{
/* Change right now then */
new String:map[65];
if (GetNextMap(map, sizeof(map)))
{
CPrintToChatAll("[SM] %t", "Changing Maps", map);
CreateTimer(5.0, Timer_ChangeMap, _, TIMER_FLAG_NO_MAPCHANGE);
g_InChange = true;

ResetRTV();

g_RTVAllowed = false;
}
return;
}

if (CanMapChooserStartVote())
{
new MapChange:when = MapChange:g_Cvar_ChangeTime.IntValue;
InitiateMapChooserVote(when);

ResetRTV();

g_RTVAllowed = false;
CreateTimer(g_Cvar_Interval.FloatValue, Timer_DelayRTV, _, TIMER_FLAG_NO_MAPCHANGE);
}
}

ResetRTV()
{
g_Votes = 0;

for (new i=1; i<=MAXPLAYERS; i++)
{
g_Voted = false;
}
}

public Action:Timer_ChangeMap(Handle:hTimer)
{
g_InChange = false;

LogMessage("RTV changing map manually");

new String:map[65];
if (GetNextMap(map, sizeof(map)))
{
ForceChangeLevel(map, "RTV after mapvote");
}

return Plugin_Stop;
}
там вроде все норм если менять строки PrintToChatAll на CPrintToChatAll то где именно! подскажи пожалуйста!
--- Добавлено позже ---


суть в том что как мне изночально скинули txt и только в той строке если меняю цвета то они работают в других меняю ! получается то что на скрине! вот эта строка только работает! как так то по суть весь документ работать должен!
"RTV Requested"
{
"ru" "{aliceblue}Игрок {fullred}{1} {aliceblue}хочет сменить карту.({aqua}{2} {aliceblue}голосов из {aqua}{3} {aliceblue}необходимых)"
}

"RTV Started"
More Colors тут беру цвета!
смени ReplyToCommand на CReplyToCommand
 

Smailik

Участник
Сообщения
46
Реакции
1
вот мой исходник будь добр глянь
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod Rock The Vote Plugin
* Creates a map vote when the required number of players have requested one.
*
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <Licenses - GNU Project - Free Software Foundation>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <SourceMod: Half-Life 2 Scripting>.
*
* Version: $Id$
*/

#include <sourcemod>
#include <morecolors>
#include <mapchooser>
#include <nextmap>

#pragma semicolon 1

public Plugin:myinfo =
{
name = "Rock The Vote",
author = "AlliedModders LLC",
description = "Provides RTV Map Voting",
version = SOURCEMOD_VERSION,
url = "SourceMod: Half-Life 2 Scripting"
};

ConVar g_Cvar_Needed;
ConVar g_Cvar_MinPlayers;
ConVar g_Cvar_InitialDelay;
ConVar g_Cvar_Interval;
ConVar g_Cvar_ChangeTime;
ConVar g_Cvar_RTVPostVoteAction;

new bool:g_CanRTV = false; // True if RTV loaded maps and is active.
new bool:g_RTVAllowed = false; // True if RTV is available to players. Used to delay rtv votes.
new g_Voters = 0; // Total voters connected. Doesn't include fake clients.
new g_Votes = 0; // Total number of "say rtv" votes
new g_VotesNeeded = 0; // Necessary votes before map vote begins. (voters * percent_needed)
new bool:g_Voted[MAXPLAYERS+1] = {false, ...};

new bool:g_InChange = false;

public OnPluginStart()
{
LoadTranslations("common.phrases");
LoadTranslations("rockthevote.phrases");

g_Cvar_Needed = CreateConVar("sm_rtv_needed", "0.60", "Percentage of players needed to rockthevote (Def 60%)", 0, true, 0.05, true, 1.0);
g_Cvar_MinPlayers = CreateConVar("sm_rtv_minplayers", "0", "Number of players required before RTV will be enabled.", 0, true, 0.0, true, float(MAXPLAYERS));
g_Cvar_InitialDelay = CreateConVar("sm_rtv_initialdelay", "30.0", "Time (in seconds) before first RTV can be held", 0, true, 0.00);
g_Cvar_Interval = CreateConVar("sm_rtv_interval", "240.0", "Time (in seconds) after a failed RTV before another can be held", 0, true, 0.00);
g_Cvar_ChangeTime = CreateConVar("sm_rtv_changetime", "0", "When to change the map after a succesful RTV: 0 - Instant, 1 - RoundEnd, 2 - MapEnd", _, true, 0.0, true, 2.0);
g_Cvar_RTVPostVoteAction = CreateConVar("sm_rtv_postvoteaction", "0", "What to do with RTV's after a mapvote has completed. 0 - Allow, success = instant change, 1 - Deny", _, true, 0.0, true, 1.0);

RegConsoleCmd("sm_rtv", Command_RTV);

AutoExecConfig(true, "rtv");
}

public OnMapStart()
{
g_Voters = 0;
g_Votes = 0;
g_VotesNeeded = 0;
g_InChange = false;

/* Handle late load */
for (new i=1; i<=MaxClients; i++)
{
if (IsClientConnected(i))
{
OnClientConnected(i);
}
}
}

public OnMapEnd()
{
g_CanRTV = false;
g_RTVAllowed = false;
}

public OnConfigsExecuted()
{
g_CanRTV = true;
g_RTVAllowed = false;
CreateTimer(g_Cvar_InitialDelay.FloatValue, Timer_DelayRTV, _, TIMER_FLAG_NO_MAPCHANGE);
}

public OnClientConnected(client)
{
if(IsFakeClient(client))
return;

g_Voted[client] = false;

g_Voters++;
g_VotesNeeded = RoundToFloor(float(g_Voters) * g_Cvar_Needed.FloatValue);

return;
}

public OnClientDisconnect(client)
{
if(IsFakeClient(client))
return;

if(g_Voted[client])
{
g_Votes--;
}

g_Voters--;

g_VotesNeeded = RoundToFloor(float(g_Voters) * g_Cvar_Needed.FloatValue);

if (!g_CanRTV)
{
return;
}

if (g_Votes &&
g_Voters &&
g_Votes >= g_VotesNeeded &&
g_RTVAllowed )
{
if (g_Cvar_RTVPostVoteAction.IntValue == 1 && HasEndOfMapVoteFinished())
{
return;
}

StartRTV();
}
}

public OnClientSayCommand_Post(client, const String:command[], const String:sArgs[])
{
if (!g_CanRTV || !client)
{
return;
}

if (strcmp(sArgs, "rtv", false) == 0 || strcmp(sArgs, "rockthevote", false) == 0)
{
new ReplySource:old = SetCmdReplySource(SM_REPLY_TO_CHAT);

AttemptRTV(client);

SetCmdReplySource(old);
}
}

public Action:Command_RTV(client, args)
{
if (!g_CanRTV || !client)
{
return Plugin_Handled;
}

AttemptRTV(client);

return Plugin_Handled;
}

AttemptRTV(client)
{
if (!g_RTVAllowed || (g_Cvar_RTVPostVoteAction.IntValue == 1 && HasEndOfMapVoteFinished()))
{
ReplyToCommand(client, "[SM] %t", "RTV Not Allowed");
return;
}

if (!CanMapChooserStartVote())
{
ReplyToCommand(client, "[SM] %t", "RTV Started");
return;
}

if (GetClientCount(true) < g_Cvar_MinPlayers.IntValue)
{
ReplyToCommand(client, "[SM] %t", "Minimal Players Not Met");
return;
}

if (g_Voted[client])
{
ReplyToCommand(client, "[SM] %t", "Already Voted", g_Votes, g_VotesNeeded);
return;
}

new String:name[64];
GetClientName(client, name, sizeof(name));

g_Votes++;
g_Voted[client] = true;

CPrintToChatAll("[SM] %t", "RTV Requested", name, g_Votes, g_VotesNeeded);

if (g_Votes >= g_VotesNeeded)
{
StartRTV();
}
}

public Action:Timer_DelayRTV(Handle:timer)
{
g_RTVAllowed = true;
}

StartRTV()
{
if (g_InChange)
{
return;
}

if (EndOfMapVoteEnabled() && HasEndOfMapVoteFinished())
{
/* Change right now then */
new String:map[65];
if (GetNextMap(map, sizeof(map)))
{
CPrintToChatAll("[SM] %t", "Changing Maps", map);
CreateTimer(5.0, Timer_ChangeMap, _, TIMER_FLAG_NO_MAPCHANGE);
g_InChange = true;

ResetRTV();

g_RTVAllowed = false;
}
return;
}

if (CanMapChooserStartVote())
{
new MapChange:when = MapChange:g_Cvar_ChangeTime.IntValue;
InitiateMapChooserVote(when);

ResetRTV();

g_RTVAllowed = false;
CreateTimer(g_Cvar_Interval.FloatValue, Timer_DelayRTV, _, TIMER_FLAG_NO_MAPCHANGE);
}
}

ResetRTV()
{
g_Votes = 0;

for (new i=1; i<=MAXPLAYERS; i++)
{
g_Voted = false;
}
}

public Action:Timer_ChangeMap(Handle:hTimer)
{
g_InChange = false;

LogMessage("RTV changing map manually");

new String:map[65];
if (GetNextMap(map, sizeof(map)))
{
ForceChangeLevel(map, "RTV after mapvote");
}

return Plugin_Stop;
}
там вроде все норм если менять строки PrintToChatAll на CPrintToChatAll то где именно! подскажи пожалуйста!
Добавь в плагин #include <morecolors> и измени все PrintToChatAll на CPrintToChatAll .
суть в том что как мне изночально скинули txt и только в той строке если меняю цвета то они работают в других меняю ! получается то что на скрине! вот эта строка только работает! как так то по суть весь документ работать должен!
"RTV Requested"
{
"ru" "{aliceblue}Игрок {fullred}{1} {aliceblue}хочет сменить карту.({aqua}{2} {aliceblue}голосов из {aqua}{3} {aliceblue}необходимых)"
}

"RTV Started"
смени ReplyToCommand на CReplyToCommand
все норм спасибо огромное)))
 
Сверху Снизу