• How do I make custom meta function tables?
    6 replies, posted
For example how DarkRP do their job system: TEAM_CITIZEN = DarkRP.createJob("Citizen", {     color = Color(20, 150, 20, 255),     model = {         "models/player/Group01/Female_01.mdl",         "models/player/Group01/Female_02.mdl",         "models/player/Group01/Female_03.mdl",         "models/player/Group01/Female_04.mdl",         "models/player/Group01/Female_06.mdl",         "models/player/group01/male_01.mdl",         "models/player/Group01/Male_02.mdl",         "models/player/Group01/male_03.mdl",         "models/player/Group01/Male_04.mdl",         "models/player/Group01/Male_05.mdl",         "models/player/Group01/Male_06.mdl",         "models/player/Group01/Male_07.mdl",         "models/player/Group01/Male_08.mdl",         "models/player/Group01/Male_09.mdl"     },     description = [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]],     weapons = {},     command = "citizen",     max = 0,     salary = GAMEMODE.Config.normalsalary,     admin = 0,     vote = false,     hasLicense = false,     candemote = false,     category = "Citizens", }) I know it's something to do with meta functions but I do not know how to make a meta function in to a table like this.
it's not meta
What would I do then to make custom table functions?
I don't think you understand what meta tables/functions are. What exactly is it that you're trying to accomplish?
Something similar to how DarkRP do their job system. And I don't fully understand meta functions and meta tables.
The example you posted just shows DarkRP.createJob. That's not a meta table function, it's just a function part of the DarkRP package. I'd imagine it probably creates a table holding the job info you provided, then returns an ID to be stored in TEAM_CITIZEN. You can see specifically by looking at the API docs or the code.
Meta tables are used to make custom methods for specified classes. There are built-in methods that gmod comes with for the player class like Give(). But if you wanted to make your own, you would access the player meta table.
Sorry, you need to Log In to post a reply to this thread.