AR/createMarker

From Multi Theft Auto: Wiki
Revision as of 17:29, 8 February 2016 by Jaber (talk | contribs) (Created page with "__NOTOC__ {{Server client function}} هذه الوظيفة تستخدم لصنع ماركر . There are various limits that govern the maximum number of each type that can be...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

هذه الوظيفة تستخدم لصنع ماركر .

There are various limits that govern the maximum number of each type that can be visible at once. These are:

  • Coronas: 32
  • Checkpoints, Rings, Cylinders and Arrows combined: 32

You are able to create as many markers as you wish (memory and element limit permitting), but the player will only be able to see the nearest ones up to the limit.

Syntax

Click to collapse [-]
Server
marker createMarker ( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement( ) ] )

OOP Syntax Help! I don't understand this!

Method: Marker(...)


Required Arguments

  • x: احداثيات الماركر x.
  • y: احداثيات الماركر y.
  • z: احداثيات ارتفاع الماركر z.

Optional arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • theType: The visual type of the marker to be created. Possible values:
    • "checkpoint": A race checkpoint. These are very tall, but not infinite, light pillars. Checkpoints snap to ground and become invisible after going over a certain Z height.
    • "ring": Doughnut shaped ring, normally used for aircraft.
    • "cylinder": Small glowing ground ring. These are the glow markers you walk into to activate missions or events in single player.
    • "arrow": Arrow pointing down. These are the arrows on the doors you can enter in single player, except MTA's are not animated by default.
    • "corona": A glowing ball of light.
  • size: حجم الماركر الذي تريد صنعه.
  • r: (0 - 255)نسبة اللون الاحمر بالماركر بين.
  • g: (0 - 255)نسبة اللون الاخضر بالماركر بين.
  • b: (0 - 255)نسبة اللون الازرق بالماركر بين.
  • a: (0 - 255)نسبة ظهور الماركر 0 = مخفي ,وبعدها يبدأ يظهر
  • visibleTo: This defines which elements can see the marker. Defaults to visible to everyone. See visibility.
Click to collapse [-]
Client
marker createMarker ( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255 ] )

OOP Syntax Help! I don't understand this!

Method: Marker(...)


Required Arguments

  • x: احداثيات الماركر x.
  • y: احداثيات الماركر y.
  • z: احداثيات ارتفاع الماركر z.

Optional arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • theType: The visual type of the marker to be created. Possible values:
    • "checkpoint": A race checkpoint. These are very tall, but not infinite, light pillars. Checkpoints snap to ground and become invisible after going over a certain Z height.
    • "ring": Doughnut shaped ring, normally used for aircraft.
    • "cylinder": Small glowing ground ring. These are the glow markers you walk into to activate missions or events in single player.
    • "arrow": Arrow pointing down. These are the arrows on the doors you can enter in single player, except MTA's are not animated by default.
    • "corona": A glowing ball of light.
  • size: حجم الماركر الذي تريد صنعه.
  • r: (0 - 255)نسبة اللون الاحمر بالماركر بين.
  • g: (0 - 255)نسبة اللون الاخضر بالماركر بين.
  • b: (0 - 255)نسبة اللون الازرق بالماركر بين.
  • a: (0 - 255)نسبة ظهور الماركر 0 = مخفي ,وبعدها يبدأ يظهر .

Example

Click to collapse [-]
Example 1

هذا المثال يصنع ماركر بجانب الاعب:

function consoleCreateMarker ( thePlayer, commandName )
   if ( thePlayer ) then
      local x, y, z = getElementPosition ( thePlayer ) --يجيب احداثيات الاعب
      -- صنع ماركر بجانب الاعب:
      local theMarker = createMarker ( x + 2, y + 2, z, "cylinder", 1.5, 255, 255, 0, 170 )
      if ( theMarker ) then 
         outputConsole ( "تم صنع الماركر بنجاح", thePlayer )
      else
         outputConsole ( "خطأ في صنع الماركر", thePlayer )
      end
   end
end
addCommandHandler ( "createmarker", consoleCreateMarker )

See Also