Category:Scripting Functions
From SA-MP Wiki
Main Page | Scripting Functions | Scripting Callbacks | Scripting Basics | Server Plugins | Tutorials
This page contains an overview of the hundreds of functions available in San Andreas: Multiplayer. All functions have received their own page with extended information about the function, the required parameters, possible usage and other functions you might want to look at.
Functions get added with every new release of San Andreas: Multiplayer. The Server Plugins can also add a lot of extra functions to the multiplayer mod, click on the link for more information about the server plugins. There currently are 438 native functions available.
Scroll down for a full list of functions ordered alphabetically.
Categories
Contents |
Vehicles
- AddStaticVehicle - Add a static vehicle
- AddStaticVehicleEx - Add a static vehicle with a re-spawn delay
- AddVehicleComponent - Add a component (tuning part) to a vehicle
- AttachTrailerToVehicle - Attach a trailer to a vehicle
- ChangeVehicleColor - Change the color(s) of a vehicle
- ChangeVehiclePaintjob - Change the paintjob of a vehicle
- CreateVehicle - Create a vehicle
- DestroyVehicle - Destroy a vehicle
- DetachTrailerFromVehicle - Detach a trailer from a vehicle
- GetPlayerSurfingVehicleID - Get the ID of the vehicle a player is surfing
- GetPlayerVehicleID - Get the ID of the vehicle that a player is in
- GetVehicleComponentInSlot - Get a vehicle's component (tuning part) in a certain slot
- GetVehicleComponentType - Find out the type of component a component is
- GetVehicleDamageStatus - Get a vehicle's damage status (visual damage)
- GetVehicleHealth - Get a vehicle's health (engine)
- GetVehicleModel - Get the model of a vehicle
- GetVehiclePos - Get the position of a vehicle
- GetVehicleTrailer - Get the ID of a vehicle's trailer
- GetVehicleVelocity - Get a vehicle's velocity
- GetVehicleVirtualWorld - Get a vehicle's virtual world
- GetVehicleZAngle - Get the rotation of a vehicle
- GetVehicleRotation - Get the rotation of a vehicle on the XYZ axis
- GetVehicleRotationQuat - Get the quaternion rotation of a vehicle
- IsPlayerInAnyVehicle - Check if a player is in any vehicle
- IsPlayerInVehicle - Check if a player is in a certain vehicle
- IsTrailerAttachedToVehicle - Check if a vehicle has a trailer attached
- IsVehicleStreamedIn - Check if a vehicle is streamed in for a certain player
- LinkVehicleToInterior - Link a vehicle into an interior
- PlayerSpectateVehicle - Make a player spectate a vehicle
- PutPlayerInVehicle - Put a player in a vehicle
- RemovePlayerFromVehicle - Remove a player from their vehicle
- RemoveVehicleComponent - Remove a component from a vehicle
- RepairVehicle - Repair a vehicle (visual damage + engine)
- SetVehicleHealth - Set a vehicle's health (engine)
- SetVehicleParamsForPlayer - Set the parameters of a vehicle for a player (locked, objective)
- SetVehiclePos - Set a vehicle's position
- SetVehicleToRespawn - Respawn a vehicle
- SetVehicleVelocity - Set a vehicle's velocity
- SetVehicleVirtualWorld - Set a vehicle's virtual world
- SetVehicleZAngle - Set a vehicle's rotation
- UpdateVehicleDamageStatus - Update the damage status of a vehicle (visual damage)
Objects
Global Objects
- AttachCameraToObject - Attach a playercamera to an object
- AttachObjectToObject - Attach an object to another object
- AttachObjectToPlayer - Attach an object to a player
- AttachObjectToVehicle - Attach an object to a vehicle
- CreateObject - Create an object
- DestroyObject - Destroy an object
- EditObject - Allows a player to edit an object (position and rotation) using their mouse on a GUI
- GetObjectPos - Get an object's position
- GetObjectRot - Get an object's rotation
- IsValidObject - Check if an object exists
- MoveObject - Move an object
- SelectObject - Display the cursor and allow the player to select an object
- SetObjectMaterial - Replace the texture of an object with the texture from another model in the game
- SetObjectMaterialText - Replace the texture of an object with text
- SetObjectPos - Set an object's position
- SetObjectRot - Set an object's rotation
- StopObject - Stop an object (moving)
Player Objects
- CreatePlayerObject - Create an player-object
- DestroyPlayerObject - Destroy an object
- GetPlayerObjectPos - Get an object's position
- GetPlayerObjectRot - Get an object's rotation
- IsValidPlayerObject - Check if an object exists
- MovePlayerObject - Move an object
- SetPlayerObjectPos - Set an object's position
- SetPlayerObjectRot - Set an object's rotation
- StopPlayerObject - Stop an object (moving)
Textdraws
Global Textdraws
- TextDrawAlignment - Set a textdraw's alignment
- TextDrawBackgroundColor - Set the background color of a textdraw
- TextDrawBoxColor - Set the color of a textdraw's box
- TextDrawColor - Set the color of a textdraw
- TextDrawCreate - Create a textdraw
- TextDrawDestroy - Destroy a textdraw
- TextDrawFont - Set a textdraw's font
- TextDrawHideForAll - Hide a textdraw for all players
- TextDrawHideForPlayer - Hide a textdraw for a specific player
- TextDrawLetterSize - Set the size of a textdraw's text
- TextDrawSetOutline - Set the outline thickness of a textdraw
- TextDrawSetProportional - Set a textdraw's text proportion
- TextDrawSetShadow - Toggle a shadow behind a textdraw's text
- TextDrawSetString - Set the text in a textdraw
- TextDrawShowForAll - Show a textdraw for all players
- TextDrawShowForPlayer - Show a textdraw for a certain player
- TextDrawTextSize - Set the size of a textdraw
- TextDrawUseBox - Toggle whether a textdraw should have a box or not
- TextDrawSetSelectable: Sets whether a textdraw is selectable through SelectTextDraw
- TextDrawSetPreviewModel: Set the 3D preview model of a textdraw.
- TextDrawSetPreviewRot: Set rotation of a 3D textdraw preview.
- TextDrawSetPreviewVehCol: Set the colours of a vehicle in a 3D textdraw preview.
Player Textdraws
- CreatePlayerTextDraw: Create a player-textdraw.
- PlayerTextDrawAlignment: Set the alignment of a player-textdraw.
- PlayerTextDrawBackgroundColor: Set the background color of a player-textdraw.
- PlayerTextDrawBoxColor: Set the color of a player-textdraw's box.
- PlayerTextDrawColor: Set the color of the text in a player-textdraw.
- PlayerTextDrawDestroy: Destroy a player-textdraw.
- PlayerTextDrawFont: Set the font of a player-textdraw.
- PlayerTextDrawHide: Hide a player-textdraw.
- PlayerTextDrawLetterSize: Set the letter size of the text in a player-textdraw.
- PlayerTextDrawSetOutline: Toggle the outline on a player-textdraw.
- PlayerTextDrawSetProportional: Scale the text spacing in a player-textdraw to a proportional ratio.
- PlayerTextDrawSetShadow: Set the shadow on a player-textdraw.
- PlayerTextDrawSetString: Set the text of a player-textdraw.
- PlayerTextDrawShow: Show a player-textdraw.
- PlayerTextDrawTextSize: Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable).
- PlayerTextDrawUseBox: Toggle the box on a player-textdraw.
- PlayerTextDrawSetSelectable: Sets whether a player-textdraw is selectable through SelectTextDraw
- PlayerTextDrawSetPreviewModel: Set model ID of a 3D player textdraw preview.
- PlayerTextDrawSetPreviewRot: Set rotation of a 3D player textdraw preview.
- PlayerTextDrawSetPreviewVehCol: Set the colours of a vehicle in a 3D player textdraw preview.
Selection
- SelectTextDraw: Enables the mouse, so the player can select a textdraw
- CancelSelectTextDraw: Cancel textdraw selection with the mouse
Gangzones
- GangZoneCreate - Create a gangzone
- GangZoneDestroy - Destroy a gangzone
- GangZoneFlashForAll - Make a gangzone flash for all players
- GangZoneFlashForPlayer - Make a gangzone flash for a certain player
- GangZoneHideForAll - Hide a gangzone for all players
- GangZoneHideForPlayer - Hide a gangzone for a specific player
- GangZoneShowForAll - Show a gangzone for all players
- GangZoneShowForPlayer - Show a gangzone for a player
- GangZoneStopFlashForAll - Stop a gangzone flashing for all players
- GangZoneStopFlashForPlayer - Stop a gangzone flashing for a specific player
3D Text Labels
- Attach3DTextLabelToPlayer - Attach a 3D text label to a player
- Attach3DTextLabelToVehicle - Attach a 3D text label to a vehicle
- Create3DTextLabel - Create a 3D text label
- CreatePlayer3DTextLabel - Create a 3D text label for one player
- Delete3DTextLabel - Delete a 3D text label
- DeletePlayer3DTextLabel - Delete a player's 3D text label
- Update3DTextLabelText - Update the text and color of a 3D label
- UpdatePlayer3DTextLabelText - Update the text and color of a player's 3D label
Checkpoints
Normal Checkpoints
- DisablePlayerCheckpoint - Disable a player's checkpoint
- IsPlayerInCheckpoint - Check if a player is in a checkpoint
- SetPlayerCheckpoint - Set a player's checkpoint
Race Checkpoints
- DisablePlayerRaceCheckpoint - Disable a player's race checkpoint
- IsPlayerInRaceCheckpoint - Check if a player is in a race checkpoint
- SetPlayerRaceCheckpoint - Set a player's race checkpoint
Player Variables (pVars)
- DeletePVar - Delete a player variable
- GetPVarFloat - Get a player variable as a float
- GetPVarInt - Get a player variable as an integer
- GetPVarString - Get a player variable as a string
- SetPVarFloat - Set a player variable to a float
- SetPVarInt - Set a player variable to an integer
- SetPVarString - Set a player variable to a string
Spectating
- PlayerSpectatePlayer - Make a player spectate another player
- PlayerSpectateVehicle - Make a player spectate a vehicle
- AttachCameraToPlayerObject - Make a player spectate a object
- TogglePlayerSpectating - Toggle whether a player is spectating or not
Administration
- Ban - Ban a player so they can't connect to the server
- BanEx - Ban a player with a custom reason
- IsPlayerAdmin - Check whether a player is logged into RCON or not
- Kick - Kick a player from the server
- SendRconCommand - Send an RCON command via the script
NPCs
npcmodes
- NPC:StartRecordingPlayback
- NPC:StopRecordingPlayback
- NPC:PauseRecordingPlayback
- NPC:ResumeRecordingPlayback
- NPC:SendChat
- NPC:SendCommand
- NPC:GetMyPos
- NPC:SetMyPos
- NPC:GetMyFacingAngle
- NPC:SetMyFacingAngle
- NPC:GetDistanceFromMeToPoint
- NPC:IsVehicleStreamedIn
- NPC:IsPlayerStreamedIn
Scripts
- ConnectNPC: Connect an NPC.
- IsPlayerNPC: Check if a player is an NPC or an actual player.
Plugins
(previous 200) (next 200)