I have problem with a weapon dialog
#2

I removed if(response) and both brackets, Also fully indented your codes.
Perhaps give it a try now:


pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new idx;
    cmd=strtok(cmdtext, idx);

    if(strcmp(cmd, "/getweapon", true) == 1)
    {
        ShowPlayerDialog(playerid, DIALOG_WEAPONSHOP, DIALOG_STYLE_LIST, "Weapon Shop", "9MM   $1000,\nAK47    $3000,\nM4    $3000,\nKatana    $750,\nDesert Eagle    $2000", "Buy", "Cancel");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_WEAPONSHOP:
        {
            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 22, 100);
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 30, 1000);
                }
                case 2:
                {
                    GivePlayerWeapon(playerid, 31, 1000);
                }
                case 3:
                {
                    GivePlayerWeapon(playerid, 8, -1);
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
I have problem with a weapon dialog - by saker277 - 22.08.2011, 12:36
Re: I have problem with a weapon dialog - by Improvement™ - 22.08.2011, 12:44
Re: I have problem with a weapon dialog - by PhoenixB - 22.08.2011, 12:45
Re: I have problem with a weapon dialog - by Improvement™ - 22.08.2011, 12:49
Re: I have problem with a weapon dialog - by saker277 - 22.08.2011, 12:56
Re: I have problem with a weapon dialog - by [MWR]Blood - 22.08.2011, 13:17
Re: I have problem with a weapon dialog - by Devilxz97 - 14.05.2012, 08:34

Forum Jump:


Users browsing this thread: 1 Guest(s)