Jump to content

[HELP] GUI via Ped


Recommended Posts

Posted
  
local t_button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Output!", true ) 
         guiSetVisible ( t_button, false ) --- No point for this function if this is set to true  
  
addEventHandler ( "onClientClick", getRootElement(),  
function ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) 
  
        if button == "left" and state == "up" and  clickedElement  then 
if getElementType(  clickedElement ) ~= "ped" then return end  
                guiSetVisible ( t_button, true )  
        end 
end 
 ) 

Posted

Well, if you want it to work when you click a ped, you obviously need to create one.

That script will also show the GUI when you click ANY ped.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

This only works with peds, not players.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Thank you Solidsnake, I appreciate yourhelp. AND ALSO Thanks Saml1er.

EDIT)

It does nothing ingame when I use LMB or RMB on another player. I've set it clientsided.

You're trying to create a Roleplay script without knowing basic things like this ...? Maybe it's a good thing to get to know the basics before you take a big step and move to a RP script.

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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