Raised This Month: $ Target: $400
 0% 

ShowSyncHudMsg to all players with languages


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
e12harry
Member
Join Date: Apr 2010
Old 07-28-2011 , 05:04   ShowSyncHudMsg to all players with languages
Reply With Quote #1

Hello.
I have plugin whitch allows voting for map length.
Results are displayed as hud msg in format:

[minutes count] [minutes string for players language] [(votes count)]

10 Minutes (1)
20 Minutes (3)
30 Minutes (0)

this is my function uset for displaying results:

Code:
public showTimeVoteResults() {
    new t;
    new msg[256];
    new item[32];
    new result = get_pcvar_num(gCvarTimeVoteResults);
    if(get_pcvar_num(gCvarTimeVoteWin) != 2 && result == 3)
        result = 1;
    switch(result){
        case 0: return;
        case 1:{
            for(new i=0;i<mapTimesCount;i++){
                t = mapTimes[i];
                formatex(item, charsmax(item), "%d %L [%d]^n", t, LANG_PLAYER, "MINUTES", mapTimesVotes[i]);
                add(msg, charsmax(msg), item);
            }
        }
        case 2: {
            new itm1 = -1, itm1count=-1, idx1, idx2, itm2=-1,itm2count=-1;
            getTop2(mapTimes, mapTimesVotes, mapTimesCount, itm1, idx1,itm1count,itm2,idx2, itm2count);
    
            formatex(item, charsmax(item), "%d %L [%d]^n", itm1, LANG_PLAYER, "MINUTES", itm1count);
            add(msg, charsmax(msg), item);
            formatex(item, charsmax(item), "%d %L [%d]", itm2, LANG_PLAYER, "MINUTES", itm2count);
            add(msg, charsmax(msg), item);
        }
        case 3:{
            new sum = 0;
            for(new i =1;i<mapTimesCount;i++){
                sum += mapTimesVotes[i] * mapTimes[i];
            }
            new num = getRealPlayersnum();
            formatex(msg, charsmax(msg), "%d %L", floatround(float(sum)/ float(num)),  LANG_PLAYER, "MINUTES");
        }
    }
    trim(msg);
    set_hudmessage(255, 0, 0, 0.01, 0.14, 0, 6.0, 1.0);
    ShowSyncHudMsg(0, gHudCenteredMsg,  msg);
    
    if(!mapTimeVoteEnd){
        set_task(0.5, "showTimeVoteResults");
    }
}

Unfortunetly results are displayed incorrectly. The MINUTES word is displaying in different languages. It changes constantly from Minutes (en) to Minut (pl). How can I format this to display for each player in his own language?
e12harry is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:54.


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