Jump to content

مشكلة


Recommended Posts

Posted

في عندي لوحة  تشتري منها  طائرات و بدي اللاعب ما يقدر ينزل طيارة من اللوحة  أذا هو في طائرة

هذا جزء من المود

addEvent ("carBuy", true)
addEventHandler( "isPedInVehicle", getRootElement(),
addEventHandler ("carBuy", getRootElement(), 
function(id2, cost2, name2,x, y, z, sRz)
  if (getPlayerMoney (source) >= tonumber(cost2)) then
    outputChatBox ("#006400You Bought A : #FFFFFF" .. name2, source, 255, 255, 255, true)
    outputChatBox ("#006400ID: #FFFFFF" .. id2, source, 255, 255, 255, true)
    outputChatBox ("#006400Costs: #FFFFFF" .. cost2, source, 255, 0, 0, true)
    takePlayerMoney (source, tonumber (cost2))
	local x,y,z = getElementPosition (source)
	local vehicle = createVehicle (id2, x, y, z, 0, 0, sRz )
	warpPedIntoVehicle(source, vehicle)
  else
    outputChatBox ("#006400You Don't Have Enough #FFFFFFMoney", source, 255, 255, 255, true)
	if isPedInVehicle (source) then
	cancelEvent()
	 outputChatBox ("#ff0000Leave your vehicle to spawn another vehicle", source, 255, 255, 255, true)
	 end
  end
end))

ممكن تصليح للمود؟

Posted

ودك إياه ما ينزل غير طيارة وحده , ولا إذا كان بطيارة ما يقدر يشتري وحدة ثانية , ولازم ينزل عشان يشتري ؟

Posted
addEvent("carBuy", true)
addEventHandler("carBuy", getRootElement(), 
function (id2, cost2, name2,x, y, z, sRz)
	if ( getPlayerMoney(source) >= tonumber(cost2) ) then
		if ( getPedOccupiedVehicle(source) ) then
			outputChatBox ("#ff0000Leave your vehicle to spawn another vehicle", source, 255, 255, 255, true)
			return
		end
		outputChatBox ("#006400You Bought A : #FFFFFF" .. name2, source, 255, 255, 255, true)
		outputChatBox ("#006400ID: #FFFFFF" .. id2, source, 255, 255, 255, true)
		outputChatBox ("#006400Costs: #FFFFFF" .. cost2, source, 255, 0, 0, true)
		takePlayerMoney (source, tonumber (cost2))
		local x,y,z = getElementPosition (source)
		local vehicle = createVehicle (id2, x, y, z, 0, 0, sRz )
		warpPedIntoVehicle(source, vehicle)
	else
		outputChatBox ("#006400You Don't Have Enough #FFFFFFMoney", source, 255, 255, 255, true)
	end
end)

 

  • Thanks 1
Posted (edited)

شكرا شغال بس ايش شيء الغلط لي كتبته انا؟ و ايش قصد كلمة 

return

Edited by Snakegold
Posted
15 minutes ago, !#NssoR_) said:

addEvent("carBuy", true)
addEventHandler("carBuy", getRootElement(), 
function (id2, cost2, name2,x, y, z, sRz)
	if ( getPlayerMoney(source) >= tonumber(cost2) ) then
		if ( getPedOccupiedVehicle(source) ) then
			outputChatBox ("#ff0000Leave your vehicle to spawn another vehicle", source, 255, 255, 255, true)
			return
		end
		outputChatBox ("#006400You Bought A : #FFFFFF" .. name2, source, 255, 255, 255, true)
		outputChatBox ("#006400ID: #FFFFFF" .. id2, source, 255, 255, 255, true)
		outputChatBox ("#006400Costs: #FFFFFF" .. cost2, source, 255, 0, 0, true)
		takePlayerMoney (source, tonumber (cost2))
		local x,y,z = getElementPosition (source)
		local vehicle = createVehicle (id2, x, y, z, 0, 0, sRz )
		warpPedIntoVehicle(source, vehicle)
	else
		outputChatBox ("#006400You Don't Have Enough #FFFFFFMoney", source, 255, 255, 255, true)
	end
end)

 

من زمان م شفناك تعلق

منورر الحتةةء ي سطى

  • Thanks 1
Posted
29 minutes ago, !#NssoR_) said:

 

عاش من شافك تساعد حسبتك اختفيت +_+

27 minutes ago, Snakegold said:

return

ابحث بقسم الشروحات  اتوقع اني شرحتها بالتفصيل

  • Thanks 1
Posted
1 hour ago, Snakegold said:

شكرا شغال بس ايش شيء الغلط لي كتبته انا؟ و ايش قصد كلمة 

return

return = ترجعلك القيمة

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