Server Scripting Functions: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
 
(481 intermediate revisions by 68 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}}
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 )
int [[getPlayerAdminLevel]] ( player )
Head over to [[Modules]] for a list of non-native serverside functions and modules that are available.
int [[getPlayerCount]] ()
int [[getPlayerCurrentWeaponAmmoInClip]] ( player )
For more functions, check the [[Useful_Functions|useful functions page]].
int [[getPlayerCurrentWeaponID]] ( player )
player [[getPlayerFromID]] ( id )
'''Client-side scripting functions can be found here: [[Client Scripting Functions]].'''
int [[getPlayerHealth]] ( player )
__TOC__
int [[getPlayerID]] ( player )
float [[getPlayerMoveSpeedX]] ( player )
==Account functions==
float [[getPlayerMoveSpeedY]] ( player )
{{Account functions}}
float [[getPlayerMoveSpeedZ]] ( player )
string [[getPlayerName]] ( player )
==ACL functions==
vehicle [[getPlayerOccupiedVehicle]] ( player )
{{ACL functions}}
int [[getPlayerOccupiedVehicleSeat]] ( player )
int [[getPlayerPing]] ( player )
==Admin functions==
float [[getPlayerPositionX]] ( player )
{{Admin functions}}
float [[getPlayerPositionY]] ( player )
float [[getPlayerPositionZ]] ( player )
==Audio functions==
float [[getPlayerRotation]] ( player )
'''Shared'''
string [[getPlayerSourceIP]] ( player )
{{Audio functions}}
float [[getPlayerTurnSpeedX]] ( player )
 
float [[getPlayerTurnSpeedY]] ( player )
==Announcement functions==
float [[getPlayerTurnSpeedZ]] ( player )
{{Announce functions}}
player [[getRandomPlayer]] ()
bool [[isPlayerDead]] ( player )
==Blip functions==
bool [[isPlayerDucked]] ( player )
'''Shared'''
bool [[isPlayerMuted]] ( player )
{{Blip functions}}
bool [[killPlayer]] ( player )
 
==Camera functions==
'''Shared'''
{{Camera functions}}
 
==Clothes and body functions==
'''Shared'''
{{Clothes and body functions}}
 
==Collision shape functions==
'''Shared'''
{{Collision shape functions}}
 
==Cursor functions==
'''Shared'''
{{Cursor functions}}


==Weapon functions==
==Element functions==
bool giveWeapon ( player, weaponid, ammo )
{{Element functions|server}}
bool giveWeaponToAll ( weaponid, ammo )
bool takeWeapon ( player, weaponid )
==Event functions==
bool takeWeaponFromAll ( player, weaponid )
{{Event functions|server}}
bool takeAllWeapons ( player )
bool takeAllWeaponsFromAll ()
==Explosion functions==
'''Shared'''
{{Explosion functions}}


==Vehicle functions==
==File functions==
vehicle createVehicle ( id, x, y, z [, rx, ry, rz] )
'''Shared'''
bool destroyVehicle ( vehicle )
{{File functions}}
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 )


==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'''
bool destroyMarker ( marker )
{{Marker functions}}
marker getMarkerFromID ( id )


==Blip functions==
==Matrix functions==
blip createBlip ( r, g, b, a [, x, y, z] )
'''Shared'''
blip createBlipAttachedTo ( entity, r, g, b, a )
{{Matrix 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 )


==Module functions==
{{Module functions}}
==Object functions==
==Object functions==
object createObject ( model, x, y, z [,rx, ry, rz] )
'''Shared'''
bool destroyObject ( object )
{{Object functions}}
string getObjectName ( object )
int getObjectModel ( object )
float getObjectPositionX ( object )
float getObjectPositionY ( object )
float getObjectPositionZ ( object )
float getObjectRotationX ( object )
float getObjectRotationY ( object )
float getObjectRotationZ ( object )
bool setObjectName ( object, name )
bool setObjectModel ( object, model )
bool setObjectPosition ( object, x, y, z )
bool setObjectRotation ( object, x, y, z )


==Output functions==
{{Output functions|server}}
==Ped functions==
{{Ped functions|server}}
==Pickup functions==
{{Pickup functions|server}}
==Player functions==
{{Player functions|server}}
==Projectile functions==
'''Shared'''
{{Projectile_functions}}
==Radar area functions==
'''Shared'''
{{Radar functions}}
==Resource functions==
{{Resource functions|server}}
==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|server}}
==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 )
int randInt ( lowerbound, upperbound )
==UTF8 Library==
float randFloat ()
'''Shared'''
int getTickCount ()
{{UTF8 functions}}
string gettok ( string, index, seperatingchar )
bool setTimer ( "function", time in ms for execution, function arguments ... )
==Vehicle functions==
{{Vehicle functions|server}}
==Water functions==
'''Shared'''
{{Water functions}}


==Map functions==
==Weapon functions==
string [[getLoadedMapName]] ()
{{Weapon functions|server}}
xmlnode [[getLoadedMapXMLRoot]] ()
==World functions==
{{World functions|server}}
==XML functions==
'''Shared'''
{{XML functions}}


==XML functions==
[[ar:Server Scripting Functions]]
xmlnode [[xmlFindSubNode]] ( xmlNode, sub node name, index )
[[de:Server-Seitige Scripting Funktionen]]
string [[xmlNodeGetValue]] ( xmlNode )
[[en:Server Scripting Functions]]
bool [[xmlNodeSetValue]] ( xmlNode, value )
[[es:Funciones_del_Server]]
string [[xmlNodeGetAttribute]] ( xmlNode, attribute name )
[[hu:Server Scripting Functions]]
bool [[xmlNodeSetAttribute]] ( xmlNode, attribute name, value )
[[pl:Server Scripting Functions]]
xmlnode [[xmlLoadFile]] ( filename )
[[pt-br:Funções de Scripting do Servidor]]
bool [[xmlUnloadFile]] ( xmlnode )
[[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