Andrixx Posted March 9, 2013 Share Posted March 9, 2013 Hola. Estaba terminando de confeccionar un script que funcionara con los donadores, pero no logro hacer que se abra les dejo el server y clientside pero obviamente no todo Client: function PANELDo() PanelD = guiCreateWindow(0.36, 0.28, 0.31, 0.37, "Panel", true) guiWindowSetSizable(PanelD, false) Curar = guiCreateButton(0.04, 0.15, 0.40, 0.30, "Curar gratis", true, PanelD) guiSetProperty(Curar, "NormalTextColour", "FFAAAAAA") Baseball = guiCreateButton(0.04, 0.57, 0.40, 0.30, "Dar bate de baseball gratis", true, PanelD) guiSetProperty(Baseball, "NormalTextColour", "FFAAAAAA") Armor = guiCreateButton(0.57, 0.15, 0.40, 0.30, "Dar Armour gratis", true, PanelD) guiSetProperty(Armor, "NormalTextColour", "FFAAAAAA") Cerrar = guiCreateButton(0.57, 0.55, 0.40, 0.30, "Cerrar", true, PanelD) guiSetProperty(Cerrar, "NormalTextColour", "FFAAAAAA") showCursor (true) addEventHandler ( "onClientGUIClick", Cerrar, Exitss, false ) addEventHandler ( "onClientGUIClick", Curar, curars, false ) addEventHandler ( "onClientGUIClick", Baseball, Baseballsa, false ) addEventHandler ( "onClientGUIClick", Armor, Armorss, false ) end function LOCALIZAR() guiSetVisible( PanelD, true ) end addEvent( "AbrirEven", true ) addEventHandler( "AbrirEven", getRootElement(), LOCALIZAR ) Server function TrigeOpen (thePlayer ) local tomarCuenta = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..tomarCuenta, aclGetGroup ( "Donadores" ) ) then triggerClientEvent ( "AbrirEven", getRootElement() ) else outputChatBox("No eres donador para abrir este panel.", playerSource) end end addCommandHandler ("paneld", TrigeOpen) Funciona todo menos que se muestre la gui. Espero que me ayuden, gracias de antemano Link to comment
Plate Posted March 9, 2013 Share Posted March 9, 2013 triggerClientEvent(thePlayer, "AbrirEven", getRootElement()) Link to comment
Andrixx Posted March 9, 2013 Author Share Posted March 9, 2013 Probe con lo que dijiste Plate, pero no me funcionon Link to comment
Plate Posted March 9, 2013 Share Posted March 9, 2013 function TrigeOpen(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Donadores" ) ) then triggerClientEvent(thePlayer, "AbrirEven", thePlayer) else outputChatBox("No eres donador para abrir este panel.", thePlayer) end end addCommandHandler ("paneld", TrigeOpen) PD: Gracias a tus videos aprendi a cambiar skins *-* Link to comment
Andrixx Posted March 9, 2013 Author Share Posted March 9, 2013 Gracias pero basicamente cambiaste por lo que dice en la wiki y aun asi no me funciono PD: jaja que bien Link to comment
Castillo Posted March 9, 2013 Share Posted March 9, 2013 -- client side: function PANELDo() PanelD = guiCreateWindow(0.36, 0.28, 0.31, 0.37, "Panel", true) guiWindowSetSizable(PanelD, false) guiSetVisible(PanelD, false) Curar = guiCreateButton(0.04, 0.15, 0.40, 0.30, "Curar gratis", true, PanelD) guiSetProperty(Curar, "NormalTextColour", "FFAAAAAA") Baseball = guiCreateButton(0.04, 0.57, 0.40, 0.30, "Dar bate de baseball gratis", true, PanelD) guiSetProperty(Baseball, "NormalTextColour", "FFAAAAAA") Armor = guiCreateButton(0.57, 0.15, 0.40, 0.30, "Dar Armour gratis", true, PanelD) guiSetProperty(Armor, "NormalTextColour", "FFAAAAAA") Cerrar = guiCreateButton(0.57, 0.55, 0.40, 0.30, "Cerrar", true, PanelD) guiSetProperty(Cerrar, "NormalTextColour", "FFAAAAAA") addEventHandler ( "onClientGUIClick", Cerrar, Exitss, false ) addEventHandler ( "onClientGUIClick", Curar, curars, false ) addEventHandler ( "onClientGUIClick", Baseball, Baseballsa, false ) addEventHandler ( "onClientGUIClick", Armor, Armorss, false ) end addEventHandler ( "onClientResourceStart", resourceRoot, PANELDo ) function LOCALIZAR() guiSetVisible( PanelD, true ) showCursor ( true ) end addEvent( "AbrirEven", true ) addEventHandler( "AbrirEven", getRootElement(), LOCALIZAR ) -- server side: function TrigeOpen (thePlayer ) local tomarCuenta = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..tomarCuenta, aclGetGroup ( "Donadores" ) ) then triggerClientEvent ( thePlayer, "AbrirEven", thePlayer ) else outputChatBox("No eres donador para abrir este panel.", thePlayer) end end addCommandHandler ("paneld", TrigeOpen) Te habias olvidado de crear el GUI al iniciar el recurso. Link to comment
Andrixx Posted March 9, 2013 Author Share Posted March 9, 2013 no me habia dado cuenta. Gracias castillo y plate por su tiempo Link to comment
Recommended Posts