Jump to content

[Help] in GUI


HunT

Recommended Posts

I guys. I have the little problem with my new job in GUI

code:

imageLogo = guiCreateStaticImage(12,14,328,236,"img/panel.png",false,bigWindow) 
          guiMoveToBack (imageLogo , true) 

image :

20110904201828.png

My problem is the image :|

The image have guiMoveToBack but i press the image with the mouse and the image move to up.

I search the solution in wiki but nothing. . .its possible freeze the image to back?

Tnx all .

Sorry for my patetic english but don't use the traductor

Link to comment

Other Problem/Suggestion :|

Problem Nr.1 guiGridListSetScrollBars

The Wiki Say's :

bool guiGridListSetScrollBars ( element guiGridlist, bool horizontalBar, bool verticalBar ) 

Ok i want only the verticalBar and set this :

driversList = guiCreateGridList(28,85,146,149,false,bigWindow) 
            guiGridListSetScrollBars ( driversList, false , true )  

Test and show horizontalBar and verticalBar :cry: why?

This is image :

testmf.png

-------------------------------------------------------------

Suggestion Nr.1 guiSetProperty

i have this for color Botton test:

botton1 = guiCreateButton(186,28,57,12,"Push",false,bigWindow) 
        guiSetProperty( botton1, "NormalTextColour", "FFFA8200" ) 
        guiSetProperty( botton1, "PushedTextColour", "FFFF0000" ) 
        guiSetProperty( botton1, "HoverTextColour", "FFA0A0A0" ) 
        guiSetFont(botton1,"default-small") 

Ok i need the info for give the botton sound . . . .no onClientGUIClick (this is easy :mrgreen: )

But similar "HoverTextColour"

---------------------------------------------------------------------------

Suggestion Nr.2 hasObjectPermissionTo

In This panel i set the "command.kick" (access for Admin SuperModerator and Moderator) and this is ok :)

My questios is : is possible now add the permission for bottons ?

Example Moderator only access push blow boom.

Call the function with triggerServerEvent ?

Tnx all for reply.

Link to comment

There's no "over sound", you need to make it on your own, you can use onClientMouseEnter, onClientMouseLeave for that.

To set who can use what in the buttons you could use element data or, a server side table with the button name, example:

local permissionTable = { 
   ["Push"] = {"Moderator"}, 
   ["Kick"] = {"SuperModerator"}, 
} 
  
addEvent("panel:Push",true) 
addEventHandler("panel:Push",root, 
function (client, target, buttonName) 
if not permissionTable[buttonName] then return end 
    for index, permission in pairs(permissionTable[buttonName]) do 
        if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(client)),aclGetGroup(tostring(permission))) then 
            -- Your function here 
        end 
    end 
end 

That should work, not tested though.

Link to comment

LoL Hard for me :mrgreen: But test ok. Tnx

Why triggerServerEvent is bad idea ? (idk :oops: )

example botton4 access danied for Moderator

client part :

elseif (source == botton4) then 
           triggerServerEvent ("accessSmash", getLocalPlayer()) 

server part :

addEvent("accessSmash",true) 
 addEventHandler("accessSmash",getRootElement(), 
function (thePlayer) 
if ( hasObjectPermissionTo ( thePlayer, "command.ban", true ) ) then 
else 
       outputChatBox ("PRO Admin Panel : Access denied", thePlayer, 255, 200, 0)             
    end 
end 
) 

Idk :| Test and reply Tnx

Link to comment

ok for permission i use you example castillo . . . better solution.

For sound i have new idea.

I use onClientGUIClick for playSound and show image info about command and permission.

And onClientGUIDoubleClick for functions.

Now my problem is only the horizontalBar :|

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