Server Scripting Functions: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
m (Changed translations hierarchy)
 
(464 intermediate revisions by 67 users not shown)
Line 1: Line 1:
This page lists all the scripting functions that exists.
<pageclass class="server"></pageclass>
 
{{Adding_Pages_to_Categories_and_Templates}}
==Player functions==
This page lists all the '''server-side''' scripting functions that have been implemented and are available as native functions. To request a function, create an issue in [https://github.com/multitheftauto/mtasa-blue/issues our GitHub repository.]
player [[findPlayer]] ( nick/id )
int [[getPlayerAdminLevel]] ( player )
int [[getPlayerCount]] ()
int [[getPlayerCurrentWeaponAmmoInClip]] ( player )
int [[getPlayerCurrentWeaponID]] ( player )
player [[getPlayerFromID]] ( id )
int [[getPlayerHealth]] ( player )
int [[getPlayerID]] ( player )
float [[getPlayerMoveSpeedX]] ( player )
float [[getPlayerMoveSpeedY]] ( player )
float [[getPlayerMoveSpeedZ]] ( player )
string [[getPlayerName]] ( player )
vehicle [[getPlayerOccupiedVehicle]] ( player )
int [[getPlayerOccupiedVehicleSeat]] ( player )
int [[getPlayerPing]] ( player )
float [[getPlayerPositionX]] ( player )
float [[getPlayerPositionY]] ( player )
float [[getPlayerPositionZ]] ( player )
float [[getPlayerRotation]] ( player )
string [[getPlayerSourceIP]] ( player )
float [[getPlayerTurnSpeedX]] ( player )
float [[getPlayerTurnSpeedY]] ( player )
float [[getPlayerTurnSpeedZ]] ( player )
player [[getRandomPlayer]] ()
bool [[isPlayerDead]] ( player )
bool [[isPlayerDucked]] ( player )
bool [[isPlayerMuted]] ( player )
bool [[killPlayer]] ( player )
 
==Weapon functions==
bool giveWeapon ( player, weaponid, ammo )
bool giveWeaponToAll ( weaponid, ammo )
bool takeWeapon ( player, weaponid )
bool takeWeaponFromAll ( player, weaponid )
bool takeAllWeapons ( player )
bool takeAllWeaponsFromAll ()
 
==Vehicle functions==
vehicle createVehicle ( id, x, y, z [, rx, ry, rz] )
bool destroyVehicle ( vehicle )
float getVehicleHealth ( vehicle )
int getVehicleID ( vehicle )
int getVehicleIndex ( vehicle )
float getVehicleMoveSpeedX ( vehicle )
float getVehicleMoveSpeedY ( vehicle )
float getVehicleMoveSpeedZ ( vehicle )
player getVehicleOccupant ( vehicle )
float getVehiclePositionX ( vehicle )
float getVehiclePositionY ( vehicle )
float getVehiclePositionZ ( vehicle )
float getVehicleRotationX ( vehicle )
float getVehicleRotationY ( vehicle )
float getVehicleRotationZ ( vehicle )
float getVehicleTurnSpeedX ( vehicle )
float getVehicleTurnSpeedY ( vehicle )
float getVehicleTurnSpeedZ ( vehicle )
float getVehicleTurretPositionX ( vehicle )
float getVehicleTurretPositionY ( vehicle )
bool setVehiclePosition ( vehicle, x, y, z )
bool setVehicleRotation ( vehicle, rx, ry, rz )
bool setVehicleMoveSpeed ( vehicle, x, y, z )
bool setVehicleTurnSpeed ( vehicle, rx, ry, rz )
bool setVehicleHealth ( vehicle, health )
bool setVehicleColor ( vehicle, color1, color2, color3, color4 )


Please note that the scripting functions can also be extended by loading in dynamic modules that provide new functionality, such as utility functions. These scripting functions are non-native and require the module to be loaded in order to work.
Head over to [[Modules]] for a list of non-native serverside functions and modules that are available.
For more functions, check the [[Useful_Functions|useful functions page]].
'''Client-side scripting functions can be found here: [[Client Scripting Functions]].'''
__TOC__
==Account functions==
{{Account_functions}}
==ACL functions==
{{ACL_functions}}
==Admin functions==
{{Admin_functions}}
==Audio functions==
{{Audio_functions}}
==Announcement functions==
{{Announce_functions}}
==Blip functions==
{{Blip_functions}}
==Camera functions==
{{Camera_functions}}
==Clothes and body functions==
{{Clothes_and_body_functions}}
==Collision shape functions==
{{Collision_shape_functions}}
==Cursor functions==
{{Cursor_functions}}
==Element functions==
{{Element_functions}}
==Event functions==
{{Event_functions}}
==Explosion functions==
{{Explosion_functions}}
==File functions==
{{File_functions}}
==HTTP functions==
{{HTTP_functions}}
==Input functions==
{{Server_input_functions}}
==Map functions==
{{Map_functions}}
==Marker functions==
==Marker functions==
marker createMarker ( id, x, y, z, r, g, b )
{{Marker_functions}}
bool destroyMarker ( marker )
marker getMarkerFromID ( id )
==Matrix functions==
 
{{Shared_matrix_functions}}
==Blip functions==
blip createBlip ( r, g, b, a [, x, y, z] )
==Module functions==
blip createBlipAttachedTo ( entity, r, g, b, a )
{{Module_functions}}
bool destroyBlip ( blip )
bool destroyBlipAttachedTo ( entity )
float, float, float getBlipPosition ( blip )
float getBlipPositionX ( blip )
float getBlipPositionY ( blip )
float getBlipPositionZ ( blip )
bool setBlipPosition ( blip, x, y, z )
bool attachBlipToEntity ( blip, entity )
 
==Object functions==
==Object functions==
object createObject ( model, x, y, z [,rx, ry, rz] )
{{Object_functions}}
bool destroyObject ( object )
string getObjectName ( object )
==Output functions==
int getObjectModel ( object )
{{Output_functions}}
float getObjectPositionX ( object )
float getObjectPositionY ( object )
==Ped functions==
float getObjectPositionZ ( object )
{{Ped_functions}}
float getObjectRotationX ( object )
float getObjectRotationY ( object )
==Pickup functions==
float getObjectRotationZ ( object )
{{Pickup_functions}}
bool setObjectName ( object, name )
bool setObjectModel ( object, model )
==Player functions==
bool setObjectPosition ( object, x, y, z )
{{Player_functions}}
bool setObjectRotation ( object, x, y, z )
 
==Projectile functions==
{{Projectile_functions}}
==Radar area functions==
{{Radar_area_functions}}
==Resource functions==
{{Resource_functions}}
==Server functions==
==Server functions==
int getMaxPlayers ()
{{Server_functions}}
bool serverLoggerPrint ( string/int/float, ... )
bool serverChat ( string/int/float, ... )
==Settings registry functions==
bool playerPM ( player, string/int/float... )
{{Settings_registry_functions}}
bool showTextForAll ( duration, r, g, b, size, string/int/float ... )
bool showTextForPlayer ( player, duration, r, g, b, size, string/int/float ... )
==SQL functions==
 
{{SQL_functions}}
==Team functions==
{{Team_functions}}
==Text functions==
{{Text_functions}}
==Utility functions==
==Utility functions==
float getDistanceBetweenPoints2D ( x1, y1, x2, y2 )
{{Utility_functions}}
float getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 )
int randInt ( lowerbound, upperbound )
==UTF8 Library==
float randFloat ()
{{UTF8_functions}}
int getTickCount ()
string gettok ( string, index, seperatingchar )
==Vehicle functions==
bool setTimer ( "function", time in ms for execution, function arguments ... )
{{Vehicle_functions}}
==Water functions==
{{Water_functions}}
==Weapon functions==
{{Weapon_functions}}
==World functions==
{{World_functions}}
==XML functions==
{{XML_functions}}


==Map functions==
[[ar:Server Scripting Functions]]
string [[getLoadedMapName]] ()
[[de:Server-Seitige Scripting Funktionen]]
xmlnode [[getLoadedMapXMLRoot]] ()
[[en:Server Scripting Functions]]
 
[[es:Funciones_del_Server]]
==XML functions==
[[hu:Server Scripting Functions]]
xmlnode [[xmlFindSubNode]] ( xmlNode, sub node name, index )
[[pl:Server Scripting Functions]]
string [[xmlNodeGetValue]] ( xmlNode )
[[pt-br:Funções de Scripting do Servidor]]
bool [[xmlNodeSetValue]] ( xmlNode, value )
[[ru:Server Scripting Functions]]
string [[xmlNodeGetAttribute]] ( xmlNode, attribute name )
[[tr:Server Scripting Functions]]
bool [[xmlNodeSetAttribute]] ( xmlNode, attribute name, value )
[[zh-cn:Server Scripting Functions]]
xmlnode [[xmlLoadFile]] ( filename )
bool [[xmlUnloadFile]] ( xmlnode )

Latest revision as of 15:13, 7 August 2023

Contributors: Did you create a page but it's not on this list? Confused? Read: Adding Pages to Categories and Templates

This page lists all the server-side scripting functions that have been implemented and are available as native functions. To request a function, create an issue in our GitHub repository.

Please note that the scripting functions can also be extended by loading in dynamic modules that provide new functionality, such as utility functions. These scripting functions are non-native and require the module to be loaded in order to work.

Head over to Modules for a list of non-native serverside functions and modules that are available.

For more functions, check the useful functions page.

Client-side scripting functions can be found here: Client Scripting Functions.

Account functions


ACL functions


Admin functions


Audio functions


Announcement functions


Blip functions


Camera functions


Clothes and body functions


Collision shape functions


Cursor functions


Element functions


Event functions


Explosion functions


File functions


HTTP functions

These functions can only be used from within lua blocks in HTML pages hosted by the server


Input functions


Map functions


Marker functions


Matrix functions


Module functions


Object functions


Output functions


Ped functions


Pickup functions


Player functions


Projectile functions


Radar area functions


Resource functions


Server functions


Settings registry functions


SQL functions


Team functions


Text functions


Utility functions


UTF8 Library


Vehicle functions


Water functions


Weapon functions


World functions


XML functions