Jump to content

Problem, need help!


Ronizzz

Recommended Posts

Hi, guys i have a problem doing a little vip panel. I want to do a type of whitelist to use it but with ACL'S groups. The problem is the next attempt to call global 'isPlayerInACL'(a nil value)

Spoiler
  1. -----------PANEL VIP ---------
  2. bindKey ( "x", "down", function whitelist( )
  3.         local state = ( not guiGetVisible ( Ventana ))
  4.         guiSetVisible ( Ventana, state )
  5.     showCursor ( state )
  6. end
  7. )
Spoiler
  1. function whitelist (thePlayer) 
  2.  local thePlayer = getPlayerAccount
  3.  if isPlayerInACL(thePlayer, "VIP") then
  4.   outputChatBox("Access Granted!")
  5.    else
  6.   outputChatBox("Access Denied!")
  7.  end
  8. end
  9. addCommandHandler("panelvip", whitelist)

 

Edited by Ronizzz
Link to comment

you forget to add the code of isPlayerInACl :v 


function isPlayerInACL ( player, acl )
	local account = getPlayerAccount ( player )
	if ( isGuestAccount ( account ) ) then
		return false
	end
        return isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup ( acl ) )
end

function whitelist (thePlayer) 
 local thePlayer = getPlayerAccount
 if isPlayerInACL(thePlayer, "VIP") then
  outputChatBox("Access Granted!")
   else
  outputChatBox("Access Denied!")
 end
end
addCommandHandler("panelvip", whitelist)

 

  • Like 1
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...