FelipeMallmann Posted January 28, 2014 Share Posted January 28, 2014 function togglePhone( source ) -- Show the phone if not guiGetVisible( phoneGui ) then showCursor ( true ) guiSetVisible( phoneGui, true ) -- Update player list guiGridListClear ( playerList ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) end end else showCursor ( false ) guiSetVisible( phoneGui, false ) end end addCommandHandler( "phone", togglePhone, source ) How to turn this just for member "VIP" can use? Link to comment
iPrestege Posted January 28, 2014 Share Posted January 28, 2014 You mean 'VIP Group' In the acl? Link to comment
FelipeMallmann Posted January 28, 2014 Author Share Posted January 28, 2014 Yes, for just who is VIP in acl, can use this command Link to comment
iPrestege Posted January 28, 2014 Share Posted January 28, 2014 Yes, for just who is VIP in acl, can use this command You can use data's : setElementData getElementData 'onPlayerLogin' -- Event 'onPlayerLogout' -- Event isObjectInACLGroup getAccountName Link to comment
Cocodrilo Posted January 29, 2014 Share Posted January 29, 2014 Try this client function togglePhone( ) -- Show the phone if not guiGetVisible( phoneGui ) then showCursor ( true ) guiSetVisible( phoneGui, true ) -- Update player list guiGridListClear ( playerList ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) end end else showCursor ( false ) guiSetVisible( phoneGui, false ) end end addEvent("showPhoneGui", true) addEventHandler("showPhoneGui", getRootElement(), togglePhone ) add this to server side function showGUI ( playerSource) if (not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("VIP"))) then outputChatBox ("You're not a VIP Member", playerSource, 255,0,0) return end triggerClientEvent ( "showPhoneGui", playerSource ) end addCommandHandler ( "phone", showGUI ) Pd: You must to be in ACL group "VIP" Link to comment
TAPL Posted January 29, 2014 Share Posted January 29, 2014 triggerClientEvent ( "showPhoneGui", playerSource ) Should be: triggerClientEvent ( playerSource, "showPhoneGui", playerSource ) Link to comment
Cocodrilo Posted January 29, 2014 Share Posted January 29, 2014 triggerClientEvent ( "showPhoneGui", playerSource ) Should be: triggerClientEvent ( playerSource, "showPhoneGui", playerSource ) I noticed too late my mistake. ty Link to comment
FelipeMallmann Posted January 29, 2014 Author Share Posted January 29, 2014 worked perfectly, thank you guys. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now