17.10.2011, 21:03
So, I'm working on a script of mine, let's say, we add 3 items in my dialog.
Item1
Item2
Item3
Let's say I delete Item2, then my dialog becomes:
Item1
Item3
I can select Item1, but when I select item3 it won't select.
A good example is exactly what I need is in Zamaroht's textdraw editor, where you can delete and select created textdraws with ease.. I'm really stuck at this, I almost did like what Zamaroht did but I simply can't make it work! I just won't select the next textdraw.
Here is some pieces of code that might help you guys help me?
This code I use when selecting my textdraw.
And this is the code I have when deleting a textdraw.
Here's an image to explain better:
Maybe you understood me somehow
Item1
Item2
Item3
Let's say I delete Item2, then my dialog becomes:
Item1
Item3
I can select Item1, but when I select item3 it won't select.
A good example is exactly what I need is in Zamaroht's textdraw editor, where you can delete and select created textdraws with ease.. I'm really stuck at this, I almost did like what Zamaroht did but I simply can't make it work! I just won't select the next textdraw.
Here is some pieces of code that might help you guys help me?
This code I use when selecting my textdraw.
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;
}
}
}
And this is the code I have when deleting a textdraw.
pawn Код:
if(!response)
return OnPlayerCommandText(playerid, #/txd);
OnPlayerCommandText(playerid, "/txd");
TextDrawHideForAll(td_i[td_editing][td]);
td_i[td_editing][created] = 0;
td_i[td_editing][td_y] = 0.0;
td_i[td_editing][td_x] = 0.0;
td_i[td_editing][td_height] = 0.0;
td_i[td_editing][td_width] = 0.0;
td_i[td_editing][td_color] = RGB(HexToInt(#FF), HexToInt(#FF), HexToInt(#FF), HexToInt(#FF));
format(td_i[td_editing][td_name],30, " ");
td_editing = -1;
Maybe you understood me somehow