24.08.2016, 12:52
Hi,
Is there callback how to know when i show player dialog?
Is there callback how to know when i show player dialog?
#if defined OnPlayerDialogShown
OnPlayerDialogShown(playerid, dialogid);
#endif
#include <a_samp>
// your hook here
stock MyLib_ShowPlayerDialog(..)
{
}
#if defined _ALS_ShowPlayerDialog
#undef ShowPlayerDialog
#else
#define _ALS_ShowPlayerDialog
#endif
// Reroute future calls to our function.
#define ShowPlayerDialog MyLib_ShowPlayerDialog
#include <other includes...>
// somewhere in the script
forward OnPlayerDialogShown(playerid);
public OnPlayerDialogShown(playerid)
{
}
stock MyLib_ShowPlayerDialog(..params..)
{
#if defined OnPlayerDialogShown
OnPlayerDialogShown(playerid, dialogid);
#endif
return ShowPlayerDialog(..params..);
}
#if defined _ALS_ShowPlayerDialog
#undef ShowPlayerDialog
#else
#define _ALS_ShowPlayerDialog
#endif
#define ShowPlayerDialog MyLib_ShowPlayerDialog