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 ?