FelipeMallmann Posted January 28, 2014 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?
FelipeMallmann Posted January 28, 2014 Author Posted January 28, 2014 Yes, for just who is VIP in acl, can use this command
iPrestege Posted January 28, 2014 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
Cocodrilo Posted January 29, 2014 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"
TAPL Posted January 29, 2014 Posted January 29, 2014 triggerClientEvent ( "showPhoneGui", playerSource ) Should be: triggerClientEvent ( playerSource, "showPhoneGui", playerSource )
Cocodrilo Posted January 29, 2014 Posted January 29, 2014 triggerClientEvent ( "showPhoneGui", playerSource ) Should be: triggerClientEvent ( playerSource, "showPhoneGui", playerSource ) I noticed too late my mistake. ty
FelipeMallmann Posted January 29, 2014 Author Posted January 29, 2014 worked perfectly, thank you guys.
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