Jump to content

preciso de ajuda em um script


Recommended Posts

queria que esse recurso adiciona-se   em cada função um acl 

exemplo: ao clicar na posição que determina o gênero masculino adiciona o acl Masculino

 

Spoiler

local screenW, screenH = guiGetScreenSize()
local x, y = (screenW/1366), (screenH/768)

local Font = dxCreateFont("Files/Fonte.otf", 10)
local FontList = dxCreateFont("Files/FonteList.otf", 10)

local UserLogin = createElement("dxEditBox3") 
local PassNome = createElement("dxEditBox3") 
local PassApelido = createElement("dxEditBox3") 
local PassCidade = createElement("dxEditBox3") 
local PassIdade = createElement("dxEditBox3") 

alpha = 0
cor = {}

mod = false
function painelmod ()
    dxDrawRoundedRectangle(screenW * 0.2971, screenH * 0.2695, screenW * 0.4147, screenH * 0.4440, tocolor(70, 70, 70, 255), false)
    dxDrawRoundedRectangle(screenW * 0.2971, screenH * 0.2695, screenW * 0.4147, screenH * 0.0768, tocolor(51, 254, 85, 255), false)
    dxDrawText("BWP-Sistema de Identidade", screenW * 0.4029, screenH * 0.2878, screenW * 0.7044, screenH * 0.3385, tocolor(0, 0, 0, 255), 1.60, "clear", "left", "top", false, false, false, false, false)
    dxDrawRoundedRectangle(screenW * 0.5265, screenH * 0.3203, screenW * 0.0265, screenH * 0.3932, tocolor(51, 254, 85, 255), false)
    dxDrawText("Escolha seu genero", screenW * 0.5676, screenH * 0.3594, screenW * 0.7074, screenH * 0.4049, tocolor(0, 0, 0, 255), 1.50, "clear", "left", "top", false, false, false, false, false)
    dxDrawImage(839, 327, 42, 67, ":mafilinda/1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(835, 429, 50, 65, ":mafilinda/2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.3971, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.4753, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.5612, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.6419, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawText("Nome:", screenW * 0.3831, screenH * 0.3607, screenW * 0.4493, screenH * 0.3932, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Apelido:", screenW * 0.3831, screenH * 0.4440, screenW * 0.4493, screenH * 0.4766, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Cidade:", screenW * 0.3831, screenH * 0.5313, screenW * 0.4493, screenH * 0.5638, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Idade:", screenW * 0.3831, screenH * 0.6146, screenW * 0.4493, screenH * 0.6471, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawEditBox("Digite seu Nome", x*451, y*310, x*200, y*030, false, 16, PassNome)
    dxDrawEditBox("Digite seu Apelido", x*451, y*370, x*200, y*030, false, 16, PassApelido)
    dxDrawEditBox("Digite sua Cidade", x*451, y*430, x*200, y*030, false, 16, PassCidade)
    dxDrawEditBox("Digite sua Idade", x*451, y*490, x*200, y*030, false, 16, PassIdade)
    if  isCursorOnElement(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391) then
        dxDrawRoundedRectangle(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391, tocolor(151, 254, 85, 255), false)
        dxDrawText("confirma", screenW * 0.6037, screenH * 0.6680, screenW * 0.7434, screenH * 0.7135, tocolor(0, 0, 0, 255), 1.20, "clear", "left", "top", false, false, false, false, false)
    else
        dxDrawRoundedRectangle(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391, tocolor(51, 254, 85, 255), false)
        dxDrawText("confirma", screenW * 0.6037, screenH * 0.6680, screenW * 0.7434, screenH * 0.7135, tocolor(0, 0, 0, 255), 1.20, "clear", "left", "top", false, false, false, false, false)
end
end

function abrirmod ()
if mod == false then
addEventHandler ("onClientRender", root, painelmod)
showCursor (true)
mod = true
end
end
addEvent ("mod", true)
addEventHandler ("mod", root, abrirmod)


function fechar (_,state)
if mod == true then
if  state == "down"  then
    if  isCursorOnElement(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391) then
        setElementPosition(localPlayer, 1481.47644, -1766.02893, 18.79576)
        removeEventHandler("onClientRender", root, painelmod)
        showCursor (false)
        mod = false
        setCameraTarget(localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, fechar)

----------------------------------------------------------------------------------------------------------------------------------

function homem(_,state)                                                             [função que supostamente adiciona a acl Masculina]
if mod == true then
if  state == "down"  then
    if  isCursorOnElement(839, 327, 42, 67) then
    setElementModel(localPlayer, 0)
 if onClientClick (root , homem ) then
 aclGroupAddObject (aclGetGroup("Masculino"), "user."..getAccountName(getPlayerAccount(state )))
         end
      end 
   end
end
addEventHandler ("onClientClick", root, homem)

--------------------------------------------------------------------------------------------------------------------------------

function mulher(_,state)                                                               [função que supostamente adiciona a acl feminina]
    if mod == true then
    if  state == "down"  then
        if  isCursorOnElement(835, 429, 50, 65) then
        setElementModel(localPlayer, 85)
 if onClientClick (root , mulher ) then
 aclGroupAddObject (aclGetGroup("Femino"), "user."..getAccountName(getPlayerAccount(state )))
             end
          end 
       end
    end
    addEventHandler ("onClientClick", root, mulher)

function dxDrawEmptyRec(absX, absY, sizeX, sizeY, color, ancho)
    dxDrawRectangle(absX, absY, sizeX, ancho, color)
    dxDrawRectangle(absX, absY + ancho, ancho, sizeY - ancho, color)
    dxDrawRectangle(absX + ancho, absY + sizeY - ancho, sizeX - ancho, ancho, color)
    dxDrawRectangle(absX + sizeX-ancho, absY + ancho, ancho, sizeY - ancho*2, color)
end

local alphaState = true

-------------------------------------------------------------------------------------------------------------------------------

function alphaFunction()
    if alphaState == true then
        alpha = alpha + 30
    if alpha >= 255 then
        alphaState = false
    end
    end
    if alphaState == false then
        alpha = alpha - 30
    if alpha <= 0 then
        alphaState = true
        end
    end
end
addEventHandler("onClientRender", getRootElement(), alphaFunction)

function cursorPosition(x, y, width, height)
    if (not isCursorShowing()) then
        return false
    end
    local sx, sy = guiGetScreenSize()
    local cx, cy = getCursorPosition()
    local cx, cy = (cx*sx), (cy*sy)
    if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then
        return true
    else
        return false
    end
end

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
            
function dxDrawRoundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
    if (x and y and w and h) then
        if (not borderColor) then
            borderColor = tocolor(0, 0, 0, 200)
        end
        if (not bgColor) then
            bgColor = borderColor
        end
        dxDrawRectangle(x, y, w, h, bgColor, postGUI);
        dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI)
        dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI)
        dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI)
        dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI)
    end
end

 

 

Edited by Ipanema Roleplay
Link to comment
16 hours ago, Ipanema Roleplay said:

queria que esse recurso adiciona-se   em cada função um acl 

exemplo: ao clicar na posição que determina o gênero masculino adiciona o acl Masculino

 

Spoiler

local screenW, screenH = guiGetScreenSize()
local x, y = (screenW/1366), (screenH/768)

local Font = dxCreateFont("Files/Fonte.otf", 10)
local FontList = dxCreateFont("Files/FonteList.otf", 10)

local UserLogin = createElement("dxEditBox3") 
local PassNome = createElement("dxEditBox3") 
local PassApelido = createElement("dxEditBox3") 
local PassCidade = createElement("dxEditBox3") 
local PassIdade = createElement("dxEditBox3") 

alpha = 0
cor = {}

mod = false
function painelmod ()
    dxDrawRoundedRectangle(screenW * 0.2971, screenH * 0.2695, screenW * 0.4147, screenH * 0.4440, tocolor(70, 70, 70, 255), false)
    dxDrawRoundedRectangle(screenW * 0.2971, screenH * 0.2695, screenW * 0.4147, screenH * 0.0768, tocolor(51, 254, 85, 255), false)
    dxDrawText("BWP-Sistema de Identidade", screenW * 0.4029, screenH * 0.2878, screenW * 0.7044, screenH * 0.3385, tocolor(0, 0, 0, 255), 1.60, "clear", "left", "top", false, false, false, false, false)
    dxDrawRoundedRectangle(screenW * 0.5265, screenH * 0.3203, screenW * 0.0265, screenH * 0.3932, tocolor(51, 254, 85, 255), false)
    dxDrawText("Escolha seu genero", screenW * 0.5676, screenH * 0.3594, screenW * 0.7074, screenH * 0.4049, tocolor(0, 0, 0, 255), 1.50, "clear", "left", "top", false, false, false, false, false)
    dxDrawImage(839, 327, 42, 67, ":mafilinda/1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(835, 429, 50, 65, ":mafilinda/2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.3971, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.4753, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.5612, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.6419, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawText("Nome:", screenW * 0.3831, screenH * 0.3607, screenW * 0.4493, screenH * 0.3932, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Apelido:", screenW * 0.3831, screenH * 0.4440, screenW * 0.4493, screenH * 0.4766, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Cidade:", screenW * 0.3831, screenH * 0.5313, screenW * 0.4493, screenH * 0.5638, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Idade:", screenW * 0.3831, screenH * 0.6146, screenW * 0.4493, screenH * 0.6471, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawEditBox("Digite seu Nome", x*451, y*310, x*200, y*030, false, 16, PassNome)
    dxDrawEditBox("Digite seu Apelido", x*451, y*370, x*200, y*030, false, 16, PassApelido)
    dxDrawEditBox("Digite sua Cidade", x*451, y*430, x*200, y*030, false, 16, PassCidade)
    dxDrawEditBox("Digite sua Idade", x*451, y*490, x*200, y*030, false, 16, PassIdade)
    if  isCursorOnElement(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391) then
        dxDrawRoundedRectangle(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391, tocolor(151, 254, 85, 255), false)
        dxDrawText("confirma", screenW * 0.6037, screenH * 0.6680, screenW * 0.7434, screenH * 0.7135, tocolor(0, 0, 0, 255), 1.20, "clear", "left", "top", false, false, false, false, false)
    else
        dxDrawRoundedRectangle(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391, tocolor(51, 254, 85, 255), false)
        dxDrawText("confirma", screenW * 0.6037, screenH * 0.6680, screenW * 0.7434, screenH * 0.7135, tocolor(0, 0, 0, 255), 1.20, "clear", "left", "top", false, false, false, false, false)
end
end

function abrirmod ()
if mod == false then
addEventHandler ("onClientRender", root, painelmod)
showCursor (true)
mod = true
end
end
addEvent ("mod", true)
addEventHandler ("mod", root, abrirmod)


function fechar (_,state)
if mod == true then
if  state == "down"  then
    if  isCursorOnElement(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391) then
        setElementPosition(localPlayer, 1481.47644, -1766.02893, 18.79576)
        removeEventHandler("onClientRender", root, painelmod)
        showCursor (false)
        mod = false
        setCameraTarget(localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, fechar)

----------------------------------------------------------------------------------------------------------------------------------

function homem(_,state)                                                             [função que supostamente adiciona a acl Masculina]
if mod == true then
if  state == "down"  then
    if  isCursorOnElement(839, 327, 42, 67) then
    setElementModel(localPlayer, 0)
 if onClientClick (root , homem ) then
 aclGroupAddObject (aclGetGroup("Masculino"), "user."..getAccountName(getPlayerAccount(state )))
         end
      end 
   end
end
addEventHandler ("onClientClick", root, homem)

--------------------------------------------------------------------------------------------------------------------------------

function mulher(_,state)                                                               [função que supostamente adiciona a acl feminina]
    if mod == true then
    if  state == "down"  then
        if  isCursorOnElement(835, 429, 50, 65) then
        setElementModel(localPlayer, 85)
 if onClientClick (root , mulher ) then
 aclGroupAddObject (aclGetGroup("Femino"), "user."..getAccountName(getPlayerAccount(state )))
             end
          end 
       end
    end
    addEventHandler ("onClientClick", root, mulher)

function dxDrawEmptyRec(absX, absY, sizeX, sizeY, color, ancho)
    dxDrawRectangle(absX, absY, sizeX, ancho, color)
    dxDrawRectangle(absX, absY + ancho, ancho, sizeY - ancho, color)
    dxDrawRectangle(absX + ancho, absY + sizeY - ancho, sizeX - ancho, ancho, color)
    dxDrawRectangle(absX + sizeX-ancho, absY + ancho, ancho, sizeY - ancho*2, color)
end

local alphaState = true

-------------------------------------------------------------------------------------------------------------------------------

function alphaFunction()
    if alphaState == true then
        alpha = alpha + 30
    if alpha >= 255 then
        alphaState = false
    end
    end
    if alphaState == false then
        alpha = alpha - 30
    if alpha <= 0 then
        alphaState = true
        end
    end
end
addEventHandler("onClientRender", getRootElement(), alphaFunction)

function cursorPosition(x, y, width, height)
    if (not isCursorShowing()) then
        return false
    end
    local sx, sy = guiGetScreenSize()
    local cx, cy = getCursorPosition()
    local cx, cy = (cx*sx), (cy*sy)
    if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then
        return true
    else
        return false
    end
end

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
            
function dxDrawRoundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
    if (x and y and w and h) then
        if (not borderColor) then
            borderColor = tocolor(0, 0, 0, 200)
        end
        if (not bgColor) then
            bgColor = borderColor
        end
        dxDrawRectangle(x, y, w, h, bgColor, postGUI);
        dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI)
        dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI)
        dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI)
        dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI)
    end
end

 

 

pra adicionar um codigo ao seu post utilize a ferramenta "Code"
spacer.png

Link to comment
15 hours ago, Ipanema Roleplay said:

queria que esse recurso adiciona-se   em cada função um acl 

exemplo: ao clicar na posição que determina o gênero masculino adiciona o acl Masculino

 

Spoiler

local screenW, screenH = guiGetScreenSize()
local x, y = (screenW/1366), (screenH/768)

local Font = dxCreateFont("Files/Fonte.otf", 10)
local FontList = dxCreateFont("Files/FonteList.otf", 10)

local UserLogin = createElement("dxEditBox3") 
local PassNome = createElement("dxEditBox3") 
local PassApelido = createElement("dxEditBox3") 
local PassCidade = createElement("dxEditBox3") 
local PassIdade = createElement("dxEditBox3") 

alpha = 0
cor = {}

mod = false
function painelmod ()
    dxDrawRoundedRectangle(screenW * 0.2971, screenH * 0.2695, screenW * 0.4147, screenH * 0.4440, tocolor(70, 70, 70, 255), false)
    dxDrawRoundedRectangle(screenW * 0.2971, screenH * 0.2695, screenW * 0.4147, screenH * 0.0768, tocolor(51, 254, 85, 255), false)
    dxDrawText("BWP-Sistema de Identidade", screenW * 0.4029, screenH * 0.2878, screenW * 0.7044, screenH * 0.3385, tocolor(0, 0, 0, 255), 1.60, "clear", "left", "top", false, false, false, false, false)
    dxDrawRoundedRectangle(screenW * 0.5265, screenH * 0.3203, screenW * 0.0265, screenH * 0.3932, tocolor(51, 254, 85, 255), false)
    dxDrawText("Escolha seu genero", screenW * 0.5676, screenH * 0.3594, screenW * 0.7074, screenH * 0.4049, tocolor(0, 0, 0, 255), 1.50, "clear", "left", "top", false, false, false, false, false)
    dxDrawImage(839, 327, 42, 67, ":mafilinda/1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(835, 429, 50, 65, ":mafilinda/2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.3971, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.4753, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.5612, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawRoundedRectangle(screenW * 0.3199, screenH * 0.6419, screenW * 0.1882, screenH * 0.0430, tocolor(51, 254, 85, 255), false)
    dxDrawText("Nome:", screenW * 0.3831, screenH * 0.3607, screenW * 0.4493, screenH * 0.3932, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Apelido:", screenW * 0.3831, screenH * 0.4440, screenW * 0.4493, screenH * 0.4766, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Cidade:", screenW * 0.3831, screenH * 0.5313, screenW * 0.4493, screenH * 0.5638, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawText("Idade:", screenW * 0.3831, screenH * 0.6146, screenW * 0.4493, screenH * 0.6471, tocolor(255, 255, 255, 255), 1.30, "clear", "left", "top", false, false, false, false, false)
    dxDrawEditBox("Digite seu Nome", x*451, y*310, x*200, y*030, false, 16, PassNome)
    dxDrawEditBox("Digite seu Apelido", x*451, y*370, x*200, y*030, false, 16, PassApelido)
    dxDrawEditBox("Digite sua Cidade", x*451, y*430, x*200, y*030, false, 16, PassCidade)
    dxDrawEditBox("Digite sua Idade", x*451, y*490, x*200, y*030, false, 16, PassIdade)
    if  isCursorOnElement(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391) then
        dxDrawRoundedRectangle(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391, tocolor(151, 254, 85, 255), false)
        dxDrawText("confirma", screenW * 0.6037, screenH * 0.6680, screenW * 0.7434, screenH * 0.7135, tocolor(0, 0, 0, 255), 1.20, "clear", "left", "top", false, false, false, false, false)
    else
        dxDrawRoundedRectangle(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391, tocolor(51, 254, 85, 255), false)
        dxDrawText("confirma", screenW * 0.6037, screenH * 0.6680, screenW * 0.7434, screenH * 0.7135, tocolor(0, 0, 0, 255), 1.20, "clear", "left", "top", false, false, false, false, false)
end
end

function abrirmod ()
if mod == false then
addEventHandler ("onClientRender", root, painelmod)
showCursor (true)
mod = true
end
end
addEvent ("mod", true)
addEventHandler ("mod", root, abrirmod)


function fechar (_,state)
if mod == true then
if  state == "down"  then
    if  isCursorOnElement(screenW * 0.5669, screenH * 0.6615, screenW * 0.1265, screenH * 0.0391) then
        setElementPosition(localPlayer, 1481.47644, -1766.02893, 18.79576)
        removeEventHandler("onClientRender", root, painelmod)
        showCursor (false)
        mod = false
        setCameraTarget(localPlayer)
end
end
end
end
addEventHandler ("onClientClick", root, fechar)

----------------------------------------------------------------------------------------------------------------------------------

function homem(_,state)                                                             [função que supostamente adiciona a acl Masculina]
if mod == true then
if  state == "down"  then
    if  isCursorOnElement(839, 327, 42, 67) then
    setElementModel(localPlayer, 0)
 if onClientClick (root , homem ) then
 aclGroupAddObject (aclGetGroup("Masculino"), "user."..getAccountName(getPlayerAccount(state )))
         end
      end 
   end
end
addEventHandler ("onClientClick", root, homem)

--------------------------------------------------------------------------------------------------------------------------------

function mulher(_,state)                                                               [função que supostamente adiciona a acl feminina]
    if mod == true then
    if  state == "down"  then
        if  isCursorOnElement(835, 429, 50, 65) then
        setElementModel(localPlayer, 85)
 if onClientClick (root , mulher ) then
 aclGroupAddObject (aclGetGroup("Femino"), "user."..getAccountName(getPlayerAccount(state )))
             end
          end 
       end
    end
    addEventHandler ("onClientClick", root, mulher)

function dxDrawEmptyRec(absX, absY, sizeX, sizeY, color, ancho)
    dxDrawRectangle(absX, absY, sizeX, ancho, color)
    dxDrawRectangle(absX, absY + ancho, ancho, sizeY - ancho, color)
    dxDrawRectangle(absX + ancho, absY + sizeY - ancho, sizeX - ancho, ancho, color)
    dxDrawRectangle(absX + sizeX-ancho, absY + ancho, ancho, sizeY - ancho*2, color)
end

local alphaState = true

-------------------------------------------------------------------------------------------------------------------------------

function alphaFunction()
    if alphaState == true then
        alpha = alpha + 30
    if alpha >= 255 then
        alphaState = false
    end
    end
    if alphaState == false then
        alpha = alpha - 30
    if alpha <= 0 then
        alphaState = true
        end
    end
end
addEventHandler("onClientRender", getRootElement(), alphaFunction)

function cursorPosition(x, y, width, height)
    if (not isCursorShowing()) then
        return false
    end
    local sx, sy = guiGetScreenSize()
    local cx, cy = getCursorPosition()
    local cx, cy = (cx*sx), (cy*sy)
    if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then
        return true
    else
        return false
    end
end

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
            
function dxDrawRoundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
    if (x and y and w and h) then
        if (not borderColor) then
            borderColor = tocolor(0, 0, 0, 200)
        end
        if (not bgColor) then
            bgColor = borderColor
        end
        dxDrawRectangle(x, y, w, h, bgColor, postGUI);
        dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI)
        dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI)
        dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI)
        dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI)
    end
end

 

 

Use o triggerServerEvent, a função aclGroupAddACL só funciona do lado servidor, então crie a função no lado server e traga ele pro client usando o triggerServerEvent.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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