SA-MP Forums Archive
Should I change "ShowPlayerDialogEx" to "ShowPlayerDialog"? - 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)
+--- Thread: Should I change "ShowPlayerDialogEx" to "ShowPlayerDialog"? (/showthread.php?tid=449399)



Should I change "ShowPlayerDialogEx" to "ShowPlayerDialog"? - Grooty - 08.07.2013

ShowPlayerDialogEx causes a crash in the compiler, idk why.
The define is...
Код:
// Anti Dialog ID spoofing
#define         ShowPlayerDialogEx(%0, %1, %2, %3, %4, %5, %6)              ShowPlayerDialog(%0, %1, %2, %3, %4, %5, %6) \
	SetPVarInt(%0, "dialog", %1)
stock ShowPlayerDialogEx(playerid, dialogid, style, caption[], info[], button1[], button2[]) {
	SetPVarInt(playerid, "dialog", dialogid);
	ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);

	return 1;
}
What can I do to get rid of the crash? Change ShowPlayerDialogEx to ShowPlayerDialog?


Re: Should I change "ShowPlayerDialogEx" to "ShowPlayerDialog"? - SuperViper - 08.07.2013

pawn Код:
#define ShowPlayerDialogEx(%0,%1,%2,%3,%4,%5,%6) ShowPlayerDialog(%0, %1, %2, %3, %4, %5, %6); \
    SetPVarInt(%0, "dialog", %1)
First stop putting random spaces in your macros. Second, the parameters of the "function" you're making in the macro may not have spaces between them. Lastly, you need a semicolon at the end of your first statement if you plan to have more.