Jump to content

Duda con panel


Hukaeshi

Recommended Posts

Usa setPedHeadless, onClientGUIClick y isPedHeadless.

Supongo que ya debes saber usar onClientGUIClick, así que te dejo un ejemplo de cómo lo haría yo:

setPedHeadless(player, not isPedHeadless) 

Eso lo escribes dentro del onClientGUIClick de tu botón(cambia player por la variable del elemento que le quieres quitar la cabeza).  

 

Link to comment
12 hours ago, Melbourne said:

Usa setPedHeadless, onClientGUIClick y isPedHeadless.

Supongo que ya debes saber usar onClientGUIClick, así que te dejo un ejemplo de cómo lo haría yo:


setPedHeadless(player, not isPedHeadless) 

Eso lo escribes dentro del onClientGUIClick de tu botón(cambia player por la variable del elemento que le quieres quitar la cabeza).  

 

Muchas gracias jajaj, ya pude pero ahora como puedo hacer para que el panel me abra y me cierre con una misma tecla, por ejemplo presiono la tecla O y me abre el panel, si la presiono otra ves se cierre

Edited by destructorOnline
Link to comment
GUIEditor = {
    button = {},
    edit = {}
}
function showPanel ()
        VipDiamante = guiCreateWindow(355, 197, 713, 464, "PANEL VIP DIAMANTE", false)
        guiWindowSetSizable(VipDiamante, false)
        guiSetProperty(VipDiamante, "CaptionColour", "FF01FDF4")

        informacion = guiCreateMemo(20, 29, 329, 141, "* Gracias por la compra de tu VIP DIAMANTE.\n\n* Evita no abusar del panel.\n\n* Disfrutalo.\n\n- COMANDOS:\n/parlante : Radio VIP.\n/volar : Activas el modo de vuelo en auto.\n/tp : teletransportarse a un jugador.\n/salto : Super Salto.\n/bici : Super Salto en bicicleta.\n/municion : Municion infinita.", false, VipDiamante)
        logo = guiCreateStaticImage(368, 29, 336, 141, "img/diamante.png", false, VipDiamante)
        Cabeza = guiCreateButton(15, 202, 89, 27, "Cabeza", false, VipDiamante)
        guiSetFont(Cabeza, "default-bold-small")
        guiSetProperty(Cabeza, "NormalTextColour", "FF9A9F94")
        Jetpack = guiCreateButton(131, 202, 89, 27, "Jetpack", false, VipDiamante)
        guiSetFont(Jetpack, "default-bold-small")
        guiSetProperty(Jetpack, "NormalTextColour", "FF9A9F94")
        Invisible = guiCreateButton(368, 202, 89, 27, "Invisible", false, VipDiamante)
        guiSetFont(Invisible, "default-bold-small")
        guiSetProperty(Invisible, "NormalTextColour", "FF9A9F94")
        AutoInvisible = guiCreateButton(246, 202, 89, 27, "Auto Invisible", false, VipDiamante)
        guiSetFont(AutoInvisible, "default-bold-small")
        guiSetProperty(AutoInvisible, "NormalTextColour", "FF9A9F94")
        Reparar = guiCreateButton(494, 202, 89, 27, "Reparar", false, VipDiamante)
        guiSetFont(Reparar, "default-bold-small")
        guiSetProperty(Reparar, "NormalTextColour", "FF9A9F94")
        Fuego = guiCreateButton(611, 202, 89, 27, "Fuego", false, VipDiamante)
        guiSetFont(Fuego, "default-bold-small")
        guiSetProperty(Fuego, "NormalTextColour", "FF9A9F94")
        Paracaidas = guiCreateButton(15, 252, 89, 27, "Paracaidas", false, VipDiamante)
        guiSetFont(Paracaidas, "default-bold-small")
        guiSetProperty(Paracaidas, "NormalTextColour", "FF9A9F94")
        Velocidad = guiCreateButton(131, 252, 89, 27, "Velocidad 3x", false, VipDiamante)
        guiSetFont(Velocidad, "default-bold-small")
        guiSetProperty(Velocidad, "NormalTextColour", "FF9A9F94")
        PistolaDual = guiCreateButton(131, 301, 89, 27, "Pistola Doble", false, VipDiamante)
        guiSetFont(PistolaDual, "default-bold-small")
        guiSetProperty(PistolaDual, "NormalTextColour", "FF9A9F94")
        DualUzi = guiCreateButton(250, 301, 89, 26, "Uzi Doble", false, VipDiamante)
        guiSetFont(DualUzi, "default-bold-small")
        guiSetProperty(DualUzi, "NormalTextColour", "FF9A9F94")
        SawOffDual = guiCreateButton(368, 301, 95, 27, "Sawn-Off Doble", false, VipDiamante)
        guiSetFont(SawOffDual, "default-bold-small")
        guiSetProperty(SawOffDual, "NormalTextColour", "FF9A9F94")
        VisionNocturna = guiCreateButton(614, 252, 89, 27, "Vision Nocturna", false, VipDiamante)
        guiSetFont(VisionNocturna, "default-bold-small")
        guiSetProperty(VisionNocturna, "NormalTextColour", "FF9A9F94")
        VisionRoja = guiCreateButton(15, 301, 89, 27, "Vision Termica", false, VipDiamante)
        guiSetFont(VisionRoja, "default-bold-small")
        guiSetProperty(VisionRoja, "NormalTextColour", "FF9A9F94")
        Chaleco = guiCreateButton(251, 251, 89, 27, "Chaleco", false, VipDiamante)
        guiSetFont(Chaleco, "default-bold-small")
        guiSetProperty(Chaleco, "NormalTextColour", "FF9A9F94")
        Vida100 = guiCreateButton(368, 251, 89, 27, "Vida 100%", false, VipDiamante)
        guiSetFont(Vida100, "default-bold-small")
        guiSetProperty(Vida100, "NormalTextColour", "FF9A9F94")
        Vida200 = guiCreateButton(494, 251, 89, 27, "Vida 200%", false, VipDiamante)
        guiSetFont(Vida200, "default-bold-small")
        guiSetProperty(Vida200, "NormalTextColour", "FF9A9F94")
        PeleaNormal = guiCreateButton(494, 301, 99, 31, "Estilo de pelea Standard", false, VipDiamante)
        guiSetFont(PeleaNormal, "default-bold-small")
        guiSetProperty(PeleaNormal, "NormalTextColour", "FF9A9F94")
        EstiloBoxeo = guiCreateButton(611, 301, 92, 31, "Estilo de pelea Boxing", false, VipDiamante)
        guiSetFont(EstiloBoxeo, "default-bold-small")
        guiSetProperty(EstiloBoxeo, "NormalTextColour", "FF9A9F94")
        EstiloKungFu = guiCreateButton(15, 350, 93, 31, "Estilo de pelea Kung Fu", false, VipDiamante)
        guiSetFont(EstiloKungFu, "default-bold-small")
        guiSetProperty(EstiloKungFu, "NormalTextColour", "FF9A9F94")
        EstiloKneeHead = guiCreateButton(130, 350, 90, 31, "Estilo de pelea Knee Head", false, VipDiamante)
        guiSetFont(EstiloKneeHead, "default-bold-small")
        guiSetProperty(EstiloKneeHead, "NormalTextColour", "FF9A9F94")
        EatiloGrabKick = guiCreateButton(251, 350, 89, 31, "Estilo de pelea Grab Kick", false, VipDiamante)
        guiSetFont(EatiloGrabKick, "default-bold-small")
        guiSetProperty(EatiloGrabKick, "NormalTextColour", "FF9A9F94")
        Sniper = guiCreateButton(369, 350, 84, 31, "Obtener Sniper Pro", false, VipDiamante)
        guiSetFont(Sniper, "default-bold-small")
        guiSetProperty(Sniper, "NormalTextColour", "FF9A9F94")
        skin1 = guiCreateButton(498, 350, 89, 31, "Skin VIP 1", false, VipDiamante)
        guiSetFont(skin1, "default-bold-small")
        guiSetProperty(skin1, "NormalTextColour", "FF9A9F94")
        skin2 = guiCreateButton(614, 350, 89, 31, "Skin VIP 2", false, VipDiamante)
        guiSetFont(skin2, "default-bold-small")
        guiSetProperty(skin2, "NormalTextColour", "FF9A9F94")
        Cerrar = guiCreateButton(621, 421, 80, 29, "Cerrar", false, VipDiamante)
        guiSetFont(Cerrar, "clear-normal")
        guiSetProperty(Cerrar, "NormalTextColour", "FF9A9F94")
        GUIEditor.edit[1] = guiCreateEdit(362, -698, 15, 15, "", false, VipDiamante)   
		
	
		addEventHandler( "onClientGUIClick", Sniper, Sniperr, false )
		addEventHandler( "onClientGUIClick", Cerrar, Salir, false )
		addEventHandler( "onClientGUIClick", PistolaDual, pistola, false )
		addEventHandler( "onClientGUIClick", DualUzi, uzi, false )
		addEventHandler( "onClientGUIClick", SawOffDual, escopeta, false )
		addEventHandler( "onClientGUIClick", Cabeza, Cabeza1, false )
	    addEventHandler( "onClientGUIClick", Jetpack, VIPJetpack, false )
        addEventHandler( "onClientGUIClick", AutoInvisible, Carro, false )	
		addEventHandler( "onClientGUIClick", Invisible, Invi1, false )  
        addEventHandler( "onClientGUIClick", Reparar, Repair, false )
		addEventHandler( "onClientGUIClick", Fuego, Fire, false )  
		addEventHandler( "onClientGUIClick", Paracaidas, Parachute, false ) 
		addEventHandler( "onClientGUIClick", Velocidad, maxpayne, false ) 
		addEventHandler( "onClientGUIClick", Chaleco, armor, false ) 
		addEventHandler( "onClientGUIClick", Vida100, Life, false ) 
		addEventHandler( "onClientGUIClick", Vida200, Life200, false )
		addEventHandler( "onClientGUIClick", VisionNocturna, Nocturna, false )
		addEventHandler( "onClientGUIClick", VisionRoja, Nocturna2, false )
		addEventHandler( "onClientGUIClick", PeleaNormal, Pelea, false )
		addEventHandler( "onClientGUIClick", EstiloBoxeo, Pelea2, false )
		addEventHandler( "onClientGUIClick", EstiloKungFu, Pelea3, false )
		addEventHandler( "onClientGUIClick", EstiloKneeHead, Pelea4, false )
		addEventHandler( "onClientGUIClick", EatiloGrabKick, Pelea5, false )
		addEventHandler( "onClientGUIClick", skin1, skinn, false )
		addEventHandler( "onClientGUIClick", skin2, skinnn, false )
		showCursor(true)
    end 
	bindKey("o", "down", showPanel)
	
----------------------------------------------------
function Sniperr ()
showCursor(true)
    triggerServerEvent ( "onGreeting", localPlayer)
end
-----------------------------------------------------------------
function Salir ()
showCursor(false)
guiSetVisible (VipDiamante, not guiGetVisible ( VipDiamante ) ) 
end
---------------------------------------------------------------------
function pistola ()
showCursor(true)
    triggerServerEvent ( "onGreetinPistola", localPlayer)
end
----------------------------------------------------------------------
function uzi ()
showCursor(true)
    triggerServerEvent ( "onGreetinUzi", localPlayer)
end
----------------------------------------------------------------------
function escopeta ()
showCursor(true)
    triggerServerEvent ( "onGreetinEscopeta", localPlayer)
end
----------------------------------------------------------------------
function Cabeza1 ()
showCursor(true)
    triggerServerEvent ( "onCabeza",localPlayer)
end
----------------------------------------------------------------------
function VIPJetpack ()
showCursor(true)
triggerServerEvent ( "onJetpack",localPlayer)
end
----------------------------------------------------------------------
function Carro ()
showCursor(true)
triggerServerEvent ( "onCarro",localPlayer)
end
----------------------------------------------------------------------
function Invi1 ()
showCursor(true)
triggerServerEvent ( "onInvisible",localPlayer)
end
----------------------------------------------------------------------
function Repair ()
showCursor(true)
triggerServerEvent ( "onReparar", localPlayer) 
end
----------------------------------------------------------------------
function Fire ()
showCursor(true)
triggerServerEvent ( "onFuego", localPlayer) 
end
----------------------------------------------------------------------
function Parachute ()
showCursor(true)
triggerServerEvent ( "onParacaidas", localPlayer) 
end
----------------------------------------------------------------------
function speed ()
showCursor(true)
triggerClientEvent ( "onVelocidad", localPlayer)
end
----------------------------------------------------------------------
function speed ()
showCursor(true)
triggerServerEvent ( "onVelocidad", localPlayer)
end
----------------------------------------------------------------------
function armor ()
showCursor(true)
triggerServerEvent ( "onArmadura", localPlayer)
end
----------------------------------------------------------------------
function Life ()
showCursor(true)
triggerServerEvent ( "onVida", localPlayer)
end
----------------------------------------------------------------------
function Life200 ()
showCursor(true)
triggerServerEvent ( "onVida2", localPlayer)
end
----------------------------------------------------------------------
function Nocturna ()
showCursor(true)
triggerServerEvent ( "onVision", localPlayer)
end
----------------------------------------------------------------------
function Nocturna2 ()
showCursor(true)
triggerServerEvent ( "onVision2", localPlayer)
end
--------------------------------------------------------------------------------------------------------------------------------------------
function Pelea ()
showCursor(true)
triggerServerEvent ( "onPelea1", localPlayer)
end
---------------------------------------------------------------------------------
function Pelea2 ()
showCursor(true)
triggerServerEvent ( "onPelea2", localPlayer)
end
---------------------------------------------------------------------------------
function Pelea3 ()
showCursor(true)
triggerServerEvent ( "onPelea3", localPlayer)
end
---------------------------------------------------------------------------------
function Pelea4 ()
showCursor(true)
triggerServerEvent ( "onPelea4", localPlayer)
end
---------------------------------------------------------------------------------
function Pelea5 ()
showCursor(true)
triggerServerEvent ( "onPelea5", localPlayer)
end
---------------------------------------------------------------------------------
function skinn ()
showCursor(true)
triggerServerEvent ( "onSkin1", localPlayer)
end
---------------------------------------------------------------------------------
function skinnn ()
showCursor(true)
triggerServerEvent ( "onSkin2", localPlayer)
end
--------------------------------------------------------------------------------
function maxpayne() 
    if getGameSpeed() == 2.5 then 
    setGameSpeed(1) 
  outputChatBox("#00FFF7VIP DIAMANTE: #D5D8D8Tu velocidad a cambiado a Normal.", 255, 255, 255, true)
  else 
    setGameSpeed(2.5) 
     outputChatBox("#00FFF7VIP DIAMANTE: #D5D8D8Tu velocidad a cambiado a 3X.", 255, 255, 255, true)
    end 
	triggerServerEvent ( "onVelocidad", localPlayer)
end  
----------------------------------------------------------------------
tengo esto en el client pero al presionar la tecla O solo me abre el panel pero no se cierra, soy principiante en esto
Link to comment

Prueba esto 

GUIEditor = {
    button = {},
    edit = {}
}

addEventHandler("onClientResourceStart", resourceRoot, 
	function () 
        VipDiamante = guiCreateWindow(355, 197, 713, 464, "PANEL VIP DIAMANTE", false)
        guiWindowSetSizable(VipDiamante, false)
        guiSetProperty(VipDiamante, "CaptionColour", "FF01FDF4")
        guiSetVisible( VipDiamante, false )

        informacion = guiCreateMemo(20, 29, 329, 141, "* Gracias por la compra de tu VIP DIAMANTE.\n\n* Evita no abusar del panel.\n\n* Disfrutalo.\n\n- COMANDOS:\n/parlante : Radio VIP.\n/volar : Activas el modo de vuelo en auto.\n/tp : teletransportarse a un jugador.\n/salto : Super Salto.\n/bici : Super Salto en bicicleta.\n/municion : Municion infinita.", false, VipDiamante)
        logo = guiCreateStaticImage(368, 29, 336, 141, "img/diamante.png", false, VipDiamante)
        Cabeza = guiCreateButton(15, 202, 89, 27, "Cabeza", false, VipDiamante)
        guiSetFont(Cabeza, "default-bold-small")
        guiSetProperty(Cabeza, "NormalTextColour", "FF9A9F94")
        Jetpack = guiCreateButton(131, 202, 89, 27, "Jetpack", false, VipDiamante)
        guiSetFont(Jetpack, "default-bold-small")
        guiSetProperty(Jetpack, "NormalTextColour", "FF9A9F94")
        Invisible = guiCreateButton(368, 202, 89, 27, "Invisible", false, VipDiamante)
        guiSetFont(Invisible, "default-bold-small")
        guiSetProperty(Invisible, "NormalTextColour", "FF9A9F94")
        AutoInvisible = guiCreateButton(246, 202, 89, 27, "Auto Invisible", false, VipDiamante)
        guiSetFont(AutoInvisible, "default-bold-small")
        guiSetProperty(AutoInvisible, "NormalTextColour", "FF9A9F94")
        Reparar = guiCreateButton(494, 202, 89, 27, "Reparar", false, VipDiamante)
        guiSetFont(Reparar, "default-bold-small")
        guiSetProperty(Reparar, "NormalTextColour", "FF9A9F94")
        Fuego = guiCreateButton(611, 202, 89, 27, "Fuego", false, VipDiamante)
        guiSetFont(Fuego, "default-bold-small")
        guiSetProperty(Fuego, "NormalTextColour", "FF9A9F94")
        Paracaidas = guiCreateButton(15, 252, 89, 27, "Paracaidas", false, VipDiamante)
        guiSetFont(Paracaidas, "default-bold-small")
        guiSetProperty(Paracaidas, "NormalTextColour", "FF9A9F94")
        Velocidad = guiCreateButton(131, 252, 89, 27, "Velocidad 3x", false, VipDiamante)
        guiSetFont(Velocidad, "default-bold-small")
        guiSetProperty(Velocidad, "NormalTextColour", "FF9A9F94")
        PistolaDual = guiCreateButton(131, 301, 89, 27, "Pistola Doble", false, VipDiamante)
        guiSetFont(PistolaDual, "default-bold-small")
        guiSetProperty(PistolaDual, "NormalTextColour", "FF9A9F94")
        DualUzi = guiCreateButton(250, 301, 89, 26, "Uzi Doble", false, VipDiamante)
        guiSetFont(DualUzi, "default-bold-small")
        guiSetProperty(DualUzi, "NormalTextColour", "FF9A9F94")
        SawOffDual = guiCreateButton(368, 301, 95, 27, "Sawn-Off Doble", false, VipDiamante)
        guiSetFont(SawOffDual, "default-bold-small")
        guiSetProperty(SawOffDual, "NormalTextColour", "FF9A9F94")
        VisionNocturna = guiCreateButton(614, 252, 89, 27, "Vision Nocturna", false, VipDiamante)
        guiSetFont(VisionNocturna, "default-bold-small")
        guiSetProperty(VisionNocturna, "NormalTextColour", "FF9A9F94")
        VisionRoja = guiCreateButton(15, 301, 89, 27, "Vision Termica", false, VipDiamante)
        guiSetFont(VisionRoja, "default-bold-small")
        guiSetProperty(VisionRoja, "NormalTextColour", "FF9A9F94")
        Chaleco = guiCreateButton(251, 251, 89, 27, "Chaleco", false, VipDiamante)
        guiSetFont(Chaleco, "default-bold-small")
        guiSetProperty(Chaleco, "NormalTextColour", "FF9A9F94")
        Vida100 = guiCreateButton(368, 251, 89, 27, "Vida 100%", false, VipDiamante)
        guiSetFont(Vida100, "default-bold-small")
        guiSetProperty(Vida100, "NormalTextColour", "FF9A9F94")
        Vida200 = guiCreateButton(494, 251, 89, 27, "Vida 200%", false, VipDiamante)
        guiSetFont(Vida200, "default-bold-small")
        guiSetProperty(Vida200, "NormalTextColour", "FF9A9F94")
        PeleaNormal = guiCreateButton(494, 301, 99, 31, "Estilo de pelea Standard", false, VipDiamante)
        guiSetFont(PeleaNormal, "default-bold-small")
        guiSetProperty(PeleaNormal, "NormalTextColour", "FF9A9F94")
        EstiloBoxeo = guiCreateButton(611, 301, 92, 31, "Estilo de pelea Boxing", false, VipDiamante)
        guiSetFont(EstiloBoxeo, "default-bold-small")
        guiSetProperty(EstiloBoxeo, "NormalTextColour", "FF9A9F94")
        EstiloKungFu = guiCreateButton(15, 350, 93, 31, "Estilo de pelea Kung Fu", false, VipDiamante)
        guiSetFont(EstiloKungFu, "default-bold-small")
        guiSetProperty(EstiloKungFu, "NormalTextColour", "FF9A9F94")
        EstiloKneeHead = guiCreateButton(130, 350, 90, 31, "Estilo de pelea Knee Head", false, VipDiamante)
        guiSetFont(EstiloKneeHead, "default-bold-small")
        guiSetProperty(EstiloKneeHead, "NormalTextColour", "FF9A9F94")
        EatiloGrabKick = guiCreateButton(251, 350, 89, 31, "Estilo de pelea Grab Kick", false, VipDiamante)
        guiSetFont(EatiloGrabKick, "default-bold-small")
        guiSetProperty(EatiloGrabKick, "NormalTextColour", "FF9A9F94")
        Sniper = guiCreateButton(369, 350, 84, 31, "Obtener Sniper Pro", false, VipDiamante)
        guiSetFont(Sniper, "default-bold-small")
        guiSetProperty(Sniper, "NormalTextColour", "FF9A9F94")
        skin1 = guiCreateButton(498, 350, 89, 31, "Skin VIP 1", false, VipDiamante)
        guiSetFont(skin1, "default-bold-small")
        guiSetProperty(skin1, "NormalTextColour", "FF9A9F94")
        skin2 = guiCreateButton(614, 350, 89, 31, "Skin VIP 2", false, VipDiamante)
        guiSetFont(skin2, "default-bold-small")
        guiSetProperty(skin2, "NormalTextColour", "FF9A9F94")
        Cerrar = guiCreateButton(621, 421, 80, 29, "Cerrar", false, VipDiamante)
        guiSetFont(Cerrar, "clear-normal")
        guiSetProperty(Cerrar, "NormalTextColour", "FF9A9F94")
        GUIEditor.edit[1] = guiCreateEdit(362, -698, 15, 15, "", false, VipDiamante)   
		
	
		addEventHandler( "onClientGUIClick", Sniper, Sniperr, false )
		addEventHandler( "onClientGUIClick", Cerrar, Salir, false )
		addEventHandler( "onClientGUIClick", PistolaDual, pistola, false )
		addEventHandler( "onClientGUIClick", DualUzi, uzi, false )
		addEventHandler( "onClientGUIClick", SawOffDual, escopeta, false )
		addEventHandler( "onClientGUIClick", Cabeza, Cabeza1, false )
	    addEventHandler( "onClientGUIClick", Jetpack, VIPJetpack, false )
        addEventHandler( "onClientGUIClick", AutoInvisible, Carro, false )	
		addEventHandler( "onClientGUIClick", Invisible, Invi1, false )  
        addEventHandler( "onClientGUIClick", Reparar, Repair, false )
		addEventHandler( "onClientGUIClick", Fuego, Fire, false )  
		addEventHandler( "onClientGUIClick", Paracaidas, Parachute, false ) 
		addEventHandler( "onClientGUIClick", Velocidad, maxpayne, false ) 
		addEventHandler( "onClientGUIClick", Chaleco, armor, false ) 
		addEventHandler( "onClientGUIClick", Vida100, Life, false ) 
		addEventHandler( "onClientGUIClick", Vida200, Life200, false )
		addEventHandler( "onClientGUIClick", VisionNocturna, Nocturna, false )
		addEventHandler( "onClientGUIClick", VisionRoja, Nocturna2, false )
		addEventHandler( "onClientGUIClick", PeleaNormal, Pelea, false )
		addEventHandler( "onClientGUIClick", EstiloBoxeo, Pelea2, false )
		addEventHandler( "onClientGUIClick", EstiloKungFu, Pelea3, false )
		addEventHandler( "onClientGUIClick", EstiloKneeHead, Pelea4, false )
		addEventHandler( "onClientGUIClick", EatiloGrabKick, Pelea5, false )
		addEventHandler( "onClientGUIClick", skin1, skinn, false )
		addEventHandler( "onClientGUIClick", skin2, skinnn, false )
    end 
)

bindKey("o", "down", 
	function() 
		guiSetVisible( VipDiamante, not guiGetVisible( VipDiamante ) ) 
		showCursor( not isCursorShowing() )
	end 
)
	
----------------------------------------------------
function Sniperr ()
showCursor(true)
    triggerServerEvent ( "onGreeting", localPlayer)
end
-----------------------------------------------------------------
function Salir ()
showCursor(false)
guiSetVisible (VipDiamante, not guiGetVisible ( VipDiamante ) ) 
end
---------------------------------------------------------------------
function pistola ()
showCursor(true)
    triggerServerEvent ( "onGreetinPistola", localPlayer)
end
----------------------------------------------------------------------
function uzi ()
showCursor(true)
    triggerServerEvent ( "onGreetinUzi", localPlayer)
end
----------------------------------------------------------------------
function escopeta ()
showCursor(true)
    triggerServerEvent ( "onGreetinEscopeta", localPlayer)
end
----------------------------------------------------------------------
function Cabeza1 ()
showCursor(true)
    triggerServerEvent ( "onCabeza",localPlayer)
end
----------------------------------------------------------------------
function VIPJetpack ()
showCursor(true)
triggerServerEvent ( "onJetpack",localPlayer)
end
----------------------------------------------------------------------
function Carro ()
showCursor(true)
triggerServerEvent ( "onCarro",localPlayer)
end
----------------------------------------------------------------------
function Invi1 ()
showCursor(true)
triggerServerEvent ( "onInvisible",localPlayer)
end
----------------------------------------------------------------------
function Repair ()
showCursor(true)
triggerServerEvent ( "onReparar", localPlayer) 
end
----------------------------------------------------------------------
function Fire ()
showCursor(true)
triggerServerEvent ( "onFuego", localPlayer) 
end
----------------------------------------------------------------------
function Parachute ()
showCursor(true)
triggerServerEvent ( "onParacaidas", localPlayer) 
end
----------------------------------------------------------------------
function speed ()
showCursor(true)
triggerClientEvent ( "onVelocidad", localPlayer)
end
----------------------------------------------------------------------
function speed ()
showCursor(true)
triggerServerEvent ( "onVelocidad", localPlayer)
end
----------------------------------------------------------------------
function armor ()
showCursor(true)
triggerServerEvent ( "onArmadura", localPlayer)
end
----------------------------------------------------------------------
function Life ()
showCursor(true)
triggerServerEvent ( "onVida", localPlayer)
end
----------------------------------------------------------------------
function Life200 ()
showCursor(true)
triggerServerEvent ( "onVida2", localPlayer)
end
----------------------------------------------------------------------
function Nocturna ()
showCursor(true)
triggerServerEvent ( "onVision", localPlayer)
end
----------------------------------------------------------------------
function Nocturna2 ()
showCursor(true)
triggerServerEvent ( "onVision2", localPlayer)
end
--------------------------------------------------------------------------------------------------------------------------------------------
function Pelea ()
showCursor(true)
triggerServerEvent ( "onPelea1", localPlayer)
end
---------------------------------------------------------------------------------
function Pelea2 ()
showCursor(true)
triggerServerEvent ( "onPelea2", localPlayer)
end
---------------------------------------------------------------------------------
function Pelea3 ()
showCursor(true)
triggerServerEvent ( "onPelea3", localPlayer)
end
---------------------------------------------------------------------------------
function Pelea4 ()
showCursor(true)
triggerServerEvent ( "onPelea4", localPlayer)
end
---------------------------------------------------------------------------------
function Pelea5 ()
showCursor(true)
triggerServerEvent ( "onPelea5", localPlayer)
end
---------------------------------------------------------------------------------
function skinn ()
showCursor(true)
triggerServerEvent ( "onSkin1", localPlayer)
end
---------------------------------------------------------------------------------
function skinnn ()
showCursor(true)
triggerServerEvent ( "onSkin2", localPlayer)
end
--------------------------------------------------------------------------------
function maxpayne() 
    if getGameSpeed() == 2.5 then 
    setGameSpeed(1) 
  outputChatBox("#00FFF7VIP DIAMANTE: #D5D8D8Tu velocidad a cambiado a Normal.", 255, 255, 255, true)
  else 
    setGameSpeed(2.5) 
     outputChatBox("#00FFF7VIP DIAMANTE: #D5D8D8Tu velocidad a cambiado a 3X.", 255, 255, 255, true)
    end 
	triggerServerEvent ( "onVelocidad", localPlayer)
end  
----------------------------------------------------------------------

 

  • Thanks 1
Link to comment

Esto en teoría debería funcionar, no lo he probado. 

SERVER

Spoiler

function showGUI( player )
	triggerClientEvent( player, "showVIPGui", player )
end 


addEventHandler("onPlayerJoin", root, 
	function ( ... )
		local accountName = getAccountName( getPlayerAccount( source ) ) 
		if ( isObjectInACLGroup("user."..accountName, aclGetGroup("Vip Diamond") ) ) then 
			bindKey( source, "o", "down", showGUI, source )
		end
	end)

addEventHandler("onResourceStart", root, 
	function ( ... )
		for i, player in ipairs( getElementsByType("player") ) do
			local accountName = getAccountName( getPlayerAccount( player ) ) 
			if ( isObjectInACLGroup("user."..accountName, aclGetGroup("Vip Diamond") ) ) then 
				bindKey( player, "o", "down", showGUI, player )
			end
		end
	end)

 

CLIENT

Spoiler

-- agregale esto a tu client

addEvent("showVIPGui", true )
addEventHandler("showVIPGui", root, 
	function ( ... )
		guiSetVisible( VipDiamante, not guiGetVisible( VipDiamante ) ) 
		showCursor( not isCursorShowing() )
	end)

 

Solo los que son del grupo Vip Diamond les debería dejar abrir el panel.

Edited by Melbourne
  • Thanks 1
Link to comment
17 hours ago, Melbourne said:

Cambia onPlayerJoin por 'onPlayerLogin' ya que siempre te saltara false la condición si lo usas con ese evento.

  • Thanks 2
Link to comment

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