AR/setBlipColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} تقوم الوظيفة بتلوين العلامة. ==Syntax== <syntaxhighlight lang="lua">bool setBlipColor ( blip theBlip, int red, int green, int blue...")
(No difference)

Revision as of 07:27, 3 January 2014

تقوم الوظيفة بتلوين العلامة.

Syntax

bool setBlipColor ( blip theBlip, int red, int green, int blue, int alpha )

Required Arguments

  • theBlip: البلب المُراد تلوينه.
  • red: قيمة اللون الأحمر للعلامة ( 0 - 255 ) , لا ينبطق الا على رمز الماركر, والإفتراضي هو 255
  • green: قيمة اللون الأخضر للعلامة ( 0 - 255 ) , لا ينبطق الا على رمز الماركر, والإفتراضي هو 0
  • blue: قيمة اللون الأحمر للعلامة ( 0 - 255 ) , لا ينبطق الا على رمز الماركر, والإفتراضي هو 0
  • alpha: قيمة شفافية العلامة ( 0 - 255 ) , لا ينبطق الا على رمز الماركر, والإفتراضي هو 255

Returns

Returns true if the blip's color was set successfully. Returns false if the blip passed to the function is invalid, or any of the colors are out of the valid range.

Example

تعيين اللون الأبيض لكل العلامات الموجود

for blipKey, blipValue in ipairs( getElementsByType ( "blip" ) ) do -- نعمل لوب لجميع العلامات
	red, green, blue, alpha = getBlipColor ( blipValue ); -- جلب اللون الأحمر والأخضر والأزرق والشفافية من وظيفة getBlipColor
	if ( red ~= 255 or green ~= 255 or blue ~= 255 or alpha ~= 255 ) then -- نتحقق إن القيم لا تساوي 255
		setBlipColor ( blipValue, 255, 255, 255, 255 ); -- نجعل جميع البلبات لونهم أبيض
	end -- إغلاق if
end -- إغلاق loop

See Also