Natives
This section contains documentation for SA-MP natives, as well as the additional UG-MP exclusive natives. We included SA-MP native documentation here because the SA-MP wiki is no longer online.
UG-MP natives
AddAnimatedClumpModel AddAtomicModel AddCdImage AddDataFile AddIDE AddIPL AddPedModel AddTimeModel AddVehicleModel ApplyMapOffsetToCoords ChangePlayerPedColor ChangeVehicleColorRGB ChangeVehiclePearlColor ChangeVehiclePearlColorRGB CreateExtraWeather DestroyExtraWeather EnableRadioAutoTune GetNumPedModels GetNumVehicleModels GetNumWeaponModels GetPlayerAircraftHeightLimit GetPlayerJetpackHeightLimit GetPlayerNetModelID GetPlayerPedColor GetRadioStationName GetRandomPedModel GetRandomVehicleModel GetRandomWeaponModel GetRandomWeaponType GetValidPedModelAt GetValidVehicleModelAt GetValidVehicleModelAtEx GetValidWeaponModelAt GetValidWeaponTypeAt GetVehicleComponentTypeEx GetVehicleRadioStation GetWeaponHighestParentType InitialiseDiscordRichPresence IsAClmpNetModelValidForPlayer IsAtmModelValidForPlayer IsPedModelValidForPlayer IsRadioAutoTuneEnabled IsRubbishVisibleForPlayer IsSASunPositionFormulaEnabled IsTimeModelValidForPlayer IsValidAnimationAndLibrary IsValidPedModel IsValidVehicleModel IsValidWeaponModel IsValidWeaponType IsVehicleModelValidForPlayer MT19937_Random OnAddModelCompleted OnLaserDotUpdate OnPlayerChangeRadio OnPlayerFinishedDownloading OnPlayerStartedDownloading OnVehicleResprayAtGarage RedirectDownloadsTo SetAircraftHeightLimitForPlayer SetCurrentSeason SetExtraWeatherParam_Flags SetExtraWeatherParam_Float SetExtraWeatherParam_Int SetExtraWeatherParam_RGB SetExtraWeatherParam_RGBA SetExtraWeatherParam_Windyness SetJetpackHeightLimitForPlayer SetPlayerFireProof SetPlayerHUDComponentsColour SetPlayerKnockedOffBikeState SetPlayerSeason SetVehicleRadioStation ShutdownDiscordRichPresence ToggleFluffyClouds ToggleLowClouds ToggleMoon TogglePlayerCCTV TogglePlayerDarknessFilter TogglePlayerFluffyClouds TogglePlayerFogOverlay TogglePlayerGrass TogglePlayerHUDComponents TogglePlayerInfiniteSprint TogglePlayerInfraRed TogglePlayerLowClouds TogglePlayerMoon TogglePlayerNightVision TogglePlayerRainbow TogglePlayerRubbish TogglePlayerStars TogglePlayerSun TogglePlayerVideoCameraOverlay ToggleRainbow ToggleSASunPositionFormula ToggleSASunPositionFormula_Pl ToggleStars ToggleVehicleColorRGB UpdateDiscordRichPresenceSA-MP natives
AddMenuItem AddPlayerClass AddPlayerClassEx AddStaticPickup AddStaticVehicle AddStaticVehicleEx AddVehicleComponent AllowAdminTeleport AllowInteriorWeapons AllowPlayerTeleport ApplyActorAnimation ApplyAnimation Attach3DTextLabelToPlayer Attach3DTextLabelToVehicle AttachCameraToObject AttachCameraToPlayerObject AttachObjectToObject AttachObjectToPlayer AttachObjectToVehicle AttachPlayerObjectToPlayer AttachPlayerObjectToVehicle AttachTrailerToVehicle Ban BanEx BlockIpAddress CallLocalFunction CallRemoteFunction CancelEdit CancelSelectTextDraw ChangeVehicleColor ChangeVehiclePaintjob ClearActorAnimations ClearAnimations ConnectNPC Create3DTextLabel CreateActor CreateExplosion CreateExplosionForPlayer CreateMenu CreateObject CreatePickup CreatePlayer3DTextLabel CreatePlayerObject CreatePlayerTextDraw CreateVehicle Delete3DTextLabel DeletePVar DeletePlayer3DTextLabel DeleteSVar DestroyActor DestroyMenu DestroyObject DestroyPickup DestroyPlayerObject DestroyVehicle DetachTrailerFromVehicle DisableInteriorEnterExits DisableMenu DisableMenuRow DisableNameTagLOS DisablePlayerCheckpoint DisablePlayerRaceCheckpoint DisableRemoteVehicleCollisions EditAttachedObject EditObject EditPlayerObject EnablePlayerCameraTarget EnableStuntBonusForAll EnableStuntBonusForPlayer EnableTirePopping EnableVehicleFriendlyFire EnableZoneNames ForceClassSelection GameModeExit GameTextForAll GameTextForPlayer GangZoneCreate GangZoneDestroy GangZoneFlashForAll GangZoneFlashForPlayer GangZoneHideForAll GangZoneHideForPlayer GangZoneShowForAll GangZoneShowForPlayer GangZoneStopFlashForAll GangZoneStopFlashForPlayer GetActorFacingAngle GetActorHealth GetActorPoolSize GetActorPos GetActorVirtualWorld GetAnimationName GetConsoleVarAsBool GetConsoleVarAsInt GetConsoleVarAsString GetGravity GetMaxPlayers GetNetworkStats GetObjectModel GetObjectPos GetObjectRot GetPVarFloat GetPVarInt GetPVarNameAtIndex GetPVarString GetPVarType GetPVarsUpperIndex GetPlayerAmmo GetPlayerAnimationIndex GetPlayerArmour GetPlayerCameraAspectRatio GetPlayerCameraFrontVector GetPlayerCameraMode GetPlayerCameraPos GetPlayerCameraTargetActor GetPlayerCameraTargetObject GetPlayerCameraTargetPlayer GetPlayerCameraTargetVehicle GetPlayerCameraZoom GetPlayerColor GetPlayerDistanceFromPoint GetPlayerDrunkLevel GetPlayerFacingAngle GetPlayerFightingStyle GetPlayerHealth GetPlayerInterior GetPlayerIp GetPlayerKeys GetPlayerLastShotVectors GetPlayerMenu GetPlayerMoney GetPlayerName GetPlayerNetworkStats GetPlayerObjectModel GetPlayerObjectPos GetPlayerObjectRot GetPlayerPing GetPlayerPoolSize GetPlayerPos GetPlayerScore GetPlayerSkin GetPlayerSpecialAction GetPlayerState GetPlayerSurfingObjectID GetPlayerSurfingVehicleID GetPlayerTargetActor GetPlayerTargetPlayer GetPlayerTeam GetPlayerTime GetPlayerVehicleID GetPlayerVehicleSeat GetPlayerVelocity GetPlayerVersion GetPlayerVirtualWorld GetPlayerWantedLevel GetPlayerWeapon GetPlayerWeaponData GetPlayerWeaponState GetSVarFloat GetSVarInt GetSVarNameAtIndex GetSVarString GetSVarType GetSVarsUpperIndex GetServerTickRate GetServerVarAsBool GetServerVarAsInt GetServerVarAsString GetTickCount GetVehicleComponentInSlot GetVehicleComponentType GetVehicleDamageStatus GetVehicleDistanceFromPoint GetVehicleHealth GetVehicleModel GetVehicleModelInfo GetVehicleParamsCarDoors GetVehicleParamsCarWindows GetVehicleParamsEx GetVehicleParamsSirenState GetVehiclePoolSize GetVehiclePos GetVehicleRotationQuat GetVehicleTrailer GetVehicleVelocity GetVehicleVirtualWorld GetVehicleZAngle GetWeaponName GivePlayerMoney GivePlayerWeapon HTTP HideMenuForPlayer InterpolateCameraLookAt InterpolateCameraPos IsActorInvulnerable IsActorStreamedIn IsObjectMoving IsPlayerAdmin IsPlayerAttachedObjectSlotUsed IsPlayerConnected IsPlayerInAnyVehicle IsPlayerInCheckpoint IsPlayerInRaceCheckpoint IsPlayerInRangeOfPoint IsPlayerInVehicle IsPlayerNPC IsPlayerObjectMoving IsPlayerStreamedIn IsTrailerAttachedToVehicle IsValidActor IsValidObject IsValidPlayerObject IsValidVehicle IsVehicleStreamedIn Kick KillTimer LimitGlobalChatRadius LimitPlayerMarkerRadius LinkVehicleToInterior ManualVehicleEngineAndLights MoveObject MovePlayerObject NPC:GetDistanceFromMeToPoint NPC:GetMyFacingAngle NPC:GetMyPos NPC:GetPlayerArmedWeapon NPC:GetPlayerHealth NPC:IsPlayerStreamedIn NPC:IsVehicleStreamedIn NPC:OnClientMessage NPC:OnNPCConnect NPC:OnNPCDisconnect NPC:OnNPCEnterVehicle NPC:OnNPCExitVehicle NPC:OnNPCModeExit NPC:OnNPCModeInit NPC:OnNPCSpawn NPC:OnPlayerDeath NPC:OnPlayerStreamIn NPC:OnPlayerStreamOut NPC:OnPlayerText NPC:OnRecordingPlaybackEnd NPC:OnVehicleStreamIn NPC:OnVehicleStreamOut NPC:PauseRecordingPlayback NPC:ResumeRecordingPlayback NPC:SendChat NPC:SendCommand NPC:SetMyFacingAngle NPC:SetMyPos NPC:StartRecordingPlayback NPC:StopRecordingPlayback NetStats_BytesReceived NetStats_BytesSent NetStats_ConnectionStatus NetStats_GetConnectedTime NetStats_GetIpPort NetStats_MessagesReceived NetStats_MessagesRecvPerSecond NetStats_MessagesSent NetStats_PacketLossPercent OnActorStreamIn OnActorStreamOut OnClientCheckResponse OnDialogResponse OnEnterExitModShop OnFilterScriptExit OnFilterScriptInit OnGameModeExit OnGameModeInit OnIncomingConnection OnObjectMoved OnPlayerClickMap OnPlayerClickPlayer OnPlayerClickPlayerTextDraw OnPlayerClickTextDraw OnPlayerCommandText OnPlayerConnect OnPlayerDeath OnPlayerDisconnect OnPlayerEditAttachedObject OnPlayerEditObject OnPlayerEnterCheckpoint OnPlayerEnterRaceCheckpoint OnPlayerEnterVehicle OnPlayerExitVehicle OnPlayerExitedMenu OnPlayerGiveDamage OnPlayerGiveDamageActor OnPlayerInteriorChange OnPlayerKeyStateChange OnPlayerLeaveCheckpoint OnPlayerLeaveRaceCheckpoint OnPlayerObjectMoved OnPlayerPickUpPickup OnPlayerRequestClass OnPlayerRequestSpawn OnPlayerSelectObject OnPlayerSelectedMenuRow OnPlayerSpawn OnPlayerStateChange OnPlayerStreamIn OnPlayerStreamOut OnPlayerTakeDamage OnPlayerText OnPlayerUpdate OnPlayerWeaponShot OnRconCommand OnRconLoginAttempt OnTrailerUpdate OnUnoccupiedVehicleUpdate OnVehicleDamageStatusUpdate OnVehicleDeath OnVehicleMod OnVehiclePaintjob OnVehicleRespray OnVehicleSirenStateChange OnVehicleSpawn OnVehicleStreamIn OnVehicleStreamOut PlayAudioStreamForPlayer PlayCrimeReportForPlayer PlayerPlaySound PlayerSpectatePlayer PlayerSpectateVehicle PlayerTextDrawAlignment PlayerTextDrawBackgroundColor PlayerTextDrawBoxColor PlayerTextDrawColor PlayerTextDrawDestroy PlayerTextDrawFont PlayerTextDrawHide PlayerTextDrawLetterSize PlayerTextDrawSetOutline PlayerTextDrawSetPreviewModel PlayerTextDrawSetPreviewRot PlayerTextDrawSetPreviewVehCol PlayerTextDrawSetProportional PlayerTextDrawSetSelectable PlayerTextDrawSetShadow PlayerTextDrawSetString PlayerTextDrawShow PlayerTextDrawTextSize PlayerTextDrawUseBox PutPlayerInVehicle RemoveBuildingForPlayer RemovePlayerAttachedObject RemovePlayerFromVehicle RemovePlayerMapIcon RemoveVehicleComponent RepairVehicle ResetPlayerMoney ResetPlayerWeapons SHA256_PassHash SelectObject SelectTextDraw SendClientMessage SendClientMessageToAll SendDeathMessage SendDeathMessageToPlayer SendPlayerMessageToAll SendPlayerMessageToPlayer SendRconCommand SetActorFacingAngle SetActorHealth SetActorInvulnerable SetActorPos SetActorVirtualWorld SetCameraBehindPlayer SetDeathDropAmount SetDisabledWeapons SetGameModeText SetGravity SetMenuColumnHeader SetNameTagDrawDistance SetObjectMaterial SetObjectMaterialText SetObjectNoCameraCol SetObjectPos SetObjectRot SetObjectsDefaultCameraCol SetPVarFloat SetPVarInt SetPVarString SetPlayerAmmo SetPlayerArmedWeapon SetPlayerArmour SetPlayerAttachedObject SetPlayerCameraLookAt SetPlayerCameraPos SetPlayerChatBubble SetPlayerCheckpoint SetPlayerColor SetPlayerDrunkLevel SetPlayerFacingAngle SetPlayerFightingStyle SetPlayerHealth SetPlayerInterior SetPlayerMapIcon SetPlayerMarkerForPlayer SetPlayerName SetPlayerObjectMaterial SetPlayerObjectMaterialText SetPlayerObjectNoCameraCol SetPlayerObjectPos SetPlayerObjectRot SetPlayerPos SetPlayerPosFindZ SetPlayerRaceCheckpoint SetPlayerScore SetPlayerShopName SetPlayerSkillLevel SetPlayerSkin SetPlayerSpecialAction SetPlayerTeam SetPlayerTime SetPlayerVelocity SetPlayerVirtualWorld SetPlayerWantedLevel SetPlayerWeather SetPlayerWorldBounds SetSVarFloat SetSVarInt SetSVarString SetSpawnInfo SetTeamCount SetTimer SetTimerEx SetVehicleAngularVelocity SetVehicleHealth SetVehicleNumberPlate SetVehicleParamsCarDoors SetVehicleParamsCarWindows SetVehicleParamsEx SetVehicleParamsForPlayer SetVehiclePos SetVehicleToRespawn SetVehicleVelocity SetVehicleVirtualWorld SetVehicleZAngle SetWeather SetWorldTime ShowMenuForPlayer ShowNameTags ShowPlayerDialog ShowPlayerMarkers ShowPlayerNameTagForPlayer SpawnPlayer StartRecordingPlayerData StopAudioStreamForPlayer StopObject StopPlayerObject StopRecordingPlayerData TextDrawAlignment TextDrawBackgroundColor TextDrawBoxColor TextDrawColor TextDrawCreate TextDrawDestroy TextDrawFont TextDrawHideForAll TextDrawHideForPlayer TextDrawLetterSize TextDrawSetOutline TextDrawSetPreviewModel TextDrawSetPreviewRot TextDrawSetPreviewVehCol TextDrawSetProportional TextDrawSetSelectable TextDrawSetShadow TextDrawSetString TextDrawShowForAll TextDrawShowForPlayer TextDrawTextSize TextDrawUseBox TogglePlayerClock TogglePlayerControllable TogglePlayerSpectating UnBlockIpAddress Update3DTextLabelText UpdatePlayer3DTextLabelText UpdateVehicleDamageStatus UsePlayerPedAnims VectorSize acos asin atan atan2 clamp db_close db_debug_openfiles db_debug_openresults db_field_name db_free_result db_get_field db_get_field_assoc db_get_field_assoc_float db_get_field_assoc_int db_get_field_float db_get_field_int db_get_mem_handle db_get_result_mem_handle db_next_row db_num_fields db_num_rows db_open db_query deleteproperty existproperty fblockread fblockwrite fclose fexist fgetchar flength float floatabs floatadd floatcmp floatcos floatdiv floatfract floatlog floatmul floatpower floatround floatsin floatsqroot floatstr floatsub floattan fopen format fputchar fread fremove fseek ftemp funcidx fwrite getarg getdate getproperty gettime gpci heapspace ispacked max memcpy numargs print printf random setarg setproperty settime settimer strcat strcmp strdel strfind strins strlen strmid strpack strunpack strval tickcount tolower toupper uudecode uuencode valstrOnPlayerStateChange
This callback is called when a player changes state. For example, when a player changes from being the driver of a vehicle to being on-foot.
Parameters
Name | Description |
---|---|
int playerid | The ID of the player that changed state. |
int newstate | The player's new state. |
int oldstate | The player's previous state. |
Return value
None
Warninig: This callback can also be called by NPC.