SA-MP Forums Archive
Creating a command list in dialog - 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: Creating a command list in dialog (/showthread.php?tid=485391)



Creating a command list in dialog - FreAkeD - 04.01.2014

Hi all,

This is a question that I've been wondering ages for.

The problem is I want to create a command list in a dialog. Problem is I use zcmd, and I don't know how to create a dialog with it. Any help is appreciated, I'm new to this


Re: Creating a command list in dialog - K9IsGodly - 04.01.2014

For me, I learn better by visualizing someone else's code and then going off of that. So here's an example that might help you in some way. I use ZCMD as well, and it's not as hard as you'd think it is. To make a dialog in ZCMD, simply setup your command, whatever you want that to be. Then do something like this, for me it's a /spawncar command. Just use the ShowPlayerDialog function, and then whatever you want the dialog id to be, type of dialog, and in those parentheses is where you'd write whatever you want in your dialog. Since you're making a stats command, I don't know what type of dialog you'd use. But hopefully this gave you some idea for making a dialog. This is the best I could come up with, because I'm pretty new to scripting pawn as well.

Код:
CMD:spawncar(playerid, params[])
{
    ShowPlayerDialog(playerid,12,DIALOG_STYLE_LIST,"Cars:","Infernus\nElegy\nTurismo\n","Select","Cancel");
    return 1;
}



Re: Creating a command list in dialog - FreAkeD - 04.01.2014

Quote:
Originally Posted by K9IsGodly
Посмотреть сообщение
For me, I learn better by visualizing someone else's code and then going off of that. So here's an example that might help you in some way. I use ZCMD as well, and it's not as hard as you'd think it is. To make a dialog in ZCMD, simply setup your command, whatever you want that to be. Then do something like this, for me it's a /spawncar command. Just use the ShowPlayerDialog function, and then whatever you want the dialog id to be, type of dialog, and in those parentheses is where you'd write whatever you want in your dialog. Since you're making a stats command, I don't know what type of dialog you'd use. But hopefully this gave you some idea for making a dialog. This is the best I could come up with, because I'm pretty new to scripting pawn as well.

Код:
CMD:spawncar(playerid, params[])
{
    ShowPlayerDialog(playerid,12,DIALOG_STYLE_LIST,"Cars:","Infernus\nElegy\nTurismo\n","Select","Cancel");
    return 1;
}
Thanks for that, I'll try it out


Re: Creating a command list in dialog - K9IsGodly - 04.01.2014

Quote:
Originally Posted by FreAkeD
Посмотреть сообщение
Thanks for that, I'll try it out
I wouldn't use DIALOG_STYLE_LIST if you plan to make a stats command.


Re: Creating a command list in dialog - FreAkeD - 04.01.2014

Quote:
Originally Posted by K9IsGodly
Посмотреть сообщение
I wouldn't use DIALOG_STYLE_LIST if you plan to make a stats command.
I need the one made for a list in a dialog..


Re: Creating a command list in dialog - K9IsGodly - 04.01.2014

Well you could do DIALOG_STYLE_LIST, but you are limited to the amount of things you can put in that list.


Re: Creating a command list in dialog - FreAkeD - 04.01.2014

Quote:
Originally Posted by K9IsGodly
Посмотреть сообщение
Well you could do DIALOG_STYLE_LIST, but you are limited to the amount of things you can put in that list.
Righto, thanks for the help


Re: Creating a command list in dialog - K9IsGodly - 04.01.2014

Quote:
Originally Posted by FreAkeD
Посмотреть сообщение
Righto, thanks for the help
Yeah no problem, glad I could help someone with my very limited knowledge of pawn scripting.