Jump to content

dont work :(


Recommended Posts

Posted

help me plss

    function open () 
        vent = guiCreateWindow(485, 185, 314, 385, "lol", false) 
        guiWindowSetSizable(vent, false) 
  
        fy = guiCreateButton(9, 31, 296, 58, "xd", false, vent) 
        wr = guiCreateButton(9, 259, 296, 58, "xd", false, vent) 
        elely = guiCreateButton(13, 94, 77, 30, "xxd", false, vent) 
        dblef = guiCreateButton(222, 94, 77, 30, "xxd", false, vent) 
        ea = guiCreateButton(13, 323, 77, 30, "xxdd", false, vent) 
        dblewa = guiCreateButton(222, 323, 77, 30, "xxdd", false, vent) 
        imagen = guiCreateStaticImage(13, 133, 292, 120, "lol.png", false, vent)     
    end 
  
addEventHandler('onClientResourceStart', g_ResRoot, 
function bind () 
        bindKey('f1', 'down', windowopenn) 
        createWindow(open) 
end 
) 
  
function windowopenn() 
    if isWindowOpen(vent) then 
        showCursor(false) 
        hideAllWindows() 
        colorPicker.closeSelect() 
    else 
        showCursor(true) 
        showAllWindows() 
    end 
end 
  
function windowopen () 
    guiSetVisible (vent, not guiGetVisible ( vent ) ) 
    showCursor (false) 
    end 
  
addEventHandler ("onPlayerJoin", 
function () 
outputChatBox ("lol", 255, 255, 255, source, true) 
end 
end 
  

^Problem: it dont show the gui when i press f1! and the outputchatbox dont show when player Joins

Posted (edited)

there is no function called "isWindowOpen" use "guiGetVisible"

and a lot more wrong stuff like events in your code

Edited by Guest

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted

That's because that doesn't make much sense, looks like you copied random code from other scripts.

function open ( ) 
    vent = guiCreateWindow(485, 185, 314, 385, "lol", false) 
    guiWindowSetSizable(vent, false) 
    guiSetVisible ( vent, false ) 
  
    fy = guiCreateButton(9, 31, 296, 58, "xd", false, vent) 
    wr = guiCreateButton(9, 259, 296, 58, "xd", false, vent) 
    elely = guiCreateButton(13, 94, 77, 30, "xxd", false, vent) 
    dblef = guiCreateButton(222, 94, 77, 30, "xxd", false, vent) 
    ea = guiCreateButton(13, 323, 77, 30, "xxdd", false, vent) 
    dblewa = guiCreateButton(222, 323, 77, 30, "xxdd", false, vent) 
    imagen = guiCreateStaticImage(13, 133, 292, 120, "lol.png", false, vent) 
end 
addEventHandler ( 'onClientResourceStart', resourceRoot, open ) 
  
function windowopen ( ) 
    guiSetVisible ( vent, not guiGetVisible ( vent ) ) 
    showCursor ( guiGetVisible ( vent ) ) 
end 
bindKey ( 'f1', 'down', windowopen ) 

P.S: "onPlayerJoin" is server side.

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

Not possible, it hides it after it gets created.

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

I'm saying that is impossible that the script shows the GUI when you join, it'll hide it when you join.

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

You must be using another script, because I just tested it again and it works.

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
oh, slender. the gamemode is in MTA community xD

also could not get it right explain?

outputchatbox \/

you had not defined the function in parameter

now try

function ( source ) 
outputChatBox ("lol", 255, 255, 255, source, true) 

Posted

i would create the gui when the player join and then hide it with guiSetVisible. With the command you can hide or show it using guiSetVisible ;)

Known Languages:

[LUA][VB.NET][ASP.NET][C#][JAVA][C++]

[sqlite][MSSQL][salesForce][bATCH][/center]
  • Moderators
Posted
oh, slender. the gamemode is in MTA community xD

also could not get it right explain?

outputchatbox \/

you had not defined the function in parameter

now try

function ( source ) 
outputChatBox ("lol", 255, 255, 255, source, true) 

You don't have to define a source.

(wiki mta)

"onPlayerJoin"

Serverside event

This event is triggered when a player joins the server.

Parameters

No parameters.

Source

The source of this event is the player who joined.

Btw there is always a source when an event got triggered, but it isn't always a player.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
function open ( ) 
    vent = guiCreateWindow(485, 185, 314, 385, "lol", false) 
    guiWindowSetSizable(vent, false) 
    guiSetVisible ( vent, false ) 
  
    fy = guiCreateButton(9, 31, 296, 58, "xd", false, vent) 
    wr = guiCreateButton(9, 259, 296, 58, "xd", false, vent) 
    elely = guiCreateButton(13, 94, 77, 30, "xxd", false, vent) 
    dblef = guiCreateButton(222, 94, 77, 30, "xxd", false, vent) 
    ea = guiCreateButton(13, 323, 77, 30, "xxdd", false, vent) 
    dblewa = guiCreateButton(222, 323, 77, 30, "xxdd", false, vent) 
    imagen = guiCreateStaticImage(13, 133, 292, 120, "lol.png", false, vent) 
end 
addEventHandler ( 'onClientResourceStart', resourceRoot, open ) 
  
function windowopen ( ) 
    guiSetVisible ( vent, not guiGetVisible ( vent ) ) 
    showCursor ( guiGetVisible ( vent ) ) 
end 
bindKey ( 'f4', 'down', windowopen ) 

Help? When I press F4, it doesn't open the Window !

Posted

You must have something else messing around with it, is it the only script on that resource?

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

yes a server side but it's only this

addEventHandler ("onPlayerJoin", getRootElement(), 
function () 
outputChatBox ("Welcome xD", source, 255, 255, 255, true) 
end 
) 

Posted

I think that there is another resource stoping the cursor from showing .

" Keep Thinking Different . " - Steve Jops

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

Don't send me PMs asking for help, I Won't reply !

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