Sande Posted April 18, 2014 Share 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" } Link to comment
justn Posted April 20, 2014 Share Posted April 20, 2014 You didn't even do the table right .. Link to comment
Sande Posted April 20, 2014 Author Share 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. Link to comment
justn Posted April 20, 2014 Share Posted April 20, 2014 Like this .. local ranks = { {"Criminal", "Street Rat", 0}, {"Criminal", "Mugger", 100}, {"Police", "Trainee", 0}, {"Police", "Officer", 100} } Link to comment
Sande Posted April 20, 2014 Author Share 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. Link to comment
Sande Posted April 20, 2014 Author Share Posted April 20, 2014 Read mta wiki. Thanks for helping.. Link to comment
Tete omar Posted April 20, 2014 Share 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 Link to comment
Sande Posted April 20, 2014 Author Share 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 Link to comment
Tete omar Posted April 20, 2014 Share Posted April 20, 2014 You're welcome, very glad this helps . Link to comment
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