Server Scripting Functions: Difference between revisions
Line 35: | Line 35: | ||
==Map functions== | ==Map functions== | ||
[[string]] [[getLoadedMapName]] () | |||
[[xmlnode]] [[getLoadedMapXMLRoot]] () | |||
[[ | [[bool]] [[startMap]] ( [[string]] name ) | ||
[[bool]] [[ | [[bool]] [[endMap]] () | ||
[[ | [[element]] [[loadMapData]] ( [[xmlnode]] node, [[element]] parent ) | ||
[[string]] [[ | [[string]] [[getMapOption]] ( [[string]] name ) | ||
==Marker functions== | |||
{{Marker functions}} | |||
==Object functions== | ==Object functions== |
Revision as of 23:03, 20 May 2006
This page lists all the scripting functions that have been implemented and are available as native functions from the Deathmatch mod. To request a function or event, use Requested Functions and Events
Please note that the scripting functions can now be extended by loading in dynamic modules that provide new functionality, such as MySQL database access. These scripting functions are non-native and require the module to be loaded in order to work.
Head over to Module functions for a list of non-native functions and modules that are available.
Incomplete/Malfunctioning Functions
Incomplete Function List: http://www.mtavc.com/once-upon_a_time-there_was-this_girl/index.php?title=Category:Incomplete
setPlayerRotation - Possibly not functional
Blip functions
- createBlip
- createBlipAttachedTo
- getBlipColor
- getBlipIcon
- getBlipOrdering
- getBlipSize
- getBlipVisibleDistance
- setBlipColor
- setBlipIcon
- setBlipOrdering
- setBlipSize
- setBlipVisibleDistance
Element functions
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement
Entity functions
float float float getEntityPosition ( entity entity )
bool setEntityPosition ( element entity, float x, float y, float z )
bool addEntityVisibleTo ( element entity, element visibleTo )
bool removeEntityVisibleTo ( element entity, element visibleTo )
bool clearEntityVisibleTo ( element entity )
Event functions
bool addEvent ( string name, string arguments )
bool addEventHandler ( string name, element element, string handler )
bool triggerEvent ( string name, element element, [ var argument1, var argument2, ... ] )
Map functions
xmlnode getLoadedMapXMLRoot ()
element loadMapData ( xmlnode node, element parent )
string getMapOption ( string name )
Marker functions
- createMarker
- getMarkerColor
- getMarkerCount
- getMarkerIcon
- getMarkerSize
- getMarkerTarget
- getMarkerType
- setMarkerColor
- setMarkerIcon
- setMarkerSize
- setMarkerTarget
- setMarkerType
- isElementWithinMarker
Object functions
An object is a model in the world. These have collision models and can be moved and rotated at will. Any existing GTA model can be used.
element createObject ( int id, float x, float y, float z, [ float rx, float ry, float rz] )
int getObjectModel ( element object )
float float float getObjectRotation ( element object )
bool setObjectModel ( element object, int id )
bool setObjectRotation ( element object, float x, float y, float z )
bool moveObject ( element object, int time, float x, float y, float z, float rx, float ry, float rz )
Pickup functions
pickup createPickup ( float x, float y, float z, int type, int amount/weapon, [ int ammo ] )
int getPickupType ( pickup pickup )
int getPickupWeapon ( pickup pickup )
int getPickupHealth ( pickup pickup )
int getPickupAmmo ( pickup pickup )
bool setPickupType ( element pickup, int type, int amount/weapon, [ int ammo ] )
Player functions
int getPlayerCurrentWeaponAmmoInClip ( player player )
int getPlayerCurrentWeaponID ( player player )
player getPlayerFromNick ( string nick )
float getPlayerHealth ( player player )
float getPlayerArmor ( player player )
int getPlayerLevel ( player player )
int getPlayerMoney ( player player )
float float float getPlayerMoveSpeed ( player player )
string getPlayerName ( player player )
vehicle getPlayerOccupiedVehicle ( player player )
int getPlayerOccupiedVehicleSeat ( player player )
int getPlayerPing ( player player )
float getPlayerRotation ( player player )
int getPlayerSkin ( player player )
string getPlayerSourceIP ( player player )
bool isPlayerDead ( player player )
bool isPlayerDucked ( player player )
bool isPlayerMuted ( player player )
bool setPlayerRotation ( element player, float rotation ) ---------------Cannot get to work
bool setPlayerSkin ( element player, int id )
bool setPlayerHealth ( element player, float health )
bool setPlayerArmor ( element player, float armor )
bool setPlayerMoney ( element player, int money )
bool givePlayerMoney ( element player, int money )
bool takePlayerMoney ( element player, int money )
bool killPlayer ( element player )
bool warpPlayerintoVehicle ( player player, vehicle vehicle, [ int seat=0 ] )
bool removePlayerFromVehicle ( element player )
bool spawnPlayer ( player player, spawnpoint spawnpoint )
bool spawnPlayer ( player player, float x, float y, float z, float rotation, int skin )
Radar area functions
radararea createRadarArea ( float x, float y, float sizex, float sizey, int r, int g, int b, int a, [ visibleTo=getRootElement () ] )
float float getRadarAreaSize ( radararea radararea )
int int int int getRadarAreaColor ( radararea radararea )
bool isRadarAreaFlashing ( radararea radararea )
bool setRadarAreaSize ( element radararea, float x, float y )
bool setRadarAreaColor ( element radararea, int r, int g, int b, int a )
bool setRadarAreaFlashing ( element radararea, bool flash )
Scoreboard functions
bool addScoreboardColumn ( string id, string name, float width )
bool removeScoreboardColumn ( string id )
Server functions
int getMaxPlayers ()
bool outputChatBox ( string text, element player, [ int r, int g, int b ] )
bool outputConsole ( string text, element player )
bool outputDebugString ( string text, [ int level=3 ] )
bool outputServerLog ( string text )
bool addCommandHandler ( string key, string handler )
bool removeCommandHandler ( string key )
Spawnpoint functions
float getspawnpointRotation ( spawnpoint spawn )
int getspawnpointSkin ( spawnpoint spawn )
bool setspawnpointRotation ( element spawn, float rotation )
bool setspawnpointSkin ( element spawn, int skin )
Text functions
textdisplay textCreateDisplay ()
void textDestroyDisplay ( textdisplay textdisplay )
textitem textCreateTextItem ( [ string text, float x, float y, int priority, int r, int g, int b, int a, float scale ] )
void textDestroyTextItem ( textitem textitem )
void textDisplayAddText ( textdisplay textdisplay, textitem textitem )
void textDisplayAddObserver ( textdisplay textdisplay, player player )
void textItemSetText ( textitem textitem, string text )
string textItemGetText ( textitem textitem )
void] textItemSetScale ( textitem textitem, float scale )
float textItemGetScale ( textitem textitem )
void textItemSetPosition ( textitem textitem, float x, float y )
float float textItemGetPosition ( textitem textitem )
void textItemSetColor ( textitem textitem, int r, int g, int b, int a )
int int int int textItemGetColor ( textitem textitem )
void textItemSetPriority ( textitem textitem, int priority )
int textItemGetPriority ( textitem textitem )
Utility functions
float getDistanceBetweenPoints2D ( float x1, float y1, float x2, float y2 )
float getDistanceBetweenPoints3D ( float x1, float y1, float z1, float x2, float y2, float z2 )
int randInt ( int lowerbound, int upperbound )
int getTickCount ()
string gettok ( string text, int index, int separator )
bool setTimer ( string function, int time, [ var argument1, var argument2, ... ] )
Vehicle functions
vehicle createVehicle ( int id, float x, float y, float z, [ float rx, float ry, float rz ] )
int int int int getVehicleColor ( vehicle vehicle )
float getVehicleHealth ( vehicle vehicle )
int getVehicleID ( vehicle vehicle )
int getVehicleIDFromName ( string name )
int getVehicleIndex ( vehicle vehicle )
float float float getVehicleMoveSpeed ( string vehicle )
string getVehicleName ( string vehicle )
string getVehicleNameFromID ( int id )
player getVehicleOccupant ( vehicle vehicle, [ int seat=0 ] )
float float float getVehicleRotation ( vehicle vehicle )
float float float getVehicleTurnSpeed ( vehicle vehicle )
float float getVehicleTurretPosition ( vehicle vehicle )
int getVehicleMaxPassengers ( vehicle vehicle )
bool isVehicleLocked ( vehicle vehicle )
bool fixVehicle ( element vehicle )
bool blowVehicle ( element vehicle, [ bool explode=true ] )
bool setVehicleRotation ( element vehicle, float rx, float ry, float rz )
bool setVehicleMoveSpeed ( element vehicle, float x, float y, float z )
bool setVehicleTurnSpeed ( element vehicle, float rx, float ry, float rz )
bool setVehicleHealth ( element vehicle, float health )
bool setVehicleColor ( element vehicle, int color1, int color2, int color3, int color4 )
bool setVehicleLocked ( element vehicle, bool locked )
Weapon functions
string getWeaponNameFromID ( int id )
int getWeaponIDFromName ( string name )
bool giveWeapon ( element player, int weapon, [ int ammo=30 ] )
bool takeWeapon ( element player, int weapon )
bool takeAllWeapons ( element player )
World functions
int getWeather ()
bool setTime ( int hour, int min )
bool setWeather ( int id )
bool setWeatherBlended ( int id )
XML functions
xmlnode xmlFindSubNode ( xmlnode parent, string subnode, int index )
string xmlNodeGetValue ( xmlnode xmlnode )
bool xmlNodeSetValue ( xmlnode xmlnode, var value )
string xmlNodeGetAttribute ( xmlnode xmlnode, string name )
bool xmlNodeSetAttribute ( xmlnode xmlnode, string name, var value )
xmlnode xmlLoadFile ( string filename )
bool xmlUnloadFile ( xmlnode xmlnode )