Multi Language Loop
#1

Hello, i want to make multi language gamemode...

I use 3D arrays method for player messages. (SendClientmessage)

And i write SendText stock to loop players and send messages (SendClientMessage) to everyone.
I think this's inefficient and bad code.

My question... Other way to make send messages(SendClientMessageToAll) ?
Reply
#2

yes just use SendClientMessageToAll instead of your loop.

im not really sure what you mean here.

also you may want to look at YSI as it provides includes for multi language support.

oh look below thats a good solution
Reply
#3

I think that this is OK:
pawn Код:
stock SendTextToAll(english[],spanish[])
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(LanguageVariable[i] == 1) //Let's say that 1 = English.
        {
            SendClientMessage(i,-1,english);
        }
        else //If LanguageVariable isn't 1, it'll send the message in Spanish.
        {
            SendClientMessage(i,-1,spanish);
        }
    }
    return false;
}
//---Example of usage:
SendTextToAll("English example","Ejemplo en espaсol");
Best regards!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)