Server Scripting Functions: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(479 intermediate revisions by 66 users not shown)
Line 1: Line 1:
This page lists all the scripting functions that exist.
<pageclass class="server"></pageclass>
{{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 [https://github.com/multitheftauto/mtasa-blue/issues our GitHub repository.]


==Player functions==
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.
player [[findPlayer]] ( nick/id )
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==
'''Shared'''
{{Audio functions}}


int [[getPlayerAdminLevel]] ( player )
==Announcement functions==
{{Announce functions}}
==Blip functions==
'''Shared'''
{{Blip functions}}


int [[getPlayerCount]] ()
==Camera functions==
'''Shared'''
{{Camera functions}}


int [[getPlayerCurrentWeaponAmmoInClip]] ( player )
==Clothes and body functions==
'''Shared'''
{{Clothes and body functions}}


int [[getPlayerCurrentWeaponID]] ( player )
==Collision shape functions==
'''Shared'''
{{Collision shape functions}}


player [[getPlayerFromID]] ( id )
==Cursor functions==
'''Shared'''
{{Cursor functions}}


int [[getPlayerHealth]] ( player )
==Element functions==
 
{{Element functions|server}}
int [[getPlayerID]] ( player )
 
==Event functions==
float [[getPlayerMoveSpeedX]] ( player )
{{Event functions|server}}
 
float [[getPlayerMoveSpeedY]] ( player )
==Explosion functions==
 
'''Shared'''
float [[getPlayerMoveSpeedZ]] ( player )
{{Explosion functions}}
 
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 )


==File functions==
'''Shared'''
{{File functions}}


==HTTP functions==
{{HTTP functions}}
==Input functions==
{{Input functions|server}}
==Map functions==
{{Map functions}}
==Marker functions==
==Marker functions==
marker createMarker ( id, x, y, z, r, g, b )
'''Shared'''
 
{{Marker functions}}
bool destroyMarker ( marker )
 
marker getMarkerFromID ( id )
 
 
==Blip functions==
blip createBlip ( r, g, b, a [, x, y, z] )
 
blip createBlipAttachedTo ( entity, r, g, b, a )
 
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 )


==Matrix functions==
'''Shared'''
{{Matrix functions}}


==Module functions==
{{Module functions}}
==Object functions==
==Object functions==
object createObject ( model, x, y, z [,rx, ry, rz] )
'''Shared'''
{{Object functions}}


bool destroyObject ( object )
==Output functions==
 
{{Output functions|server}}
string getObjectName ( object )
 
==Ped functions==
int getObjectModel ( object )
{{Ped functions|server}}
 
float getObjectPositionX ( object )
==Pickup functions==
 
{{Pickup functions|server}}
float getObjectPositionY ( object )
 
==Player functions==
float getObjectPositionZ ( object )
{{Player functions|server}}
 
float getObjectRotationX ( object )
==Projectile functions==
 
'''Shared'''
float getObjectRotationY ( object )
{{Projectile_functions}}
 
float getObjectRotationZ ( object )
 
bool setObjectName ( object, name )
 
bool setObjectModel ( object, model )
 
bool setObjectPosition ( object, x, y, z )
 
bool setObjectRotation ( object, x, y, z )


==Radar area functions==
'''Shared'''
{{Radar functions}}


==Resource functions==
{{Resource functions|server}}
==Server functions==
==Server functions==
int getMaxPlayers ()
{{Server functions}}
 
bool serverLoggerPrint ( string/int/float, ... )
==Settings registry functions==
 
{{Settings registry functions}}
bool serverChat ( string/int/float, ... )
 
==SQL functions==
bool playerPM ( player, string/int/float... )
{{SQL functions}}
 
bool showTextForAll ( duration, r, g, b, size, string/int/float ... )
==Team functions==
 
{{Team functions|server}}
bool showTextForPlayer ( player, duration, r, g, b, size, string/int/float ... )
 
==Text functions==
 
{{Text functions}}
==Utility functions==
==Utility functions==
float getDistanceBetweenPoints2D ( x1, y1, x2, y2 )
{{Utility functions|server}}
 
float getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 )
==UTF8 Library==
 
'''Shared'''
int randInt ( lowerbound, upperbound )
{{UTF8 functions}}
 
float randFloat ()
==Vehicle functions==
 
{{Vehicle functions|server}}
int getTickCount ()
 
==Water functions==
string gettok ( string, index, seperatingchar )
'''Shared'''
 
{{Water functions}}
bool setTimer ( "function", time in ms for execution, function arguments ... )
 
 
==Map functions==
string [[getLoadedMapName]] ()
 
xmlnode [[getLoadedMapXMLRoot]] ()
 


==Weapon functions==
{{Weapon functions|server}}
==World functions==
{{World functions|server}}
==XML functions==
==XML functions==
xmlnode [[xmlFindSubNode]] ( xmlNode, sub node name, index )
'''Shared'''
 
{{XML functions}}
string [[xmlNodeGetValue]] ( xmlNode )
 
bool [[xmlNodeSetValue]] ( xmlNode, value )
 
string [[xmlNodeGetAttribute]] ( xmlNode, attribute name )
 
bool [[xmlNodeSetAttribute]] ( xmlNode, attribute name, value )
 
xmlnode [[xmlLoadFile]] ( filename )


bool [[xmlUnloadFile]] ( xmlnode )
[[ar:Server Scripting Functions]]
[[de:Server-Seitige Scripting Funktionen]]
[[en:Server Scripting Functions]]
[[es:Funciones_del_Server]]
[[hu:Server Scripting Functions]]
[[pl:Server Scripting Functions]]
[[pt-br:Funções de Scripting do Servidor]]
[[ru:Server Scripting Functions]]
[[tr:Server Scripting Functions]]
[[zh-cn:Server Scripting Functions]]

Latest revision as of 22:34, 6 September 2024

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

Shared



Announcement functions


Blip functions

Shared


Camera functions

Shared



Clothes and body functions

Shared


Collision shape functions

Shared


Cursor functions

Shared



Element functions



Event functions



Explosion functions

Shared


File functions

Shared


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

Shared



Matrix functions

Shared


Module functions


Object functions

Shared



Output functions



Ped functions



Pickup functions



Player functions



Projectile functions

Shared



Radar area functions

Shared


Resource functions



Server functions


Settings registry functions


SQL functions


Team functions



Text functions


Utility functions



UTF8 Library

Shared


Vehicle functions



Water functions

Shared



Weapon functions



World functions



XML functions

Shared