lLinux Posted June 22, 2014 Posted June 22, 2014 Estoy haciendo un panel para dar rangos, ya logre que cargue las personas en la gridlist y que se auto-actualize, pero no logro hcer que cuando den al boton de dar rango mod, o smod o admin les de: Client con funcion del boton: function onBotonMod() outputChatBox("asdasd") 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, "Moderator") end end addEventHandler("onClientGUIClick", b_mod, onBotonMod, false ) Server-side evento setRank: 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)
MisterQuestions Posted June 24, 2014 Posted June 24, 2014 ¿Como lograste lo de hacer lo de las gridlist, es que yo tambien toy haciendo uno T-t
lLinux Posted June 24, 2014 Author Posted June 24, 2014 ¿Como lograste lo de hacer lo de las gridlist, es que yo tambien toy haciendo uno T-t Añademe en skype(HackerlLinux) o en fb(www.fb.com/lLinux)
Recommended Posts