Quote:
Originally Posted by [uL]Pottus
Command method
*Your code*
@LeeXian99 I disagree with doing this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response) { switch(dialogid) {
If you do that then you might have another switch(dialogid) when reponse is 0, this is not good it means the code would be separated from where response is 1 that could be a pain in the ass to work with it should really be the following code convention to prevent potentially hundreds of lines between areas of code that should be grouped for readability. But if I was using dialogs I would use y_inline and y_dialog anyways
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { if(response) { } else { } {
That is a far better practice.
|
I learned a lesson today! Thanks Pottus, rep.