public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/FAQ", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "Frequently Asked Questions", "Server Related Questions\nClasses Help\nCars & Houses\nAirlines\nAdminstartion, "Select", "Cancel"); return 1; } |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response == 1) //clicked first button
{
switch(dialogid)
{
case 1: //Your dialog - (case YourDialogID:)
{
switch(listitem)
{
case 0: //the first listitem
{
ShowPlayerDialog(playerid,YOURDIALOG,DIALOG_STYLE_MSGBOX,"Header","Message","Button1","Button2");
}
}
}
}
}
if(response == 0) //clicked second button
{
switch(dialogid)
{
case 1: //your msgbox dialog
{
//DoWhateverYouWantHere
}
}
}
return 0;
}
C:\Users\Jot\Desktop\FAQ.pwn(17) : error 001: expected token: "-string end-", but found "-identifier-" C:\Users\Jot\Desktop\FAQ.pwn(17) : error 017: undefined symbol "Select" C:\Users\Jot\Desktop\FAQ.pwn(17) : warning 215: expression has no effect C:\Users\Jot\Desktop\FAQ.pwn(17) : error 001: expected token: ";", but found "-identifier-" C:\Users\Jot\Desktop\FAQ.pwn(17) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response == 1)
{
switch(dialogid)
{
case 0:
{
ShowPlayerDialog(listitem 1 stuff here);
}
case 1:
{
ShowPlayerDialog(listitem 2 stuff here);
}
}
}
}
#define DIALOG_FAQ 1
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/faq", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, DIALOG_FAQ, DIALOG_STYLE_LIST, "Frequently Asked Questions", "Server Related Questions\nClasses Help\nCars & Houses\nAirlines\nAdminstartion", "Select", "Cancel");
return 1;
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
case DIALOG_FAQ:
{
if(response)
{
switch(listitem)
{
case 0:
{
//Server Related Questions
}
case 1:
{
//Classes Help
}
case 2:
{
//Cars & Houses
}
case 3:
{
//Airlines
}
}
}
}
return 1;
}
Maybe look through GF edits and see how they did it, and it might give you an idea.
|