Jump to content

Rank system [Need help to tell how to do]


Sande

Recommended Posts

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

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
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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...