Hello, i have some problem on my code.
my code:
Citizen.CreateThread(function ()
while true do
local user_id = vRP.getUserId(source)
Citizen.Wait(2000)
print("qq "..function_name())
end
end)
function function_name()
-- body
local test = 0
MySQL.scalar("vRP/conha", {id = "1"}, function(rows, affected)
test = rows
print("abc "..rows)
end)
return test
end
my problem is i want on print qq return a value but return 0.
but on print abc return 3 (value i have on database)
some can explain why dont work?
sorry for my bad english and thanks for helping!