From f8a18e3e51f9a5090596dde35897ee0de74bb50a Mon Sep 17 00:00:00 2001 From: Lorenc Date: Sun, 1 Apr 2018 08:50:59 +1000 Subject: [PATCH] hook dialog callback in dialog include because some modules avoid the security patches otherwise --- pawno/include/irresistible/cnr/dialog_ids.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pawno/include/irresistible/cnr/dialog_ids.inc b/pawno/include/irresistible/cnr/dialog_ids.inc index a4cdb77..0837e10 100644 --- a/pawno/include/irresistible/cnr/dialog_ids.inc +++ b/pawno/include/irresistible/cnr/dialog_ids.inc @@ -5,6 +5,9 @@ * Purpose: */ +/* ** Includes ** */ +#include < YSI\y_hooks > + /* ** Definitions ** */ #define DIALOG_REGISTER 1000 #define DIALOG_LOGIN 1001 @@ -161,3 +164,15 @@ #define DIALOG_AIRPORT 1153 #define DIALOG_CASINO_BAR 1154 #define DIALOG_ACC_EMAIL 1155 + +/* ** Hooks ** */ +hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) +{ + // make a confirmation/cancellation sound between dialogs + if ( response ) PlayerPlaySound( playerid, 1083, 0.0, 0.0, 0.0 ); // Confirmation sound + else PlayerPlaySound( playerid, 1084, 0.0, 0.0, 0.0 ); // Cancellation sound + + // replace % with # in dialogs + if ( strlen( inputtext ) ) strreplacechar( inputtext, '%', '#' ); // The percentage injection crasher (critical) + return 1; +}