-
-
Save spacemud/219c241a23707b5a12efcbf61f28d6e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define INVALID_DIALOG_ID (cellmin) | |
static stock | |
gPrev[MAX_PLAYERS] = { INVALID_DIALOG_ID, ... }, | |
gCur[MAX_PLAYERS] = { INVALID_DIALOG_ID, ... }, | |
bool:gOPDR = true; | |
hook function ShowPlayerDialog(playerid, dialogid, style, const caption[], const info[], const button1[], const button2[]) | |
{ | |
gCur[playerid] = dialogid; | |
if (gOPDR) | |
gPrev[playerid] = INVALID_DIALOG_ID; | |
return continue(playerid, dialogid, style, caption, info, button1, button2); | |
} | |
stock GetPreviousDialog(playerid) | |
{ | |
return 0 <= playerid < MAX_PLAYERS ? gPrev[playerid] : INVALID_DIALOG_ID; | |
} | |
hook public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
{ | |
gOPDR = false; | |
gCur[playerid] = INVALID_DIALOG_ID; | |
continue(playerid, dialogid, response, listitem, inputtext); | |
gPrev[playerid] = (gCur[playerid] == INVALID_DIALOG_ID) ? INVALID_DIALOG_ID : dialogid; | |
gOPDR = true; | |
return 1; | |
} | |
hook public OnPlayerConnect(playerid) | |
{ | |
gPrev[playerid] = gCur[playerid] = INVALID_DIALOG_ID; | |
continue(playerid); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment