need help in dcmd
#1

i want to change this dcmd from text to dialog input
Код:
dcmd_0(playerid, params[])
	{
	#pragma unused params
	dini_Create(file);
	dini_Set(file, "Name" , pname);
	TogglePlayerControllable(playerid, 0);
	SetCameraBehindPlayer(playerid);
	SendClientMessage(playerid, green,"Are you Male or Female ? (/1 [male] [female])");
	return 1;
}
dcmd_1(playerid, params[])
	{
	if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: (/1 [male] [female])");
	dini_Set(file, "Gender", params);
	new string[128];
	format(string, sizeof(string), "Ok, so you are %s.", params);
 	SendClientMessage(playerid, green,string);
 	SendClientMessage(playerid, green," ");
	SendClientMessage(playerid, green,"What's your age ? (/2 [Age])");
	return 1;
}
dcmd_2(playerid, params[])
	{
	if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /2 [age]");
	dini_Set(file, "Age", params);
	new string[128];
	format(string, sizeof(string), "Ok, so you are %s years old.", params);
 	SendClientMessage(playerid, green,string);
 	SendClientMessage(playerid, green," ");
	SendClientMessage(playerid, green, "Ok. Where do you live ? (/3 [Country's name])");
	return 1;
}
dcmd_3(playerid, params[])
	{
	if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: (/3 [Country's name])");
	dini_Set(file, "Country", params);
	new string[128];
	format(string, sizeof(string), "Ok, so you live in %s.", params);
 	SendClientMessage(playerid, green,string);
 	SendClientMessage(playerid, green," ");
	SendClientMessage(playerid, green, "How will you deal a Cheater/Hacker ? (/4 [Message])");
	return 1;
}
dcmd_4(playerid, params[])
	{
	if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: (/4 [Message])");
	dini_Set(file, "Dealing with Cheaters", params);
	SendClientMessage(playerid, green," ");
	SendClientMessage(playerid, green, "Ok, Why would you like to be a Administrator ? (/5 [Reason])");
	return 1;
}
dcmd_5(playerid, params[])
	{
	if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: (/5 [Reason])");
	dini_Set(file, "Reason", params);
	SendClientMessage(playerid, green," ");
	SendClientMessage(playerid, green, "Ok, Thankyou. That was all the information we need right now!");
	SendClientMessage(playerid, blue, "It might take some time, so please be patient!");
	TogglePlayerControllable(playerid, 1);
	return 1;
}
and i want it like this dialogs
dialog button next and button cancel
button next show the after dialog and this you know how
Reply
#2

Use ShowPlayerDialog and OnDialogResponse
Reply
#3

this i needed i can't use ShowPlayerDialog and OnDialogResponse and can't understand from wiki i need scripter or any one can change it from dcmd to dialog
Reply
#4

pawn Код:
ShowPlayerDialog(playerid, 8800,DIALOG_STYLE_INPUT,"Tutorial","Enter your gender (Male/Female)","Next","Cancel");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[200];
    if(dialogid == 8800)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter your gender");
        format(string, sizeof(string), "Ok, so you are a %s", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8801, DIALOG_STYLE_INPUT,"Tutorial","What is your age? (16-100)","Next","Cancel");
        return 1;
    }
   
    if(dialogid == 8801)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter your age");
        format(string, sizeof(string), "Ok, so you are %d years old", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8802, DIALOG_STYLE_INPUT,"Tutorial","Where do you live?","Next","Cancel");
        return 1;
    }

    if(dialogid == 8802)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter the location where you live");
        format(string, sizeof(string), "Ok, so you live at %s", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8803, DIALOG_STYLE_INPUT,"Tutorial","How will you deal a cheater/hacker?","Next","Cancel");
        return 1;
    }

    if(dialogid == 8803)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter the way you deal a cheater/hacker");
        if(inputtext < 5 || inputtext > 100) return SendClientMessage(playerid, green,"Message it to short or to long (min 5 words, max 100 words)");
        SendClientMessage(playerid, green, "Ok, so the way you deal a cheater/hacker is:");
        format(string, sizeof(string), "' %s '", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8804, DIALOG_STYLE_INPUT,"Tutorial","Why would you to be an administrator?","Next","Cancel");
        return 1;
    }
   
    if(dialogid == 8804)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter why you want to be an administrator");
        if(inputtext < 5 || inputtext > 100) return SendClientMessage(playerid, green,"Message it to short or to long (min 5 words, max 100 words)");
        SendClientMessage(playerid, green, "The reason why you want to be an administrator is");
        format(string, sizeof(string), "' %s '", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8805, DIALOG_STYLE_MSGBOX,"Tutorial","Thank you for applying, it might take some time, please wait patiencly","Next","Cancel");
        return 1;
    }
   
    if(!response) SendClientMessage(playerid, green,"You didn't decide to apply");
    return 1;
}
Lol, I am not sure if it work but give it a try it took me some time
Reply
#5

Quote:
Originally Posted by Claude
Посмотреть сообщение
pawn Код:
ShowPlayerDialog(playerid, 8800,DIALOG_STYLE_INPUT,"Tutorial","Enter your gender (Male/Female)","Next","Cancel");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[200];
    if(dialogid == 8800)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter your gender");
        format(string, sizeof(string), "Ok, so you are a %s", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8801, DIALOG_STYLE_INPUT,"Tutorial","What is your age? (16-100)","Next","Cancel");
        return 1;
    }
   
    if(dialogid == 8801)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter your age");
        format(string, sizeof(string), "Ok, so you are %d years old", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8802, DIALOG_STYLE_INPUT,"Tutorial","Where do you live?","Next","Cancel");
        return 1;
    }

    if(dialogid == 8802)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter the location where you live");
        format(string, sizeof(string), "Ok, so you live at %s", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8803, DIALOG_STYLE_INPUT,"Tutorial","How will you deal a cheater/hacker?","Next","Cancel");
        return 1;
    }

    if(dialogid == 8803)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter the way you deal a cheater/hacker");
        if(inputtext < 5 || inputtext > 100) return SendClientMessage(playerid, green,"Message it to short or to long (min 5 words, max 100 words)");
        SendClientMessage(playerid, green, "Ok, so the way you deal a cheater/hacker is:");
        format(string, sizeof(string), "' %s '", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8804, DIALOG_STYLE_INPUT,"Tutorial","Why would you to be an administrator?","Next","Cancel");
        return 1;
    }
   
    if(dialogid == 8804)
    {
        if(!inputtext) return SendClientMessage(playerid, green,"Please enter why you want to be an administrator");
        if(inputtext < 5 || inputtext > 100) return SendClientMessage(playerid, green,"Message it to short or to long (min 5 words, max 100 words)");
        SendClientMessage(playerid, green, "The reason why you want to be an administrator is");
        format(string, sizeof(string), "' %s '", inputtext);
        SendClientMessage(playerid, green, string);
        ShowPlayerDialog(playerid, 8805, DIALOG_STYLE_MSGBOX,"Tutorial","Thank you for applying, it might take some time, please wait patiencly","Next","Cancel");
        return 1;
    }
   
    if(!response) SendClientMessage(playerid, green,"You didn't decide to apply");
    return 1;
}
Lol, I am not sure if it work but give it a try it took me some time
Errors
Код:
(52) : error 033: array must be indexed (variable "inputtext")
(61) : error 033: array must be indexed (variable "inputtext")
(70) : error 033: array must be indexed (variable "inputtext")
(79) : error 033: array must be indexed (variable "inputtext")
(80) : error 033: array must be indexed (variable "inputtext")
(90) : error 033: array must be indexed (variable "inputtext")
(91) : error 033: array must be indexed (variable "inputtext")

7 Errors.
Reply
#6

help please i can't repair it
Reply
#7

Replace

pawn Код:
if(!inputtext)
with

pawn Код:
if(!strlen(inputtext))
Everywhere in your script.
Reply
#8

Get this errors again
Код:
error 033: array must be indexed (variable "inputtext")
error 033: array must be indexed (variable "inputtext")
in lines
pawn Код:
if(inputtext < 5 || inputtext > 100) return SendClientMessage(playerid, green,"Message it to short or to long (min 5 words, max 100 words)");
pawn Код:
if(inputtext < 5 || inputtext > 100) return SendClientMessage(playerid, green,"Message it to short or to long (min 5 words, max 100 words)");
relly can't
Reply
#9

Quote:
Originally Posted by OmarEco
Посмотреть сообщение
Get this errors again
Код:
error 033: array must be indexed (variable "inputtext")
error 033: array must be indexed (variable "inputtext")
in lines
pawn Код:
if(inputtext < 5 || inputtext > 100) return SendClientMessage(playerid, green,"Message it to short or to long (min 5 words, max 100 words)");
pawn Код:
if(inputtext < 5 || inputtext > 100) return SendClientMessage(playerid, green,"Message it to short or to long (min 5 words, max 100 words)");
relly i can't repair it
Reply
#10

and can't
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)