golanu21 Posted July 20, 2014 Share Posted July 20, 2014 hi i make this function local function getFactionRank( player ) accountIDDD = exports.players:getCharacterID(player) if not factionRankCache[ accountIDDD ] then local result = exports.sql:query_assoc_single( "SELECT factionRank FROM character_to_factions WHERE characterID = " .. accountIDDD ) if result then factionRankCache[ accountIDDD ] = { tick = getTickCount( ), factionRank = result.factionRank } else return false end else factionRankCache[ accountIDDD ].tick = getTickCount( ) end return factionRankCache[ accountIDDD ].factionRank end addCommandHandler("stats", function(player) factionname = "" factionID = getFactionID(player) if factionID == 1 then factionname = "Los santos Police Departament" elseif factionID == 2 then factionname = "School Instructors" end outputChatBox( "_____________________________________________________________", player, 255, 255, 255 ) outputChatBox( "STATUS", player, 255, 255, 255 ) outputChatBox( "", player, 255, 255, 255 ) outputChatBox( "Name: "..getPlayerName(player).." Money:"..exports.players:getMoney(player).. " BankMoney: " ..getAccountBalance(player).. " Faction: "..factionname.."(ID:"..getFactionID(player)..")", player, 255, 255, 255 ) outputChatBox( "FactionRank: "..getFactionRank(player), player, 255, 255, 255 ) outputChatBox( "_____________________________________________________________", player, 255, 255, 255 ) end) and when use the command ./stats. for the first time, the "factionrank" is 1...and when i change my rank to 3(for example) the factionrank .. is tot 1 why ? 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