mSelection + regular dialog , possibly?
#1

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!!
Reply
#2

PHP код:
#define DIALOG_CONFIRM 1337
new WhatModelID[MAX_PLAYERS];
public 
OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(
listid == skinlisthere)
    {
        if(
response)
        {
            
WhatModelID[playerid] = modelid;
            
ShowPlayerDialog(playerid, DIALOG_CONFIRM, 0, "Confirm", "Are you sure you want to buy these clothes?", "Yes", "No");
        }
        else
        {
            
SendClientMessage(playerid, -1, "Cancelled");
        }
        return 
1;
    }
    return 
1;
}
public 
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(
dialogid == DIALOG_CONFIRM)
    {
        if(
response)
        {
            
SetPlayerSkin(playerid, WhatModelID[playerid]);
            
// rest of your code
        
}
        else 
SendClientMessage(playerid, -1, "Cancelled");
    }
    return 
1;
} 
Code improvements can be made.
Reply
#3

Thanks bud
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)