Dialog help! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog help! (
/showthread.php?tid=136806)
Dialog help! -
Assyria - 26.03.2010
Hey!
Код:
#include <a_samp>
#if defined FILTERSCRIPT
#else
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Jobs", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 157, DIALOG_STYLE_LIST, "Job information", "Police \nPilot \nTaxi", "Select", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 157 && response)
{
switch(listitem)
{
case 0:
{
SendClientMessageToAll(0xAA0000AA,"Type /Police to see information about police job!");
}
case 1:
{
SendClientMessage(playerid,0xAA0000AA,"Type /Pilot to see information about pilot job!");
}
case 2:
{
SendClientMessage(playerid,0xAA0000AA,"Type /Taxi to see information about taxi job!");
}
}
}
return 1;
}
#endif
When I do /jobs, the menu pops up well and things work great, UNTIL
When I select any of those "Police, Pilot, Taxi" -> NOTHING pops up, what should happen is that SendClientMessage sends the message for that selection.
It Compiles without errors or warnings.
Anyone knows whats wrong?
Regards,
Assyria
Re: Dialog help! -
MadeMan - 26.03.2010
It should be DIALOG_STYLE_LIST
Re: Dialog help! -
Assyria - 26.03.2010
Oh, It was but I changed for a try for that. That didnt work too.
Re: Dialog help! -
MadeMan - 26.03.2010
You press the button too after you select it?
Re: Dialog help! -
Assyria - 26.03.2010
Yes
Re: Dialog help! -
MadeMan - 26.03.2010
This code is working, it has to be something else.
Re: Dialog help! -
Assyria - 26.03.2010
Yes, code is working, but when I select example, "Police" and click "Select"... nothing happeds... What should happen is come a message what I have set with SendClientMessage in case 0
Re: Dialog help! -
MadeMan - 26.03.2010
I mean I tested this code and I can see the message.
Re: Dialog help! -
Assyria - 31.03.2010
bump
Re: Dialog help! -
[WF]Demon - 31.03.2010
pawn Код:
#include <a_samp>
#if defined FILTERSCRIPT
#else
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Jobs", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Job information", "Police \nPilot \nTaxi", "Select", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 157 && response)
{
switch(listitem)
{
case 0:
{
SendClientMessageToAll(0xAA0000AA,"Type /Police to see information about police job!");
}
case 1:
{
SendClientMessage(playerid,0xAA0000AA,"Type /Pilot to see information about pilot job!");
}
case 2:
{
SendClientMessage(playerid,0xAA0000AA,"Type /Taxi to see information about taxi job!");
}
}
}
return 1;
}
#endif
thats not the fixed im saying is it because /jobs has
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Job information", "Police \nPilot \nTaxi", "Select", "Cancel");
the id 1 and dialog response has
pawn Код:
if(dialogid == 157 && response)
{
? i bet it is...