Jump to content

Problema Panel De Reclutacion


iFoReX

Recommended Posts

Posted

Ams Estaba Creando Un Panel De Reclutacion Ya Que Un Amigo No Me Quiso Pasar El Que Creo El e.e y todo iba bien hasta que cuando uno aprieta expulsar no pasa nada :C

GUIEditor = { 
    gridlist = {}, 
    button = {}, 
    window = {}, 
} 
GUIEditor.window[1] = guiCreateWindow(245, 135, 404, 349, "Panel De Reclutacion De GH by ElMota", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FFDD") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 23, 181, 317, false, GUIEditor.window[1]) 
column = guiGridListAddColumn(GUIEditor.gridlist[1], "Jugadores", 0.9) 
GUIEditor.button[1] = guiCreateButton(202, 31, 179, 39, "Expulsar", false, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(202, 88, 179, 39, "Agregar Al Clan", false, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(202, 147, 179, 39, "Darle Panel Recluter", false, GUIEditor.window[1]) 
GUIEditor.button[4] = guiCreateButton(202, 203, 179, 39, "Quitarle Panel Recluter", false, GUIEditor.window[1]) 
  
guiSetVisible(GUIEditor.window[1],false) 
  
addEvent("guiGH",true) 
addEventHandler("guiGH",root,function() 
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1])) 
end 
) 
  
  
function list() 
if ( column ) then 
for id, player in ipairs(getElementsByType("player")) do 
local name = getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" ) 
    local row3 = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
        guiGridListSetItemText ( GUIEditor.gridlist[1], row3, column, name, false, false ) 
        end 
    end 
end 
addEventHandler("onClientResourceStart",resourceRoot,list) 
addEventHandler("onClientPlayerJoin", getRootElement(), list) 
addEventHandler("onClientPlayerQuit", getRootElement(), list) 
addEventHandler("onClientPlayerChangeNick", getRootElement(), list) 
  
  
function click() 
if source == GUIEditor.gridlist[1] and source == GUIEditor.button[1] then 
local playerName = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
local elPlayer = getPlayerFromName(playerName) 
triggerServerEvent(elPlayer,"gay",elPlayer) 
end 
end 
addEventHandler ( "onClientGUIClick", root, click ) 

addCommandHandler("PanelGH",function(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ReGH" ) ) then 
triggerClientEvent ( thePlayer, "guiGH", thePlayer ) 
end 
end 
) 
  
addEvent("gay",true) 
addEventHandler("gay",root,function(elPlayer) 
local accName = getAccountName ( getPlayerAccount ( elPlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "GH" ) ) then 
aclGroupRemoveObject (aclGetGroup("GH"), "user."..accName) 
aclGroupRemoveObject (aclGetGroup("ReGH"), "user."..accName) 
local name = getPlayerName(elPlayer) 
outputChatBox(name.." #ff0000Ha Sido Expulsado Del Clan GH satisfactoriamente", getRootElement(),255,255,255,true) 
end 
end 
) 
  

Posted

Primer error:

if source == GUIEditor.gridlist[1] and source == GUIEditor.button[1] then 

Estas comprobando si el GUI-Element clickeado es el gridList y ademas el Boton, como es posible clickear ambos?

Posted

Esto es de mi nuevo gamemode, ve lo que necesitas:

----------------------------------------------- 
--------------Spawn Source--------------------- 
----------------------------------------------- 
  
addEventHandler( "onClientResourceStart", resourceRoot, 
function () 
local species = speciesCache ( ) 
 for k, i in ipairs( species ) do 
  guiGridListSetItemText ( spawng, guiGridListAddRow ( spawng ), spawnc, i, false, false ) 
 end 
end 
) 
  
  
 showCursor( true ) 
  
 addEventHandler( "onClientGUIClick", root, 
       function ( button ) 
        local i1, i2 = guiGridListGetSelectedItem ( spawng ) 
        if button == "left" and source == spawnb and i1 ~= -1 and i2 ~= -1 then 
           setElementData( localPlayer, "Specie", guiGridListGetItemText ( spawng, i1, i2 ), true) 
                             showCursor( false ) 
                             guiSetVisible( spawnw ,false) 
                             guiSetVisible( spawnb ,false) 
        end 
       end 
 ) 

Posted

Ams Ahora Me Da Error En El Trigger :/

GUIEditor = { 
    gridlist = {}, 
    button = {}, 
    edit = {}, 
    window = {}, 
} 
GUIEditor.window[1] = guiCreateWindow(245, 135, 404, 349, "Panel De Reclutacion De GH by ElMota", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FFDD") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 23, 181, 317, false, GUIEditor.window[1]) 
column = guiGridListAddColumn(GUIEditor.gridlist[1], "Jugadores", 0.9) 
GUIEditor.button[1] = guiCreateButton(202, 31, 179, 39, "Expulsar", false, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(202, 88, 179, 39, "Agregar Al Clan", false, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(202, 147, 179, 39, "Darle Panel Recluter", false, GUIEditor.window[1]) 
GUIEditor.button[4] = guiCreateButton(202, 203, 179, 39, "Quitarle Panel Recluter", false, GUIEditor.window[1]) 
GUIEditor.edit[1] = guiCreateEdit(206, 253, 172, 36, "", false, GUIEditor.window[1]) 
guiEditSetReadOnly(GUIEditor.edit[1], true) 
  
guiSetVisible(GUIEditor.window[1],false) 
  
addEvent("guiGH",true) 
addEventHandler("guiGH",root,function() 
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1])) 
end 
) 
  
  
function list() 
if ( column ) then 
for id, player in ipairs(getElementsByType("player")) do 
local name = getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" ) 
    local row3 = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
        guiGridListSetItemText ( GUIEditor.gridlist[1], row3, column, name, false, false ) 
        end 
    end 
end 
addEventHandler("onClientResourceStart",resourceRoot,list) 
addEventHandler("onClientPlayerJoin", getRootElement(), list) 
addEventHandler("onClientPlayerQuit", getRootElement(), list) 
addEventHandler("onClientPlayerChangeNick", getRootElement(), list) 
  
function click () 
       local playerName = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
       guiSetText ( GUIEditor.edit[1], playerName ) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor.gridlist[1], click ) 
  
-------- 
--Funcion Exportada--------- 
function getPlayerFromNamePart(name) 
    if name then  
        for i, player in ipairs(getElementsByType("player")) do 
            if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then 
                return player  
            end 
        end 
    end 
    return false 
end 
------------------- 
-------- 
  
  
addEventHandler("onClientGUIClick",root,function() 
if source == GUIEditor.button[1] then 
local text = guiGetText(GUIEditor.edit[1]) 
local elPlayer = getPlayerFromNamePart(text) 
triggerServerEvent("gay",elPlayer) 
end 
end 
) 
  

addCommandHandler("PanelGH",function(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ReGH" ) ) then 
triggerClientEvent ( thePlayer, "guiGH", thePlayer ) 
end 
end 
) 
  
addEvent("gay",true) 
addEventHandler("gay",root,function(elPlayer) 
local accName = getAccountName ( getPlayerAccount ( elPlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "GH" ) ) then 
local sacado = aclGroupRemoveObject (aclGetGroup("GH"), "user."..accName) 
aclGroupRemoveObject (aclGetGroup("ReGH"), "user."..accName) 
if sacado then 
local name = getPlayerName(elPlayer) 
outputChatBox(name.." #ff0000Ha Sido Expulsado Del Clan GH satisfactoriamente", getRootElement(),255,255,255,true) 
end 
elseif not isObjectInACLGroup ("user."..accName, aclGetGroup ( "GH" ) ) then 
outputChatBox(name.." #ff0000No Pertenece Al Clan", source,255,255,255,true) 
end 
end 
) 
  

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...