Querying is pretty simple. Have you actually tried it yourself? You might learn more doing so.
LuaFunctions.cpp (Methods, etc) and
HookMgr.h (Hooks, event #, etc) can help you if needed, just need to look through it.
I made a script for you. Though, if there's issues with it someone else could help you fix them or I can if nobody has.
Code:
local function PlayerUpdateZone(event, player, newZone, newArea)
if (newZone == 3518 and newArea == 3631) then
local result = CharDBQuery("SELECT columnVal FROM premium WHERE acctId='"..player:GetAccountId().."'") -- Change columnVal to the column we're pulling the 'value 1' from. Also change 'acctId' column name to the appropriate column name that is in your table
local val = result:GetBool(0)
if not val then
player:TeleportTo(530, x, y, z, o) -- Change x, y, z, o to the location you want to send them
player:SendNotification("You cannot come to this zone/area!")
end
end
end
RegisterPlayerEvent(27, PlayerUpdateZone)
I'm not too comfortable using the CharDBQuery in that certain event because it will be used every time someone goes into that zone/area. Would be best to create a table and adding the premium column values in there at server start up. HOWEVER, you did NOT give enough information about the table so I cannot help you doing that until you can supply the table structure. Make sure to read the comments I left in the script. Enjoy.