Jump to content

مساعدة بكود سهل


Recommended Posts

السلام عليكم

الحين انا بدي هالكلام يشتغل لما اضغط علي زر مثلا

addEventHandler("onPlayerDamage",root,
	function(attacker, weapon, bodypart)
		if attacker and attacker ~= source and getElementType(attacker) == "player" then
			if weapon == 0 then
				killPed(source, attacker, weapon, bodypart)
			end 
		end
	end
)

وشكرا :)

Link to comment

محاولتي

client

elseif ( source == btn.box ) then 
playSound("open.wav")
guiSetEnabled (btn.box ,false)
setTimer(guiSetEnabled, 150000, 1 ,btn.box ,true)
triggerServerEvent("onPlayerDamage",getLocalPlayer()) 

server

addEventHandler("onPlayerDamage",root,
	function(attacker, weapon, bodypart)
		if attacker and attacker ~= source and getElementType(attacker) == "player" then
			if weapon == 0 then
outputChatBox ("#00FF00=(VIP-System)=#CC0000 : Wait 5 minutes to again.|You take Super Box successfully ",source,255,255,0,true)
				killPed(source, attacker, weapon, bodypart)
			end 
		end
	end
)

 

2 minutes ago, *RayaN-Alharbi. said:

انت وش تببي بالضبط؟

شوف

 ابي لما اضغط علي زر يخليني لو ضربت احد بالبقس اقتلة فورا

ضربة قاضية يعني

Link to comment
elseif ( source == btn.box ) then 
playSound("open.wav")
guiSetEnabled (btn.box ,false)
setTimer(guiSetEnabled, 150000, 1 ,btn.box ,true)
setElementData(localPlayer,"Damage",true)
outputChatBox ("#00FF00=(VIP-System)=#CC0000 : Wait 5 minutes to again.|You take Super Box successfully ",255,255,0,true)

    addEventHandler("onPlayerDamage",root,
    	function(attacker, weapon, bodypart)
		if ( getElementData(attacker,"Damage") == true ) then
    		if attacker and attacker ~= source and getElementType(attacker) == "player" then
    			if weapon == 0 then
    				killPed(source, attacker, weapon, bodypart)
    			end 
    		end
    	end
	end
    )

جرب

Link to comment
-- server
addEventHandler("onPlayerDamage",root,
	function(attacker, weapon, bodypart)
		if attacker and attacker ~= source and getElementType(attacker) == "player" and getElementData(attacker,"SPunch") then
			if weapon == 0 then
				killPed(source, attacker, weapon, bodypart)
			end 
		end
	end
)
-- Client

addEventHandler("onClientGUIClick",root, function ()
if source == button1 then
local Data = getElementData(localPlayer,"SPunch")
if Data and Data == true then
setElementData(localPlayer,"SPunch",false)
outputChatBox("تم اغلاق خاصية الضربه القاتله")
else
setElementData(localPlayer,"SPunch",true)
outputChatBox("تم فتح خاصية الضربه القاتله")
end
end
end)

 

  • Thanks 1
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...