Need a example :)
#2

pawn Код:
#define DIALOG_TRUNK 8464 // defines the dialogid so you don't confuse it later
zcmd:
pawn Код:
CMD:trunk(playerid, params[]) {
    ShowPlayerDialog(playerid, DIALOG_TRUNK, DIALOG_STYLE_LIST, "Trunk", "Take M4\nTake MP5", "Take", "Exit"); // shows the dialog
    return 1;
}
strcmp:
pawn Код:
if(!strcmp(cmdtext, "/trunk", true, 6)) {
    ShowPlayerDialog(playerid, DIALOG_TRUNK, DIALOG_STYLE_LIST, "Trunk", "Take M4\nTake MP5", "Take", "Exit"); // shows the dialog
    return 1;
}
And add this to your OnDialogResponse:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    if(dialogid == DIALOG_TRUNK) {
        if(response) { // if you responded to the dialog
            switch(listitem) {
                case 0: GivePlayerWeapon(playerid, 31, 1000); // Gives player an M4.
                case 1: GivePlayerWeapon(playerid, 29, 1000); // Gives player an MP5.
            }
        }
    }
    return 0;
}
Reply


Messages In This Thread
Need a example :) - by Gooday - 14.01.2012, 12:52
Re: Need a example :) - by Mean - 14.01.2012, 12:58
Re: Need a example :) - by Gooday - 14.01.2012, 13:09
Re: Need a example :) - by Mean - 14.01.2012, 13:10
Re: Need a example :) - by Gooday - 14.01.2012, 13:17
Re: Need a example :) - by Mean - 14.01.2012, 13:21
Re: Need a example :) - by Gooday - 14.01.2012, 13:57
Re: Need a example :) - by Mean - 14.01.2012, 14:08
Re: Need a example :) - by Gooday - 14.01.2012, 14:09
Re: Need a example :) - by Min - 14.01.2012, 14:16

Forum Jump:


Users browsing this thread: 1 Guest(s)