yMassai Posted May 28, 2012 Share Posted May 28, 2012 wantedJanela = guiCreateWindow(76,58,171,21,"",false) editWanted = guiCreateEdit(76,58,171,21,"",false,wantedJanela) function Visible () guiSetVisible ( wantedJanela, true ) showCursor(true) end end addCommandHandler ( "wantedstats", Visible ) Hello I had a new idea and I'm already in the production of another script that will be available for download within a few days. I have never used the function "addCommandHandler". Link to comment
Alpha Posted May 28, 2012 Share Posted May 28, 2012 wantedJanela = guiCreateWindow(76,58,171,21,"",false) editWanted = guiCreateEdit(76,58,171,21,"",false,wantedJanela) guiSetVisible ( wantedJanela, false) function Visible () guiSetVisible ( wantedJanela, true ) showCursor(true) end addCommandHandler ( "wantedstats", Visible ) Link to comment
Al3grab Posted May 28, 2012 Share Posted May 28, 2012 wantedJanela = guiCreateWindow(76,58,171,21,"",false) editWanted = guiCreateEdit(76,58,171,21,"",false,wantedJanela) guiSetVisible ( wantedJanela, false) function Visible () guiSetVisible ( wantedJanela, not guiGetVisible(wantedJanela) ) showCursor(guiGetVisible(wantedJanela) ) end addCommandHandler ( "wantedstats", Visible ) will be better Link to comment
Stanley Sathler Posted May 28, 2012 Share Posted May 28, 2012 function CreateWantedGUI() wantedJanela = guiCreateWindow(76,58,171,21,"",false) editWanted = guiCreateEdit(76,58,171,21,"",false,wantedJanela) guiSetVisible ( wantedJanela, false) end addEventHandler("onClientResourceStart", getRootElement(), CreateWantedGUI) function Visible () guiSetVisible ( wantedJanela, not guiGetVisible(wantedJanela) ) showCursor(guiGetVisible(wantedJanela) ) end addCommandHandler ( "wantedstats", Visible ) Link to comment
Alpha Posted May 28, 2012 Share Posted May 28, 2012 Stanley, that doesn't make any difference. Al3grab, yeah better, but might not be what he wanted. Link to comment
yMassai Posted May 29, 2012 Author Share Posted May 29, 2012 function CriarJanela() wantedJanela = guiCreateWindow(80,80,250,250,"",false) --labels labelJanela = guiCreateLabel(20,20,250,60,"Janela de Alteração de Wanted Stats",false,wantedJanela) labelNome = guiCreateLabel(10,55,250,60,"Nome do Jogador :",false,wantedJanela) labelWanted = guiCreateLabel(30,90,250,60,"Wanted Level :",false,wantedJanela) --edit editWanted1 = guiCreateEdit(120,50,120,25,"",false,wantedJanela) editWanted2 = guiCreateEdit(160,85,80,25,"",false,wantedJanela) buttonAlterar = guiCreateButton(0,210,120,30,"Alterar o Stats",false,wantedJanela) --Radio buttonRadio1 = guiCreateRadioButton(170,110,50,50,"Adicionar",false,wantedJanela) buttonRadio2 = guiCreateRadioButton(170,140,50,50,"Remover",false,wantedJanela) buttonFechar = guiCreateButton(130,210,120,30,"Fechar",false,wantedJanela) end addEventHandler("onClientGUIClick", buttonFechar, Fechar) addEventHandler("onClientResourceStart", getRootElement, CriaJanela) guiSetVisible ( wantedJanela, false) guiWindowSetSizable(wantedJanela,false) function Fechar() guiSetVisible ( wantedJanela, true ) showCursor ( true ) end end function Visible () guiSetVisible ( wantedJanela, true ) showCursor(true) end end addCommandHandler ( "wantedstats", Visible ) WARNING: Loading script failed: WantedTest\client.lua:32 '' expected near 'end' Link to comment
iFoReX Posted May 29, 2012 Share Posted May 29, 2012 function CriarJanela() wantedJanela = guiCreateWindow(80,80,250,250,"",false) --labels labelJanela = guiCreateLabel(20,20,250,60,"Janela de Alteração de Wanted Stats",false,wantedJanela) labelNome = guiCreateLabel(10,55,250,60,"Nome do Jogador :",false,wantedJanela) labelWanted = guiCreateLabel(30,90,250,60,"Wanted Level :",false,wantedJanela) --edit editWanted1 = guiCreateEdit(120,50,120,25,"",false,wantedJanela) editWanted2 = guiCreateEdit(160,85,80,25,"",false,wantedJanela) buttonAlterar = guiCreateButton(0,210,120,30,"Alterar o Stats",false,wantedJanela) --Radio buttonRadio1 = guiCreateRadioButton(170,110,50,50,"Adicionar",false,wantedJanela) buttonRadio2 = guiCreateRadioButton(170,140,50,50,"Remover",false,wantedJanela) buttonFechar = guiCreateButton(130,210,120,30,"Fechar",false,wantedJanela) end addEventHandler("onClientGUIClick", buttonFechar, Fechar) addEventHandler("onClientResourceStart", getRootElement, CriaJanela) guiSetVisible ( wantedJanela, false) guiWindowSetSizable(wantedJanela,false) function Fechar() guiSetVisible ( wantedJanela, true ) showCursor ( true ) end function Visible () guiSetVisible ( wantedJanela, true ) showCursor(true) end addCommandHandler ( "wantedstats", Visible ) Link to comment
X-SHADOW Posted May 31, 2012 Share Posted May 31, 2012 Here function CriarJanela() wantedJanela = guiCreateWindow(80,80,250,250,"",false) --labels labelJanela = guiCreateLabel(20,20,250,60,"Janela de Alteração de Wanted Stats",false,wantedJanela) labelNome = guiCreateLabel(10,55,250,60,"Nome do Jogador :",false,wantedJanela) labelWanted = guiCreateLabel(30,90,250,60,"Wanted Level :",false,wantedJanela) --edit editWanted1 = guiCreateEdit(120,50,120,25,"",false,wantedJanela) editWanted2 = guiCreateEdit(160,85,80,25,"",false,wantedJanela) buttonAlterar = guiCreateButton(0,210,120,30,"Alterar o Stats",false,wantedJanela) --Radio buttonRadio1 = guiCreateRadioButton(170,110,50,50,"Adicionar",false,wantedJanela) buttonRadio2 = guiCreateRadioButton(170,140,50,50,"Remover",false,wantedJanela) buttonFechar = guiCreateButton(130,210,120,30,"Fechar",false,wantedJanela) end addEventHandler("onClientGUIClick", buttonFechar, Fechar) addEventHandler("onClientResourceStart", getRootElement, CriaJanela) guiSetVisible ( wantedJanela, false) guiWindowSetSizable(wantedJanela,false) function Fechar() guiSetVisible ( wantedJanela, true ) showCursor ( true ) end function Visible () guiSetVisible ( wantedJanela, true ) showCursor(true) end addCommandHandler ( "wantedstats", Visible ) Link to comment
yMassai Posted May 31, 2012 Author Share Posted May 31, 2012 not really detect any error. but the window does not open with the command. Link to comment
X-SHADOW Posted May 31, 2012 Share Posted May 31, 2012 (edited) updated again. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} function CriarJanela() local root = getRootElement() wantedJanela = guiCreateWindow(80,80,250,250,"",false) guiWindowSetSizable(wantedJanela,false) --labels labelJanela = guiCreateLabel(20,20,250,60,"Janela de Alteraç?o de Wanted Stats",false,wantedJanela) labelNome = guiCreateLabel(10,55,250,60,"Nome do Jogador :",false,wantedJanela) labelWanted = guiCreateLabel(30,90,250,60,"Wanted Level :",false,wantedJanela) --edit editWanted1 = guiCreateEdit(120,50,120,25,"",false,wantedJanela) editWanted2 = guiCreateEdit(160,85,80,25,"",false,wantedJanela) buttonAlterar = guiCreateButton(0,210,120,30,"Alterar o Stats",false,wantedJanela) --Radio buttonRadio1 = guiCreateRadioButton(170,110,50,50,"Adicionar",false,wantedJanela) buttonRadio2 = guiCreateRadioButton(170,140,50,50,"Remover",false,wantedJanela) buttonFechar = guiCreateButton(130,210,120,30,"Fechar",false,wantedJanela) guiSetVisible ( wantedJanela, false ) showCursor ( false ) end addEventHandler( "onClientResourceStart", getRootElement( ), CriarJanela) addEventHandler('onClientGUIClick', root, function () if ( source == buttonFechar) then guiSetVisible ( wantedJanela, true ) showCursor ( true ) end end) function Visible () guiSetVisible ( wantedJanela, true ) showCursor(true) end addCommandHandler ( "wantedstats", Visible ) Edited June 1, 2012 by Guest Link to comment
yMassai Posted May 31, 2012 Author Share Posted May 31, 2012 the cursor is turned on but an error not open the window bad argument line 18 , 29 29 Link to comment
X-SHADOW Posted May 31, 2012 Share Posted May 31, 2012 See my last post tested and Worked. Link to comment
yMassai Posted June 1, 2012 Author Share Posted June 1, 2012 the window is already open. the window don't open with command. Link to comment
X-SHADOW Posted June 1, 2012 Share Posted June 1, 2012 updated again and tested worked . Link to comment
Stanley Sathler Posted June 1, 2012 Share Posted June 1, 2012 Hmm... try it: function CriarJanela() local root = getRootElement() wantedJanela = guiCreateWindow(80,80,250,250,"",false) guiWindowSetSizable(wantedJanela,false) --labels labelJanela = guiCreateLabel(20,20,250,60,"Janela de Alteraç?o de Wanted Stats",false,wantedJanela) labelNome = guiCreateLabel(10,55,250,60,"Nome do Jogador :",false,wantedJanela) labelWanted = guiCreateLabel(30,90,250,60,"Wanted Level :",false,wantedJanela) --edit editWanted1 = guiCreateEdit(120,50,120,25,"",false,wantedJanela) editWanted2 = guiCreateEdit(160,85,80,25,"",false,wantedJanela) buttonAlterar = guiCreateButton(0,210,120,30,"Alterar o Stats",false,wantedJanela) --Radio buttonRadio1 = guiCreateRadioButton(170,110,50,50,"Adicionar",false,wantedJanela) buttonRadio2 = guiCreateRadioButton(170,140,50,50,"Remover",false,wantedJanela) buttonFechar = guiCreateButton(130,210,120,30,"Fechar",false,wantedJanela) guiSetInputMode("no_binds_when_editing") end addEventHandler( "onClientResourceStart", getRootElement( ), CriarJanela) addEventHandler('onClientGUIClick', root, function () if ( source == buttonFechar) then guiSetVisible ( wantedJanela, true ) showCursor ( true ) end end) function Visible () guiSetVisible ( wantedJanela, true ) showCursor(true) end addCommandHandler ( "wantedstats", Visible ) Link to comment
yMassai Posted June 1, 2012 Author Share Posted June 1, 2012 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} function CriarJanela() local root = getRootElement() wantedJanela = guiCreateWindow(80,80,250,250,"",false) guiWindowSetSizable(wantedJanela,false) --labels labelJanela = guiCreateLabel(20,20,250,60,"Janela de Alteração de Wanted Stats",false,wantedJanela) labelNome = guiCreateLabel(10,55,250,60,"Nome do Jogador :",false,wantedJanela) labelWanted = guiCreateLabel(30,90,250,60,"Wanted Level :",false,wantedJanela) --edit editWanted1 = guiCreateEdit(120,50,120,25,"",false,wantedJanela) editWanted2 = guiCreateEdit(160,85,80,25,"",false,wantedJanela) --Memo memoEdit = guiCreateMemo(10,120,230,80,"Identifique o jogador e selecione o nivel de procurado para a alteração, os niveis podem ser de 0-6 .",false,wantedJanela) --Button buttonAlterar = guiCreateButton(0,210,120,30,"Alterar Nivel",false,wantedJanela) buttonFechar = guiCreateButton(130,210,120,30,"Fechar",false,wantedJanela) guiSetVisible ( wantedJanela, false ) showCursor ( false ) end addEventHandler( "onClientResourceStart", getRootElement( ), CriarJanela) addEventHandler('onClientGUIClick', root, function () if ( source == buttonFechar) then guiSetVisible ( wantedJanela, false ) showCursor ( false ) end end) function Visible () guiSetVisible ( wantedJanela, true ) showCursor(true) end addCommandHandler ( "wantedstats", Visible ) I made some adjustments. Someone could help me? I tried to change the level of the player. the variable editWanted1 is to put the player's name. and the variable editWanted2 is for identify the level is to obtain the player, either larger or smaller. the variable buttonAlterar is for change the informations. Link to comment
X-SHADOW Posted June 1, 2012 Share Posted June 1, 2012 This is Just An Example / local Toyota = getElementData(source,'Level')--- getElementData (Leve) --- Just An Example ! addEventHandler('onClientGUIClick', root,--- make the event function() if (source == buttonAlterar) then -- if source press the button then guiSetText(editWanted2, Toyota) -- set the gui edit to the level of player end end) --- Just An Example ! Link to comment
yMassai Posted June 2, 2012 Author Share Posted June 2, 2012 Did not quite understand. You just posted with respect to exchange level but not with name identification. Link to comment
myonlake Posted June 2, 2012 Share Posted June 2, 2012 function createWindow() wantedJanela = guiCreateWindow(80, 80, 250, 250, "", false) guiWindowSetSizable(wantedJanela, false) labelJanela = guiCreateLabel(20, 20, 250, 60, "Janela de Alteração de Wanted Stats", false, wantedJanela) labelNome = guiCreateLabel(10, 55, 250, 60, "Nome do Jogador :", false, wantedJanela) labelWanted = guiCreateLabel(30, 90, 250, 60, "Wanted Level :", false, wantedJanela) editWanted1 = guiCreateEdit(120, 50, 120, 25, "", false, wantedJanela) editWanted2 = guiCreateEdit(160, 85, 80, 25, "", false, wantedJanela) memoEdit = guiCreateMemo(10, 120, 230, 80, "Identifique o jogador e selecione o nivel de procurado para a alteração, os niveis podem ser de 0-6 .", false, wantedJanela) buttonAlterar = guiCreateButton(0, 210, 120, 30, "Alterar Nivel", false, wantedJanela) buttonFechar = guiCreateButton(130, 210, 120, 30, "Fechar", false, wantedJanela) end addEventHandler("onClientGUIClick", buttonFechar, function() destroyElement(wantedJanela) showCursor(false) guiSetInputEnabled(false) end, false ) addCommandHandler("wantedstats", function() createWindow() showCursor(true) guiSetInputEnabled(true) end ) Link to comment
yMassai Posted June 4, 2012 Author Share Posted June 4, 2012 guiSetText(editWanted1, Name) What function i can use for take the name of player to change Wanted lvl? Link to comment
X-SHADOW Posted June 5, 2012 Share Posted June 5, 2012 That's Weird you dont know how to get the name and set the wanted level ? addEventHandler('onClientGUIClick', root, function() local who = getPlayerName(source) if ( who) then guiSetText(editWanted1, who) end end) Link to comment
Castillo Posted June 5, 2012 Share Posted June 5, 2012 'source' of "onClientGUIClick" is the GUI element clicked, not a player. Link to comment
X-SHADOW Posted June 5, 2012 Share Posted June 5, 2012 you mean it should be like this getPlayerName() ? Link to comment
Kenix Posted June 5, 2012 Share Posted June 5, 2012 You should use localPlayer instead of source in argument function getPlayerName. 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