Jump to content

[HELP] 420 system


Arnolds

Recommended Posts

Hi,basiclly i need to weed plant show pertcent on plant.

i dont know how to do it,becuse im new to this

here is scirpt 

 

 
Quote

 

function addWeedButtons (button, state, absX, absY, wx, wy, wz, element)

 

    if (element) and (getElementType(element)=="object") and (button=="right") and (state=="down") then --if it's a right-click on a object

 

        local model = getElementModel(element)

 

        local rcMenu

 

        if(model == 2203 and getElementData(element, "weed:level") > 0) then

 

            local x, y, z = getElementPosition(localPlayer)

 

            local x2, y2, z2 = getElementPosition(element)

 

            if (getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) > 5) then return end

 

            rcMenu = exports.rightclick:create("Marihuāna")

 

            local row = exports.rightclick:addRow("Paostīt")

 

            local row2 = exports.rightclick:addRow("Novākt")

 

            addEventHandler("onClientGUIClick", row,  function (button, state)

 

                smellWeed(element)

 

            end, true)

 

            addEventHandler("onClientGUIClick", row2,  function (button, state)

 

                harvestWeed(element)

 

            end, true)

 

        end

 

    end

 

end

 

addEventHandler("onClientClick", getRootElement(), addWeedButtons, true)

 

 

 

 

 

 

 

 

function smellWeed (element)

 

    if element and getElementModel(element) == 2203 then

 

        triggerServerEvent("onWeedCheck", resourceRoot, element)

 

    end

 

end

 

 

 

 

 

 

 

 

function harvestWeed (element)

 

    if element and getElementModel(element) == 2203 then

 

        triggerServerEvent("harvestWeed", resourceRoot, element)

 

    end

 

end

 

 

 

 

 

Link to comment

From what I understand, he wants an effect for plants to grow when you approach them. ?. If this is what he is asking then he can make it with setObjectScale since plants are objects or with a shader. With script he could use colshape events

Edited by Hydra
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...