Developer. Posted August 8, 2019 Posted August 8, 2019 (edited) Iae rapaziada bom estou com uma duvida aqui, estou desenvolvendo um sistema de Porte e estou trabalhando com setELementData e ACL! Para garantir que não ocorra falhas... No sistema tem dois tipos de ACL a ACL DE PORTE LEVE (Armas de pequeno calibre) e a ACL DE PORTE PESADO (Armas de grosso calibre), até ai tudo certo. Porém eu fiz um sistema para os PM's saberem se o player possui porte e qual o tipo de porte, a minha duvida é se tem como verificar duas ACL'S no mesmo IF. O código abaixo eu tenho absoluta certeza que vai dar errado nas linhas de verificação pois, se ele tiver na acl LEVE ele recebe a data SIM, porém se ele Não tiver na PESADO ele irá receber a data NÃO. Penso que para resolver essa questão seja algo envolvendo tabelas porém eu não consigo compreender a estrutura nem a formação de tabelas (mesmo assistindo diversos vídeos). Será que tem como fazer a verificação em duas tabelas ou até mais ao mesmo tempo? codigo: triggerClientEvent(source, "[RDS]Painel_CopomPm", source, infos_jogador) local conta = getAccount(getAccountName(getPlayerAccount(infos_jogador))) local porte = getAccountName( getPlayerAccount(infos_jogador)) local procurado = getPlayerWantedLevel (infos_jogador) setElementData(infos_jogador, "mandatos", procurado) local nome = getPlayerName(infos_jogador) setElementData(infos_jogador, "Nome_Porte", nome) if isObjectInACLGroup ("user."..porte, aclGetGroup(AclPorteLeve)) then triggerClientEvent(source, "[RDS]registroSim", source, infos_jogador) elseif isObjectInACLGroup ("user."..porte, aclGetGroup(AclPortePesado)) then triggerClientEvent(source, "[RDS]registroSim", source, infos_jogador) end if not isObjectInACLGroup ("user."..porte, aclGetGroup(AclPorteLeve)) then triggerClientEvent(source , "[RDS]registroNao", source, infos_jogador) elseif not isObjectInACLGroup ("user."..porte, aclGetGroup(AclPortePesado)) triggerClientEvent(source , "[RDS]registroNao", source, infos_jogador) end Edit: Eu até tentei fazer uma verificação "dupla" no evento onPLayerLogin agora pouco, mas não tenho certeza se irá funcionar! addEventHandler("onPlayerLogin",root, function() local porte = getAccountName( getPlayerAccount(source)) if isObjectInACLGroup ("user."..porte, aclGetGroup(AclPorteLeve)) then setElementData(source,"RdsPorteSim", porte) elseif isObjectInACLGroup ("user."..porte, aclGetGroup(AclPortePesado)) then setElementData(source,"RdsPorteSim", porte) elseif not isObjectInACLGroup ("user."..porte, aclGetGroup(AclPortePesado) or aclGetGroup(AclPorteLeve)) then setElementData(source,"RdsPorteNao", porte) end end) Client-Side: function RegistradoSim() if getElementData(localPlayer, "RdsPorteSim") then dxDrawText("Porte: Porte Registrado!", x*607, y*214, x*742, y*246, tocolor(0, 0, 0, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end end addEvent("[RDS]registroSim", true) addEventHandler("[RDS]registroSim", root, RegistradoSim) function RegistradoNao() if getElementData(localPlayer, "RdsPorteNao") then dxDrawText("Porte: Não Encontrado!", x*607, y*214, x*742, y*246, tocolor(0, 0, 0, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end end addEvent("[RDS]registroNao", true) addEventHandler("[RDS]registroNao", root, RegistradoNao) Edited August 8, 2019 by Eder
Jonas^ Posted August 8, 2019 Posted August 8, 2019 (edited) Tem, exemplo: addCommandHandler ("rights", function (thePlayer, cmd) if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("x")) or isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("y")) then -- Se o jogador estiver na acl x, ou y tanto faz, então: outputChatBox ("Parabéns! Você está na acl x ou na acl y.", thePlayer, 0, 255, 0) else outputChatBox ("Erro! Você não está na acl x e nem na y!", thePlayer, 255, 30, 30) end end) Edited August 8, 2019 by Jonas^ Correção. 1
Developer. Posted August 8, 2019 Author Posted August 8, 2019 6 minutes ago, Jonas^ said: Tem, exemplo: addCommandHandler ("rights", function (thePlayer, cmd) if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("x")) or isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("y")) then -- Se o jogador estiver na acl x, ou y tanto faz, então: outputChatBox ("Parabéns! Você está na acl x ou na acl y.", thePlayer, 0, 255, 0) else outputChatBox ("Erro! Você não está na acl x e nem na y!", thePlayer, 255, 30, 30) end end) Ué, pior que eu tentei desse jeito mas não aparecia o resultado no DX. Bom devo ter errado em outra linha do código, vlw pelo esclarecimento
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