AR/setElementPosition

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

هذه الوظيفة تستخدم لنقل الالمنت او الشيئ لاحداثيات محددة.

Attention: Do not use this function to spawn a player. It will cause problems with other functions like warpPedIntoVehicle.
Use spawnPlayer instead.

Syntax

bool setElementPosition ( element theElement, float x, float y, float z [, bool warp = true ] )  

OOP Syntax Help! I don't understand this!

Method: element:setPosition(...)
Variable: .position
Counterpart: getElementPosition


شرح الارقمنتات

  • theElement: الالمنت الذي تريد جلب احداثيات.
  • x: الاحداثيات x.
  • y: الاحداثيات y.
  • z: الاحداثيات z.

Optional Arguments

  • warp: ان كنت تريد نقل الاعب.

Returns

Returns true if the function was successful, false otherwise.

Example

Click to collapse [-]
Example 1

هذه الوظيفة عند كتابة امر باف8 تقوم بنقل الاعب.

function consoleSetPlayerPosition ( source, commandName, posX, posY, posZ )
	setElementPosition ( source, posX, posY, posZ )
end
addCommandHandler ( "setpos", consoleSetPlayerPosition  )
Click to expand [+]
Example 2
Click to expand [+]
Example 3

See Also