#Horus Posted September 7, 2018 Share Posted September 7, 2018 Fiz um painel de tag para donos de gangues e corps, ai tem a lista de jogadores, eu queria que aparecesse apenas quem ja esta logado nesta lista de jogadores pfv ajudem, eu queria tambem que a lista atualizasse para quando um player sair ele desaparecer da lista e para quando um player entrar ele aparecer na lista, vou deixar os arquivos abaixo, pfv urgente pessoal Server: PMTAG = aclCreateGroup ( "CmdBOPE" ) PM = aclCreateGroup ( "BOPE" ) function painelbope(thePlayer) login = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user."..login, aclGetGroup("CmdBOPE")) then triggerClientEvent(thePlayer, "bopetag", getRootElement()) else end end addCommandHandler ("painelbope", painelbope) function armasbope (jogador) giveWeapon ( jogador, 4, 9999 ) giveWeapon ( jogador, 23, 100 ) giveWeapon ( jogador, 25, 9999 ) giveWeapon ( jogador, 29, 9999 ) giveWeapon ( jogador, 31, 9999 ) giveWeapon ( jogador, 34, 9999 ) giveWeapon ( jogador, 17, 9999 ) outputChatBox (""..getPlayerName(jogador).."", source, 255,255,255, true) outputChatBox ("", jogador, 255,255,255, true) end addEvent("armasbope",true) addEventHandler ( "armasbope", getRootElement(), armasbope) function skinbope (jogador) setPedSkin ( jogador, 79) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce Deu A Skin para : "..getPlayerName(jogador).."", source, 255,255,255, true) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce Ganhou a Skin ", jogador, 255,255,255, true) end addEvent("skinbope",true) addEventHandler ( "skinbope", getRootElement(), skinbope) veh = {} function vtrbope (jogador) if veh[jogador] and isElement( veh[jogador] ) then destroyElement( veh[jogador] ) veh[jogador] = nil end local x,y,z = getElementPosition(jogador) veh[jogador] = createVehicle(490, x,y,z) warpPedIntoVehicle (jogador,veh[jogador]) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce deu A VTR para : "..getPlayerName(jogador).."", source, 255,255,255, true) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce Ganhou a VTR", jogador, 255,255,255, true) end addEvent("vtrbope",true) addEventHandler ( "vtrbope", getRootElement(), vtrbope) function basebope (jogador) setElementPosition (jogador, 1551.4127197266,-1620.5498046875,13.546875) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce teleportou : "..getPlayerName(jogador).."", source, 255,255,255, true) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce foi teleportado para a base", jogador, 255,255,255, true) end addEvent("basebope",true) addEventHandler ( "basebope", getRootElement(), basebope) function destruirbope (jogador) destroyElement (veh[jogador]) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce Destruiu A VTR"..getPlayerName(jogador).."", source, 255,255,255, true) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEA Sua VTR Foi Destruida", jogador, 255,255,255, true) end addEvent("destruirbope",true) addEventHandler ( "destruirbope", getRootElement(), destruirbope) function addbope (jogador) local gett = getTeamName(getPlayerTeam(jogador)) if isGuestAccount(getPlayerAccount(jogador)) then outputChatBox ("#000000[#00FFFFErro#000000]#BEBEBEEsse Jogador Nao Esta Logado", source, 255,255,255, true) else if gett == false then aclGroupAddObject (aclGetGroup("BOPE"), "user."..getAccountName(getPlayerAccount(jogador))) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce adiciono O Jogador " ..getPlayerName(jogador).." No Grupo Da #00FFFFBOPE", source, 255,255,255, true) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce Ganhou Tag Da #00FFFFBOPE", jogador, 255,255,255, true) else outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEO Jogador Ja Esta Com Tag", source, 255,255,255, true) end end end addEvent ("addbope", true) addEventHandler ("addbope", getRootElement(), addbope) function removebope (jogador) local conta = getAccountName ( getPlayerAccount ( jogador ) ) if isGuestAccount(getPlayerAccount(jogador)) then return outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEO Jogador Nao Esta Logado", source, 255,255,255, true) end if isObjectInACLGroup ("user."..conta, aclGetGroup ( "BOPE" ) ) then aclGroupRemoveObject (aclGetGroup("BOPE"), "user."..getAccountName(getPlayerAccount(jogador))) outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEVoce Removeu o Jogador "..getPlayerName(jogador).." Do Grupo Da #00FFFFBOPE", source, 255,255,255, true) else outputChatBox ("#ffffff♦ - #ffffff「 #FFFF00AVISO #ffffff」#BEBEBEO Jogador Nao Esta Com Tag", source, 255,255,255, true) end end addEvent ("removebope", true) addEventHandler ("removebope", getRootElement(), removebope) Client: local screenW,screenH = guiGetScreenSize() local resW, resH = 1365,767 local x, y = (screenW/resW), (screenH/resH) gridlist = guiCreateGridList(x*529, y*264, x*160, y*260, false) coluna = guiGridListAddColumn(gridlist, "Players", 0.9) guiSetVisible(gridlist, false) painelBOPE = false function bopetag () dxDrawRectangle(x*514, y*171, x*381, y*400, tocolor(0, 0, 0, 225), false) dxDrawRectangle(x*514, y*170, x*341, y*42, tocolor(36, 35, 35, 255), false) dxDrawText("BOPE", x*515, y*171, x*855, y*212, tocolor(241, 0, 0, 255), x*1.0, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("Selecione o player", x*527, y*244, x*689, y*266, tocolor(255, 255, 255, 255), x*1.00, "default", "center", "bottom", false, false, false, false, false) dxDrawRectangle(x*855, y*170, x*40, y*42, tocolor(0, 0, 0, 255), false) dxDrawText("X", x*855, y*171, x*895, y*212, tocolor(255, 255, 255, 255), x*2.00, "clear", "center", "center", false, false, false, false, false) dxDrawRectangle(x*699, y*266, x*89, y*34, tocolor(36, 35, 35, 255), false) dxDrawText("Armas", x*699, y*266, x*788, y*300, tocolor(241, 0, 0, 255), x*1.30, "pricedown-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(x*798, y*266, x*89, y*34, tocolor(36, 35, 35, 255), false) dxDrawText("Skin", x*798, y*266, x*887, y*300, tocolor(241, 0, 0, 255), x*1.30, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(x*699, y*310, x*89, y*34, tocolor(36, 35, 35, 255), false) dxDrawText("VTR", x*689, y*310, x*788, y*344, tocolor(241, 0, 0, 255), x*1.30, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(x*798, y*310, x*89, y*34, tocolor(36, 35, 35, 255), false) dxDrawText("Base", x*788, y*310, x*887, y*344, tocolor(241, 0, 0, 255), x*1.30, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(x*699, y*354, x*186, y*34, tocolor(36, 35, 35, 255), false) dxDrawText("Destruir VTR", x*699, y*354, x*885, y*388, tocolor(241, 0, 0, 255), x*1.30, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(x*699, y*446, x*186, y*34, tocolor(36, 35, 35, 255), false) dxDrawText("Adicionar TAG", x*699, y*446, x*885, y*480, tocolor(241, 0, 0, 255), x*1.30, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(x*699, y*490, x*186, y*34, tocolor(36, 35, 35, 255), false) dxDrawText("Remover TAG", x*699, y*490, x*885, y*524, tocolor(241, 0, 0, 255), x*1.30, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("2018 @Copyright - Criado por :#Horus", x*524, y*548, x*885, y*565, tocolor(255, 255, 255, 255), x*1.00, "default", "center", "top", false, false, false, false, false) end function abrir () if painelBOPE == false then addEventHandler ("onClientRender", root, bopetag) painelBOPE = true showCursor (true) guiSetVisible(gridlist, true) else if painelBOPE == true then removeEventHandler ("onClientRender", root, bopetag) guiSetVisible(gridlist, false) painelBOPE = false showCursor (false) end end end addEvent ("bopetag",true) addEventHandler ("bopetag",root,abrir) function X () if painelBOPE == true then if ( isCursorOnElement (x*855, y*170, x*40, y*42) ) then removeEventHandler("onClientRender", root, bopetag) guiSetVisible(gridlist, false) showCursor (false) painelBOPE = false end end end addEventHandler ("onClientClick", root, X) function Actualizar() guiGridListClear(gridlist) for index, player in ipairs(getElementsByType("player")) do FILA = guiGridListAddRow(gridlist) guiGridListSetItemText ( gridlist, FILA, coluna, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) guiGridListSetItemData ( gridlist, FILA, coluna, getPlayerName(player)) end end addEventHandler("onClientPlayerJoin", getRootElement(), Actualizar) addEventHandler("onClientPlayerQuit", getRootElement(), Actualizar) addEventHandler("onClientPlayerChangeNick", getRootElement(), Actualizar) addEventHandler ("onClientResourceStart",getRootElement(), Actualizar) function pegarnick () if source == gridlist then local nomeplayer = guiGridListGetItemData(gridlist, guiGridListGetSelectedItem(gridlist), 1) local jogadorx = getPlayerFromName(nomeplayer) jogador = jogadorx end end addEventHandler ("onClientResourceStart", getRootElement(), pegarnick) addEventHandler ("onClientGUIClick", gridlist, pegarnick, false) addEventHandler("onClientPlayerJoin", getRootElement(), pegarnick) addEventHandler("onClientPlayerQuit", getRootElement(), pegarnick) addEventHandler("onClientPlayerChangeNick", getRootElement(), pegarnick) function armasbope (_,state) if painelBOPE == true then if state == "down" then if isCursorOnElement (x*699, y*266, x*89, y*34) then triggerServerEvent ("armasbope", getLocalPlayer(), jogador) end end end end addEventHandler ("onClientClick", root, armasbope) function skinbope (_,state) if painelBOPE == true then if state == "down" then if isCursorOnElement (x*798, y*266, x*89, y*34) then triggerServerEvent ("skinbope", getLocalPlayer(), jogador) end end end end addEventHandler ("onClientClick", root, skinbope) function vtrbope (_,state) if painelBOPE == true then if state == "down" then if isCursorOnElement (x*699, y*310, x*89, y*34) then triggerServerEvent ("vtrbope", getLocalPlayer(), jogador) end end end end addEventHandler ("onClientClick", root, vtrbope) function basebope (_,state) if painelBOPE == true then if state == "down" then if isCursorOnElement (x*798, y*310, x*89, y*34) then triggerServerEvent ("basebope", getLocalPlayer(), jogador) end end end end addEventHandler ("onClientClick", root, basebope) function destruirbope (_,state) if painelBOPE == true then if state == "down" then if isCursorOnElement (x*699, y*354, x*186, y*34) then triggerServerEvent ("destruirbope", getLocalPlayer(), jogador) end end end end addEventHandler ("onClientClick", root, destruirbope) function addbope (_,state) if painelBOPE == true then if state == "down" then if isCursorOnElement (x*699, y*446, x*186, y*34) then triggerServerEvent ("addbope", getLocalPlayer(), jogador) end end end end addEventHandler ("onClientClick", root, addbope) function removebope (_,state) if painelBOPE == true then if state == "down" then if isCursorOnElement (x*699, y*490, x*186, y*34) then triggerServerEvent ("removebope", getLocalPlayer(), jogador) end end end end addEventHandler ("onClientClick", root, removebope) function isCursorOnElement(x,y,w,h) local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end Gente, vcs estariam me ajudando muito... namoral msm,,, trabalhei nisso a dias! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now