dialog help
#1

pawn Код:
CMD:vipgunsmenu(playerid, params[])
{
    if(IsPlayerVip[playerid] >= 1)
    {
        ShowPlayerDialog(playerid, vipguns, DIALOG_STYLE_LIST, "Vip Guns", "Shawn-off\nTec9", "Accept", "Cancel");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, 0xFF0000, "You can not use this command. Reason: You are not VIP player.");
        return 1;
    }
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(vipguns)
    {
        case 1:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            }

            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 36, 500);
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 26, 500);
                }
            }
        }
    }
    return 1;
}
the dialog i can see but the items i can't get it idk what is the prob i see this example from wiki...
Thanks.
Reply
#2

So whats your problem here? you said you can see the dialog and you can get the item, i dont see any problem here Yo.
Reply
#3

OMG SORRY I CAN'T GET THE ITEMS.. :/
Reply
#4

pawn Код:
CMD:vipgunsmenu(playerid, params[])
{
    if(IsPlayerVip[playerid] >= 1)
    {
        ShowPlayerDialog(playerid, vipguns, DIALOG_STYLE_LIST, "Vip Guns", "Shawn-off\nTec9", "Accept", "Cancel");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, 0xFF0000, "You can not use this command. Reason: You are not VIP player.");
        return 1;
    }
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(vipguns) // <------------ here is the problem, replace it with 'switch(dialogid)'
    {
        case 1://<----------------- here aswell, replace it with 'case vipguns'
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            }

            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 36, 500);
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 26, 500);
                }
            }
        }
    }
    return 1;
}

for more info https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)