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 UpdateDiscordRichPresence
SA-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 valstr

AddIPL

Adds an item placement (IPL) file which will be loaded by players once they join.
Parameters
Name Description
string filename The path to the IPL file, relative to the assets folder.
float fOffsetX The offset X coordinate to apply to all entries in the file. Very useful if you want to load in maps and place them outside of San Andreas.
float fOffsetY The offset Y coordinate to apply to all entries in the file. Very useful if you want to load in maps and place them outside of San Andreas.
float fOffsetZ The offset Z coordinate to apply to all entries in the file. Very useful if you want to load in maps and place them outside of San Andreas.
Return value

None

Related functions

The following functions and/or callbacks might be useful, as they're related to this one in one way or another.

  • AddCdImage: Adds a cdimage (IMG file) which will be loaded by players once they join.
  • AddDataFile: Adds a data file which will be loaded by players once they join. This native allows you to specify a custom vehicle audio settings file, or a carcols.dat file, for example.
  • AddIDE: Adds an item definition (IDE) file which will be loaded by players once they join.
Tip: This function was added in Snapshot 4.2 and will not work in earlier versions!
Important: Make sure you update assets.json so players will have to download the files first! Failing to do so (and proceeding to use the assets in your script) can easily result in crashes if you're not careful.
Warninig: Refer to GTA Mods Wiki for information on how IPL files are set up.
Warninig: Although DL IDEs have dynamically allocated IDs, the game still has to link the IPL entries to the appropriate IDE entries. To do this, the model ID column is used. If you specify an object with ID 5000 in an IDE, use 5000 in IPLs as well. If you use CreateObject for this model, use the dynamic ID. This behavior is added to make sure existing map mods can be loaded in via DL without much effort.
Important: If the game fails to find the right IDE entry for an IPL entry, the IPL entry is ignored, which means you will have problems with LOD indexing as the indices no longer point to the right entries. Fortunately, the game informs you of this should it happen, and you can thus correct the mistake with ease.
Warninig: Only the inst, grge, enex, cull, tcyc, auzo, occl, cloc and scrl sections are read. Other sections are ignored. Future expansions may support additional IPL sections.
Note: Use subfolders to keep your map files organized.