Menu isn't working
#1

Hey there, I've never worked with Menus before although I'm not a newbie at scripting. So I'm working on a new Language selection script. However when I join in game it the menu items cannot be selected for what ever reason.

pawn Код:
public OnGameModeInit()
{
    gLanguageSelection = CreateMenu("Language Selection", 1, 200.0, 100.0, 150.0, 150.0);
    AddMenuItem(gLanguageSelection, 0, " ");
    AddMenuItem(gLanguageSelection, 0, " ");
    AddMenuItem(gLanguageSelection, 0, "English");
    AddMenuItem(gLanguageSelection, 0, "Francais");
    AddMenuItem(gLanguageSelection, 0, "Espanol");
    AddMenuItem(gLanguageSelection, 0, " ");
    return 1;
}

public OnPlayerConnect(playerid)
{
    SetTimerEx("LanguageS", 1000, false, "d", playerid);
    return 1;
}
forward LanguageS(playerid);

public LanguageS(playerid)
{
    ShowMenuForPlayer(gLanguageSelection, playerid);
    return 1;
}


public OnPlayerSelectedMenuRow(playerid, row)
{
    if(GetPlayerMenu(playerid) == gLanguageSelection && IsValidMenu(gLanguageSelection))
    {
        switch(row)
        {
            case 3:
            {
                gLanguage[playerid] = 1;
                SendClientMessage(playerid, -1, "Your selected language is: English.");
            }
            case 4:
            {
                gLanguage[playerid] = 2;
                SendClientMessage(playerid, -1, "Votre langue choisie est: Franзais");
            }
            case 5:
            {
                gLanguage[playerid] = 3;
                SendClientMessage(playerid, -1, "El idioma seleccionado es: Espaсol");
            }
        }
    }
    return 1;
}
That's just the basic element I haven't started anything else.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)