Jump to content

vip database


Best-Killer

Recommended Posts

function test (player,cmd)
acc = getAccountName(getPlayerAccount(player))
if isPlayerVIP(acc) then
outputChatBox("Vip level"..tostring(isPlayerVIP(getAccountName(getPlayerAccount(player)))))
else
outputChatBox("error")
end
end
addCommandHandler("aa",test)
function isPlayerVIP(accountName)
	local check = exports.NGsql:db_query ( "SELECT * FROM vips_data WHERE acc=? ", getIDAccount(accountName))
	if ( type( check ) == "table" and #check == 0 ) or not check then
		return false
	else
		return check[1]["level"]
	end
end
function getIDAccount(player)
	plid = false
	pqr = exports.NGsql:db_query ( "SELECT * FROM accountdata WHERE id=? LIMIT 1", tonumber(player))
	for k, plas in ipairs (pqr) do
		plid = plas["Username"]
	end
	if not plid then return false end
	return plid
end

i'm geting in chat error -_-

i'm sure the accountid is in database and vip level .... ect

no errors what's worng guys

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...