SA-MP Forums Archive
mSelection + regular dialog , possibly? - 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)
+--- Thread: mSelection + regular dialog , possibly? (/showthread.php?tid=593235)



mSelection + regular dialog , possibly? - Camorra - 03.11.2015

Hi, I trying to make something using mSelection and I wanna do like if you click the skin you choose that will open you a dialog with " are you sure you want to buy this clothes ? " "yes" "no".

Thanks!!


Re: mSelection + regular dialog , possibly? - itsCody - 03.11.2015

PHP код:
#define DIALOG_CONFIRM 1337
new WhatModelID[MAX_PLAYERS];
public 
OnPlayerModelSelection(playeridresponselistidmodelid)
{
    if(
listid == skinlisthere)
    {
        if(
response)
        {
            
WhatModelID[playerid] = modelid;
            
ShowPlayerDialog(playeridDIALOG_CONFIRM0"Confirm""Are you sure you want to buy these clothes?""Yes""No");
        }
        else
        {
            
SendClientMessage(playerid, -1"Cancelled");
        }
        return 
1;
    }
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_CONFIRM)
    {
        if(
response)
        {
            
SetPlayerSkin(playeridWhatModelID[playerid]);
            
// rest of your code
        
}
        else 
SendClientMessage(playerid, -1"Cancelled");
    }
    return 
1;

Code improvements can be made.


Re: mSelection + regular dialog , possibly? - Camorra - 03.11.2015

Thanks bud