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:
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!