How to make GM with 2 languages?
#6

If you want to show the dialog before they get to class selection, then show the dialog in OnPlayerConnect , and return '0' in OnPlayerRequestClass untill they have selected a language.

EG,
pawn Code:
#include <a_samp>

#define L_ENGLISH               (0)
#define L_SERBIAN               (1)

#define LANG_DIALOG             (500)

new bool:SelectedLang[MAX_PLAYERS];
new P_Language[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)
{
    if(!SelectedLang[ playerid ])
        return 0;
       
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SelectedLang[ playerid ] = false;
    P_Language[ playerid ] = L_ENGLISH;
    ShowPlayerDialog(playerid, LANG_DIALOG, DIALOG_STYLE_LIST, "Languages", "English \nSerbian", "Accept", "Close");
    return 1;
}



public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case LANG_DIALOG:
        {
            if(response)
            {
                switch(listitem)
                {
                    case 0://english
                    {
                        SelectedLang[ playerid ] = true;
                    }
                    case 1://serbian
                    {
                        SelectedLang[ playerid ] = true;
                        P_Language[ playerid ] = L_SERBIAN;
                    }
                }
            }
            else
            {
                SelectedLang[ playerid ] = true;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
How to make GM with 2 languages? - by Gotti_ - 08.03.2011, 06:31
Re: How to make GM with 2 languages? - by thiaZ_ - 08.03.2011, 06:38
Re: How to make GM with 2 languages? - by Davz*|*Criss - 08.03.2011, 06:39
Re: How to make GM with 2 languages? - by Gotti_ - 08.03.2011, 07:16
Re: How to make GM with 2 languages? - by Gotti_ - 08.03.2011, 09:28
Re: How to make GM with 2 languages? - by iggy1 - 08.03.2011, 09:38
Re: How to make GM with 2 languages? - by Gotti_ - 08.03.2011, 09:56
Re: How to make GM with 2 languages? - by iggy1 - 08.03.2011, 10:04
Re: How to make GM with 2 languages? - by Gotti_ - 08.03.2011, 10:15
Re: How to make GM with 2 languages? - by iggy1 - 08.03.2011, 10:20

Forum Jump:


Users browsing this thread: 1 Guest(s)