Alexez Posted April 3, 2014 Share Posted April 3, 2014 hi guys i want the target for exactly team particular code : function makeTargetFollow ( target ) if ( target ) and ( getElementType(target) == "player" ) then local x,y,z = getElementPosition( source ) local tx,ty,tz = getElementPosition( target ) if ( getDistanceBetweenPoints3D( x,y,z,tx,ty,tz ) <= 7 ) then toggleAllControls( target, false ) setControlState( target, "forwards", true) setTimer( updateRotation, 500, 0, source, target ) end end end addEventHandler( "onPlayerTarget", root, makeTargetFollow ) function updateRotation( player, target ) if ( isElement(player) ) and ( isElement(target) ) then local x,y = getElementPosition( player ) local tx,ty = getElementPosition( target ) local rot = findRotation(tx,ty,x,y) setElementRotation ( target, 0, 0, rot ) end end function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end Link to comment
WhoAmI Posted April 3, 2014 Share Posted April 3, 2014 if ( getTeamName ( getPlayerTeam ( source ) ) == "Team Name" ) then Link to comment
Tete omar Posted April 3, 2014 Share Posted April 3, 2014 Alexez is a ban evader. Locked Link to comment
Recommended Posts