Server Scripting Functions: Difference between revisions
No edit summary |
|||
Line 20: | Line 20: | ||
int [[getPlayerID]] ( player ) | int [[getPlayerID]] ( player ) | ||
float float float [[getPlayerMoveSpeed]] ( player ) | |||
float [[getPlayerMoveSpeedX]] ( player ) | float [[getPlayerMoveSpeedX]] ( player ) | ||
Line 34: | Line 36: | ||
int [[getPlayerPing]] ( player ) | int [[getPlayerPing]] ( player ) | ||
float float float [[getPlayerPosition]] ( player ) | |||
float [[getPlayerPositionX]] ( player ) | float [[getPlayerPositionX]] ( player ) | ||
Line 44: | Line 48: | ||
string [[getPlayerSourceIP]] ( player ) | string [[getPlayerSourceIP]] ( player ) | ||
float float float [[getPlayerTurnSpeed]] ( player ) | |||
float [[getPlayerTurnSpeedX]] ( player ) | float [[getPlayerTurnSpeedX]] ( player ) | ||
Line 86: | Line 92: | ||
int [[getVehicleIndex]] ( vehicle ) | int [[getVehicleIndex]] ( vehicle ) | ||
float float float [[getVehicleMoveSpeed]] ( vehicle ) | |||
float [[getVehicleMoveSpeedX]] ( vehicle ) | float [[getVehicleMoveSpeedX]] ( vehicle ) | ||
Line 94: | Line 102: | ||
player [[getVehicleOccupant]] ( vehicle ) | player [[getVehicleOccupant]] ( vehicle ) | ||
float float float [[getVehiclePosition]] ( vehicle ) | |||
float [[getVehiclePositionX]] ( vehicle ) | float [[getVehiclePositionX]] ( vehicle ) | ||
Line 100: | Line 110: | ||
float [[getVehiclePositionZ]] ( vehicle ) | float [[getVehiclePositionZ]] ( vehicle ) | ||
float float float [[getVehicleRotation]] ( vehicle ) | |||
float [[getVehicleRotationX]] ( vehicle ) | float [[getVehicleRotationX]] ( vehicle ) | ||
Line 106: | Line 118: | ||
float [[getVehicleRotationZ]] ( vehicle ) | float [[getVehicleRotationZ]] ( vehicle ) | ||
float float float [[getVehicleTurnSpeed]] ( vehicle ) | |||
float [[getVehicleTurnSpeedX]] ( vehicle ) | float [[getVehicleTurnSpeedX]] ( vehicle ) | ||
Line 112: | Line 126: | ||
float [[getVehicleTurnSpeedZ]] ( vehicle ) | float [[getVehicleTurnSpeedZ]] ( vehicle ) | ||
float float [[getVehicleTurretPosition]] ( vehicle ) | |||
float [[getVehicleTurretPositionX]] ( vehicle ) | float [[getVehicleTurretPositionX]] ( vehicle ) | ||
Line 168: | Line 184: | ||
int [[getObjectModel]] ( object ) | int [[getObjectModel]] ( object ) | ||
float float float [[getObjectPosition]] ( object ) | |||
float [[getObjectPositionX]] ( object ) | float [[getObjectPositionX]] ( object ) | ||
Line 174: | Line 192: | ||
float [[getObjectPositionZ]] ( object ) | float [[getObjectPositionZ]] ( object ) | ||
float float float [[getObjectRotation]] ( object ) | |||
float [[getObjectRotationX]] ( object ) | float [[getObjectRotationX]] ( object ) |
Revision as of 23:22, 25 March 2006
This article needs checking. | |
Reason(s): There is an inconsistency in the functions listed here. findPlayer and getPlayerFromID have similar uses. Perhaps FindPlayer should just take a name, instead of either Name or ID. |
This page lists all the scripting functions that exist already. To request a function or event, use Requested Functions and Events.
Player functions
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 float float getPlayerMoveSpeed ( player )
float getPlayerMoveSpeedX ( player )
float getPlayerMoveSpeedY ( player )
float getPlayerMoveSpeedZ ( player )
string getPlayerName ( player )
vehicle getPlayerOccupiedVehicle ( player )
int getPlayerOccupiedVehicleSeat ( player )
int getPlayerPing ( player )
float float float getPlayerPosition ( player )
float getPlayerPositionX ( player )
float getPlayerPositionY ( player )
float getPlayerPositionZ ( player )
float getPlayerRotation ( player )
string getPlayerSourceIP ( player )
float float float getPlayerTurnSpeed ( 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 float float getVehicleMoveSpeed ( vehicle )
float getVehicleMoveSpeedX ( vehicle )
float getVehicleMoveSpeedY ( vehicle )
float getVehicleMoveSpeedZ ( vehicle )
player getVehicleOccupant ( vehicle )
float float float getVehiclePosition ( vehicle )
float getVehiclePositionX ( vehicle )
float getVehiclePositionY ( vehicle )
float getVehiclePositionZ ( vehicle )
float float float getVehicleRotation ( vehicle )
float getVehicleRotationX ( vehicle )
float getVehicleRotationY ( vehicle )
float getVehicleRotationZ ( vehicle )
float float float getVehicleTurnSpeed ( vehicle )
float getVehicleTurnSpeedX ( vehicle )
float getVehicleTurnSpeedY ( vehicle )
float getVehicleTurnSpeedZ ( vehicle )
float float getVehicleTurretPosition ( 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 )
Marker functions
marker createMarker ( id, x, y, z, r, g, b )
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 )
Object functions
object createObject ( model, x, y, z, [rx, ry, rz] )
bool destroyObject ( object )
string getObjectName ( object )
int getObjectModel ( object )
float float float getObjectPosition ( object )
float getObjectPositionX ( object )
float getObjectPositionY ( object )
float getObjectPositionZ ( object )
float float float getObjectRotation ( 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 )
bool moveObject ( object, time, x, y, z, rx, ry, rz )
Radar area functions
radararea createRadarArea ( x, y, sizex, sizey, r, g, b, a )
bool destroyRadarArea ( radararea )
float float getRadarAreaPosition ( radararea )
float getRadarAreaPositionX ( radararea )
float getRadarAreaPositionY ( radararea )
float float getRadarAreaSize ( radararea )
float getRadarAreaSizeX ( radararea )
float getRadarAreaSizeY ( radararea )
int int int int getRadarAreaColor ( radararea )
int getRadarAreaColorRed ( radararea )
int getRadarAreaColorGreen ( radararea )
int getRadarAreaColorBlue ( radararea )
int getRadarAreaColorAlpha ( radararea )
bool setRadarAreaPosition ( radararea, x, y )
bool setRadarAreaSize ( radararea, x, y )
bool setRadarAreaColor ( radararea, r, g, b, a )
Server functions
int getMaxPlayers ()
bool serverLoggerPrint ( string, [...] )
bool serverChat ( string, [...] )
bool playerPM ( player, string, [...] )
bool showTextForAll ( duration, r, g, b, size, string, [...] )
bool showTextForPlayer ( player, duration, r, g, b, size, string, [...] )
Utility functions
float getDistanceBetweenPoints2D ( x1, y1, x2, y2 )
float getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 )
int randInt ( lowerbound, upperbound )
float randFloat ()
int getTickCount ()
string gettok ( string, index, seperatingchar )
bool setTimer ( function, time, [arg1, arg2, ...] )
Map functions
string getLoadedMapName ()
xmlnode getLoadedMapXMLRoot ()
XML functions
xmlnode xmlFindSubNode ( parent, subnode, index )
string xmlNodeGetValue ( xmlNode )
bool xmlNodeSetValue ( xmlNode, value )
string xmlNodeGetAttribute ( xmlNode, attribute name )
bool xmlNodeSetAttribute ( xmlNode, attribute name, value )
xmlnode xmlLoadFile ( filename )
bool xmlUnloadFile ( xmlnode )
Text Functions
textdisplay textCreateDisplay ()
void textDestroyDisplay ( textdisplay )
textitem textCreateTextItem ( [text, x, y, priority, red, green, blue, alpha, scale] )
void textDestroyTextItem ( textitem )
void textDisplayAddText ( textdisplay, textitem )
void textDisplayAddObserver ( textdisplay, player )
void textItemSetText ( textitem, text )
string textItemGetText ( textitem )
void textItemSetScale ( textitem, scale )
float textItemGetScale ( textitem )
void textItemSetPosition ( textitem, x, y )
float, float textItemGetPosition ( textitem )
void textItemSetColor ( textitem, red, green, blue, alpha )
int, int, int, int textItemGetColor ( textitem )
void textItemSetPriority ( textitem, priority )
int textItemGetPriority ( textitem )