Saving Space.
#1

I'm trying to simplify my code because i don't like have 10k lines and 20% are just waste lines and could be gunned down to 5k,so my question today is that i've 100 cases..
case 1:
case 2:
etc etc..

and i want to show a specific textdraw for each of these cases and i cant do case 1..100: so repeat the show textdraw for the 100 cases is a good thing or bad thing?
Reply
#2

Do you have an example of what you want? What you're saying doesn't really make sense to me.
Reply
#3

If the TextDraws are like: gtdTextDraw[0], gtdTextDraw[1], etc.

Then you can show them with: gtdTextDraw[the value in switch]
Reply
#4

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
If the TextDraws are like: gtdTextDraw[0], gtdTextDraw[1], etc.

Then you can show them with: gtdTextDraw[the value in switch]
....

A textdraw is never hidden until you hide it,so show the textdraw for case 0: and it will show for the other 99 cases thus saving 1 line everycase.
Reply
#5

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
....

A textdraw is never hidden until you hide it,so show the textdraw for case 0: and it will show for the other 99 cases thus saving 1 line everycase.
You could just create another function that does the same thing, but hides the TextDraw. If required, you could save the last index shown in a variable and hide the TextDraw using that index.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)