I'm stuck at this...totally
#4

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
I see a bit of redundant code:

pawn Код:
new id;
for(new t=-1; t < MAX_TEXTDRAWS; t ++)
{
    if(td_i[t][created])
    {
        if(id == listitem)
        {
            td_editing = t;
            SendClientMessageEx(playerid, -1, "Selected sprite id {FF0000}%d{FFFFFF}.", td_editing);
            break;
        }
    }
}
What's the purpose of the "id" variable? You're creating it and not assigning a value to it, so basically what your if statement says is:

pawn Код:
if(0 == listitem)
Which is pretty redundant, that variable seems utterly pointless!
While I decided to make a topic about this problem I've reversed my code back by pressing Ctrl+z, and didn't notice that id++; was missing.

It was like this:
pawn Код:
new id;
for(new t=-1; t < MAX_TEXTDRAWS; t ++)
{
    if(td_i[t][created])
    {
        if(id == listitem)
        {
            td_editing = t;
            SendClientMessageEx(playerid, -1, "Selected sprite id {FF0000}%d{FFFFFF}.", td_editing);
            break;
        }
        id++'
    }
}
I'm really stuck I have no idea how Zamaroht did it, I've tried to understand, but I can't actually..
He's a sort of a genius of the way he thought of scripting that textdraw editor!
Reply


Messages In This Thread
I'm stuck at this...totally - by Zh3r0 - 17.10.2011, 21:03
Re: I'm stuck at this...totally - by DiDok - 17.10.2011, 21:17
Re: I'm stuck at this...totally - by JaTochNietDan - 17.10.2011, 21:27
Re: I'm stuck at this...totally - by Zh3r0 - 18.10.2011, 03:58
Re: I'm stuck at this...totally - by DiDok - 18.10.2011, 14:17

Forum Jump:


Users browsing this thread: 2 Guest(s)