[Include] stormLang 1.0.0 - Use more than 1 language
#6

pawn Код:
stock SetPlayerLanguage(playerid, language);
{
    if(language == -1) return pLanguage[playerid] = -1;
    if(language == 0) return pLanguage[playerid] = 0;
    if(language == 1) return pLanguage[playerid] = 1;
    if(language == 2) return pLanguage[playerid] = 2;
    if(language == 3) return pLanguage[playerid] = 3;
}
Can be:

pawn Код:
stock SetPlayerLanguage(playerid, language);
{
    pLanguage[playerid] = language;
    return 1;
}
Or
pawn Код:
stock GetPlayerLanguage(playerid)
{
    new lan;

    if(pLanguage[playerid] == -1)
    {
        lan = -1;
    }
   
    if(pLanguage[playerid] == 0)
    {
        lan = 0;
    }
   
    if(pLanguage[playerid] == 1)
    {
        lan = 1;
    }
   
    if(pLanguage[playerid] == 2)
    {
        lan = 2;
    }
   
    if(pLanguage[playerid] == 3)
    {
        lan = 3;
    }
   
    if(pLanguage[playerid] == 4)
    {
        lan = 4;
    }
    return lan;
}
Can be:

pawn Код:
#define GetPlayerLanguage(%1) (pLanguage[%1])
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)