Jump to content

x [ أستفسار ] x createWater


Recommended Posts


-- اعدادات المياة .
height = 40 -- ارتفاع المياه
SizeVal = 2998 -- منسوب المياه او حجم المياه بالمنطقة الي بتحط احداثياتها
-- 
southWest_X = -SizeVal
southWest_Y = -SizeVal
southEast_X = SizeVal
southEast_Y = -SizeVal
northWest_X = -SizeVal
northWest_Y = SizeVal
northEast_X = SizeVal
northEast_Y = SizeVal

-- OnClientResourceStart الفنكشن الي يصنع المياه .
function thaResourceStarting( )
    water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height ) -- الاحداثيات الموجوده للمكان 
    setWaterLevel ( height ) -- ارتفاع المياه الموجود
end
addEventHandler("onClientResourceStart", resourceRoot, thaResourceStarting)

-- مثال رقم2

function thaResourceStarting( )
    water = createWater ( 1866 "southWest_X" ,  -1444 "southWest_Y",10 "southWest_Z", 1968 "southEast_X", -1442 "southEast_Y", 10 "southEast_Z", 1866 "northWest_X", -1372 "northWest_Y", 10 "northWest_Z", 1968 "northEast_X", -1370 "northEast_Y", 10 "northEast_Z" )
    setWaterLevel ( water, 20 ) -- ارتفاع منسوب المياة
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), thaResourceStarting)

بس عشان لاتخطأ واسهل لك مثال رقم 2 

الاشياء الي بالاقواس بعد الارقام هذه للشرح فقط لا اكثر يعني لاتضيفها وانت تبرمج بس حط الاحداثيات بالظبط وخلاص

وهذا كود حق الاخ ريان طالب عليه تعديل وسويته له  , اعتقد بتفهم من الكود هذا اكثر

x1, y1 = 3059, 1063
x2, y2  = 3016, 1063
x3, y3  = 3016, 1092
x4, y4  = 3059, 1092
height = 40  -- ارتفاع المياه



function thaResourceStarting( )
    water = createWater ( x1,y1,height,x2,y2,height,x3,y3,height,x4,y4,height  )
	createBlipAttachedTo ( water, 52 )
    setWaterLevel ( height  )
	if water then
	print("ssssssssssssssssssssssssssss")
	else
	print("s")
	end
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), thaResourceStarting)

 

وإتمنى اكون افدتك .

Edited by ivor
اضافة كود .
  • Like 2
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...