Little scripting questions -
Cedimedi - 03.10.2009
I maked a thread now because many peoples ask only little script questions. post it here.
I have too a question. I use 2 Filterscripts and both use a Dialog. 1 dialog work, but with the other dialog and if i klick on it the dialog just disapear. if i only load 1 then it works...
And i maked a Dialog and want to make if some klick on a Dialogtext that it SendCommand. But that Feature is only for NPCs... how do i can make for normal players?
Greets
Re: Little scripting questions -
Kurence - 03.10.2009
RE: Try other dialog IDs for both FS.
And command text by dialog?
try something like this under OnDialogResponse:
if(dialogid == DIALOG)
{
if(response)
{
OnPlayerCommandText(playerid, inputtext);
}
return 1;
}
Re: Little scripting questions -
Cedimedi - 03.10.2009
If i try
Код:
if(dialogid == DIALOGID+1) // Server Commands
{
if(response)
{
if(listitem == 0) // Spawn Car
if(response)
{
OnPlayerCommandText(playerid, inputtext);
(!strcmp(inputtext, "/car", true));
}
i can compile but it don't work ingame, how do you mean?
Re: Little scripting questions -
Kurence - 03.10.2009
oh no... you have to set the dialog style to dialog_style_inputbox
Re: Little scripting questions -
Cedimedi - 03.10.2009
can you show me please? ^^ the menu works perfect but if i klick on it nothing happens
Re: Little scripting questions -
Kurence - 03.10.2009
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_INPUTBOX, "Dialog", "Enter command text", "Ok", "Cancel");
and this under OnDialogResponse:
if(dialogid == DIALOGID)
{
if(!response) return 1;
if(response)
{
OnPlayerCommandText(playerid, inputtext);
}
return 0;
}
and this under OnPlayerCommandText:
if(!strcmp(cmdtext, "/car", true))
{
//COMMANDS HERE
return 1;
}
Re: Little scripting questions -
Dj_maryo1993 - 04.10.2009
I'm sorry for "puping in "
But ..
Код:
D:\Multiple\Servere\Sa-Mp\0.3\gamemodes\rostunt.pwn(484) : error 017: undefined symbol "DIALOG_STYLE_INPUTBOX"
Some help please
pawn Код:
if(strcmp(cmd, "/menutest", true) == 0)
{
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_INPUTBOX, "Dialog", "Enter command text", "Ok", "Cancel");
}
Re: Little scripting questions -
Correlli - 04.10.2009
It's "DIALOG_STYLE_INPUT", not "DIALOG_STYLE_INPUTBOX".
Re: Little scripting questions -
Cedimedi - 09.10.2009
Sorry for bump, couldn't script because of school. If i change bot DialogID's, i have the same problem. do they need to be the same or what?!
thanks, too for the menuscript.