Desaster Posted September 27, 2013 Share Posted September 27, 2013 this is the beginning of a script i am posting it for my friend I can't find why it don't work local createTeam ( "farmer", 0, 255, 0 ) local Marker = createMarker ( 670.69952392578, 906.75018310547, -40.3984375, "cylinder", 1, 255, 255, 255, 0 ) local Elem = createObject ( 3409, 670.69952392578, 906.75018310547, -40.3984375, 90, 0, 0 ) function onmarkethit() if ( weapon == 23 ) then destroyElement ( Elem ) destroyElement ( Marker ) givePlayerMoney ( source, 5000 ) end else end Link to comment
Castillo Posted September 27, 2013 Share Posted September 27, 2013 Because it doesn't make any sense. Link to comment
xXMADEXx Posted September 27, 2013 Share Posted September 27, 2013 createTeam ( "farmer", 0, 255, 0 ) local Marker = createMarker ( 670.69952392578, 906.75018310547, -40.3984375, "cylinder", 1, 255, 255, 255, 0 ) local Elem = createObject ( 3409, 670.69952392578, 906.75018310547, -40.3984375, 90, 0, 0 ) function onmarkethit ( p ) if ( weapon == 23 ) then if ( isElement ( Elem ) ) then destroyElement ( Elem ) end if ( isElement ( Marker ) ) then destroyElement ( Marker ) end givePlayerMoney ( p, 5000 ) end end addEventHandler ( "onMarkerHit", Marker onmarkerhit ) Link to comment
Castillo Posted September 27, 2013 Share Posted September 27, 2013 'weapon' is not defined anywhere. Link to comment
glowdemon1 Posted September 27, 2013 Share Posted September 27, 2013 createTeam ( "farmer", 0, 255, 0 ) local Marker = createMarker ( 670.69952392578, 906.75018310547, -40.3984375, "cylinder", 1, 255, 255, 255, 0 ) local Elem = createObject ( 3409, 670.69952392578, 906.75018310547, -40.3984375, 90, 0, 0 ) function customOnMarkerHit( p ) local playerWeapon = getPedWeapon( p ) if ( playerWeapon == 23 ) then if ( isElement ( Elem ) ) then destroyElement ( Elem ) end if ( isElement ( Marker ) ) then destroyElement ( Marker ) end givePlayerMoney ( p, 5000 ) end end addEventHandler ( "onMarkerHit", Marker, customOnMarkerHit) Should work. Link to comment
TAPL Posted September 27, 2013 Share Posted September 27, 2013 This function also should be used. getElementType 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