Creating a command list in dialog
#1

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

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;
}
Reply
#3

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
Reply
#4

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.
Reply
#5

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..
Reply
#6

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

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
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)