Sande Posted April 18, 2014 Posted April 18, 2014 Hello, i want to make rank system for teams. In my server if you do a carjacker mission you will get +1 criminal actions. I want to make system like when you have 100 criminal actions you will get rank up. Only thing what i had now. So pls, give some ideas or post little code where i can start. I am newbie in these things! thaanks local ranks { --TEAM, RANKNAME, REQUIRED ACTIONS {"Criminal", "Rat", "0" {"Criminal, "Mugger", 100" {"Police", "Trial", "0" {"Police, "Officer", "100" }
Sande Posted April 20, 2014 Author Posted April 20, 2014 Theres the ranks maybe working.. --TEAM, RANKNAME, REQUIRED ACTIONS ranks = {Criminal, "Street rat", "0"}, {Criminal, "Mugger", "100"}, {Police, "Trainee", "0"}, {Police, "Officer", "100"} What i should do next, give some functions. I have to code the rank-UP system when player gets 100 criminal actions he will become mugger etc.
justn Posted April 20, 2014 Posted April 20, 2014 Like this .. local ranks = { {"Criminal", "Street Rat", 0}, {"Criminal", "Mugger", 100}, {"Police", "Trainee", 0}, {"Police", "Officer", 100} }
Sande Posted April 20, 2014 Author Posted April 20, 2014 Like this .. local ranks = { {"Criminal", "Street Rat", 0}, {"Criminal", "Mugger", 100}, {"Police", "Trainee", 0}, {"Police", "Officer", 100} } Thank you, can you help me little make a some example how i can take information about tables.
Tete omar Posted April 20, 2014 Posted April 20, 2014 Like this .. local ranks = { {"Criminal", "Street Rat", 0}, {"Criminal", "Mugger", 100}, {"Police", "Trainee", 0}, {"Police", "Officer", 100} } Thank you, can you help me little make a some example how i can take information about tables. Example: local ranks = { {"Criminal", "Street Rat", 0}, {"Criminal", "Mugger", 100}, {"Police", "Trainee", 0}, {"Police", "Officer", 100} } ranks [ 1 ] -- {"Criminal", "Street Rat", 0} ranks [ 2 ] -- {"Criminal", "Mugger", 100} ranks [ 3 ] -- {"Police", "Trainee", 0} -- etc.. Note: This example should not be tested as it is just for clarifying how this works, and it will show an error as soon as you run it. Another example: local foo = { "bar", "baz", "anything" } outputChatBox ( foo [ 1 ] ) -- bar outputChatBox ( foo [ 2 ] ) -- baz outputChatBox ( foo [ 3 ] ) -- anything This is fine to be tested. Read more about Lua tables here: http://lua-users.org/wiki/TablesTutorial
Sande Posted April 20, 2014 Author Posted April 20, 2014 Like this .. local ranks = { {"Criminal", "Street Rat", 0}, {"Criminal", "Mugger", 100}, {"Police", "Trainee", 0}, {"Police", "Officer", 100} } Thank you, can you help me little make a some example how i can take information about tables. Example: local ranks = { {"Criminal", "Street Rat", 0}, {"Criminal", "Mugger", 100}, {"Police", "Trainee", 0}, {"Police", "Officer", 100} } ranks [ 1 ] -- {"Criminal", "Street Rat", 0} ranks [ 2 ] -- {"Criminal", "Mugger", 100} ranks [ 3 ] -- {"Police", "Trainee", 0} -- etc.. Note: This example should not be tested as it is just for clarifying how this works, and it will show an error as soon as you run it. Another example: local foo = { "bar", "baz", "anything" } outputChatBox ( foo [ 1 ] ) -- bar outputChatBox ( foo [ 2 ] ) -- baz outputChatBox ( foo [ 3 ] ) -- anything This is fine to be tested. Read more about Lua tables here: http://lua-users.org/wiki/TablesTutorial Thank you very much, now i have some idea how to working on it
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