Help with my Name Colour Script?
#7

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.
Reply


Messages In This Thread
Help with my Name Colour Script? - by CrystalMethod - 21.04.2013, 04:47
AW: Help with my Name Colour Script? - by [AK]Nazgul - 21.04.2013, 05:06
Re: Help with my Name Colour Script? - by LeeXian99 - 21.04.2013, 05:45
Re: Help with my Name Colour Script? - by Pottus - 21.04.2013, 05:59
Re: Help with my Name Colour Script? - by kalanerik99 - 21.04.2013, 08:48
Re: Help with my Name Colour Script? - by Parker_Daley - 21.04.2013, 08:54
Re: Help with my Name Colour Script? - by LeeXian99 - 21.04.2013, 08:58
Re: Help with my Name Colour Script? - by Guest123 - 21.04.2013, 09:05
Re: Help with my Name Colour Script? - by Guest123 - 21.04.2013, 09:19
Re: Help with my Name Colour Script? - by CrystalMethod - 21.04.2013, 16:03

Forum Jump:


Users browsing this thread: 1 Guest(s)