a_npc.inc
Description:
Include a_npc.inc allows you to create, manage and interact with non-player characters (NPC).
This inclusion comes in the standard windows serer build |
List of functions:
- SendChat: Sends text to the player using an NPC, just like using SendPlayerMessageToAll, but this function must be used inside NPC scripts.
- SendCommand: Force the NPC to write a desired command, and this way, getting the effects it would produce.
- GetPlayerState: Get a player's current state.
- GetPlayerPos: Get the position of a player, represented by X, Y and Z coordinates.
- GetPlayerVehicleID: Gets the ID of the vehicle the player is currently in.
- GetPlayerArmedWeapon: Returns the ID of the weapon a NPC is currently holding.
- GetPlayerHealth: Allows you to retrieve the health of a player. Useful for cheat detection, among other things.
- GetPlayerArmour: Stores the armour of a player into a variable.
- GetPlayerSpecialAction: Retrieves a player's current special action.
- IsPlayerStreamedIn: Checks if a player is streamed in for an NPC. Only nearby players are streamed in.
- IsVehicleStreamedIn: Checks if a vehicle is streamed in for an NPC. Only nearby vehicles are streamed in.
- GetPlayerKeys: Check which keys a player is pressing.
- GetPlayerFacingAngle: Gets the angle a player is facing.
- GetMyPos: Get the current location of the NPC.
- SetMyPos: Set the position of the NPC.
- GetMyFacingAngle: Get the current facing angle of the NPC.
- SetMyFacingAngle: Set the NPC's facing angle.
- GetDistanceFromMeToPoint: Get the distance between the NPC and a point.
- IsPlayerInRangeOfPoint: Checks if a player is in range of a point. This native function is faster than the PAWN implementation using distance formula.
- GetPlayerName: Get a player's name.
- IsPlayerConnected: Checks if a player is connected (if an ID is taken by a connected player).
- StartRecordingPlayback: Run a .rec file which has to be saved in the npcmodes/recordings folder.
- StopRecordingPlayback: Stop the current .rec file which is being ran by the NPC, making it stay idle until some other order is given.
- PauseRecordingPlayback: Pause playing back the recording.
- ResumeRecordingPlayback: Resume the paused recording.
List of callbacks:
- OnNPCModeInit: Called when a NPC script is loaded.
- OnNPCModeExit: Called when a NPC-script unloaded.
- OnNPCConnect: Called when the NPC successfully connects to the server.
- OnNPCDisconnect: Called when the NPC gets disconnected from the server.
- OnNPCSpawn: Called when a NPC spawned.
- OnNPCEnterVehicle: Called when a NPC enters a vehicle.
- OnNPCExitVehicle: Called when a NPC leaves a vehicle.
- OnClientMessage: Called when the NPC sees the ClientMessage.
- OnPlayerDeath: Called when any player dies.
- OnPlayerText: Called every time someone says something in the chat
- OnPlayerStreamIn: Called when a player is streamed in for an NPC.
- OnPlayerStreamOut: Called when a player is streamed out the NPC.
- OnVehicleStreamIn: Called when a vehicle is streamed by the NPC.
- OnVehicleStreamOut: alled when a vehicle is streamed out for an NPC.
- OnRecordingPlaybackEnd: Called when a recorded file being reproduced with NPC:StartRecordingPlayback has reached to its end.