Max+ Posted July 5, 2014 Posted July 5, 2014 Hello , i made a gameMode , it has a lot of buttons , labels , dxdraw What iam Asking about is , can i make a tabel , to improt them and loop the table and it will automaticly make the buttons and labels and dxdraw , same thing with events can i make a table have like 3 events , and each event will do something , because my gameMode has like 120 lines of codes , - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
SkittlesAreFalling Posted July 5, 2014 Posted July 5, 2014 120 isn't BAD, but if you want it shorter you could externally store buttons and whatnot into SQLite, removing them staticly and replacing them dynamically reduces lines of code A LOT. Find more efficient code, efficient code usually decreases the amount of lines used to write the code. You can do a lot to reduce coding. http://www.prntscr.com/4fkwyj
Max+ Posted July 5, 2014 Author Posted July 5, 2014 i dont know about sql and i dont want to use it at all , i want like i posted above tables, if you know about tabel please show me , - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Max+ Posted July 6, 2014 Author Posted July 6, 2014 Can i get Some Help Please ? - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Dealman Posted July 6, 2014 Posted July 6, 2014 Google "lua tables" and "lua for loop". Read about how they work, and then try it yourself. There's no better way of learning than by trial and error. If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
#DRAGON!FIRE Posted July 7, 2014 Posted July 7, 2014 ex : local table = { labels = { 100, 100, 100, 100, 200, 200, 200, 200 }, buttons = { 300, 300, 300, 300, 500, 500, 500, 500 }, ["onClientResourceStart"] = { function1, function2 }, } CreateLabels = guiCreateLabel( table[1][1], table[1][2], table[1][3], table[1][4] ) for i = 1, #table["onClientResourceStart"] do addEventHandler( "onClientResourceStart", resourceRoot, table["onClientResourceStart"][i] ) end To Contact Me at Skype : [email protected]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now