So in my gamemode when someone creates a character they input a citizen id. The citizen id is the primary key for my data tables so i don’t ever want duplicates. (even though I couldn’t…)
To assure that none of this will happen I am attempting to try and select the cid out of the database to see if it actually exists and isn’t nil.
local cid = args
if Liquid.IssueCID(ply,cid) == false then
Liquid.Notify(ply, “Error: Citizen I.D. is already in use! Choose Another!”)
This is in the console command where I am calling the database function to do the checking for me and return a value of true/false.
local check = tmysql.query(“SELECT cid FROM liquidrp_characters WHERE cid=’”…tostring(cid)…"’", function(res)
if !res or !res[“cid”] or !res then
However, the probem is, its still just trying to add it anyway like its not working. Would anyone happen to know what is wrong with these two blocks of code?