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

Posted

Yes, it is possible, you must use:

createMarker 
getPlayerTeam 
getTeamName 
setElementPosition 

onMarkerHit

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

No, first try to make it, then if it doesn't work, post it here and we'll help you.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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?

350x20_FFFFFF_FFFFFF_000000_000000.png
Posted
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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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) 
  

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted
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?

  

Posted
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

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted
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

350x20_FFFFFF_FFFFFF_000000_000000.png
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...