PleaseScript Posted October 19, 2012 Share Posted October 19, 2012 Oa likes what I do to open that panel only with admin Thanks Client Side function Window ( ) if ( guiGetVisible ( GUIEditor_Window[1] ) == true ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) else guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end end GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(158,61,267,377,"Teleports By xRg3'iSantista",false) guiSetAlpha(GUIEditor_Window[1],1) GUIEditor_Button[1] = guiCreateButton(10,51,104,30,"Las Venturas",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"default-bold-small") GUIEditor_Button[2] = guiCreateButton(11,95,104,30,"Los Santos",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[2],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(10,141,104,30,"San Fierro",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[3],"default-bold-small") GUIEditor_Button[4] = guiCreateButton(10,188,104,30,"Area 51",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[4],"default-bold-small") GUIEditor_Button[5] = guiCreateButton(10,234,104,30,"Aero LV",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[5],"default-bold-small") GUIEditor_Button[6] = guiCreateButton(144,51,104,30,"Aero SF",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[6],"default-bold-small") GUIEditor_Button[7] = guiCreateButton(144,95,104,30,"Aero LS",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[7],"default-bold-small") GUIEditor_Button[8] = guiCreateButton(143,140,104,30,"Aero AB",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[8],"default-bold-small") GUIEditor_Button[9] = guiCreateButton(142,188,104,30,"Casa Do CJ",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[9],"default-bold-small") GUIEditor_Button[10] = guiCreateButton(142,235,104,30,"Praia",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[10],"default-bold-small") GUIEditor_Image[1] = guiCreateStaticImage(13,270,239,78,"180761_Papel-de-Parede-Reggae--180761_1152x864.jpg",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(7,22,247,19,"|||||||||||||||||||||||||||||||||||||||||||||||||||||||||",false,GUIEditor_Window[1]) GUIEditor_Button[11] = guiCreateButton(13,350,245,18,"Sair / Close",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[11],"default-bold-small") guiSetVisible(GUIEditor_Window[1],false) bindKey ( "F4","down", Window ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[11]) then guiSetVisible( GUIEditor_Window[1], false ) showCursor( false ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[1]) then local player = getLocalPlayer() setElementPosition (player , 2083.8010253906, 1542.1982421875,10.8203125 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[2]) then local player = getLocalPlayer() setElementPosition (player , 1188.6821289063, -1324.6730957031, 13.567060470581 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[3]) then local player = getLocalPlayer() setElementPosition (player , -1977.5372314453, 249.90628051758, 35.171875 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[4]) then local player = getLocalPlayer() setElementPosition (player , 212.32801818848, 1917.9499511719, 17.640625 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[5]) then local player = getLocalPlayer() setElementPosition (player , 1582.9320068359, 1534.15625, 10.831702232361 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[6]) then local player = getLocalPlayer() setElementPosition (player , -1654.4792480469, -166.14811706543, 14.1484375 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[7]) then local player = getLocalPlayer() setElementPosition (player ,1877.9274902344,-2363.5681152344, 13.5546875 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[8]) then local player = getLocalPlayer() setElementPosition (player ,423.60571289063,2526.8220214844, 16.563385009766 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[9]) then local player = getLocalPlayer() setElementPosition (player ,2494.4189453125,-1682.2431640625,13.338448524475 ) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == GUIEditor_Button[10]) then local player = getLocalPlayer() setElementPosition (player ,833.18756103516,-2052.388671875,12.8671875 ) end end ) Link to comment
myonlake Posted October 19, 2012 Share Posted October 19, 2012 isObjectInACLGroup getElementData setElementData Link to comment
Baseplate Posted October 19, 2012 Share Posted October 19, 2012 PleaseScript, what's the way that identifies your VIP? ACL or Element Data? Link to comment
Dev Posted October 19, 2012 Share Posted October 19, 2012 You can either provide the permission to a specific object in the ACL or use the Element data to set and identify it's virtual permissions, like 'admin'. For example, if ( getElementData( thePlayer, 'admin' ) == 1 ) then Or, local accountName = getAccountName( getPlayerAccount ( thePlayer ) ) -- Account name ( e.g, Dev ) if ( isObjectInACLGroup('user.'.. accountName, aclGetGroup( 'Admin' ) ) ) then -- user.Dev ACL Layout for this would be, <group name="Admin"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <!-- User account name added as an object --> <object name="user.Dev"></object> </group> Link to comment
myonlake Posted October 19, 2012 Share Posted October 19, 2012 PleaseScript, what's the way that identifies your VIP? ACL or Element Data? We are not here to give away codes. Please check out those functions from the Wiki. Link to comment
Techial Posted October 19, 2012 Share Posted October 19, 2012 I think you got this guy wrong, he's not the OP. @Samer - That's actually a good question, as you can't know if he uses ACL or getAccountData / setAccountData. Link to comment
HunT Posted October 19, 2012 Share Posted October 19, 2012 Server: function checkPermission(thePlayer) if ( hasObjectPermissionTo ( thePlayer, "command.kick", true ) ) then -- can u change the command triggerClientEvent (thePlayer, "openVipGui", getRootElement()) else outputChatBox ("Access denied", thePlayer, 255, 0, 0) -- can u change the reason end end function onResStart () for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "F1", "down", checkPermission ) -- can u change the bindKey end end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), onResStart) Client : Vip = 0 function guiVip () if Vip==0 then Vip = 1 showCursor ( true ) TheWindow = guiCreateWindow --[[ -- All GUI Elements Here ]] elseif Vip==1 then Vip = 0 guiSetVisible(TheWindow, false) showCursor(false) end end Vip = 0 addEvent("openVipGui", true) addEventHandler("openVipGui", getResourceRootElement(getThisResource()), guiVip) Link to comment
Baseplate Posted October 20, 2012 Share Posted October 20, 2012 That's what I meant myonlake...cause we dunno about his System 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