a_samp.inc
Description:
Include a_samp.inc contains functions that help the character interact with the car, menu, world, time, and so on..
This inclusion comes in the standard windows serer build |
List of functions:
- print: Prints a string to the server console and logs.
- printf: Outputs a formatted string on the console.
- format: Formats a string to include variables and other strings inside it.
- SendClientMessage: Sends a message to a specific player with a chosen color in the chat.
- SendClientMessageToAll: Displays a message in chat to all players.
- SendPlayerMessageToPlayer: Sends a message in the name of a player to another player on the server.
- SendPlayerMessageToAll: Sends a message in the name of a player to all other players on the server.
- SendDeathMessage: Adds a death to the 'killfeed' on the right-hand side of the screen for all players.
- SendDeathMessageToPlayer: Adds a death to the 'killfeed' on the right-hand side of the screen for a single player.
- GameTextForAll: Shows 'game text' (on-screen text) for a certain length of time for all players.
- GameTextForPlayer: Shows 'game text' (on-screen text) for a certain length of time for a specific player.
- SetTimer: Sets a 'timer' to call a function after some time.
- SetTimerEx: Sets a timer to call a function after the specified interval.
- KillTimer: Kills (stops) a running timer.
- GetTickCount: Returns the uptime of the actual server (not the SA-MP server) in milliseconds.
- GetMaxPlayers: Returns the maximum number of players that can join the server, as set by the server variable 'maxplayers' in server.cfg.
- CallRemoteFunction: Calls a public function in any script that is loaded.
- CallLocalFunction: Calls a public function from the script in which it is used.
- VectorSize: Returns the norm (length) of the provided vector.
- asin: Calculates arksinus from the specified value.
- acos: Calculates the arccosine from the specified value.
- atan: Calculates the arctangent of the specified valu
- atan2: Calculates the arctangent from the coordinates of a point.
- GetPlayerPoolSize: Gets the highest playerid currently in use on the server.
- GetVehiclePoolSize: Gets the highest vehicleid currently in use on the server.
- GetActorPoolSize: Gets the highest actorid created on the server.
- SHA256_PassHash: Hashes a password using the SHA-256 hashing algorithm.
- SetSVarInt: Set an integer server variable.
- GetSVarInt: Gets an integer server variable's value.
- SetSVarString: Set a string server variable.
- GetSVarString: Gets a string server variable's value.
- SetSVarFloat: Set a float server variable.
- GetSVarFloat: Gets a float server variable's value.
- DeleteSVar: Deletes a previously set server variable.
- GetSVarsUpperIndex: Each SVar (server-variable) has its own unique identification number for lookup, this function returns the highest ID.
- GetSVarNameAtIndex: Retrieve the name of a sVar via the index.
- GetSVarType: Gets the type (integer, float or string) of a server variable.
- SetGameModeText: Set the name of the game mode, which appears in the server browser.
- SetTeamCount: Change the amount of teams used in the gamemode.
- AddPlayerClass: Adds a class to class selection.
- AddPlayerClassEx: Adds a class to class selection of a team paramete.
- AddStaticVehicle: Adds a 'static' vehicle (models are pre-loaded for players) to the gamemode.
- AddStaticVehicleEx: Adds a 'static' vehicle (models are pre-loaded for players)to the gamemode. Allows a respawn time.
- AddStaticPickup: Adds a 'static' pickup to the game.
- CreatePickup: Creates pickup to the game.
- DestroyPickup: Destroys a pickup created with CreatePickup.
- ShowNameTags: Toggle the drawing of nametags, health bars and armor bars above players.
- ShowPlayerMarkers: Toggles player markers (blips on the radar).
- GameModeExit: Ends the current gamemode.
- SetWorldTime: Sets the world time (for all players) to a specific hour.
- GetWeaponName: Get the name of a weapon.
- EnableTirePopping: Enable or disable tire popping.
- EnableVehicleFriendlyFire: Enable friendly fire for team vehicles.
- AllowInteriorWeapons: Toggle whether the usage of weapons in interiors is allowed or not.
- SetWeather: Set the world weather for all players.
- SetGravity: Set the gravity for all players.
- AllowAdminTeleport: Determine whether RCON admins will be teleported to their waypoint when they set one.
- SetDeathDropAmount: Sets the amount of money that the player has.
- CreateExplosion: Create an explosion at the specified coordinates.
- EnableZoneNames: Gamemode option and should be set in the callback OnGameModeInit.
- UsePlayerPedAnims: Uses standard player walking animation.
- DisableInteriorEnterExits: Disable all the interior entrances and exits in the game (the yellow arrows at doors).
- SetNameTagDrawDistance: Set the maximum distance to display the names of players.
- DisableNameTagLOS: Disables the nametag Line-Of-Sight checking so that players can see nametags through objects.
- LimitGlobalChatRadius: Set a radius limitation for the chat.
- LimitPlayerMarkerRadius: Set the player marker radius.
- ConnectNPC: Connect an NPC to the server.
- IsPlayerNPC: Check if a player is an actual player or an NPC.
- IsPlayerAdmin: Check if a player is logged in as an RCON admin.
- Kick: Kick a player from the server.
- Ban: Bbaned a player who is currently in the server.
- BanEx: Ban a player with a reason.
- SendRconCommand: Sends an RCON (Remote Console) command.
- GetPlayerNetworkStats: Gets a player's network stats and saves them into a string.
- GetNetworkStats: Gets the server's network stats and stores them in a string.
- GetPlayerVersion: Returns the SA-MP client version, as reported by the player.
- BlockIpAddress: Blocks an IP address from further communication with the server for a set amount of time.
- UnBlockIpAddress: Unblock an IP address that was previously blocked using BlockIpAddress.
- GetServerVarAsString: Get the string value of a server variable.
- GetServerVarAsInt: Get the integer value of a server variable.
- GetServerVarAsBool: Get the boolean value of a server variable.
- GetConsoleVarAsString: Get the string value of a console variable.
- GetConsoleVarAsInt: Get the integer value of a console variable.
- GetConsoleVarAsBool: Get the boolean value of a console variable.
- GetServerTickRate: Gets the tick rate (like FPS) of the server.
- NetStats_GetConnectedTime: Gets the amount of time (in milliseconds) that a player has been connected to the server for.
- NetStats_MessagesReceived: Gets the number of messages the server has received from the player.
- NetStats_BytesReceived: Gets the amount of data (in bytes) that the server has received from the player.
- NetStats_MessagesSent: Gets the number of messages the server has sent to the player.
- NetStats_BytesSent: Gets the amount of data (in bytes) that the server has sent to the player.
- NetStats_MessagesRecvPerSecond: Gets the number of messages the player has received in the last second.
- NetStats_PacketLossPercent: Gets the packet loss percentage of a player.
- NetStats_ConnectionStatus: Gets the player's current connection status.
- NetStats_GetIpPort: Get a player's IP and port.
- CreateMenu: Creates a menu.
- DestroyMenu: Destroys the specified menu.
- AddMenuItem: Adds an item to a specified menu.
- SetMenuColumnHeader: Sets the caption of a column in a menu.
- ShowMenuForPlayer: Shows a previously created menu for a player.
- HideMenuForPlayer: Hides a menu for a player.
- IsValidMenu:
- DisableMenu: Disable input for a menu. Any item will lose the ability to be selected.
- DisableMenuRow: Disable a specific row in a menu for all players.
- GetPlayerMenu: Gets the ID of the menu the player is currently viewing (shown by ShowMenuForPlayer).
- TextDrawCreate: Creates a textdraw.
- TextDrawDestroy: Destroys a previously-created textdraw.
- TextDrawLetterSize: Sets the width and height of the letters.
- TextDrawTextSize: Change the size of a textdraw.
- TextDrawAlignment: Set the alignment of text in a text draw.
- TextDrawColor: Sets the text color of a textdraw.
- TextDrawUseBox: Toggle whether a textdraw uses a box or not.
- TextDrawBoxColor: Adjusts the text box colour.
- TextDrawSetShadow: Sets the size of a textdraw's text's shadow.
- TextDrawSetOutline: Sets the thickness of a textdraw's text's outline.
- TextDrawBackgroundColor: Adjusts the text draw area background color.
- TextDrawFont: Changes the text font.
- TextDrawSetProportional: Appears to scale text spacing to a proportional ratio.
- TextDrawSetSelectable: Sets whether a textdraw can be selected (clicked on) or not.
- TextDrawShowForPlayer: Shows a textdraw for a specific player.
- TextDrawHideForPlayer: Hides a textdraw for a specific player.
- TextDrawShowForAll: Shows a textdraw for all players.
- TextDrawHideForAll: Hides a text draw for all players.
- TextDrawSetString: Changes the text on a textdraw.
- TextDrawSetPreviewModel: Set the model for a textdraw model preview.
- TextDrawSetPreviewRot: Sets the rotation and zoom of a 3D model preview textdraw.
- TextDrawSetPreviewVehCol: Used if a vehicle model is used in a 3D preview textdraw, this sets the two colour values for that vehicle.
- GangZoneCreate: Create a gangzone (colored radar area).
- GangZoneDestroy: Destroy a gangzone.
- GangZoneShowForPlayer: Show a gangzone for a player.
- GangZoneShowForAll: Shows a gangzone with the desired color to all players.
- GangZoneHideForPlayer: Hides a gangzone for a player.
- GangZoneHideForAll: Hides a gangzone from all players.
- GangZoneFlashForPlayer: Makes a gangzone flash for a player.
- GangZoneFlashForAll: Flashes a gangzone for all players.
- GangZoneStopFlashForPlayer: Stops a gangzone flashing for a player.
- GangZoneStopFlashForAll: Stops a gangzone flashing for all players.
- Create3DTextLabel: Creates a 3D Text Label at a specific location in the world.
- Delete3DTextLabel: Delete a 3D text label (created with Create3DTextLabel).
- Attach3DTextLabelToPlayer: Attach a 3D text label to a player.
- Attach3DTextLabelToVehicle: Attaches a 3D Text Label to a specific vehicle.
- Update3DTextLabelText: Updates a 3D Text Label text and color.
- CreatePlayer3DTextLabel: Creates a 3D Text Label only for a specific player.
- DeletePlayer3DTextLabel: Destroy a 3D text label that was created using CreatePlayer3DTextLabel.
- UpdatePlayer3DTextLabelText: Updates a player 3D Text Label's text and color.
- ShowPlayerDialog: Shows the player a synchronous (only one at a time) dialog box.
List of callbacks:
- OnGameModeInit: Called when the gamemode starts.
- OnGameModeExit: Called when a gamemode ends, either through 'gmx', the server being shut down, or GameModeExit.
- OnFilterScriptInit: Called when a filterscript is initialized (loaded)
- OnFilterScriptExit: Called when a filterscript is unloaded.
- OnPlayerConnect: Called when a player connects to the server.
- OnPlayerDisconnect: Called when a player disconnects from the server.
- OnPlayerSpawn: Called when a player spawns.
- OnPlayerDeath: Called when a player dies, either by suicide or by being killed by another player.
- OnVehicleSpawn: Called when a vehicle respawns.
- OnVehicleDeath: Called when a vehicle is destroyed - either by exploding or becoming submerged in water.
- OnPlayerText: Called when a player sends a chat message.
- OnPlayerCommandText: Called when a player enters a command into the client chat window.
- OnPlayerRequestClass: Called when a player changes class at class selection.
- OnPlayerEnterVehicle: Called when a player starts to enter a vehicle.
- OnPlayerExitVehicle: Called when a player starts to exit a vehicle.
- OnPlayerStateChange: Called when a player changes state.
- OnPlayerEnterCheckpoint: Called when a player enters the checkpoint set for that player.
- OnPlayerLeaveCheckpoint: Called when a player leaves the checkpoint set for them by SetPlayerCheckpoint.
- OnPlayerEnterRaceCheckpoint: Called when a player enters a race checkpoint.
- OnPlayerLeaveRaceCheckpoint: Called when a player leaves the race checkpoint.
- OnRconCommand: Called when a command is sent through the server console, remote RCON, or via the in-game "/rcon command".
- OnPlayerRequestSpawn: Called when a player attempts to spawn via class selection either by pressing SHIFT or clicking the 'Spawn' button.
- OnObjectMoved: Called when an object is moved after MoveObject (when it stops moving).
- OnPlayerObjectMoved: Called when a player object is moved after MovePlayerObject.
- OnPlayerPickUpPickup: Called when a player picks up a pickup created with CreatePickup.
- OnVehicleMod: Called when a vehicle is modded.
- OnEnterExitModShop: Called when a player enters or exits a mod shop.
- OnVehiclePaintjob: Called when a player previews a vehicle paintjob inside a mod shop.
- OnVehicleRespray: Called when a player exits a mod shop, even if the colors weren't changed.
- OnVehicleDamageStatusUpdate: Called when a vehicle element such as doors, tires, panels, or lights change their damage status.
- OnUnoccupiedVehicleUpdate: Ccalled when a player's client updates/syncs the position of a vehicle they're not driving.
- OnPlayerSelectedMenuRow: Called when a player selects an item from a menu.
- OnPlayerExitedMenu: Called when a player exits a menu.
- OnPlayerInteriorChange: Called when a player changes interior
- OnPlayerKeyStateChange: Called when the state of any supported key is changed (pressed/released).
- OnRconLoginAttempt: Called when someone attempts to log in to RCON in-game; successful or not.
- OnPlayerUpdate: Called every time a client/player updates the server with their status.
- OnPlayerStreamIn: Called when a player is streamed by some other player's client.
- OnPlayerStreamOut: Called when a player is streamed out from some other player's client.
- OnVehicleStreamIn: Called when a vehicle is streamed to a player's client.
- OnVehicleStreamOut: Called when a vehicle is streamed out for a player's client.
- OnActorStreamIn: Called when an actor is streamed in by a player's client.
- OnActorStreamOut: Called when an actor is streamed out by a player's client.
- OnDialogResponse: Called when a player responds to a dialog shown using ShowPlayerDialog.
- OnPlayerTakeDamage: Called when a player takes damage.
- OnPlayerGiveDamage: Called when a player gives damage to another player.
- OnPlayerGiveDamageActor: Called when a player gives damage to an actor.
- OnPlayerClickMap: Called when a player places a target/waypoint on the pause menu map (by right-clicking).
- OnPlayerClickTextDraw: Called when a player clicks on a textdraw or cancels the select mode with the Escape key.
- OnPlayerClickPlayerTextDraw: Called when a player clicks on a player-textdraw.
- OnIncomingConnection: Called when an IP address attempts a connection to the server.
- OnTrailerUpdate: Called when a player sent a trailer update.
- OnVehicleSirenStateChange: Called when a vehicle's siren is toggled.
- OnPlayerClickPlayer: Called when a player double-clicks on a player on the scoreboard.
- OnPlayerEditObject: Called when a player finishes editing an object.
- OnPlayerEditAttachedObject: Called when a player ends attached object edition mode.
- OnPlayerSelectObject: Called when a player selects an object after SelectObject has been used.
- OnPlayerWeaponShot: Called when a player fires a shot from a weapon.