Jump to content

call image by variable


HitmanLM

Recommended Posts

I made a script to be able to call the image from the client to the server, but I don't know how to call it, I did a test with "outputChatBox" it works perfectly, it doesn't give any errors everything great but I don't know how to call the image if someone can help me please .

server:

function showPanellr(thePlayer)
  accountname = getAccountName(getPlayerAccount(thePlayer))
        if isObjectInACLGroup('user.'.. accountname, aclGetGroup("BOPE")) then
			outputChatBox ('1',source,255,255,255,true)
        elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("EB")) then
			outputChatBox ('2',source,255,255,255,true)
        elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("PCRJ")) then
			outputChatBox ('3',source,255,255,255,true)
        elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("semgrupo")) then
        end
	triggerClientEvent(thePlayer, "painelrota", getRootElement())
  end
function onResStartlr()
  for index, player in ipairs(getElementsByType("player")) do
    bindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel
  end
end
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStartlr)
function onPlayerJoinlr()
  bindKey(source, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel
end
addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinlr)
function cleanAlllr(player)
  for index, player in ipairs(getElementsByType("player")) do
    unbindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel
  end
end
addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAlllr)

 

client:

local screenW,screenH = guiGetScreenSize()
local resW, resH = 1365,767
local x, y = (screenW/resW), (screenH/resH)

function Pdx ()

        dxDrawText("Test", 332, 361, 497, 374, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
    end

local img_names = {
[1] = "img/gfx/BOPE.png",
[2] = "img/gfx/EB.png",
[3] = "img/gfx/PCRJ.png",
[4] = "img/gfx/semequipe.png",
}

local function draw_img(x, y, des1, n)
    dxDrawImage(x*290, y*475, x*150, y*110, img_names[n], 0, 0, 0, tocolor(255, 255, 255, des1), false)
end

function abrir (_,state)
if painel == false then
showCursor(true)
addEventHandler("onClientRender", root, Pdx)
painel = true
else
showCursor(false)
removeEventHandler("onClientRender", root, Pdx)
painel = false
end
end
addEvent("painelrota", true)
addEventHandler("painelrota", root , abrir)

 

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...