Dynamic textdraws
#1

Anybody here knows how to make dynamic textdraws? I mean like: a weapon shop with a list of weapons in arrays, then instead of creating a new textdraw for each weapon name, the script will read this array and auto create the textdraw. Any tip?
Reply
#2

You mean like in singleplayer? When you walk in ammunation you can buy weapons etc?
Reply
#3

Emh i think you dont understand what i said.
Reply
#4

14:57 [MG]Dimi Erm Face
14:57 Meelis13 lol
14:57 Meelis13 for shop i guess
14:57 [MG]Dimi Make enum with data
14:57 Beremix yes
14:57 [MG]Dimi ex.
14:58 [MG]Dimi Name
14:58 [MG]Dimi Price
14:58 [MG]Dimi Type (0 weapon, 1 vehicle)
14:58 *** Passord quit (User Disconnect: )
14:58 [MG]Dimi ShopID
14:58 *** Passord joined #MG
14:58 +++ Mini-Games has given op to Passord
14:58 *** DjJunior quit (Quit: http://www.mibbit.com ajax IRC Client)
14:58 [Air]Albers14 such skills, so many data much pawno
14:58 [Air]Albers14 xd
14:58 [MG]Dimi ID (vehicle if Type = 1 and weapon = 0)
14:58 *** DjJunior joined #MG
14:58 +++ Mini-Games has given voice to DjJunior
14:59 [MG]Dimi etc.
14:59 [MG]Dimi then you calculate start of textdraw
14:59 Passord so much
14:59 Passord sex
15:00 [MG]Dimi ex. x= 5, y = 200
15:00 [MG]Dimi and then offset
15:00 [MG]Dimi First item goes y (200) + x (Item ID = 0) * 25 (for example)
15:00 RadioBot RADIO NEWS: Party non stop with DjJunior - #MG RADIO
15:00 [MG]Dimi then you go item ID++
15:00 [MG]Dimi and in next it will be 200+ 1*25
15:00 [MG]Dimi third will be
15:01 [MG]Dimi 200+2*25
15:01 [MG]Dimi and os on
15:01 [MG]Dimi and so on*
15:01 [MG]Dimi if your enum is sItems
15:01 [MG]Dimi you make variable
15:02 [MG]Dimi new ShopItems[MAX_SHOP_ITEMS][sItems];
15:02 [MG]Dimi Define somewhere MAX_SHOP_ITEMS
15:02 [MG]Dimi and then to display certain shop you use loop
15:02 [MG]Dimi for(new i=0; i < MAX_SHOP_ITEMS; i++)
15:02 [MG]Dimi {
15:03 [MG]Dimi if(ShopItems[i][ShopID] == 1) //for example
15:03 [MG]Dimi {
15:03 Passord yes
15:03 [MG]Dimi /add it to shop textdraw group
15:03 [MG]Dimi }
15:03 [MG]Dimi }
15:03 [MG]Dimi and that's it
15:03 [MG]Dimi not that hard
15:03 [MG]Dimi And since you are **** IM gonna go post this in SA-Mp Topic


Quick tutorial I gave you on IRC while you were AFK.
Reply
#5

Can You Explain More?! Please
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)