Jump to content

Bad Argument


Best-Killer

Recommended Posts

bad argument getElementData expected element at argument 1 got nill

addEvent("PayClient", true) 
addEventHandler( "PayClient", root, 
    function() 
        givePlayerMoney(source, 2000) 
        setPlayerWantedLevel(source, getPlayerWantedLevel(source)+1) 
        if getElementData (vehicle, "OwnerOfThisVehicle") == source then 
        destroyElement (vehicle) 
    end 
    end 
) 

Link to comment

i tried with that

function Location2() 
    markerlocation2 = createMarker (-2642.98, 1371.07, 7.16, "cylinder", 4,238, 44, 44, 255) 
    blipSF = createBlipAttachedTo (markerlocation2, 51) 
    addEventHandler( "onClientMarkerHit", markerlocation2, 
        function ( hitPlayer, d ) 
                if isElement(markerlocation2) then 
                    destroyElement(markerlocation2) 
                    destroyElement(blipSF) 
                end 
            triggerServerEvent("doPayClient2", hitPlayer, localPlayer) 
        end 
    ) 
end 

addEvent("finish", true) 
addEventHandler( "finish", root, 
    function(vehicle) 
    if getElementData ( "OwnerOfThisVehicle") == source then 
        destroyElement (vehicle) 
    end 
end 

i got that : expected element at argument 1 got string ownerOfThinsVehicle

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