lucascba Posted August 3, 2014 Share Posted August 3, 2014 Hello I would like to know how to do to put the current team a player in my GUI, Here I give you an example of what I want to do: this is my code: VentanaT = guiCreateWindow(462, 218, 522, 295, "CL Trabajos", false) guiWindowSetSizable(VentanaT, false) guiSetVisible(VentanaT, false) RenunciarB = guiCreateButton(10, 77, 114, 37, "Renunciar", false, VentanaT) guiSetProperty(RenunciarB, "NormalTextColour", "FFAAAAAA") DescansarB = guiCreateButton(10, 30, 114, 37, "Descansar", false, VentanaT) guiSetProperty(DescansarB, "NormalTextColour", "FFAAAAAA") OcupacionT = guiCreateLabel(142, 53, 63, 14, "Team:", false, VentanaT) CuentaT = guiCreateLabel(140, 33, 100, 15, "Nombre: ", false, VentanaT) Imagen = guiCreateStaticImage(336, 33, 176, 152, ":login_panel/logo.png", false, VentanaT) CerrarB = guiCreateButton(336, 244, 177, 41, "Cerrar Ventana", false, VentanaT) guiSetProperty(CerrarB, "NormalTextColour", "FFAAAAAA") Info = guiCreateLabel(10, 136, 157, 98, "Sistema de trabajos de CL\nAca Podras Renunciar\nA Tu Trabajo,\nO Descansar De Tu Trabajo", false, VentanaT) Cuenta = guiCreateLabel(187, 33, 200, 150, "" ..getPlayerName(localPlayer).. "", false, VentanaT) Ocupacion = guiCreateLabel(205, 53, 91, 15, "n/n", false, VentanaT) VentanaE = guiCreateWindow(519, 285, 224, 157, "CL Trabajos", false) guiWindowSetSizable(VentanaE, false) guiSetVisible(VentanaE, false) BotonSi = guiCreateButton(16, 102, 74, 45, "Si", false, VentanaE) guiSetProperty(BotonSi, "NormalTextColour", "FFAAAAAA") BotonNo = guiCreateButton(124, 102, 74, 45, "No", false, VentanaE) guiSetProperty(BotonNo, "NormalTextColour", "FFAAAAAA") Label = guiCreateLabel(26, 33, 163, 50, "Estas Seguro De Renunciar?", false, VentanaE) function openT() if (guiGetVisible (VentanaT) == false) then guiSetVisible(VentanaT, true) showCursor(true) elseif (guiGetVisible (VentanaT) == true) then guiSetVisible(VentanaT, false) showCursor(false) end end bindKey ("F4", "down", openT) function cerrarventanaT() guiSetVisible(VentanaT, false) showCursor(false) end addEventHandler("onClientGUIClick", CerrarB , cerrarventanaT, false) function AbrirE() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, true) showCursor(true) end addEventHandler("onClientGUIClick", RenunciarB , AbrirE, false) function BotonNo1() guiSetVisible(VentanaT, true) guiSetVisible(VentanaE, false) showCursor(true) end addEventHandler("onClientGUIClick", BotonNo , BotonNo1, false) function BotonSi1() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, false) triggerServerEvent("Sacarteam1", localPlayer) showCursor(false) end addEventHandler("onClientGUIClick", BotonSi , BotonSi1, false) thanks, hope you can help me. sorry for my bad English Link to comment
Anubhav Posted August 3, 2014 Share Posted August 3, 2014 VentanaT = guiCreateWindow(462, 218, 522, 295, "CL Trabajos", false) guiWindowSetSizable(VentanaT, false) guiSetVisible(VentanaT, false) RenunciarB = guiCreateButton(10, 77, 114, 37, "Renunciar", false, VentanaT) guiSetProperty(RenunciarB, "NormalTextColour", "FFAAAAAA") DescansarB = guiCreateButton(10, 30, 114, 37, "Descansar", false, VentanaT) guiSetProperty(DescansarB, "NormalTextColour", "FFAAAAAA") OcupacionT = guiCreateLabel(142, 53, 63, 14, "Team:", false, VentanaT) CuentaT = guiCreateLabel(140, 33, 100, 15, "Nombre: ", false, VentanaT) Imagen = guiCreateStaticImage(336, 33, 176, 152, ":login_panel/logo.png", false, VentanaT) CerrarB = guiCreateButton(336, 244, 177, 41, "Cerrar Ventana", false, VentanaT) guiSetProperty(CerrarB, "NormalTextColour", "FFAAAAAA") Info = guiCreateLabel(10, 136, 157, 98, "Sistema de trabajos de CL\nAca Podras Renunciar\nA Tu Trabajo,\nO Descansar De Tu Trabajo", false, VentanaT) Cuenta = guiCreateLabel(187, 33, 200, 150, "" ..getPlayerName(localPlayer).. "", false, VentanaT) Ocupacion = guiCreateLabel(205, 53, 91, 15, "n/n", false, VentanaT) VentanaE = guiCreateWindow(519, 285, 224, 157, "CL Trabajos", false) guiWindowSetSizable(VentanaE, false) guiSetVisible(VentanaE, false) BotonSi = guiCreateButton(16, 102, 74, 45, "Si", false, VentanaE) guiSetProperty(BotonSi, "NormalTextColour", "FFAAAAAA") BotonNo = guiCreateButton(124, 102, 74, 45, "No", false, VentanaE) guiSetProperty(BotonNo, "NormalTextColour", "FFAAAAAA") Label = guiCreateLabel(26, 33, 163, 50, "Estas Seguro De Renunciar?", false, VentanaE) function openT(thePlayer) if (guiGetVisible (VentanaT) == false) then local plrTeam = getPlayerTeam( thePlayer ) guiSetText(Ocupacion, tostring(plrTeam) or plrTeam) guiSetVisible(VentanaT, true) showCursor(true) elseif (guiGetVisible (VentanaT) == true) then guiSetVisible(VentanaT, false) showCursor(false) end end bindKey ("F4", "down", openT) function cerrarventanaT() guiSetVisible(VentanaT, false) showCursor(false) end addEventHandler("onClientGUIClick", CerrarB , cerrarventanaT, false) function AbrirE() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, true) showCursor(true) end addEventHandler("onClientGUIClick", RenunciarB , AbrirE, false) function BotonNo1() guiSetVisible(VentanaT, true) guiSetVisible(VentanaE, false) showCursor(true) end addEventHandler("onClientGUIClick", BotonNo , BotonNo1, false) function BotonSi1() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, false) triggerServerEvent("Sacarteam1", localPlayer) showCursor(false) end addEventHandler("onClientGUIClick", BotonSi , BotonSi1, false) Link to comment
lucascba Posted August 3, 2014 Author Share Posted August 3, 2014 VentanaT = guiCreateWindow(462, 218, 522, 295, "CL Trabajos", false) guiWindowSetSizable(VentanaT, false) guiSetVisible(VentanaT, false) RenunciarB = guiCreateButton(10, 77, 114, 37, "Renunciar", false, VentanaT) guiSetProperty(RenunciarB, "NormalTextColour", "FFAAAAAA") DescansarB = guiCreateButton(10, 30, 114, 37, "Descansar", false, VentanaT) guiSetProperty(DescansarB, "NormalTextColour", "FFAAAAAA") OcupacionT = guiCreateLabel(142, 53, 63, 14, "Team:", false, VentanaT) CuentaT = guiCreateLabel(140, 33, 100, 15, "Nombre: ", false, VentanaT) Imagen = guiCreateStaticImage(336, 33, 176, 152, ":login_panel/logo.png", false, VentanaT) CerrarB = guiCreateButton(336, 244, 177, 41, "Cerrar Ventana", false, VentanaT) guiSetProperty(CerrarB, "NormalTextColour", "FFAAAAAA") Info = guiCreateLabel(10, 136, 157, 98, "Sistema de trabajos de CL\nAca Podras Renunciar\nA Tu Trabajo,\nO Descansar De Tu Trabajo", false, VentanaT) Cuenta = guiCreateLabel(187, 33, 200, 150, "" ..getPlayerName(localPlayer).. "", false, VentanaT) Ocupacion = guiCreateLabel(205, 53, 91, 15, "n/n", false, VentanaT) VentanaE = guiCreateWindow(519, 285, 224, 157, "CL Trabajos", false) guiWindowSetSizable(VentanaE, false) guiSetVisible(VentanaE, false) BotonSi = guiCreateButton(16, 102, 74, 45, "Si", false, VentanaE) guiSetProperty(BotonSi, "NormalTextColour", "FFAAAAAA") BotonNo = guiCreateButton(124, 102, 74, 45, "No", false, VentanaE) guiSetProperty(BotonNo, "NormalTextColour", "FFAAAAAA") Label = guiCreateLabel(26, 33, 163, 50, "Estas Seguro De Renunciar?", false, VentanaE) function openT(thePlayer) if (guiGetVisible (VentanaT) == false) then local plrTeam = getPlayerTeam( thePlayer ) guiSetText(Ocupacion, tostring(plrTeam) or plrTeam) guiSetVisible(VentanaT, true) showCursor(true) elseif (guiGetVisible (VentanaT) == true) then guiSetVisible(VentanaT, false) showCursor(false) end end bindKey ("F4", "down", openT) function cerrarventanaT() guiSetVisible(VentanaT, false) showCursor(false) end addEventHandler("onClientGUIClick", CerrarB , cerrarventanaT, false) function AbrirE() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, true) showCursor(true) end addEventHandler("onClientGUIClick", RenunciarB , AbrirE, false) function BotonNo1() guiSetVisible(VentanaT, true) guiSetVisible(VentanaE, false) showCursor(true) end addEventHandler("onClientGUIClick", BotonNo , BotonNo1, false) function BotonSi1() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, false) triggerServerEvent("Sacarteam1", localPlayer) showCursor(false) end addEventHandler("onClientGUIClick", BotonSi , BotonSi1, false) not working Link to comment
Addlibs Posted August 3, 2014 Share Posted August 3, 2014 local plrTeam = getPlayerTeam( thePlayer ) guiSetText(Ocupacion,(plrTeam and getTeamName(plrTeam) or "None")) Link to comment
Et-win Posted August 3, 2014 Share Posted August 3, 2014 VentanaT = guiCreateWindow(462, 218, 522, 295, "CL Trabajos", false) guiWindowSetSizable(VentanaT, false) guiSetVisible(VentanaT, false) RenunciarB = guiCreateButton(10, 77, 114, 37, "Renunciar", false, VentanaT) guiSetProperty(RenunciarB, "NormalTextColour", "FFAAAAAA") DescansarB = guiCreateButton(10, 30, 114, 37, "Descansar", false, VentanaT) guiSetProperty(DescansarB, "NormalTextColour", "FFAAAAAA") OcupacionT = guiCreateLabel(142, 53, 63, 14, "Team:", false, VentanaT) CuentaT = guiCreateLabel(140, 33, 100, 15, "Nombre: ", false, VentanaT) Imagen = guiCreateStaticImage(336, 33, 176, 152, ":login_panel/logo.png", false, VentanaT) CerrarB = guiCreateButton(336, 244, 177, 41, "Cerrar Ventana", false, VentanaT) guiSetProperty(CerrarB, "NormalTextColour", "FFAAAAAA") Info = guiCreateLabel(10, 136, 157, 98, "Sistema de trabajos de CL\nAca Podras Renunciar\nA Tu Trabajo,\nO Descansar De Tu Trabajo", false, VentanaT) Cuenta = guiCreateLabel(187, 33, 200, 150, "" ..getPlayerName(localPlayer).. "", false, VentanaT) Ocupacion = guiCreateLabel(205, 53, 91, 15, "n/n", false, VentanaT) VentanaE = guiCreateWindow(519, 285, 224, 157, "CL Trabajos", false) guiWindowSetSizable(VentanaE, false) guiSetVisible(VentanaE, false) BotonSi = guiCreateButton(16, 102, 74, 45, "Si", false, VentanaE) guiSetProperty(BotonSi, "NormalTextColour", "FFAAAAAA") BotonNo = guiCreateButton(124, 102, 74, 45, "No", false, VentanaE) guiSetProperty(BotonNo, "NormalTextColour", "FFAAAAAA") Label = guiCreateLabel(26, 33, 163, 50, "Estas Seguro De Renunciar?", false, VentanaE) function openT(thePlayer) if (guiGetVisible (VentanaT) == false) then local gError = true local plrTeam = getPlayerTeam(getLocalPlayer()) if (plrTeam ~= false) and (plrTeam ~= nil) then local gTeamName = getTeamName(plrTeam) if (gTeamName ~= false) and (gTeamName ~= nil) then guiSetText(Ocupacion, gTeamName) gError = false end end if (gError == true) then guiSetText(Ocupacion, "N/A") end guiSetVisible(VentanaT, true) showCursor(true) elseif (guiGetVisible (VentanaT) == true) then guiSetVisible(VentanaT, false) showCursor(false) end end bindKey ("F4", "down", openT) function cerrarventanaT() guiSetVisible(VentanaT, false) showCursor(false) end addEventHandler("onClientGUIClick", CerrarB , cerrarventanaT, false) function AbrirE() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, true) showCursor(true) end addEventHandler("onClientGUIClick", RenunciarB , AbrirE, false) function BotonNo1() guiSetVisible(VentanaT, true) guiSetVisible(VentanaE, false) showCursor(true) end addEventHandler("onClientGUIClick", BotonNo , BotonNo1, false) function BotonSi1() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, false) triggerServerEvent("Sacarteam1", localPlayer) showCursor(false) end addEventHandler("onClientGUIClick", BotonSi , BotonSi1, false) You guys know that client-side 'bindKey' doesn't have a 'player' argument, right? EDIT: Edited my code. 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