proracer Posted January 2, 2011 Share Posted January 2, 2011 Ok so here is my code. local myMarker = createMarker ( -720,965,11.78,corona,3,255,0,0,255 ) function MarketHit ( hitElement, mathingDimension ) function removePedsHead(thePlayer) if getElementType (hitElement) == "player" then setPedHeadless(thePlayer, true) outputChatBox ("You lost your head.", thePlayer, 255, 140, 0) end end end addEventHandler ("onMarkerHit", myMarker, MarkerHit) I know this is wrong code as Im missing event for function:" removePedsHead".And I don't know where to put it. I want to know how can I register function:"removePedsHead".Because I saw on Wiki that there is only addComandHandler.So how can I register it for Event? I want that when some player enters the corona he becomes headless. Link to comment
Aibo Posted January 2, 2011 Share Posted January 2, 2011 you are already doing it with setPedHeadless (though the ped element is wrong) local myMarker = createMarker ( -720,965,11.78, "corona",3,255,0,0,255 ) function MarketHit ( hitElement, mathingDimension ) if getElementType (hitElement) == "player" then setPedHeadless(hitElement, true) outputChatBox ("You lost your head.", hitElement, 255, 140, 0) end end addEventHandler ("onMarkerHit", myMarker, MarkerHit) PS: corona should be quoted, cause it's a string argument. well unless corona is a variable. Link to comment
proracer Posted January 2, 2011 Author Share Posted January 2, 2011 Oh thanks man.Yeah forgot about corona. 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