SA-MP Forums Archive
dialog help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dialog help (/showthread.php?tid=270966)



dialog help - Rafa - 22.07.2011

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.


Re: dialog help - WoodPecker - 22.07.2011

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.


Re: dialog help - Rafa - 22.07.2011

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


Re: dialog help - Roko_foko - 22.07.2011

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