AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved NativeVotes: translating the vote title (https://forums.alliedmods.net/showthread.php?t=327110)

dustinandband 09-01-2020 15:45

NativeVotes: translating the vote title
 
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(sDetailssizeof(sDetails), "Change server tickrate to %i?"g_iTickVote);
NativeVotes_SetDetails(votesDetails);
NativeVotes_SetResultCallback(voteVoteResultHandler);
NativeVotes_DisplayToAll(vote20); 

Trying this:
PHP Code:

char sDetails[256];
for (
int i1<= MaxClientsi++)
{
    if (!
IsClientInGame(i) || IsFakeClient(i)) continue;
    
    
// NativeVotes_Display() requires an array index for 2nd argument
    
int iClient[1];
    
iClient[0] = i;
    
    
FormatEx(sDetailssizeof(sDetails), "%T""TICKRATE_VOTE"ig_iTickVote);
    
NativeVotes_SetDetails(votesDetails);
    
NativeVotes_Display(voteiClient120);
}
NativeVotes_SetResultCallback(voteVoteResultHandler); 

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


All times are GMT -4. The time now is 03:34.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.