SA-MP Forums Archive
Help with ShowPlayerDialog and OnDialogResponse! - 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: Help with ShowPlayerDialog and OnDialogResponse! (/showthread.php?tid=169444)



Help with ShowPlayerDialog and OnDialogResponse! - markjaysonpinoy - 19.08.2010

pawn Code:
#include <a_samp>

public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext, "/wepshop", true))
    {
        ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Weapon Shop","Brass Knuckles ($500)\r\nGolf Club ($500)\r\nNite Stick ($500)\r\n9mm Pistol ($1000)\r\nMP5 ($1000)\r\nSniper Rifle ($2000)\r\nRocket Launcher ($20000)\r\n","Buy!", "Exit");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response)
        {
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid,330,1);
                GivePlayerMoney(playerid,-500);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid,333,1);
                GivePlayerMoney(playerid,-500);
            }
            if(listitem == 3)
            {
                GivePlayerWeapon(playerid,334,1);
                GivePlayerMoney(playerid,-500);
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid,346,500);
                GivePlayerMoney(playerid,-1000);
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid,353,500);
                GivePlayerMoney(playerid,-1000);
            }
            if(listitem == 6)
            {
                GivePlayerWeapon(playerid,358,500);
                GivePlayerMoney(playerid,-2000);
            }
            if(listitem == 7)
            {
            GivePlayerWeapon(playerid,359,10);
            GivePlayerMoney(playerid,-20000);
            }
        }
        return 1;
    }
    return 0;
}
Please help me nothing appears when i click ingame


Re: Help with ShowPlayerDialog and OnDialogResponse! - FireCat - 19.08.2010

try taking off return 0


Re: Help with ShowPlayerDialog and OnDialogResponse! - markjaysonpinoy - 19.08.2010

nah that does not fix it


Re: Help with ShowPlayerDialog and OnDialogResponse! - FireCat - 19.08.2010

well i cant get your porblem O.o sorry


Re: Help with ShowPlayerDialog and OnDialogResponse! - LifeStyle - 19.08.2010

try a other dialog id


Re: Help with ShowPlayerDialog and OnDialogResponse! - Dark_Kostas - 19.08.2010

Do you have any other dialogs using ID 1?


Re: Help with ShowPlayerDialog and OnDialogResponse! - [NWA]Hannes - 19.08.2010

Lol nubz getof teh internetzzz!

With the GivePlayerWeapon function you need to type in the weapon id, not the weapon model.

You can see weapons, slots and models here:
https://sampwiki.blast.hk/wiki/Weapons

The weapon id is the first param of the row containing the weapons name.
For example, 24 is the weapon id for desert eagle.


Re: Help with ShowPlayerDialog and OnDialogResponse! - Vince - 19.08.2010

Also, list items start with 0, not with 1. And you might use a switch as-well.