Norhy Posted February 21, 2012 Share Posted February 21, 2012 local BodyguardMarker = createMarker( -2765.46118, 368.87973, 5.17000, 'cylinder', 2.0, 255, 0, 0, 150) local BodyguardTeam = createTeam ( "Bodyguard", 47, 79, 79 ) function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) setPlayerTeam(BodyguardMarker, BodyguardTeam) end addEventHandler( "onMarkerHit", Bodyguard, MarkerHit ) Please, did i something wrong here? I'm new to scripting.. Debug doesn't show any errors or warning, so please what's the problem? Link to comment
JR10 Posted February 21, 2012 Share Posted February 21, 2012 That is so messed up. local BodyguardMarker = createMarker( -2765.46118, 368.87973, 5.17000, 'cylinder', 2.0, 255, 0, 0, 150) local BodyguardTeam = createTeam ( "Bodyguard", 47, 79, 79 ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then setPlayerTeam(hitElement, BodyguardTeam) end end addEventHandler( "onMarkerHit", BodyguardMarker, MarkerHit ) Link to comment
Kenix Posted February 21, 2012 Share Posted February 21, 2012 (edited) local BodyguardMarker = createMarker( -2765.46118, 368.87973, 5.17000, 'cylinder', 2.0, 255, 0, 0, 150) local BodyguardTeam = createTeam ( "Bodyguard", 47, 79, 79 ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == 'player' and not isPedInVehicle( BodyguardMarker ) then setPlayerTeam( hitElement, BodyguardTeam ) end end addEventHandler( "onMarkerHit", BodyguardMarker, MarkerHit ) 1.So you attach not defined variable to 2 argument in function addEventHandler. 2.Your code setPlayerTeam(BodyguardMarker, BodyguardTeam) So you trying to set marker in team. Edited February 21, 2012 by Guest 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