Jump to content

Dar rango a un usuario seleccionado de una gridlist?


lLinux

Recommended Posts

Hola, bueno estoy haciendo un panel para dar rango pero los usuarios lo carga y lso actualiza, pero cuando selecciono el usuario y le doy ene l boton no pasa nada

La funcion del boton de supermoderator

function onBotonSMod() 
    local row, col = guiGridListGetSelectedItem(lista) 
    if row == -1 or col == -1 then 
        return 
    end 
    local name = guiGridListGetItemText(lista, row, col) 
    local target = getPlayerFromName(name) 
    if target then 
        triggerServerEvent("setRank", getLocalPlayer(), target, "SuperModerator") 
    end 
end 
addEventHandler("onClientGUIClick", b_smod, onBotonSMod, false ) 

Link to comment
podrias mostrar la funcion del server setRank?

algun error en el debug?

Claro mira:

function darRango(player, groupname) 
    local account = getPlayerAccount(player) 
    if ( not isGuestAccount ( account ) ) then 
        local group = aclGetGroup ( groupname ) 
        if ( group ) then 
            local isInACLGroup = isObjectInACLGroup ( "user." .. getAccountName ( account ), group) 
            if ( not isInACLGroup ) then 
                aclGroupAddObject ( group, "user."..getAccountName ( account ) ) 
                outputChatBox ( "#AFAFAF[GIVE-RANGE]#FFFFFF The player " .. getPlayerName(player) .. "#FFFFFF was added to the group #AFAFAF" .. groupname .. ".", source, 255, 255 ,0 ) 
            elseif ( isInACLGroup ) then 
                aclGroupRemoveObject ( group, "user."..getAccountName ( account ) ) 
                outputChatBox ( "#AFAFAF[GIVE-RANGE]#FFFFFF The player " .. getPlayerName(player) .. "#FFFFFF has been removed from group #AFAFAF" .. groupname .. ".", source, 255, 255 ,0 ) 
            end 
        else 
            outputChatBox ( "#AFAFAF[ERROR]#FFFFFF The group #AFAFAF" .. groupname .. "#FFFFFF does not exist.", source, 255, 0 ,0 ) 
        end 
    else 
        outputChatBox ( "#AFAFAF[ERROR]#FFFFFF The player has not logged in", source, 255, 100 ,100 ) 
    end 
end 
addEvent("setRank",true) 
addEventHandler("setRank", getRootElement(), darRango) 

Link to comment
  • Recently Browsing   0 members

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