Jump to content

call


Tox

Recommended Posts

hi, i will call a resource's function but there is an error

call: failed to call 'gangs:setBlipInvisible' [string "?"]

code is below:

function and resource i'll call:

function setBlipInvisible (player) 
    if isElement(blips [player]) then 
        destroyElement (blips[player]) 
    end 
end  
  
function setBlipVisible (player) 
    local bbbbr,bbbbg,bbbbb = getPlayerNametagColor (player) 
    blips [player] = createBlipAttachedTo(p, 0, 2, bbbbr,bbbbg,bbbbb ,255,0) 
end 
  

meta.xml:

<meta> 
    <info author="Tox" type="script" name="Super Market" version = "1.0.1" description= "hi" /> 
        <oop>true</oop> 
         
        <script src="client.lua" type="client" /> 
        <script src="server.lua" type="server" />    
        <script src="skills/cloak_c.lua" type="client" /> 
        <script src="skills/cloak_s.lua" type="server" />    
        <script src="skills/two-handed_c.lua" type="client" /> 
        <script src="skills/two-handed_s.lua" type="server" />       
         
        <settings> 
        <setting name="*Skill key" value="B" /> 
        </settings>  
         
        <export function="setBlipVisible" type= "server" /> 
        <export function="setBlipInvisible" type= "server" /> 
  
    <min_mta_version server="1.3.4-0.00000" client="1.3.4-0.00000"></min_mta_version> 
</meta> 
  

script i'll be calling the function in:

addEvent ( "skills_cloak", true ) 
addEventHandler ("skills_cloak", root, 
    function ( seconds, alpha ) 
        local client = client 
        client:setAlpha( alpha ) 
        client:setNametagShowing( false ) 
        exports.gangs:setBlipInvisible(client) 
        Timer ( 
            function () 
                if isElement ( client ) then 
                    client:setAlpha( 255 ) 
                    client:setNametagShowing( true ) 
                    exports.gangs:setBlipVisible(client) 
                end 
            end, 
        1000*seconds, 1) 
    end 
) 

can someone help me out?

Link to comment
You need to pass client to the timer. So after the 1, but before the closing bracket on the Timer function, add another argument called client.

well, i kinda mixed meta files, so that was the main reason of errors. i fixed the thing now, thank you

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