opnaiC Posted May 15, 2016 Posted May 15, 2016 Hello, since 1 weak I am making my own server. Now I need help 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.
Dimos7 Posted May 15, 2016 Posted May 15, 2016 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
opnaiC Posted May 15, 2016 Author Posted May 15, 2016 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 ?
opnaiC Posted May 15, 2016 Author Posted May 15, 2016 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 ;(
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