HeK Posted November 21, 2012 Share 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 ) Link to comment
Renkon Posted November 21, 2012 Share Posted November 21, 2012 We do not know.. Could you at least SHOW us the full code? Link to comment
myonlake Posted November 22, 2012 Share Posted November 22, 2012 Probably show us the code first. Two lines is not enough. Link to comment
Guest Guest4401 Posted November 22, 2012 Share Posted November 22, 2012 robHouseMarker and robHouseBlip aren't elements. You may check it with isElement to check that. Link to comment
Moderators IIYAMA Posted November 22, 2012 Moderators Share 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 Link to comment
HeK Posted November 25, 2012 Author Share 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 ) Link to comment
Scripting Moderators Sarrum Posted November 25, 2012 Scripting Moderators Share Posted November 25, 2012 Try if isElement ( robhouseMarker ) and isElement ( robhouseBlip ) then destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) end Link to comment
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