Jump to content

Wrote 2 functions?


Klesh

Recommended Posts

Posted

Im using the gui to make a window, but the trouble is this, when player join the window appear so i was thinking in bind that winndow for the player, here come the real trouble:

This is an example of lua code, the first code i try.

  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
function () 
genWindow() 
showCursor(true,true) 
end 
) 

But later i was thinking in bind that window, so i try to do this:

  
function onresourceStart() 
bindKey("F1", "down", showgenWindow) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) 
function showgenWindow() 
genWindow() 
showCursor(true,true) 
end 

I was make the code, when i test it the window not shows when player join, but the bind works fine.

I tryed to make with onPlayerJoin, or onPlayerLogin with root but the windows being not show when players join or login, or bind no work.

What other way i can make the window show's when player join, with the bind working.

Posted

Post your whole code.

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

Add this to the function where the GUI is created.

guiSetVisible(WINDOWNAME, true) 

And use "onClientResourceStart" as an event.

If I helped you, please click the like button on the right ;) Thanks!

Posted
You can use bind and this outside a event "onClientResourceStart".

Yes i know that, but what i mean is is i add that event the window not will show at playerjoin, so i need to know how i can call 2 functions, one to bind and th other one to show it at serverjoin.

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