Help with dialogs (inputtext)
#1

Im really a beginner with dialogs, i want that when you type "/answer" a input dialog pops up, and if you write "Hannes" you get $500, if you write something else you dont get any money, and if you press cancel you get a message.

I have this, and i can compile without errors, but when i try it in game nothing happens when i press cancel or submit

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/answer", true)==0)
    {
        ShowPlayerDialog(playerid, 3275, DIALOG_STYLE_INPUT, "What is the correct answer?", "Write the answer below:", "Submit", "Cancel");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[7] = "Hannes";
    new str = strval(string);
   
    if(dialogid == 3275)
    {
        if(response)
        {
            if(inputtext[playerid] == str)
            {
                SendClientMessage(playerid, 0xFFFFFFFF, "You won $500!");
                GivePlayerMoney(playerid, 500);
            }
            else
            {
                SendClientMessage(playerid, 0xFFFFFFFF, "Wrong answer!");
            }
        }
        if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Help with dialogs (inputtext) - by [NWA]Hannes - 05.12.2010, 10:26
Re: Help with dialogs (inputtext) - by fangoth1 - 05.12.2010, 10:43
Re: Help with dialogs (inputtext) - by Joe_ - 05.12.2010, 11:12
Re: Help with dialogs (inputtext) - by [NWA]Hannes - 05.12.2010, 11:31
Re: Help with dialogs (inputtext) - by Joe_ - 05.12.2010, 11:33

Forum Jump:


Users browsing this thread: 1 Guest(s)