Dialogs help
#1

Hello guys. I want to make something like when the dialog 5 appears, and the player enters the id, it goes back again to dialog 5 again and show the name or id of the weapon instead of weapon 1,weapon 2 and weapon 3 . Help will really be appreciated. Thanks



Код:
 ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Weapon","Weapon 1 \nWeapon 2 \nWeapon 3","OK","Cancel");


if(dialogid==5)
        {
            if(response)
            {
                if(listitem==0)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
                if(listitem==1)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
                if(listitem==2)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
			}
Reply
#2

Quote:

ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Wea pon ID","Enter weapon ID","OK","Cancel");

That should be
Quote:

ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"We apon ID","Enter weapon ID","OK","Cancel");

And on dialog response 6 use strval(inputtext)

Example: if(strval(inputtext) > 0 || strval(inputtext) < 46)
since weapon id's are from 0 to 46(I think, might be 47)
Reply
#3

The dialog first appears like :

Weapon 1
Weapon 2
Weapon 3
When the player enters the 24 in weapon 1, the next time I see this dialog it shoud be like :
Deagle
Weapon 2
Weapon 3
I hope u get me now. Thanks.
Reply
#4

Anyone can help please
Reply
#5

First of all you as you have there "Enter weapon id" Which is not dialog style list it sud be Dialog_Style_Input where you can input the id of the desired weapon so copy the code.
Код:
if(dialogid==5)
        {
            if(response)
            {
                if(listitem==0)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
                if(listitem==1)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
                if(listitem==2)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
			}
Reply
#6

Quote:
Originally Posted by Imperor
Посмотреть сообщение
First of all you as you have there "Enter weapon id" Which is not dialog style list it sud be Dialog_Style_Input where you can input the id of the desired weapon so copy the code.
Код:
if(dialogid==5)
        {
            if(response)
            {
                if(listitem==0)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
                if(listitem==1)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
                if(listitem==2)
                {
                    ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"Weapon ID","Enter weapon ID","OK","Cancel");
                }
			}
Thnxx for that. but can u help me with my problem.
Reply
#7

Do you mean when you selected the gun the other dialog is like you inventory? Will show you what gun you have? I'm very confused :/
Reply
#8

He actually means when he inputs a weapon id the script returns him the name of the weapon with the same id.
Think needs to create some stock and some defines will be needed.But still confused.
Reply
#9

Okey. Let me explain it again. I am making a script with dialogs to tp a player with a maximum of 3 weapons. I will try to explain it with these pictures.
This is when an admin types the command.



When the admin enters the weapon ID



After entering the ID of the weapon, the first dialog is diaplyed again, but this time it is seen like this.

Reply
#10

its more complicated than it sounds, u have to save it into a string and be able load load it back up && more thinking of possible ways :/ besides that 1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)