How could i?
#2

Quote:
Originally Posted by FireCat
Посмотреть сообщение
pawn Код:
stock SendLangMessageToAll(const eng[],const esp[])
{
    new string[250];
    for(new i = 0; i < MAX_PLAYERS;i++)
    {
        if(GetLang(i) == 1)
        {
            format(string,sizeof(string),"%s",eng);
        }
        if(GetLang(i) == 2)
        {
            format(string,sizeof(string),"%s",esp);
        }
        SendClientMessage(i,green2,string);
    }
    return 1;
}
That when i do in a function or command SendLangMessageToAll("Hello","Hola");
But how could i make that so i can do SendLangMessageToAll("Hello there %s","Hola %s",GetPlayerName(playerid,pName,sizeof(pName));
Format the string and send it like parameter. E.g.:
PHP код:
format(stringsizeof(string), "Hello there %s""FireCat");
format(string1sizeof(string), "Hola %s""FireCat");
SendLangMessageToAll(stringstring1); 
And your function can be edited a bit:
PHP код:
stock SendLangMessageToAll(const eng[], const esp[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(!
IsPlayerConnected(i)) continue;
        
SendClientMessage(igreen2, (!(GetLang(i) == 2) ? (eng) : (esp)));
    }
    return 
1;

Reply


Messages In This Thread
How could i? - by FireCat - 17.07.2011, 09:43
Re: How could i? - by MoroDan - 17.07.2011, 09:47
Re: How could i? - by RyDeR` - 17.07.2011, 09:54
Re: How could i? - by FireCat - 17.07.2011, 10:17

Forum Jump:


Users browsing this thread: 1 Guest(s)