Jump to content

Help


Ahmed Ly

Recommended Posts

addEvent("createMarker:Health",true)
addEventHandler("createMarker:Health",root,
function ()
x,y,z = getElementPosition(source)
i = getElementInterior(source)
team = getTeamName(getPlayerTeam(source))
marker = createMarker(x,y,z,"cylinder",1.5,255,255,255,255)
setElementInterior(marker,i)
outputChatBox("[Server-Dragon]  Player "..getPlayerName(source).." Has Been Create Marker at ("..math.floor(x)..","..math.floor(y)..","..math.floor(z)..").",root,0,255,0,true)
setTimer(destroyElement,30000,1,marker)
end
) 


addEventHandler("onMarkerHit",resourceRoot,
function  (hitPlayer,_)
if hitPlayer == source and  getPlayerTeam(hitPlayer) and getTeamName(getPlayerTeam) == team then 
if isElementWithinMarker(hitPlayer,marker) then 
setElementHealth(hitPlayer,30)
end
end
end
)

 

Link to comment
addEvent("createMarker:Health",true)
addEventHandler("createMarker:Health",root, function ( )
if ( isElement ( marker ) ) then destroyElement ( marker ) end
local Values = { name = getPlayerName ( source ) , pos = { getElementPosition ( source ) } , int = getElementInterior ( source ) };
marker = createMarker ( Values["pos"][1] , Values["pos"][2] , Values["pos"][3] , "cylinder" , 1.5 , 255,255,255,255 );
setElementInterior ( marker , Values["int"] );
setElementData ( marker , "Team_" , ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) or false ) );
outputChatBox("[Server-Dragon]  Player "..tostring(Values["name"]).." Has Been Create Marker at ("..math.floor(Values["pos"][1])..","..math.floor(Values["pos"][2])..","..math.floor(Values["pos"][3])..").",root,0,255,0,true)
setTimer( function ( )
setElementData ( marker , "Team_" , nil )
destroyElement ( marker )
end,30000,1)
end );


addEventHandler ( "onMarkerHit" , resourceRoot , function ( hitElement )
if ( source == marker and getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) and getTeamName ( getPlayerTeam ( hitElement ) ) == getElementData(source,"Team_") ) then
if ( isElementWithinMarker ( hitElement , source ) ) then 
setElementHealth ( hitElement , getElementHealth ( hitElement ) + 30 );
end
end 
end );

 

try this

Link to comment
13 hours ago, TF8DNA said:

addEvent("createMarker:Health",true)
addEventHandler("createMarker:Health",root, function ( )
if ( isElement ( marker ) ) then destroyElement ( marker ) end
local Values = { name = getPlayerName ( source ) , pos = { getElementPosition ( source ) } , int = getElementInterior ( source ) };
marker = createMarker ( Values["pos"][1] , Values["pos"][2] , Values["pos"][3] , "cylinder" , 1.5 , 255,255,255,255 );
setElementInterior ( marker , Values["int"] );
setElementData ( marker , "Team_" , ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) or false ) );
outputChatBox("[Server-Dragon]  Player "..tostring(Values["name"]).." Has Been Create Marker at ("..math.floor(Values["pos"][1])..","..math.floor(Values["pos"][2])..","..math.floor(Values["pos"][3])..").",root,0,255,0,true)
setTimer( function ( )
setElementData ( marker , "Team_" , nil )
destroyElement ( marker )
end,30000,1)
end );


addEventHandler ( "onMarkerHit" , resourceRoot , function ( hitElement )
if ( source == marker and getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) and getTeamName ( getPlayerTeam ( hitElement ) ) == getElementData(source,"Team_") ) then
if ( isElementWithinMarker ( hitElement , source ) ) then 
setElementHealth ( hitElement , getElementHealth ( hitElement ) + 30 );
end
end 
end );

 

try this

not work

Link to comment

Try this:

addEvent("createMarker:Health", true);

addEventHandler("createMarker:Health", root, function()
	local x,y,z = getElementPosition(source);
	local i = getElementInterior(source);
	team = getTeamName(getPlayerTeam(source));
	marker = createMarker(x, y, z, "cylinder", 1.5, 255, 255, 255, 255);
	setElementInterior(marker, i);
	outputChatBox("[Server-Dragon]  Player "..getPlayerName(source).." Has Been Create Marker at ("..math.floor(x)..","..math.floor(y)..","..math.floor(z)..").", root, 0, 255, 0, true);
	setTimer(destroyElement, 30000, 1, marker);
end);

addEventHandler("onMarkerHit", marker, function(hitPlayer, _)
	if getElementType(hitPlayer) == "player" and getTeamName(getPlayerTeam(hitPlayer)) == team then 
		if isElementWithinMarker(hitPlayer, marker) then 
			setElementHealth(hitPlayer, getElementHealth(hitPlayer)+30);
		end
	end
end);

 

Link to comment

Enjoy

addEvent("createMarker:Health", true);
addEventHandler("createMarker:Health", root, function()
	if (source == client) then
		local x,y,z = getElementPosition(client)

		local marker = createMarker(x, y, z, "cylinder", 1.5, 255, 255, 255, 255)
		setElementInterior(marker, getElementInterior(client))
		outputChatBox("[Server-Dragon]  Player "..getPlayerName(client).." Has Been Create Marker at ("..math.floor(x)..","..math.floor(y)..","..math.floor(z)..").", root, 0, 255, 0, true);


		if (getPlayerTeam(client)) then
			setElementData(marker, "team", getTeamName(getPlayerTeam(client)), false)
		end

		setTimer(function()
			if (isElement(marker)) then
				destroyElement(marker)
			end
		end, 30000, 1)


		onTeamMarkerHit = function (hitElement, matchingDimensions)
		    if (getElementType(hitElement) == "player") and (matchingDimensions) then
		    	if (getPlayerTeam(hitElement)) then
		    		local team = getPlayerTeam(hitElement)
		    		if (getElementData(source, "team") == getTeamName(team)) then
		    			setElementHealth(hitPlayer, getElementHealth(hitPlayer)+30);
		    		end
		    	end
		    end
		end
		addEventHandler("onMarkerHit", marker, onTeamMarkerHit)
	end
end)

 

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...