Andrixx Posted March 9, 2013 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
Plate Posted March 9, 2013 Posted March 9, 2013 triggerClientEvent(thePlayer, "AbrirEven", getRootElement()) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Andrixx Posted March 9, 2013 Author Posted March 9, 2013 Probe con lo que dijiste Plate, pero no me funcionon
Plate Posted March 9, 2013 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 *-* Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Andrixx Posted March 9, 2013 Author 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
Castillo Posted March 9, 2013 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Andrixx Posted March 9, 2013 Author Posted March 9, 2013 no me habia dado cuenta. Gracias castillo y plate por su tiempo
Castillo Posted March 9, 2013 Posted March 9, 2013 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts