Jump to content

[HELP] Rank system in a Team


opnaiC

Recommended Posts

Hello,

since 1 weak I am making my own server. Now I need help :D

Anybody knows how I can setup a rank system in the team.

Example in LSPD: cadet, chief, ...

I dont want to use mysql. So is there any other way with XML or the standart .db?

Hope you can help me. It would be cool if could show me any examples, because there is really nothing in the public about this.

Link to comment
local Ranks = {  
    {"Cadet", 1}, 
    {"Officer", 2}, 
    {"Senior Officer", 3} 
    {"Sergeant", 4} 
    {"Lieutenant", 5} 
    {"Captain", 6}, 
    {"Deputy Chief", 7} 
    {"Chief", 8} 
} 
  
function rankAPlayer(thePlayer) 
    for i = 1, #Ranks do  
        if not Rank[i] then 
           Rank[i] = source 
           setElementData(source, "Rank", i) 
           break; 
           connect = dbConnect("sqlite", "simple.db") 
           dbExec(connect, "CREATE TABLE IF NOT EXIST `faction` (`name`, `faction`, `rank`)") 
           dbExec(connect, "INSERT INTO faction (name, faction ,rank) VALUES", getPlayerName(source), getElementData(source, "faction"), i) 
        end 
    end 
enda 
  

Link to comment
local Ranks = {  
    {"Cadet", 1}, 
    {"Officer", 2}, 
    {"Senior Officer", 3} 
    {"Sergeant", 4} 
    {"Lieutenant", 5} 
    {"Captain", 6}, 
    {"Deputy Chief", 7} 
    {"Chief", 8} 
} 
  
function rankAPlayer(thePlayer) 
    for i = 1, #Ranks do  
        if not Rank[i] then 
           Rank[i] = source 
           setElementData(source, "Rank", i) 
           break; 
           connect = dbConnect("sqlite", "simple.db") 
           dbExec(connect, "CREATE TABLE IF NOT EXIST `faction` (`name`, `faction`, `rank`)") 
           dbExec(connect, "INSERT INTO faction (name, faction ,rank) VALUES", getPlayerName(source), getElementData(source, "faction"), i) 
        end 
    end 
enda 
  

Where do you have that from ?

And will this create a simple.db where the ranks will be saved right ?

Link to comment
local Ranks = {  
    {"Cadet", 1}, 
    {"Officer", 2}, 
    {"Senior Officer", 3} 
    {"Sergeant", 4} 
    {"Lieutenant", 5} 
    {"Captain", 6}, 
    {"Deputy Chief", 7} 
    {"Chief", 8} 
} 
  
function rankAPlayer(thePlayer) 
    for i = 1, #Ranks do  
        if not Rank[i] then 
           Rank[i] = source 
           setElementData(source, "Rank", i) 
           break; 
           connect = dbConnect("sqlite", "simple.db") 
           dbExec(connect, "CREATE TABLE IF NOT EXIST `faction` (`name`, `faction`, `rank`)") 
           dbExec(connect, "INSERT INTO faction (name, faction ,rank) VALUES", getPlayerName(source), getElementData(source, "faction"), i) 
        end 
    end 
enda 
  

Where do you have that from ?

And will this create a simple.db where the ranks will be saved right ?

This script dont help me and it isnt working. Have a big problem now with my factions ;(

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