Jump to content

Teleport marker for a team


Recommended Posts

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

theMarker = createMarker (-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150)   
  
addEventHandler( "onClientMarkerHit", theMarker,  
function teamName ( source, key, newTeamName ) 
    local playerTeam = getPlayerTeam ( source )  player's team 
    if ( playerTeam, Team1 ) then                                
setElementPosition( localPlayer , 2287.78320,607.99255,10.82031 ) 
end 
end 
) 
 

did I do it right?

Link to comment
theMarker = createMarker ( -2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150 ) 
  
addEventHandler ( "onClientMarkerHit", theMarker, 
    function ( hitElement ) 
        if ( hitElement == localPlayer and getElementType ( hitElement ) == "player" ) then 
            local playerTeam = getPlayerTeam ( hitElement ) 
            if ( playerTeam and getTeamName ( playerTeam ) == "Team1" ) then 
                setElementPosition ( hitElement, 2287.78320, 607.99255, 10.82031 ) 
            end 
        end 
    end 
) 

Link to comment
Yes I am sure that I am in the right team , Also I used the command and there are no errors.

the marker have a bug

try this:

-- #! Server Side 
  
Marker = createMarker ( -2596.625, 579.358, 15.626 - 1, 'cylinder', 2.0, 255, 0, 0, 150 ) 
  
  
function setPosition(player) 
    local PlayerTeam = getPlayerTeam ( player ) 
    local TeamN = getTeamFromName ( "TeamName" ) 
    if isElementWithinMarker ( player, Marker ) then 
        if PlayerTeam == TeamN then 
          setElementPosition ( player, 2287.78320, 607.99255, 10.82031 ) 
     end 
end 
end 
addEventHandler("onMarkerHit",Marker, setPosition) 
  

Link to comment
Yes I am sure that I am in the right team , Also I used the command and there are no errors.

the marker have a bug

try this:

-- #! Server Side 
  
Marker = createMarker ( -2596.625, 579.358, 15.626 - 1, 'cylinder', 2.0, 255, 0, 0, 150 ) 
  
  
function setPosition(player) 
    local PlayerTeam = getPlayerTeam ( player ) 
    local TeamN = getTeamFromName ( "TeamName" ) 
    if isElementWithinMarker ( player, Marker ) then 
        if PlayerTeam == TeamN then 
          setElementPosition ( player, 2287.78320, 607.99255, 10.82031 ) 
     end 
end 
end 
addEventHandler("onMarkerHit",Marker, setPosition) 
  

Would you like to tell us the bug?

Link to comment
Yes I am sure that I am in the right team , Also I used the command and there are no errors.

the marker have a bug

try this:

-- #! Server Side 
  
Marker = createMarker ( -2596.625, 579.358, 15.626 - 1, 'cylinder', 2.0, 255, 0, 0, 150 ) 
  
  
function setPosition(player) 
    local PlayerTeam = getPlayerTeam ( player ) 
    local TeamN = getTeamFromName ( "TeamName" ) 
    if isElementWithinMarker ( player, Marker ) then 
        if PlayerTeam == TeamN then 
          setElementPosition ( player, 2287.78320, 607.99255, 10.82031 ) 
     end 
end 
end 
addEventHandler("onMarkerHit",Marker, setPosition) 
  

Would you like to tell us the bug?

the bug is in the cylinder

i dont mean Castillo's code is wrong

i say the marker have a bug in MTA all

the bug is when you put position for the marker and Cylinder then

you'll get the marker is up of the ground

so i added like this

Marker = createMarker ( -2596.625, 579.358, 15.626 - 1, 'cylinder', 2.0, 255, 0, 0, 150 ) 

Minus one is mean in this code that the marker will be a little under.

so it will attach with the ground

Link to comment
Yes I am sure that I am in the right team , Also I used the command and there are no errors.

the marker have a bug

try this:

-- #! Server Side 
  
Marker = createMarker ( -2596.625, 579.358, 15.626 - 1, 'cylinder', 2.0, 255, 0, 0, 150 ) 
  
  
function setPosition(player) 
    local PlayerTeam = getPlayerTeam ( player ) 
    local TeamN = getTeamFromName ( "TeamName" ) 
    if isElementWithinMarker ( player, Marker ) then 
        if PlayerTeam == TeamN then 
          setElementPosition ( player, 2287.78320, 607.99255, 10.82031 ) 
     end 
end 
end 
addEventHandler("onMarkerHit",Marker, setPosition) 
  

I will test it now

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...