Jump to content

remover colete


Recommended Posts

opa pessoal, bom dia, gostaria de saber como que faço para estar removendo colete, peguei um painel de policial paisana na internet, onde ele dar um armamento e um colete, porém, eu gostaria de fazer com que ele retirasse o colete, e, não dar, alguem sabe como faz?, vou estar escrevendo as linhas de comandos do painel.

===CLIENT===


local screenW, screenH = guiGetScreenSize()

painelpol = false
function pmpcdx()

--------------
        dxDrawLine((screenW * 0.0900) - 1, (screenH * 0.3477) - 1, (screenW * 0.0900) - 1, screenH * 0.5833, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.2057, (screenH * 0.3477) - 1, (screenW * 0.0900) - 1, (screenH * 0.3477) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.0900) - 1, screenH * 0.5833, screenW * 0.2057, screenH * 0.5833, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.2057, screenH * 0.5833, screenW * 0.2057, (screenH * 0.3477) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.0900, screenH * 0.3477, screenW * 0.1157, screenH * 0.2357, tocolor(0, 0, 118, 114), false)
        dxDrawLine((screenW * 0.0900) - 1, (screenH * 0.3086) - 1, (screenW * 0.0900) - 1, screenH * 0.3477, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.2057, (screenH * 0.3086) - 1, (screenW * 0.0900) - 1, (screenH * 0.3086) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.0900) - 1, screenH * 0.3477, screenW * 0.2057, screenH * 0.3477, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.2057, screenH * 0.3477, screenW * 0.2057, (screenH * 0.3086) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.0900, screenH * 0.3086, screenW * 0.1157, screenH * 0.0391, tocolor(72, 61, 139, 255), false)
        dxDrawRectangle(screenW * 0.0900, screenH * 0.5443, screenW * 0.1157, screenH * 0.0391, tocolor(0, 0, 0, 194), false)
        
        dxDrawRectangle(screenW * 0.0981, screenH * 0.3737, screenW * 0.1003, screenH * 0.0299, tocolor(0, 0, 0, 173), false)
        dxDrawRectangle(screenW * 0.0981, screenH * 0.4388, screenW * 0.1003, screenH * 0.0299, tocolor(0, 0, 0, 173), false)
        dxDrawRectangle(screenW * 0.0981, screenH * 0.5013, screenW * 0.1003, screenH * 0.0299, tocolor(0, 0, 0, 173), false)
        
        
        dxDrawText("Painel", screenW * 0.0900, screenH * 0.3086, screenW * 0.2057, screenH * 0.3477, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Armamento ", screenW * 0.0981, screenH * 0.3737, screenW * 0.1984, screenH * 0.4036, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Remover Armas", screenW * 0.0981, screenH * 0.4388, screenW * 0.1984, screenH * 0.4688, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Colete Balistico", screenW * 0.0981, screenH * 0.5013, screenW * 0.1984, screenH * 0.5313, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        

        
        dxDrawRectangle(screenW * 0.1713, screenH * 0.5664, screenW * 0.0337, screenH * 0.0156, tocolor(255, 255, 255, 0), false)
        dxDrawText("Fechar", screenW * 0.1706, screenH * 0.5651, screenW * 0.2050, screenH * 0.5820, tocolor(0, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)

end


function abrirpainel ()
if painelpol == false then
addEventHandler ("onClientRender", root, pmpcdx)
showCursor (true)
painelpol = true
end
end
addEvent ("abrirpainel", true)
addEventHandler ("abrirpainel", root, abrirpainel)

function armapaisana (_,state)
if painelpol == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.0981, screenH * 0.3737, screenW * 0.1003, screenH * 0.0299) then
triggerServerEvent ("armapaisana", localPlayer)
removeEventHandler ("onClientRender", root, pmpcdx)
showCursor (false)
painelpol = false
end
end
end
end
addEventHandler ("onClientClick", root, armapaisana)


function remover (_,state)
if painelpol == true then
if  state == "down"  then
if  isCursorOnElement(screenW * 0.0981, screenH * 0.4388, screenW * 0.1003, screenH * 0.0299) then
triggerServerEvent ("remover", localPlayer)
removeEventHandler ("onClientRender", root, pmpcdx)
showCursor (false)
painelpol = false
end
end
end
end
addEventHandler ("onClientClick", root, remover)


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


function coletebpm(_,state)
if painelpol then
if state == "down" then
if isCursorOnElement (screenW * 0.0981, screenH * 0.5013, screenW * 0.1003, screenH * 0.0299) then
triggerServerEvent ("coletebpm", getLocalPlayer())
removeEventHandler ("onClientRender", root, pmpcdx)
showCursor (false)
painelpol = false
end
end
end
end
addEventHandler ("onClientClick", root, coletebpm)

-----------


function fecharpol (_,state)
if painelpol == true then
if state == "down" then
if isCursorOnElement (screenW * 0.1713, screenH * 0.5664, screenW * 0.0337, screenH * 0.0156) then 
removeEventHandler ("onClientRender", root, pmpcdx)
showCursor (false)
painelpol = false
end
end
end
end
addEventHandler ("onClientClick", root, fecharpol)

local x,y = guiGetScreenSize()
 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
===SERVER===

local kitPM = createMarker (1438.5236816406, -1713.2526855469, 13.380000114441-1, "cylinder", 1.1, getColorFromString("#7CFC00"))

bpmgrup = { "PM"}
function abrirpainel (source)
                for i, k in pairs(bpmgrup) do 
                local ContaACL = getAccountName ( getPlayerAccount ( source ) )                
                if isObjectInACLGroup ("user."..ContaACL, aclGetGroup (k)) then
triggerClientEvent (source, "abrirpainel", root)


end
end
end
addEventHandler ("onMarkerHit", kitPM, abrirpainel)


function dxMsg(source, text, type)
    exports.dxmessages:outputDx(source, text, type)
end    


function armapaisana ()
     giveWeapon ( source, 24, 9999 )

        dxMsg(source, "Você pegou sua arma ", "info")
     
end
addEvent("armapaisana",true)
addEventHandler ( "armapaisana", getRootElement(), armapaisana )

function remover ()
     takeAllWeapons (source)

        dxMsg(source, "Você retirou o Armamento ", "info")
     
end
addEvent("remover",true)
addEventHandler ( "remover", getRootElement(), remover )


-----------
function coletebpm    ()

    setPedArmor(source, 100)
    
        dxMsg(source, "Você pegou o Colete", "info")
end
addEvent("coletebpm", true)
addEventHandler("coletebpm", getRootElement(), coletebpm)
-----------

 

Edited by Vinyard
code formatting
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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