Little scripting questions
#1

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

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

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

oh no... you have to set the dialog style to dialog_style_inputbox
Reply
#5

can you show me please? ^^ the menu works perfect but if i klick on it nothing happens
Reply
#6

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

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");
    }
Reply
#8

It's "DIALOG_STYLE_INPUT", not "DIALOG_STYLE_INPUTBOX".
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)