Jump to content

What's wrong here?


Norhy

Recommended Posts

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

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
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 by Guest
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...