• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X I have problem in my code

claws2012

Member
Joined
Feb 22, 2023
Messages
27
Solutions
1
Reaction score
12
Everything is fine, but there is no problem at all with the server or with the script, but nothing about this script appears

local accountFlags = {}

function getPlayerFlags(cid)
if not isPlayer(cid) then
return nil
end

local accountId = getPlayerAccountId(cid)
if accountFlags[accountId] then
return accountFlags[accountId]
end

local flagResult = db.getResult("SELECT flag FROM accounts WHERE id = " .. db.escapeString(accountId))
if(flagResult:getID() == -1) then
return nil
end

local flag = flagResult:getDataString("flag")
flagResult:free()

accountFlags[accountId] = flag

return accountFlags[accountId]
end

function onThink(interval, lastExecution)
local players = getOnlinePlayers()
if players then
for i, cid in ipairs(players) do
if not isPlayerGhost(cid) and isPlayer(cid) then
doSendMagicEffect(getPlayerPosition(cid), 5)
local flags = getPlayerFlags(cid)
if flags then
doSendAnimatedText(cid, 'Flag: ' .. flags, TEXTCOLOR_RED)
end
end
end
end
return true
end

Screenshot_1.png
 
Back
Top