HeK Posted November 21, 2012 Posted November 21, 2012 I'm getting a weird warning on destroyElement. "WARNING: script\script_client\:62: Bad argument @ 'destroyElement' "WARNING: script\script_client\:63: Bad argument @ 'destroyElement' Could someone explain to me, what's going on? These are the lines: destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) Zero is a number too.
Renkon Posted November 21, 2012 Posted November 21, 2012 We do not know.. Could you at least SHOW us the full code?
myonlake Posted November 22, 2012 Posted November 22, 2012 Probably show us the code first. Two lines is not enough. If I helped you, please click the like button on the right Thanks!
Guest Guest4401 Posted November 22, 2012 Posted November 22, 2012 robHouseMarker and robHouseBlip aren't elements. You may check it with isElement to check that.
Moderators IIYAMA Posted November 22, 2012 Moderators Posted November 22, 2012 Make sure the element do exist. Most of the time the problem: When you try to destroy an element that already have been destroyed. To solve it: if robhouseMarker and robhouseBlip then destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) end or if you aren't sure they both exist: if robhouseMarker then destroyElement ( robhouseMarker ) end if robhouseBlip then destroyElement ( robhouseBlip ) end Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
HeK Posted November 25, 2012 Author Posted November 25, 2012 Here's the code, i tried those but still doesn't work, still gives me warnings. addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( source == robhouseMarker and not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then triggerServerEvent ( "givePlayerPayment", localPlayer ) if robhouseMarker and robhouseBlip then destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) end triggerEvent ( "createHouseEvent", localPlayer ) end end ) Zero is a number too.
Moderators Sarrum Posted November 25, 2012 Moderators Posted November 25, 2012 Try if isElement ( robhouseMarker ) and isElement ( robhouseBlip ) then destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) end
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now