Does anyone have any suggestions or example code on how to translate a vote display title (using Native Votes)?
Original:
PHP Code:
char sDetails[256];
FormatEx(sDetails, sizeof(sDetails), "Change server tickrate to %i?", g_iTickVote);
NativeVotes_SetDetails(vote, sDetails);
NativeVotes_SetResultCallback(vote, VoteResultHandler);
NativeVotes_DisplayToAll(vote, 20);
Trying this:
PHP Code:
char sDetails[256];
for (int i= 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || IsFakeClient(i)) continue;
// NativeVotes_Display() requires an array index for 2nd argument
int iClient[1];
iClient[0] = i;
FormatEx(sDetails, sizeof(sDetails), "%T", "TICKRATE_VOTE", i, g_iTickVote);
NativeVotes_SetDetails(vote, sDetails);
NativeVotes_Display(vote, iClient, 1, 20);
}
NativeVotes_SetResultCallback(vote, VoteResultHandler);
But it keeps the vote on the screen indefinitely and produces the following error:
Code:
L 09/01/2020 - 15:36:44: [SM] Exception reported: Invalid key value handle 3e00286 (error 3)
L 09/01/2020 - 15:36:44: [SM] Blaming: nativevotes.smx
L 09/01/2020 - 15:36:44: [SM] Call stack trace:
L 09/01/2020 - 15:36:44: [SM] [0] KvGetNum
L 09/01/2020 - 15:36:44: [SM] [1] Line 176, D:\tf2server\plugins\nativevotes\addons\sourcemod\scripting\nativevotes/data-keyvalues.sp::Data_GetResultCallback
L 09/01/2020 - 15:36:44: [SM] [2] Line 1532, D:\tf2server\plugins\nativevotes\addons\sourcemod\scripting\nativevotes.sp::Native_SetResultCallback
L 09/01/2020 - 15:36:44: [SM] [4] NativeVotes_SetResultCallback
L 09/01/2020 - 15:36:44: [SM] [5] Line 396, D:\Documents\game folders\left 4 dead 2\sourcemod 1.8.0\addons\sourcemod\scripting\resetonempty.sp::Vote_Tickrate
I'm in the process of translating plugin messages so that we can set up servers in different regions. This has me completely stumped.
I'm looking for the phrase "
Change server tickrate to %i?" to be translated individually to each client depending on what their language is set to.
Edit:
Nvm found something. Must've been real tired last night to have missed this when searching through stuff
https://github.com/sirdigbot/SatansF..._votes.sp#L279