Jump to content

# - Code | كود - #


Jw8.

Recommended Posts

11 minutes ago, Default said:

'onPlayerWasted'
getElementData
setElementData

 

للاسف معرف للدتأ

addEventHandler( "onPlayerWasted", root,
function()
guiSetVisible ( killWasted, true )
guiSetEnabled (openPack,true)
triggerServerEvent('get_packges', localPlayer)
	end

 

Link to comment

اخي تقصد بس الاعب يقتل 10 لاعبين يجية صورة علي الشاشة ولا وش لاني مو فاهمك كويس؟

server side

--server side

function leesh ( playerSource )
	if getElementData ( localPlayer , 'kills' ) >= 10 then 
		triggerClientEvent(root, "leesh", root)
	end
end

--client side

function leesh()
     	leeshsound = playSound("leesh.mp3",false) -- اضافة من عندي لك لو تبي تحط صوت مع الصورة
     	setSoundVolume (leeshsound, 1)
	addEventHandler("onClientRender", root, drowleesh)
	setTimer(function()
	removeEventHandler("onClientRender", root, drowleesh)
	end,2000,1)
end
addEvent("leesh",true)
addEventHandler("leesh",root,leesh)

local sX, sY = guiGetScreenSize()

function drowleesh()
	dxDrawImage((sX/2)-250, (sY/2)-250, 250, 250 , "leesh.jpg") -- اسم صورتك
end

 

Edited by SAM!!
Link to comment
19 minutes ago, SAM!! said:

اخي تقصد بس الاعب يقتل 10 لاعبين يجية صورة علي الشاشة ولا وش لاني مو فاهمك كويس؟

 

server side


function leesh ( playerSource )
	if getElementData ( localPlayer , 'kills' ) >= 10 then 
		triggerClientEvent(root, "leesh", root)
	end
end

وش ذا يالحبيب

3 hours ago, DmAr511 said:

للاسف معرف للدتأ


addEventHandler( "onPlayerWasted", root,
function()
guiSetVisible ( killWasted, true )
guiSetEnabled (openPack,true)
triggerServerEvent('get_packges', localPlayer)
	end

 

onPlayerWasted سيرفر

استعمل onClientPlayerWasted

ووين محاولتك حق الداتا ماتحتاج خبرة كبيرة

Link to comment
On ١٥‏/٨‏/٢٠١٧ at 16:11, #BrosS said:

@SAM!! كودك غلط وانا حطيت رد مافي داعي تزوييد مشاركات

 addEventHandler( "onClientPlayerWasted", root,
function()
triggerServerEvent('get_packgesB', localPlayer)
addEventHandler("onClientRender", root, showOnSpawnS)
outputChatBox("#00FFFF[Packges System]#DC143CYou Get packge Silver", source, 255, 0, 0,true)
Sound = playSound("sound.mp3",false)
setSoundVolume (Sound, 100)
setTimer(function()
guiSetEnabled (openPack,true)
removeEventHandler("onClientRender", root, showOnSpawnS)
triggerServerEvent('remove_packges', localPlayer)
end,10000,1)
end
)

وش المشكله هنا ؟ كل ما اموت انا يجيلي البكج ؟ 

addEvent("get_packgesS",true) 
addEventHandler("get_packgesS",getRootElement(),function() 
if getElementData ( source , 'kills' ) >= 25 or getElementData ( source , 'kills' ) >= 21 or getElementData ( source , 'kills' ) >= 32 then 
setElementData(source, "Money", (getElementData(source, "Money") or 0) + 0)
outputChatBox("#00FFFF[Packges System]#DC143CYou Get Packges Silver To Open 'F8 - packges'", player, 255, 0, 0,true)
end
end
)

 

Link to comment
On ١٥‏/٨‏/٢٠١٧ at 16:11, #BrosS said:

@SAM!! كودك غلط وانا حطيت رد مافي داعي تزوييد مشاركات

 addEventHandler( "onClientPlayerWasted", root,
function()
triggerServerEvent('get_packgesB', localPlayer)
addEventHandler("onClientRender", root, showOnSpawnS)
outputChatBox("#00FFFF[Packges System]#DC143CYou Get packge Silver", source, 255, 0, 0,true)
Sound = playSound("sound.mp3",false)
setSoundVolume (Sound, 100)
setTimer(function()
guiSetEnabled (openPack,true)
removeEventHandler("onClientRender", root, showOnSpawnS)
triggerServerEvent('remove_packges', localPlayer)
end,10000,1)
end
)

ابي كل ما تقتل تجي صورة 

Link to comment
20 minutes ago, DmAr511 said:

 addEventHandler( "onClientPlayerWasted", root,
function()
triggerServerEvent('get_packgesB', localPlayer)
addEventHandler("onClientRender", root, showOnSpawnS)
outputChatBox("#00FFFF[Packges System]#DC143CYou Get packge Silver", source, 255, 0, 0,true)
Sound = playSound("sound.mp3",false)
setSoundVolume (Sound, 100)
setTimer(function()
guiSetEnabled (openPack,true)
removeEventHandler("onClientRender", root, showOnSpawnS)
triggerServerEvent('remove_packges', localPlayer)
end,10000,1)
end
)

ابي كل ما تقتل تجي صورة 

تجي صورة للي انقلت ولا للي قتل

Link to comment
 addEventHandler( "onClientPlayerWasted", root,
function(killer)
triggerServerEvent('get_packgesB', killer)
addEventHandler("onClientRender", root, showOnSpawnS)
outputChatBox("#00FFFF[Packges System]#DC143CYou Get packge Silver", 255, 0, 0,true)
Sound = playSound("sound.mp3",false)
setSoundVolume (Sound, 100)
setTimer(function()
guiSetEnabled (openPack,true)
removeEventHandler("onClientRender", root, showOnSpawnS)
triggerServerEvent('remove_packges', killer)
end,10000,1)
end
)

..

Edited by #BrosS
Link to comment
39 minutes ago, #BrosS said:

 addEventHandler( "onClientPlayerWasted", root,
function(killer)
triggerServerEvent('get_packgesB', killer)
addEventHandler("onClientRender", root, showOnSpawnS)
outputChatBox("#00FFFF[Packges System]#DC143CYou Get packge Silver", 255, 0, 0,true)
Sound = playSound("sound.mp3",false)
setSoundVolume (Sound, 100)
setTimer(function()
guiSetEnabled (openPack,true)
removeEventHandler("onClientRender", root, showOnSpawnS)
triggerServerEvent('remove_packges', killer)
end,10000,1)
end
)

..

يجي لكل السيرفر وانا كل ما امووت خخخ

Link to comment

جرب ذا ماجربته, اذا جبت 10 قتلات وفوق يطلع لك الصورة

killWasted = guiCreateStaticImage(1113, 298, 243, 239, "pack/gold_package.png", false)    
killCount = 0

addEventHandler( "onClientPlayerWasted", root,
	function ( killer )
		if ( killer == localPlayer ) and ( getElementType(source) == "player" ) then
			killCount = killCount + 1
			outputChatBox("Kills Count: "..killCount)
			if ( killCount =< 10 ) then
				guiSetVisible ( killWasted, true )
				outputChatBox("You've got a gold package")
			end
		end
	end
)

 

Link to comment
-- Server

addEventHandler ( "onPlayerWasted", root, function ( _, attacker )
	if ( attacker and attacker ~= source and isElement ( attacker ) ) then
	if getElementData ( attacker , 'kills' ) >= 25 or getElementData ( attacker , 'kills' ) >= 21 or getElementData (attacker , 'kills') >= 32 then 
	outputChatBox("#00FFFF[Packges System]#DC143CYou Get packge Silver", attacker, 255, 0, 0,true)
	triggerClientEvent(attacker,"123",attacker) 
	end
	end
	end 
	)

--- Client
addEvent("123",true)
addEventHandler("123",root,
function ()
addEventHandler("onClientRender", root, showOnSpawnS)
Sound = playSound("sound.mp3",false)
setTimer(function()
guiSetEnabled (openPack,true)
removeEventHandler("onClientRender", root, showOnSpawnS)
triggerServerEvent('remove_packges', localPlayer)
end,10000,1)
end
)

 

Link to comment
4 hours ago, N3xT said:

جرب ذا ماجربته, اذا جبت 10 قتلات وفوق يطلع لك الصورة


killWasted = guiCreateStaticImage(1113, 298, 243, 239, "pack/gold_package.png", false)    
killCount = 0

addEventHandler( "onClientPlayerWasted", root,
	function ( killer )
		if ( killer == localPlayer ) and ( getElementType(source) == "player" ) then
			killCount = killCount + 1
			outputChatBox("Kills Count: "..killCount)
			if ( killCount =< 10 ) then
				guiSetVisible ( killWasted, true )
				outputChatBox("You've got a gold package")
			end
		end
	end
)

 

سطر 9

=< x

<=

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