Jump to content

ابي كود


MR.Mosa

Recommended Posts

السلام عليكم

عندي مشكلة تواجهني من زمان 

ابي لما واحد يضغط على زر يجب احداثياته

ويصير لما يموت ينقله للمكان الي حفظه

 

وشكرا اطرحو الاكواد المستخدمة وانا احوال اسويها وشكرااا

 

 

Link to comment

شباب اعرف انه داتا بس المشكلة مش قادر افهم الداتا

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

وشكرااا والله حاولت كثير اني افهم الداتا :)

 

 

Edited by MR.Mosa
Link to comment

نلف كلينت

functionToAll = {'الدائري','النخيل'}
for i, f in ipairs ( functionToAll ) do
 guiGridListSetItemText ( amakn1, guiGridListAddRow( amakn1 ), amakn2, f, false, false )
end

function setPlayerXYZ(x,y,z)
	local player = getLocalPlayer()
	setElementData(player,"x",x)
	setElementData(player,"y",y)
	setElementData(player,"z",z)
end

addEventHandler('onClientGUIClick', tm, function()
local get = guiGridListGetItemText ( amakn1, guiGridListGetSelectedItem ( amakn1 ), 1 )
local px, py, pz = getElementPosition(localPlayer)
if (get == 'النخيل') then
			guiSetInputEnabled(false)
			showCursor(false)
			fadeCamera(false)
			showChat(true)
setElementPosition(localPlayer, 2135.09253,1403.77039,11.13952 )
setPlayerXYZ(px, py, pz)
guiSetVisible(wnd1,false)
elseif (get == 'الدائري') then
fadeCamera(false)
showChat(true)
setTimer ( setElementPosition, 1000, 1, localPlayer, 1693.26697,1392.95569,10.74823)
setTimer ( fadeCamera, 1000, 1, true)
setPlayerXYZ(px, py, pz)
guiSetVisible(wnd1,false)
	end
end,false
)

ملف سيرفر

addEventHandler("onPlayerWasted",root,
	function ()
		if getElementData(source,"new") == true then
			setTimer(function(player)
				spawnPlayer(player,-3689.37231,-2998.42676,65.62993,0,46,0,0)
				setCameraTarget(player,player)
				fadeCamera(player,true)
			end,3500,1,source)
			setTimer(function(player)
				local x,y,z = getPlayerXYZ(player)
				spawnPlayer(player,x,y,z,0,getPlayerSkin(player),0,0)
				setCameraTarget(player,player)
				fadeCamera(player,true)
			end,500,1,source)
		end
		end
)

 

Link to comment

سويت لك ذا, بس يحفظ عن طريق أمر. إذا تبيه بزر بس تقدر تستعمل 

addCommandHandler ( "save-pos",
	function ( plr )  
		local x,y,z = getElementPosition ( plr )
		if ( x,y,z ) then
			setElementData(plr, "position", x,y,z)
			outputChatBox("تم حفظ إحداثياتك بنجاح", plr, 0, 255, 0, true)
		end
	end
)

addEventHandler("onPlayerWasted", root,
	function ()
		local x,y,z = getElementData(source, "position")
		if ( x,y,z ) then
			setTimer( spawnPlayer, 2000, 1, source, x,y,z )
			outputChatBox("تم نقلك لإحداثياتك", source, 0, 255, 0, true)
		end
	end
)

 

  • Like 1
Link to comment
addCommandHandler ( "save-pos",
	function ( plr )  
		local x,y,z = getElementPosition ( plr )
		if ( x and y and z ) then
			setElementData(plr, "position", {x,y,z})
			outputChatBox("تم حفظ إحداثياتك بنجاح", plr, 0, 255, 0, true)
		end
	end
)

addEventHandler("onPlayerWasted", root,
	function ()
		local x,y,z = unpack(getElementData(source, "position"))
		if ( x and y and z ) then
			setTimer( spawnPlayer, 2000, 1, source, x,y,z )
			outputChatBox("تم نقلك لإحداثياتك", source, 0, 255, 0, true)
		end
	end
)

 

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