Jump to content

مشكله


Ahmed Eka

Recommended Posts

الحين انا كنت مسوي شئ المود عباره عن

ماركرين

اول ما تخش لهم ماحد يقدر يخش لهم 

و لما تموت يرجع الناس يقدرون يخشو لهم و كالتالي

بس مدري الخطا وين

في شخص مساعدني

[lua]

local myMarker = createMarker(726.43085, -1274.49963, 13.64844+1, 'arrow', 2.0, 0, 255, 0, 150) 
local myMarker1 = createMarker(726.21460, -1278.10498, 13.64844+1, 'arrow', 2.0, 0, 255, 0, 150) 
 
state = true 

addEventHandler ( "onMarkerHit" , resourceRoot , 

 function ( player )

 if ( source == myMarker ) or ( source == myMarker1 ) then

 if ( getElementType ( player ) == "player" ) then 
 state = false
state = 0
state = state + 1
if ( state >= 2 ) then return end
 if ( state == false ) then return end 

 local Money = getPlayerMoney ( player )

 if ( Money >= 5000 ) then
  
 takePlayerMoney ( player , 5000 )

 setElementPosition ( player , 775.97052, -1279.57434, 13.64844 )

    
 state = false
    end
   end
  end
 end
 )  ;
 
Timers = { };

addEventHandler("onPlayerWasted",root,

 function ( _,killer )

 if isElement( killer ) and ( killer ~= source ) and ( getElementType( killer ) == "player" ) then
  
 if ( isTimer ( Timers [ killer ] ) ) then killTimer ( Timers [ killer ] ) Timers [ killTimer ] = nil end
  
   
 givePlayerMoney( killer, 50000 )

 Timers [ killer ] = setTimer ( setElementPosition , 2500 , 1 , killer, 775.97052, -1279.57434, 13.64844 )

  end
 end 
 ) ;

[/lua]

Link to comment
local myMarker = createMarker(726.43085, -1274.49963, 13.64844+1, 'arrow', 2.0, 0, 255, 0, 150)
local myMarker1 = createMarker(726.21460, -1278.10498, 13.64844+1, 'arrow', 2.0, 0, 255, 0, 150)
addEventHandler ( "onMarkerHit" , resourceRoot ,
function ( hitElement )
	if ( source == myMarker ) then
		if ( getElementType ( hitElement ) == "player" ) then 
			if getElementData (source, "markerhiting") == false then
			local Money = getPlayerMoney ( hitElement )
				if ( Money >= 5000 ) then
				takePlayerMoney ( hitElement , 5000 )
				setElementData ( hitElement, "markerhiting", true)
				setElementData ( source, "markerhiting", true)
				setElementPosition ( hitElement , 775.97052, -1279.57434, 13.64844 )
				end
            else
            cancelEvent ()
   			end
  		end
	elseif ( source == myMarker1 ) then
		if ( getElementType ( hitElement ) == "player" ) then 
			if getElementData (source, "markerhitingA") == false then
			local Money = getPlayerMoney ( hitElement )
				if ( Money >= 5000 ) then
				takePlayerMoney ( hitElement , 5000 )
				setElementData ( hitElement, "markerhitingA", true)
				setElementData ( source, "markerhitingA", true)
				setElementPosition ( hitElement , 775.97052, -1279.57434, 13.64844 )
				end
            else
            cancelEvent ()
   			end
  		end
	end
end)

addEventHandler("onPlayerWasted",root,
function ()
	if getElementData (source, "markerhiting") == true then
	setElementData (myMarker, "markerhiting", false)
	elseif getElementData (source, "markerhitingA") == true then
	setElementData (myMarker1, "markerhitingA", false)
	end
end)

 

Edited by Modren
Small Erorr
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...