addEventHandler ( "onPlayerLogin", root,
function ( _, account )
dbQuery ( loadPlayersVIP, { source }, dbConnection, "SELECT level FROM Freeroam_VIP_Players WHERE account = ? LIMIT 1", getAccountName ( account ) )
end
)
function loadPlayersVIP ( query, who )
local sql, numrows, errmsg = dbPoll ( query, 0 )
if ( type ( sql ) == "table" and numrows > 0 ) then
setElementData ( who, "VIP", sql [ 1 ] [ "level" ] )
end
end