Jump to content

Check Vip


Best-Killer

Recommended Posts

function test (p,cmd)
isPlayerVIP(p)
outputChatBox(tostring(isPlayerVIP(p)))
end
addCommandHandler("aa",test)


function isPlayerVIP(p)
	query = exports.NGsql:db_query ( "SELECT * FROM vips_data WHERE acc=? ", tostring(getPlayerID(getIDAccount(acc))))
	for _, vip in ipairs(query) do
     return tostring(vip["level"])
     end
	return "None"
end

if there player have vip all players will be have vip what is the problem pff

Link to comment

another code :

function test (p,cmd)
isPlayerVIP(p)
end
addCommandHandler("aa",test)


function isPlayerVIP(p)
	local acc = getAccountName ( getPlayerAccount ( p ) )
	query = exports.NGsql:db_query ( "SELECT * FROM vips_data WHERE acc=? ", tostring(getPlayerID(getIDAccount(acc))))
	if ( type ( query ) ~= "table" or #query < 1 ) then
		return outputChatBox("None")
		
	else
		return  outputChatBox(tostring(query[1]["level"]))
		
	end
end

what i got with that ?? 

if no one is vip ig then when player type /aa and he's not vip will get None and when is there Player Vip ig then other player type aa (and he's not Vip) he will get vip level of the other player in the chat pfffffff

what i want ??

if the player used /aa and he's not vip he get None and if he's vip player he get his level in the chat 

Link to comment
5 minutes ago, marty000123 said:

Shouldn't you work with get/setElementData?

already i use that in the scoreboard but you didn't understand bro :v  

if is there 1 play vip in game all players will be vip in scoreboard 

and see 

function test (p,cmd)
isPlayerVIP(p)
end
addCommandHandler("aa",test)

i'm testing for see it when fixed ;) 

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...