Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Command problem

$
0
0
Hello, I would like to ask for help, because I created a command, dialogue, table in the database and added a phrase Language to PlayerData, it is worth noting that the search does not concern me in the database, why?

Code:

CMD:language(playerid, params[])
{
        Dialog_Show(playerid, Language, DIALOG_STYLE_LIST, "Select language", "English\nPolish", "Select", "Cancel");
        return 1;
}

This is my command

Code:

Dialog:Language(playerid, response, listitem, inputtext[])
{
        if (response)
        {
            new
                        message[256+1],
                        query[2048];
            if(listitem == 0)
            {
                        format(message, 256, "You have changed the server language to English!", listitem);
                        SendClientMessage(playerid, 0xFFFFFFFF, message);
                        PlayerData[playerid][pLanguage] = 0;
                        format(query, sizeof(query), "UPDATE `account` SET `Language` = '%d'",
                        PlayerData[playerid][pLanguage]
                        );
                        return 1;
                }
                if(listitem == 1)
                {
                        format(message, 256, "Zmieniłeś język serwera na polski!", listitem);
                          SendClientMessage(playerid, 0xFFFFFFFF, message);
                        PlayerData[playerid][pLanguage] = 1;
                        format(query, sizeof(query), "UPDATE `account` SET `Language` = '%d'",
                        PlayerData[playerid][pLanguage]
                        );
                          return 1;
                }
        }
        return 1;
}

And this is my dialog. Please help me :(

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>