isa_Khamdan Posted July 8, 2013 Posted July 8, 2013 Is it possible to make a marker enterable for the team I choose? And if it is possible can someone give me the codes to make one. Thanks
Castillo Posted July 8, 2013 Posted July 8, 2013 Yes, it is possible, you must use: createMarker getPlayerTeam getTeamName setElementPosition onMarkerHit
isa_Khamdan Posted July 8, 2013 Author Posted July 8, 2013 Can I get the full code because I am still newbie :c
Castillo Posted July 8, 2013 Posted July 8, 2013 No, first try to make it, then if it doesn't work, post it here and we'll help you.
isa_Khamdan Posted July 8, 2013 Author Posted July 8, 2013 I don't want the marker to get the player team name I want it to check if he is in the X Team and if yes change his position
isa_Khamdan Posted July 8, 2013 Author Posted July 8, 2013 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?
Castillo Posted July 8, 2013 Posted July 8, 2013 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 )
isa_Khamdan Posted July 8, 2013 Author Posted July 8, 2013 I tested it , The marker shows up but it doesn't change your position even if you are in the right team
iPrestege Posted July 8, 2013 Posted July 8, 2013 Are you sure you're in 'Team1' Team? debugscript 3?
isa_Khamdan Posted July 8, 2013 Author Posted July 8, 2013 Yes I am sure that I am in the right team , Also I used the command and there are no errors.
iMr.3a[Z]eF Posted July 8, 2013 Posted July 8, 2013 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)
iPrestege Posted July 8, 2013 Posted July 8, 2013 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?
iMr.3a[Z]eF Posted July 8, 2013 Posted July 8, 2013 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
iMr.3a[Z]eF Posted July 8, 2013 Posted July 8, 2013 Make no sense at all this isn't a bug . Make a cylinder marker then tell me what is a bug
iPrestege Posted July 8, 2013 Posted July 8, 2013 I tested it , The marker shows up but it doesn't change your position even if you are in the right team No more post about this fuck problem again .
iMr.3a[Z]eF Posted July 8, 2013 Posted July 8, 2013 I tested it , The marker shows up but it doesn't change your position even if you are in the right team No more post about this problem again . I really don't know about the others But this is happens to me every time.
isa_Khamdan Posted July 8, 2013 Author Posted July 8, 2013 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
Recommended Posts