SA-MP Forums Archive
Difference - 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: Difference (/showthread.php?tid=634362)



Difference - StrikerZ - 17.05.2017

Whats the difference between both codes?

PHP код:
enum 
{
    
DIALOG_TEST
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_TEST) { //code }
    
return 1;

PHP код:
#define DIALOG_TEST 1
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_TEST) { //code }
    
return 1;




Re: Difference - Toroi - 17.05.2017

Not much, the enum makes it easier to order the dialog ids as it provides a value depending on the order.


Re: Difference - coool - 17.05.2017

You don't have to worry about their ids you just keep them inserting in enum.


Re: Difference - StrikerZ - 17.05.2017

Alright thanks.


Re: Difference - Hansrutger - 17.05.2017

Note that DIALOG_TEST in the first equal to 0 though.