Jump to content

Ajuda Com onClientClick


Recommended Posts

queria fazer o player clicar no ped e vender a droga mas não to conseguindo 

 

function venderdroga(thePlayer)
    local crack = getNearestPed(thePlayer) 
    local drogado = getElementData(crack, "drogado") 
    if crack then 
        if drogado == false then 
            if getElementData(thePlayer, "cocaina") >= 1 then
                setElementData(thePlayer, "cocaina",(getElementData(thePlayer, "cocaina")) - 1)
                local  valor = math.random(1000, 4000)
                givePlayerMoney(thePlayer, valor)
                setElementData(crack, "drogado", true)
                setPedAnimation(thePlayer, "DEALER","DEALER_DEAL")
                setPedAnimation(crack, "DEALER","DEALER_DEAL")
                setTimer ( function()
                    setPedAnimation(thePlayer, nil)
                    setPedAnimation(crack, nil)
                end, 2500, 1 )
                setTimer ( function()
                    setElementData(crack, "drogado", false)
                end, 0* minutosdrogado, 0 )
            else
                outputChatBox("["..Cidade.."] #FFFFFFVocê não tem Coca", thePlayer,148,0,211,true)
            end
        else
            triggerClientEvent("noti", thePlayer)
        end 
    else
        outputChatBox("["..Cidade.."] #FFFFFFNão Tenho nenhum Noia perto de você", thePlayer,148,0,211,true)
    end
end
addEvent("venderdroga", true )
addCommandHandler ( "venderdroga", venderdroga )

 

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