Snoozy Posted June 3, 2011 Share Posted June 3, 2011 So for some reason destroyElement() wont destroy the thing I asks it to. function MarkerHit ( hitPlayer, matchingDimension ) if source == getElementData(hitPlayer,"Marker") then outputChatBox("Hit the marker",hitPlayer) local Marker = getElementData(getLocalPlayer(),"Marker") destroyElement(Marker) local Blip = getElementData(getLocalPlayer(),"Blip") destroyElement (Blip) end end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) Not either the Marker or the Blip gets destroyed. The data is set here: local Blip = createBlip(X,Y,Z,31,0, 0, 0, 255,source) local Marker = createMarker(X,Y,Z,"checkpoint",1.0,0,255,0,170,source) setElementData(source,"Marker",Marker) setElementData(source,"Blip",Blip) They do appear ingame the created marker and blip Link to comment
Castillo Posted June 3, 2011 Share Posted June 3, 2011 Try this: local Blip = createBlip(X,Y,Z,31,0, 0, 0, 255,source) local Marker = createMarker(X,Y,Z,"checkpoint",1.0,0,255,0,170,source) setElementData(getLocalPlayer(),"Marker",Marker) setElementData(getLocalPlayer(),"Blip",Blip) Link to comment
Snoozy Posted June 3, 2011 Author Share Posted June 3, 2011 @Solidsnake14: The creation of the marker and blip is serverside so that wouldn't work. @Callum: They are both in the same resource just that creation is serverside Link to comment
Aibo Posted June 3, 2011 Share Posted June 3, 2011 why are you using hitPlayer but then getting local player element data? maybe i dont understand the purpose of this (actually, i dont), but what if some other player hits the marker? and what is the source in the second part? ps: clientside outputChatBox does not have any element input parameters, it outputs to local player only. Link to comment
Castillo Posted June 3, 2011 Share Posted June 3, 2011 Can the client destroy a server-side marker? Link to comment
Snoozy Posted June 3, 2011 Author Share Posted June 3, 2011 Can the client destroy a server-side marker? Yea... Lol that was the problem Link to comment
Castillo Posted June 3, 2011 Share Posted June 3, 2011 So, the client can't destroy a server-side marker, i'am right? Link to comment
Snoozy Posted June 3, 2011 Author Share Posted June 3, 2011 Certainly seems so cause it worked once I placed all of it serverside 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