From 425c9ac485ad54be19dcac25eafebbb0b2398ea9 Mon Sep 17 00:00:00 2001 From: dockfries Date: Thu, 13 Mar 2025 17:53:36 +0800 Subject: [PATCH] update zh-CN translations, rename locale code case for zh-CN, zh-TW --- CODEOWNERS | 3 +- frontend/docusaurus.config.ts | 4 +- .../current/awesome.md | 163 ++ .../current/changelog.md | 198 +- .../current/client/ClientCommands.md | 45 + .../current/client/ClientOnLinux.md | 47 + .../current/client/CommonClientIssues.md | 82 + .../current/client/CrashAddresses.md | 34 + .../current/client/_.md | 7 + .../current/client/sa-mp.cfg.md | 26 + .../current/index.md | 31 + .../current/meta/Contributing.md | 120 ++ .../scripting/callbacks/OnActorStreamIn.md | 43 + .../scripting/callbacks/OnActorStreamOut.md | 43 + .../callbacks/OnClientCheckResponse.md | 60 + .../scripting/callbacks/OnClientMessage.md | 42 + .../scripting/callbacks/OnDialogResponse.md | 187 ++ .../scripting/callbacks/OnEnterExitModShop.md | 59 + .../scripting/callbacks/OnFilterScriptExit.md | 30 + .../scripting/callbacks/OnFilterScriptInit.md | 30 + .../scripting/callbacks/OnGameModeExit.md | 56 + .../scripting/callbacks/OnGameModeInit.md | 36 + .../callbacks/OnIncomingConnection.md | 48 + .../scripting/callbacks/OnNPCConnect.md | 31 + .../scripting/callbacks/OnNPCDisconnect.md | 31 + .../scripting/callbacks/OnNPCEnterVehicle.md | 31 + .../scripting/callbacks/OnNPCExitVehicle.md | 26 + .../scripting/callbacks/OnNPCModeExit.md | 26 + .../scripting/callbacks/OnNPCModeInit.md | 26 + .../current/scripting/callbacks/OnNPCSpawn.md | 21 + .../scripting/callbacks/OnObjectMoved.md | 51 + .../scripting/callbacks/OnPickupStreamIn.md | 56 + .../scripting/callbacks/OnPickupStreamOut.md | 56 + .../callbacks/OnPlayerClickGangZone.md | 42 + .../scripting/callbacks/OnPlayerClickMap.md | 50 + .../callbacks/OnPlayerClickPlayer.md | 54 + .../callbacks/OnPlayerClickPlayerGangZone.md | 42 + .../callbacks/OnPlayerClickPlayerTextDraw.md | 91 + .../callbacks/OnPlayerClickTextDraw.md | 85 + .../callbacks/OnPlayerCommandText.md | 55 + .../scripting/callbacks/OnPlayerConnect.md | 49 + .../scripting/callbacks/OnPlayerDeath.md | 88 + .../scripting/callbacks/OnPlayerDisconnect.md | 86 + .../callbacks/OnPlayerEditAttachedObject.md | 115 + .../scripting/callbacks/OnPlayerEditObject.md | 106 + .../callbacks/OnPlayerEnterCheckpoint.md | 60 + .../callbacks/OnPlayerEnterGangZone.md | 47 + .../callbacks/OnPlayerEnterPlayerGangZone.md | 47 + .../callbacks/OnPlayerEnterRaceCheckpoint.md | 51 + .../callbacks/OnPlayerEnterVehicle.md | 55 + .../callbacks/OnPlayerExitVehicle.md | 58 + .../scripting/callbacks/OnPlayerExitedMenu.md | 41 + .../callbacks/OnPlayerFinishedDownloading.md | 47 + .../scripting/callbacks/OnPlayerGiveDamage.md | 70 + .../callbacks/OnPlayerGiveDamageActor.md | 76 + .../callbacks/OnPlayerInteriorChange.md | 46 + .../callbacks/OnPlayerKeyStateChange.md | 277 +++ .../callbacks/OnPlayerLeaveCheckpoint.md | 51 + .../callbacks/OnPlayerLeaveGangZone.md | 46 + .../callbacks/OnPlayerLeavePlayerGangZone.md | 47 + .../callbacks/OnPlayerLeaveRaceCheckpoint.md | 51 + .../callbacks/OnPlayerObjectMoved.md | 49 + .../callbacks/OnPlayerPickUpPickup.md | 72 + .../callbacks/OnPlayerPickUpPlayerPickup.md | 74 + .../callbacks/OnPlayerPickupStreamIn.md | 68 + .../callbacks/OnPlayerPickupStreamOut.md | 68 + .../callbacks/OnPlayerRequestClass.md | 56 + .../callbacks/OnPlayerRequestDownload.md | 85 + .../callbacks/OnPlayerRequestSpawn.md | 57 + .../callbacks/OnPlayerSelectObject.md | 59 + .../callbacks/OnPlayerSelectedMenuRow.md | 81 + .../scripting/callbacks/OnPlayerSpawn.md | 65 + .../callbacks/OnPlayerStateChange.md | 58 + .../scripting/callbacks/OnPlayerStreamIn.md | 43 + .../scripting/callbacks/OnPlayerStreamOut.md | 49 + .../scripting/callbacks/OnPlayerTakeDamage.md | 94 + .../scripting/callbacks/OnPlayerText.md | 58 + .../scripting/callbacks/OnPlayerUpdate.md | 111 + .../scripting/callbacks/OnPlayerWeaponShot.md | 79 + .../scripting/callbacks/OnRconCommand.md | 74 + .../scripting/callbacks/OnRconLoginAttempt.md | 75 + .../callbacks/OnRecordingPlaybackEnd.md | 26 + .../scripting/callbacks/OnScriptCash.md | 51 + .../scripting/callbacks/OnScriptLoadPlayer.md | 46 + .../callbacks/OnScriptUnloadPlayer.md | 46 + .../scripting/callbacks/OnTrailerUpdate.md | 56 + .../callbacks/OnUnoccupiedVehicleUpdate.md | 71 + .../callbacks/OnVehicleDamageStatusUpdate.md | 66 + .../scripting/callbacks/OnVehicleDeath.md | 57 + .../scripting/callbacks/OnVehicleMod.md | 65 + .../scripting/callbacks/OnVehiclePaintjob.md | 60 + .../scripting/callbacks/OnVehicleRespray.md | 70 + .../callbacks/OnVehicleSirenStateChange.md | 61 + .../scripting/callbacks/OnVehicleSpawn.md | 51 + .../scripting/callbacks/OnVehicleStreamIn.md | 41 + .../scripting/callbacks/OnVehicleStreamOut.md | 41 + .../scripting/functions/AddCharModel.md | 59 + .../scripting/functions/AddMenuItem.md | 58 + .../scripting/functions/AddPlayerClass.md | 63 + .../scripting/functions/AddPlayerClassEx.md | 67 + .../scripting/functions/AddServerRule.md | 37 + .../scripting/functions/AddSimpleModel.md | 65 + .../functions/AddSimpleModelTimed.md | 64 + .../scripting/functions/AddStaticPickup.md | 57 + .../scripting/functions/AddStaticVehicle.md | 61 + .../scripting/functions/AddStaticVehicleEx.md | 65 + .../functions/AddVehicleComponent.md | 70 + .../scripting/functions/AllowAdminTeleport.md | 41 + .../functions/AllowInteriorWeapons.md | 57 + .../functions/AllowNickNameCharacter.md | 41 + .../functions/AllowPlayerTeleport.md | 50 + .../scripting/functions/AllowPlayerWeapons.md | 35 + .../functions/ApplyActorAnimation.md | 65 + .../scripting/functions/ApplyAnimation.md | 73 + .../functions/AreAllAnimationsEnabled.md | 37 + .../functions/AreInteriorWeaponsAllowed.md | 31 + .../functions/ArePlayerWeaponsAllowed.md | 40 + .../functions/Attach3DTextLabelToPlayer.md | 46 + .../functions/Attach3DTextLabelToVehicle.md | 55 + .../functions/AttachCameraToObject.md | 47 + .../functions/AttachCameraToPlayerObject.md | 49 + .../functions/AttachObjectToObject.md | 76 + .../functions/AttachObjectToPlayer.md | 57 + .../functions/AttachObjectToVehicle.md | 71 + .../functions/AttachPlayerObjectToObject.md | 64 + .../functions/AttachPlayerObjectToPlayer.md | 73 + .../functions/AttachPlayerObjectToVehicle.md | 74 + .../functions/AttachTrailerToVehicle.md | 42 + .../current/scripting/functions/Ban.md | 69 + .../current/scripting/functions/BanEx.md | 82 + .../scripting/functions/BeginObjectEditing.md | 64 + .../functions/BeginObjectSelecting.md | 49 + .../functions/BeginPlayerObjectEditing.md | 62 + .../scripting/functions/BlockIpAddress.md | 50 + .../scripting/functions/CallLocalFunction.md | 58 + .../scripting/functions/CallRemoteFunction.md | 57 + .../current/scripting/functions/CancelEdit.md | 43 + .../functions/CancelSelectTextDraw.md | 52 + .../scripting/functions/ChangeVehicleColor.md | 66 + .../functions/ChangeVehicleColours.md | 93 + .../functions/ChangeVehiclePaintjob.md | 54 + .../functions/ChatTextReplacementToggled.md | 28 + .../functions/ClearActorAnimations.md | 44 + .../scripting/functions/ClearAnimations.md | 51 + .../scripting/functions/ClearBanList.md | 55 + .../functions/ClearPlayerWorldBounds.md | 51 + .../current/scripting/functions/ConnectNPC.md | 45 + .../scripting/functions/CountRunningTimers.md | 28 + .../scripting/functions/Create3DTextLabel.md | 93 + .../scripting/functions/CreateActor.md | 89 + .../scripting/functions/CreateExplosion.md | 54 + .../functions/CreateExplosionForPlayer.md | 55 + .../current/scripting/functions/CreateMenu.md | 67 + .../scripting/functions/CreateObject.md | 68 + .../scripting/functions/CreatePickup.md | 92 + .../functions/CreatePlayer3DTextLabel.md | 83 + .../functions/CreatePlayerGangZone.md | 85 + .../scripting/functions/CreatePlayerObject.md | 69 + .../scripting/functions/CreatePlayerPickup.md | 87 + .../functions/CreatePlayerTextDraw.md | 101 + .../scripting/functions/CreateVehicle.md | 72 + .../scripting/functions/DB_ExecuteQuery.md | 119 ++ .../scripting/functions/DB_FreeResultSet.md | 110 + .../DB_GetDatabaseConnectionCount.md | 46 + .../functions/DB_GetDatabaseResultSetCount.md | 47 + .../scripting/functions/DB_GetFieldCount.md | 157 ++ .../scripting/functions/DB_GetFieldFloat.md | 157 ++ .../functions/DB_GetFieldFloatByName.md | 124 ++ .../scripting/functions/DB_GetFieldInt.md | 158 ++ .../functions/DB_GetFieldIntByName.md | 124 ++ .../scripting/functions/DB_GetFieldName.md | 108 + .../scripting/functions/DB_GetFieldString.md | 159 ++ .../functions/DB_GetFieldStringByName.md | 125 ++ .../functions/DB_GetLegacyDBResult.md | 94 + .../scripting/functions/DB_GetMemHandle.md | 86 + .../scripting/functions/DB_GetRowCount.md | 125 ++ .../scripting/functions/DB_SelectNextRow.md | 122 ++ .../scripting/functions/Delete3DTextLabel.md | 47 + .../current/scripting/functions/DeletePVar.md | 48 + .../functions/DeletePlayer3DTextLabel.md | 58 + .../current/scripting/functions/DeleteSVar.md | 47 + .../scripting/functions/DestroyActor.md | 44 + .../scripting/functions/DestroyMenu.md | 39 + .../scripting/functions/DestroyObject.md | 50 + .../scripting/functions/DestroyPickup.md | 41 + .../functions/DestroyPlayerObject.md | 51 + .../functions/DestroyPlayerPickup.md | 46 + .../scripting/functions/DestroyVehicle.md | 44 + .../functions/DetachTrailerFromVehicle.md | 30 + .../functions/DisableInteriorEnterExits.md | 44 + .../scripting/functions/DisableMenu.md | 59 + .../scripting/functions/DisableMenuRow.md | 67 + .../scripting/functions/DisableNameTagLOS.md | 43 + .../functions/DisablePlayerCheckpoint.md | 46 + .../functions/DisablePlayerRaceCheckpoint.md | 44 + .../DisableRemoteVehicleCollisions.md | 46 + .../scripting/functions/EditAttachedObject.md | 69 + .../current/scripting/functions/EditObject.md | 61 + .../scripting/functions/EditPlayerClass.md | 46 + .../scripting/functions/EditPlayerObject.md | 59 + .../functions/EnableAllAnimations.md | 52 + .../functions/EnablePlayerCameraTarget.md | 40 + .../functions/EnableStuntBonusForAll.md | 44 + .../functions/EnableStuntBonusForPlayer.md | 35 + .../scripting/functions/EnableTirePopping.md | 43 + .../functions/EnableVehicleFriendlyFire.md | 28 + .../scripting/functions/EnableZoneNames.md | 46 + .../scripting/functions/EndObjectEditing.md | 45 + .../functions/FindModelFileNameFromCRC.md | 28 + .../functions/FindTextureFileNameFromCRC.md | 28 + .../functions/ForceClassSelection.md | 52 + .../scripting/functions/GameModeExit.md | 23 + .../scripting/functions/GameTextForAll.md | 61 + .../scripting/functions/GameTextForPlayer.md | 65 + .../scripting/functions/GangZoneCreate.md | 77 + .../scripting/functions/GangZoneDestroy.md | 50 + .../functions/GangZoneFlashForAll.md | 49 + .../functions/GangZoneFlashForPlayer.md | 50 + .../functions/GangZoneGetColourForPlayer.md | 38 + .../GangZoneGetFlashColourForPlayer.md | 38 + .../scripting/functions/GangZoneGetPos.md | 61 + .../scripting/functions/GangZoneHideForAll.md | 52 + .../functions/GangZoneHideForPlayer.md | 55 + .../scripting/functions/GangZoneShowForAll.md | 54 + .../functions/GangZoneShowForPlayer.md | 50 + .../functions/GangZoneStopFlashForAll.md | 56 + .../functions/GangZoneStopFlashForPlayer.md | 55 + .../functions/Get3DTextLabelAttachedData.md | 56 + .../functions/Get3DTextLabelColor.md | 39 + .../functions/Get3DTextLabelColour.md | 35 + .../functions/Get3DTextLabelDrawDistance.md | 37 + .../scripting/functions/Get3DTextLabelLOS.md | 37 + .../scripting/functions/Get3DTextLabelPos.md | 41 + .../scripting/functions/Get3DTextLabelText.md | 40 + .../functions/Get3DTextLabelVirtualWorld.md | 37 + .../scripting/functions/GetActorAnimation.md | 60 + .../functions/GetActorFacingAngle.md | 37 + .../scripting/functions/GetActorHealth.md | 50 + .../scripting/functions/GetActorPoolSize.md | 34 + .../scripting/functions/GetActorPos.md | 38 + .../scripting/functions/GetActorSkin.md | 40 + .../scripting/functions/GetActorSpawnInfo.md | 53 + .../functions/GetActorVirtualWorld.md | 46 + .../current/scripting/functions/GetActors.md | 35 + .../scripting/functions/GetAnimationName.md | 46 + .../functions/GetAvailableClasses.md | 24 + .../functions/GetConsoleVarAsBool.md | 45 + .../functions/GetConsoleVarAsFloat.md | 39 + .../scripting/functions/GetConsoleVarAsInt.md | 38 + .../functions/GetConsoleVarAsString.md | 57 + .../scripting/functions/GetCustomModelPath.md | 42 + .../functions/GetDefaultPlayerColour.md | 30 + .../scripting/functions/GetGameText.md | 54 + .../current/scripting/functions/GetGravity.md | 53 + .../scripting/functions/GetMaxPlayers.md | 33 + .../functions/GetMenuColumnHeader.md | 36 + .../scripting/functions/GetMenuColumnWidth.md | 37 + .../scripting/functions/GetMenuColumns.md | 31 + .../scripting/functions/GetMenuItem.md | 38 + .../scripting/functions/GetMenuItems.md | 33 + .../current/scripting/functions/GetMenuPos.md | 33 + .../scripting/functions/GetModeRestartTime.md | 29 + .../scripting/functions/GetMyFacingAngle.md | 33 + .../current/scripting/functions/GetMyPos.md | 32 + .../scripting/functions/GetNetworkStats.md | 69 + .../functions/GetObjectAttachedData.md | 41 + .../functions/GetObjectAttachedOffset.md | 47 + .../functions/GetObjectDrawDistance.md | 33 + .../scripting/functions/GetObjectMaterial.md | 56 + .../functions/GetObjectMaterialText.md | 68 + .../scripting/functions/GetObjectModel.md | 38 + .../scripting/functions/GetObjectMoveSpeed.md | 36 + .../functions/GetObjectMovingTargetPos.md | 47 + .../functions/GetObjectMovingTargetRot.md | 47 + .../scripting/functions/GetObjectPos.md | 61 + .../scripting/functions/GetObjectRot.md | 59 + .../functions/GetObjectSyncRotation.md | 36 + .../scripting/functions/GetObjectType.md | 48 + .../scripting/functions/GetPVarFloat.md | 55 + .../current/scripting/functions/GetPVarInt.md | 55 + .../scripting/functions/GetPVarNameAtIndex.md | 29 + .../scripting/functions/GetPVarString.md | 60 + .../scripting/functions/GetPVarType.md | 79 + .../scripting/functions/GetPVarsUpperIndex.md | 51 + .../scripting/functions/GetPickupModel.md | 54 + .../scripting/functions/GetPickupPos.md | 66 + .../scripting/functions/GetPickupType.md | 55 + .../functions/GetPickupVirtualWorld.md | 54 + .../functions/GetPlayer3DTextLabelAttached.md | 70 + .../GetPlayer3DTextLabelAttachedData.md | 58 + .../functions/GetPlayer3DTextLabelColor.md | 43 + .../functions/GetPlayer3DTextLabelColour.md | 39 + .../functions/GetPlayer3DTextLabelDrawDist.md | 52 + .../GetPlayer3DTextLabelDrawDistance.md | 40 + .../functions/GetPlayer3DTextLabelLOS.md | 40 + .../functions/GetPlayer3DTextLabelPos.md | 37 + .../functions/GetPlayer3DTextLabelText.md | 39 + .../GetPlayer3DTextLabelVirtualWorld.md | 47 + .../scripting/functions/GetPlayerAmmo.md | 50 + .../scripting/functions/GetPlayerAnimFlags.md | 48 + .../functions/GetPlayerAnimationFlags.md | 62 + .../functions/GetPlayerAnimationIndex.md | 50 + .../scripting/functions/GetPlayerArmour.md | 56 + .../functions/GetPlayerAttachedObject.md | 67 + .../functions/GetPlayerBuildingsRemoved.md | 39 + .../functions/GetPlayerCameraAspectRatio.md | 42 + .../functions/GetPlayerCameraFrontVector.md | 67 + .../functions/GetPlayerCameraMode.md | 46 + .../scripting/functions/GetPlayerCameraPos.md | 51 + .../functions/GetPlayerCameraTargetActor.md | 81 + .../functions/GetPlayerCameraTargetObject.md | 68 + .../functions/GetPlayerCameraTargetPlayer.md | 46 + .../GetPlayerCameraTargetPlayerObject.md | 65 + .../functions/GetPlayerCameraTargetVehicle.md | 81 + .../functions/GetPlayerCameraUpVector.md | 34 + .../functions/GetPlayerCameraZoom.md | 41 + .../functions/GetPlayerCheckpoint.md | 54 + .../scripting/functions/GetPlayerClass.md | 70 + .../scripting/functions/GetPlayerColor.md | 42 + .../functions/GetPlayerCustomSkin.md | 43 + .../scripting/functions/GetPlayerDialog.md | 43 + .../functions/GetPlayerDialogData.md | 61 + .../scripting/functions/GetPlayerDialogID.md | 39 + .../functions/GetPlayerDistanceFromPoint.md | 47 + .../functions/GetPlayerDrunkLevel.md | 35 + .../functions/GetPlayerFacingAngle.md | 62 + .../functions/GetPlayerFightingStyle.md | 73 + .../scripting/functions/GetPlayerGhostMode.md | 34 + .../scripting/functions/GetPlayerGravity.md | 42 + .../scripting/functions/GetPlayerHealth.md | 58 + .../functions/GetPlayerHydraReactorAngle.md | 32 + .../scripting/functions/GetPlayerInterior.md | 47 + .../scripting/functions/GetPlayerIp.md | 65 + .../scripting/functions/GetPlayerKeys.md | 65 + .../functions/GetPlayerLandingGearState.md | 32 + .../functions/GetPlayerLastShotVectors.md | 68 + .../functions/GetPlayerLastSyncedTrailerID.md | 38 + .../functions/GetPlayerLastSyncedVehicleID.md | 38 + .../functions/GetPlayerMarkerForPlayer.md | 39 + .../scripting/functions/GetPlayerMenu.md | 47 + .../scripting/functions/GetPlayerMoney.md | 34 + .../scripting/functions/GetPlayerName.md | 58 + .../functions/GetPlayerNetworkStats.md | 56 + .../functions/GetPlayerObjectAttachedData.md | 43 + .../GetPlayerObjectAttachedOffset.md | 49 + .../functions/GetPlayerObjectDrawDistance.md | 34 + .../functions/GetPlayerObjectMaterial.md | 57 + .../functions/GetPlayerObjectMaterialText.md | 69 + .../functions/GetPlayerObjectModel.md | 40 + .../functions/GetPlayerObjectMoveSpeed.md | 37 + .../GetPlayerObjectMovingTargetPos.md | 48 + .../GetPlayerObjectMovingTargetRot.md | 48 + .../scripting/functions/GetPlayerObjectPos.md | 66 + .../scripting/functions/GetPlayerObjectRot.md | 62 + .../functions/GetPlayerObjectSyncRotation.md | 37 + .../functions/GetPlayerPickupModel.md | 50 + .../scripting/functions/GetPlayerPickupPos.md | 60 + .../functions/GetPlayerPickupType.md | 52 + .../functions/GetPlayerPickupVirtualWorld.md | 50 + .../scripting/functions/GetPlayerPing.md | 81 + .../scripting/functions/GetPlayerPoolSize.md | 30 + .../scripting/functions/GetPlayerPos.md | 55 + .../functions/GetPlayerRaceCheckpoint.md | 60 + .../scripting/functions/GetPlayerRawIp.md | 44 + .../functions/GetPlayerRotationQuat.md | 54 + .../scripting/functions/GetPlayerScore.md | 39 + .../functions/GetPlayerSirenState.md | 50 + .../functions/GetPlayerSkillLevel.md | 58 + .../scripting/functions/GetPlayerSkin.md | 54 + .../functions/GetPlayerSpecialAction.md | 41 + .../functions/GetPlayerSpectateID.md | 54 + .../functions/GetPlayerSpectateType.md | 46 + .../scripting/functions/GetPlayerState.md | 47 + .../functions/GetPlayerSurfingObjectID.md | 42 + .../functions/GetPlayerSurfingOffsets.md | 45 + .../GetPlayerSurfingPlayerObjectID.md | 44 + .../functions/GetPlayerSurfingVehicleID.md | 37 + .../functions/GetPlayerTargetActor.md | 52 + .../functions/GetPlayerTargetPlayer.md | 49 + .../scripting/functions/GetPlayerTeam.md | 47 + .../scripting/functions/GetPlayerTime.md | 41 + .../functions/GetPlayerTrainSpeed.md | 29 + .../scripting/functions/GetPlayerVehicleID.md | 38 + .../functions/GetPlayerVehicleSeat.md | 64 + .../scripting/functions/GetPlayerVelocity.md | 47 + .../scripting/functions/GetPlayerVersion.md | 56 + .../functions/GetPlayerVirtualWorld.md | 48 + .../functions/GetPlayerWantedLevel.md | 44 + .../scripting/functions/GetPlayerWeapon.md | 62 + .../functions/GetPlayerWeaponData.md | 66 + .../functions/GetPlayerWeaponState.md | 52 + .../scripting/functions/GetPlayerWeather.md | 42 + .../functions/GetPlayerWorldBounds.md | 51 + .../scripting/functions/GetPlayerZAim.md | 32 + .../current/scripting/functions/GetPlayers.md | 39 + .../functions/GetRandomVehicleColourPair.md | 38 + .../scripting/functions/GetRunningTimers.md | 32 + .../scripting/functions/GetSVarFloat.md | 41 + .../current/scripting/functions/GetSVarInt.md | 41 + .../scripting/functions/GetSVarNameAtIndex.md | 27 + .../scripting/functions/GetSVarString.md | 43 + .../scripting/functions/GetSVarType.md | 71 + .../scripting/functions/GetSVarsUpperIndex.md | 41 + .../scripting/functions/GetServerRuleFlags.md | 45 + .../scripting/functions/GetServerTickRate.md | 20 + .../scripting/functions/GetServerVarAsBool.md | 52 + .../scripting/functions/GetServerVarAsInt.md | 45 + .../functions/GetServerVarAsString.md | 62 + .../scripting/functions/GetSpawnInfo.md | 75 + .../scripting/functions/GetTickCount.md | 73 + .../scripting/functions/GetTimerInterval.md | 49 + .../scripting/functions/GetTimerRemaining.md | 49 + .../scripting/functions/GetVehicleCab.md | 30 + .../scripting/functions/GetVehicleColours.md | 48 + .../functions/GetVehicleComponentInSlot.md | 73 + .../functions/GetVehicleComponentType.md | 53 + .../functions/GetVehicleDamageStatus.md | 62 + .../functions/GetVehicleDistanceFromPoint.md | 48 + .../scripting/functions/GetVehicleDriver.md | 42 + .../scripting/functions/GetVehicleHealth.md | 73 + .../functions/GetVehicleHydraReactorAngle.md | 28 + .../scripting/functions/GetVehicleInterior.md | 40 + .../functions/GetVehicleLandingGearState.md | 32 + .../functions/GetVehicleLastDriver.md | 52 + .../scripting/functions/GetVehicleMatrix.md | 48 + .../scripting/functions/GetVehicleModel.md | 42 + .../functions/GetVehicleModelCount.md | 37 + .../functions/GetVehicleModelInfo.md | 41 + .../functions/GetVehicleModelsUsed.md | 25 + .../functions/GetVehicleNumberPlate.md | 39 + .../functions/GetVehicleOccupiedTick.md | 39 + .../scripting/functions/GetVehiclePaintjob.md | 40 + .../functions/GetVehicleParamsCarDoors.md | 44 + .../functions/GetVehicleParamsCarWindows.md | 44 + .../scripting/functions/GetVehicleParamsEx.md | 50 + .../functions/GetVehicleParamsSirenState.md | 56 + .../scripting/functions/GetVehiclePoolSize.md | 29 + .../scripting/functions/GetVehiclePos.md | 59 + .../functions/GetVehicleRespawnDelay.md | 35 + .../functions/GetVehicleRespawnTick.md | 39 + .../functions/GetVehicleRotationQuat.md | 53 + .../scripting/functions/GetVehicleSeats.md | 36 + .../functions/GetVehicleSirenState.md | 41 + .../functions/GetVehicleSpawnInfo.md | 49 + .../scripting/functions/GetVehicleTower.md | 34 + .../scripting/functions/GetVehicleTrailer.md | 40 + .../functions/GetVehicleTrainSpeed.md | 31 + .../scripting/functions/GetVehicleVelocity.md | 65 + .../functions/GetVehicleVirtualWorld.md | 31 + .../scripting/functions/GetVehicleZAngle.md | 55 + .../scripting/functions/GetVehicles.md | 35 + .../scripting/functions/GetWeaponName.md | 62 + .../scripting/functions/GetWeaponSlot.md | 49 + .../current/scripting/functions/GetWeather.md | 31 + .../scripting/functions/GetWorldTime.md | 26 + .../scripting/functions/GivePlayerMoney.md | 43 + .../scripting/functions/GivePlayerWeapon.md | 39 + .../current/scripting/functions/HTTP.md | 85 + .../scripting/functions/HasGameText.md | 46 + .../functions/HasObjectCameraCollision.md | 40 + .../HasPlayerObjectCameraCollision.md | 41 + .../functions/HasVehicleBeenOccupied.md | 45 + .../scripting/functions/HideGameTextForAll.md | 46 + .../functions/HideGameTextForPlayer.md | 40 + .../scripting/functions/HideMenuForPlayer.md | 73 + .../functions/HideObjectForPlayer.md | 49 + .../functions/HidePickupForPlayer.md | 58 + .../scripting/functions/HidePlayerDialog.md | 49 + .../scripting/functions/HideVehicle.md | 40 + .../functions/InterpolateCameraLookAt.md | 62 + .../functions/InterpolateCameraPos.md | 61 + .../functions/Is3DTextLabelStreamedIn.md | 48 + .../functions/IsActorInvulnerable.md | 49 + .../scripting/functions/IsActorStreamedIn.md | 48 + .../functions/IsAdminTeleportAllowed.md | 32 + .../current/scripting/functions/IsBanned.md | 47 + .../functions/IsGangZoneFlashingForPlayer.md | 37 + .../functions/IsGangZoneVisibleForPlayer.md | 36 + .../scripting/functions/IsMenuDisabled.md | 26 + .../scripting/functions/IsMenuRowDisabled.md | 26 + .../functions/IsNickNameCharacterAllowed.md | 40 + .../functions/IsObjectHiddenForPlayer.md | 66 + .../functions/IsObjectMaterialSlotUsed.md | 51 + .../scripting/functions/IsObjectMoving.md | 49 + .../functions/IsPickupHiddenForPlayer.md | 64 + .../scripting/functions/IsPickupStreamedIn.md | 62 + .../scripting/functions/IsPlayerAdmin.md | 41 + .../IsPlayerAttachedObjectSlotUsed.md | 55 + .../functions/IsPlayerCameraTargetEnabled.md | 39 + .../functions/IsPlayerCheckpointActive.md | 39 + .../scripting/functions/IsPlayerConnected.md | 52 + .../functions/IsPlayerControllable.md | 40 + .../scripting/functions/IsPlayerCuffed.md | 32 + .../functions/IsPlayerGangZoneFlashing.md | 70 + .../functions/IsPlayerGangZoneVisible.md | 72 + .../functions/IsPlayerInAnyVehicle.md | 46 + .../functions/IsPlayerInCheckpoint.md | 45 + .../functions/IsPlayerInDriveByMode.md | 31 + .../scripting/functions/IsPlayerInGangZone.md | 50 + .../scripting/functions/IsPlayerInModShop.md | 52 + .../functions/IsPlayerInPlayerGangZone.md | 69 + .../functions/IsPlayerInRaceCheckpoint.md | 45 + .../functions/IsPlayerInRangeOfPoint.md | 47 + .../scripting/functions/IsPlayerInVehicle.md | 51 + .../scripting/functions/IsPlayerNPC.md | 40 + .../IsPlayerObjectMaterialSlotUsed.md | 58 + .../functions/IsPlayerObjectMoving.md | 68 + .../functions/IsPlayerPickupStreamedIn.md | 57 + .../functions/IsPlayerRaceCheckpointActive.md | 38 + .../scripting/functions/IsPlayerSpawned.md | 40 + .../scripting/functions/IsPlayerStreamedIn.md | 58 + .../functions/IsPlayerTeleportAllowed.md | 45 + .../functions/IsPlayerTextDrawVisible.md | 63 + .../functions/IsPlayerUsingOfficialClient.md | 40 + .../scripting/functions/IsPlayerUsingOmp.md | 47 + .../functions/IsPlayerWidescreenToggled.md | 40 + .../scripting/functions/IsRepeatingTimer.md | 49 + .../functions/IsTextDrawVisibleForPlayer.md | 56 + .../functions/IsTrailerAttachedToVehicle.md | 35 + .../scripting/functions/IsValid3DTextLabel.md | 42 + .../scripting/functions/IsValidActor.md | 45 + .../functions/IsValidAnimationLibrary.md | 41 + .../scripting/functions/IsValidCustomModel.md | 28 + .../scripting/functions/IsValidGangZone.md | 34 + .../scripting/functions/IsValidMenu.md | 36 + .../scripting/functions/IsValidNickName.md | 47 + .../scripting/functions/IsValidObject.md | 71 + .../scripting/functions/IsValidPickup.md | 57 + .../functions/IsValidPlayer3DTextLabel.md | 41 + .../functions/IsValidPlayerGangZone.md | 62 + .../functions/IsValidPlayerObject.md | 69 + .../functions/IsValidPlayerPickup.md | 53 + .../functions/IsValidPlayerTextDraw.md | 64 + .../scripting/functions/IsValidServerRule.md | 38 + .../scripting/functions/IsValidTextDraw.md | 64 + .../scripting/functions/IsValidTimer.md | 59 + .../scripting/functions/IsValidVehicle.md | 65 + .../scripting/functions/IsVehicleDead.md | 41 + .../scripting/functions/IsVehicleHidden.md | 48 + .../scripting/functions/IsVehicleOccupied.md | 41 + .../functions/IsVehicleSirenEnabled.md | 42 + .../functions/IsVehicleStreamedIn.md | 51 + .../current/scripting/functions/Kick.md | 62 + .../current/scripting/functions/KillTimer.md | 58 + .../functions/LimitGlobalChatRadius.md | 38 + .../functions/LimitPlayerMarkerRadius.md | 34 + .../functions/LinkVehicleToInterior.md | 41 + .../functions/ManualVehicleEngineAndLights.md | 48 + .../current/scripting/functions/MoveObject.md | 85 + .../scripting/functions/MovePlayerObject.md | 72 + .../functions/NetStats_BytesReceived.md | 48 + .../scripting/functions/NetStats_BytesSent.md | 48 + .../functions/NetStats_ConnectionStatus.md | 71 + .../functions/NetStats_GetConnectedTime.md | 56 + .../scripting/functions/NetStats_GetIpPort.md | 52 + .../functions/NetStats_MessagesReceived.md | 48 + .../NetStats_MessagesRecvPerSecond.md | 46 + .../functions/NetStats_MessagesSent.md | 46 + .../functions/NetStats_PacketLossPercent.md | 88 + .../functions/PauseRecordingPlayback.md | 14 + .../functions/PlayAudioStreamForPlayer.md | 53 + .../functions/PlayCrimeReportForPlayer.md | 46 + .../functions/PlayerGangZoneDestroy.md | 63 + .../functions/PlayerGangZoneFlash.md | 59 + .../functions/PlayerGangZoneGetColour.md | 58 + .../functions/PlayerGangZoneGetFlashColour.md | 62 + .../functions/PlayerGangZoneGetPos.md | 62 + .../scripting/functions/PlayerGangZoneHide.md | 63 + .../scripting/functions/PlayerGangZoneShow.md | 56 + .../functions/PlayerGangZoneStopFlash.md | 67 + .../functions/PlayerHasClockEnabled.md | 49 + .../scripting/functions/PlayerPlaySound.md | 49 + .../functions/PlayerSpectatePlayer.md | 53 + .../functions/PlayerSpectateVehicle.md | 49 + .../functions/PlayerTextDrawAlignment.md | 73 + .../PlayerTextDrawBackgroundColor.md | 61 + .../PlayerTextDrawBackgroundColour.md | 63 + .../functions/PlayerTextDrawBoxColor.md | 52 + .../functions/PlayerTextDrawBoxColour.md | 54 + .../functions/PlayerTextDrawColor.md | 62 + .../functions/PlayerTextDrawColour.md | 64 + .../functions/PlayerTextDrawDestroy.md | 55 + .../scripting/functions/PlayerTextDrawFont.md | 84 + .../functions/PlayerTextDrawGetAlignment.md | 58 + .../PlayerTextDrawGetBackgroundCol.md | 57 + .../PlayerTextDrawGetBackgroundColour.md | 57 + .../functions/PlayerTextDrawGetBoxColor.md | 57 + .../functions/PlayerTextDrawGetBoxColour.md | 57 + .../functions/PlayerTextDrawGetColor.md | 56 + .../functions/PlayerTextDrawGetColour.md | 56 + .../functions/PlayerTextDrawGetFont.md | 59 + .../functions/PlayerTextDrawGetLetterSize.md | 63 + .../functions/PlayerTextDrawGetOutline.md | 58 + .../functions/PlayerTextDrawGetPos.md | 57 + .../PlayerTextDrawGetPreviewModel.md | 64 + .../functions/PlayerTextDrawGetPreviewRot.md | 57 + .../PlayerTextDrawGetPreviewVehCol.md | 52 + .../PlayerTextDrawGetPreviewVehicleColours.md | 52 + .../functions/PlayerTextDrawGetShadow.md | 59 + .../functions/PlayerTextDrawGetString.md | 62 + .../functions/PlayerTextDrawGetTextSize.md | 63 + .../scripting/functions/PlayerTextDrawHide.md | 57 + .../functions/PlayerTextDrawIsBox.md | 68 + .../functions/PlayerTextDrawIsProportional.md | 67 + .../functions/PlayerTextDrawIsSelectable.md | 69 + .../functions/PlayerTextDrawLetterSize.md | 69 + .../functions/PlayerTextDrawSetOutline.md | 54 + .../functions/PlayerTextDrawSetPos.md | 55 + .../PlayerTextDrawSetPreviewModel.md | 63 + .../functions/PlayerTextDrawSetPreviewRot.md | 65 + .../PlayerTextDrawSetPreviewVehCol.md | 63 + .../PlayerTextDrawSetPreviewVehicleColours.md | 65 + .../PlayerTextDrawSetProportional.md | 54 + .../functions/PlayerTextDrawSetSelectable.md | 70 + .../functions/PlayerTextDrawSetShadow.md | 64 + .../functions/PlayerTextDrawSetString.md | 101 + .../scripting/functions/PlayerTextDrawShow.md | 62 + .../functions/PlayerTextDrawTextSize.md | 79 + .../functions/PlayerTextDrawUseBox.md | 53 + .../scripting/functions/PutPlayerInVehicle.md | 99 + .../scripting/functions/RedirectDownload.md | 71 + .../functions/RemoveBuildingForPlayer.md | 62 + .../functions/RemovePlayerAttachedObject.md | 44 + .../functions/RemovePlayerFromVehicle.md | 49 + .../functions/RemovePlayerMapIcon.md | 34 + .../scripting/functions/RemovePlayerWeapon.md | 40 + .../scripting/functions/RemoveServerRule.md | 31 + .../functions/RemoveVehicleComponent.md | 45 + .../scripting/functions/RepairVehicle.md | 46 + .../scripting/functions/ResetPlayerMoney.md | 36 + .../scripting/functions/ResetPlayerWeapons.md | 45 + .../functions/ResumeRecordingPlayback.md | 14 + .../scripting/functions/SHA256_PassHash.md | 65 + .../scripting/functions/SelectObject.md | 44 + .../scripting/functions/SelectTextDraw.md | 53 + .../current/scripting/functions/SendChat.md | 31 + .../scripting/functions/SendClientCheck.md | 70 + .../scripting/functions/SendClientMessage.md | 71 + .../functions/SendClientMessageToAll.md | 61 + .../functions/SendClientMessageToAllf.md | 47 + .../scripting/functions/SendClientMessagef.md | 76 + .../scripting/functions/SendCommand.md | 35 + .../scripting/functions/SendDeathMessage.md | 58 + .../functions/SendDeathMessageToPlayer.md | 43 + .../functions/SendPlayerMessageToAll.md | 53 + .../functions/SendPlayerMessageToPlayer.md | 57 + .../scripting/functions/SendRconCommand.md | 61 + .../functions/Set3DTextLabelDrawDistance.md | 37 + .../scripting/functions/Set3DTextLabelLOS.md | 33 + .../functions/Set3DTextLabelVirtualWorld.md | 33 + .../functions/SetActorFacingAngle.md | 57 + .../scripting/functions/SetActorHealth.md | 42 + .../functions/SetActorInvulnerable.md | 48 + .../scripting/functions/SetActorPos.md | 53 + .../scripting/functions/SetActorSkin.md | 41 + .../functions/SetActorVirtualWorld.md | 44 + .../functions/SetCameraBehindPlayer.md | 31 + .../scripting/functions/SetDeathDropAmount.md | 51 + .../scripting/functions/SetGameModeText.md | 46 + .../current/scripting/functions/SetGravity.md | 45 + .../functions/SetMenuColumnHeader.md | 59 + .../scripting/functions/SetModeRestartTime.md | 57 + .../scripting/functions/SetMyFacingAngle.md | 32 + .../current/scripting/functions/SetMyPos.md | 30 + .../functions/SetNameTagDrawDistance.md | 38 + .../scripting/functions/SetObjectMaterial.md | 71 + .../functions/SetObjectMaterialText.md | 77 + .../scripting/functions/SetObjectMoveSpeed.md | 39 + .../functions/SetObjectNoCameraCol.md | 56 + .../functions/SetObjectNoCameraCollision.md | 50 + .../scripting/functions/SetObjectPos.md | 49 + .../scripting/functions/SetObjectRot.md | 55 + .../functions/SetObjectsDefaultCameraCol.md | 70 + .../SetObjectsDefaultCameraCollision.md | 70 + .../scripting/functions/SetPVarFloat.md | 54 + .../current/scripting/functions/SetPVarInt.md | 49 + .../scripting/functions/SetPVarString.md | 59 + .../scripting/functions/SetPickupForPlayer.md | 71 + .../scripting/functions/SetPickupModel.md | 59 + .../scripting/functions/SetPickupPos.md | 57 + .../scripting/functions/SetPickupType.md | 55 + .../functions/SetPickupVirtualWorld.md | 54 + .../SetPlayer3DTextLabelVirtualWorld.md | 44 + .../scripting/functions/SetPlayerAdmin.md | 48 + .../scripting/functions/SetPlayerAmmo.md | 48 + .../functions/SetPlayerArmedWeapon.md | 64 + .../scripting/functions/SetPlayerArmour.md | 52 + .../functions/SetPlayerAttachedObject.md | 71 + .../functions/SetPlayerCameraLookAt.md | 50 + .../scripting/functions/SetPlayerCameraPos.md | 49 + .../functions/SetPlayerChatBubble.md | 52 + .../functions/SetPlayerCheckpoint.md | 76 + .../scripting/functions/SetPlayerColor.md | 48 + .../functions/SetPlayerDrunkLevel.md | 52 + .../functions/SetPlayerFacingAngle.md | 52 + .../functions/SetPlayerFightingStyle.md | 50 + .../scripting/functions/SetPlayerGravity.md | 49 + .../scripting/functions/SetPlayerHealth.md | 63 + .../functions/SetPlayerHoldingObject.md | 54 + .../scripting/functions/SetPlayerInterior.md | 38 + .../scripting/functions/SetPlayerMapIcon.md | 64 + .../functions/SetPlayerMarkerForPlayer.md | 44 + .../scripting/functions/SetPlayerName.md | 72 + .../functions/SetPlayerObjectMaterial.md | 69 + .../functions/SetPlayerObjectMaterialText.md | 64 + .../functions/SetPlayerObjectMoveSpeed.md | 40 + .../functions/SetPlayerObjectNoCameraCol.md | 50 + .../SetPlayerObjectNoCameraCollision.md | 50 + .../scripting/functions/SetPlayerObjectPos.md | 61 + .../scripting/functions/SetPlayerObjectRot.md | 68 + .../functions/SetPlayerPickupModel.md | 51 + .../scripting/functions/SetPlayerPickupPos.md | 55 + .../functions/SetPlayerPickupType.md | 51 + .../functions/SetPlayerPickupVirtualWorld.md | 52 + .../scripting/functions/SetPlayerPos.md | 59 + .../scripting/functions/SetPlayerPosFindZ.md | 45 + .../functions/SetPlayerRaceCheckpoint.md | 88 + .../scripting/functions/SetPlayerScore.md | 39 + .../scripting/functions/SetPlayerShopName.md | 53 + .../functions/SetPlayerSkillLevel.md | 49 + .../scripting/functions/SetPlayerSkin.md | 108 + .../functions/SetPlayerSpecialAction.md | 57 + .../scripting/functions/SetPlayerTeam.md | 46 + .../scripting/functions/SetPlayerTime.md | 55 + .../scripting/functions/SetPlayerVelocity.md | 43 + .../functions/SetPlayerVirtualWorld.md | 49 + .../functions/SetPlayerWantedLevel.md | 41 + .../scripting/functions/SetPlayerWeather.md | 52 + .../functions/SetPlayerWorldBounds.md | 64 + .../scripting/functions/SetSVarFloat.md | 42 + .../current/scripting/functions/SetSVarInt.md | 42 + .../scripting/functions/SetSVarString.md | 45 + .../scripting/functions/SetServerRule.md | 47 + .../scripting/functions/SetServerRuleFlags.md | 47 + .../scripting/functions/SetSpawnInfo.md | 62 + .../scripting/functions/SetTeamCount.md | 34 + .../current/scripting/functions/SetTimer.md | 78 + .../current/scripting/functions/SetTimerEx.md | 92 + .../functions/SetVehicleAngularVelocity.md | 58 + .../functions/SetVehicleBeenOccupied.md | 36 + .../scripting/functions/SetVehicleDead.md | 35 + .../scripting/functions/SetVehicleHealth.md | 65 + .../functions/SetVehicleNumberPlate.md | 55 + .../functions/SetVehicleOccupiedTick.md | 47 + .../functions/SetVehicleParamsCarDoors.md | 32 + .../functions/SetVehicleParamsCarWindows.md | 32 + .../scripting/functions/SetVehicleParamsEx.md | 92 + .../functions/SetVehicleParamsForPlayer.md | 121 ++ .../functions/SetVehicleParamsSirenState.md | 31 + .../scripting/functions/SetVehiclePos.md | 47 + .../functions/SetVehicleRespawnDelay.md | 37 + .../functions/SetVehicleRespawnTick.md | 47 + .../functions/SetVehicleSpawnInfo.md | 45 + .../functions/SetVehicleToRespawn.md | 35 + .../scripting/functions/SetVehicleVelocity.md | 53 + .../functions/SetVehicleVirtualWorld.md | 32 + .../scripting/functions/SetVehicleZAngle.md | 58 + .../current/scripting/functions/SetWeather.md | 51 + .../scripting/functions/SetWorldTime.md | 46 + .../scripting/functions/ShowMenuForPlayer.md | 65 + .../scripting/functions/ShowNameTags.md | 53 + .../functions/ShowObjectForPlayer.md | 55 + .../functions/ShowPickupForPlayer.md | 58 + .../scripting/functions/ShowPlayerDialog.md | 97 + .../scripting/functions/ShowPlayerMarkers.md | 55 + .../functions/ShowPlayerNameTagForPlayer.md | 55 + .../scripting/functions/ShowVehicle.md | 55 + .../scripting/functions/SpawnPlayer.md | 54 + .../functions/StartRecordingPlayback.md | 28 + .../functions/StartRecordingPlayerData.md | 46 + .../functions/StopAudioStreamForPlayer.md | 39 + .../current/scripting/functions/StopObject.md | 68 + .../functions/StopPlayerHoldingObject.md | 43 + .../scripting/functions/StopPlayerObject.md | 69 + .../functions/StopRecordingPlayback.MD | 23 + .../functions/StopRecordingPlayerData.md | 36 + .../scripting/functions/TextDrawAlignment.md | 76 + .../functions/TextDrawBackgroundColor.md | 68 + .../functions/TextDrawBackgroundColour.md | 71 + .../scripting/functions/TextDrawBoxColor.md | 61 + .../scripting/functions/TextDrawBoxColour.md | 63 + .../scripting/functions/TextDrawColor.md | 60 + .../scripting/functions/TextDrawColour.md | 62 + .../scripting/functions/TextDrawCreate.md | 107 + .../scripting/functions/TextDrawDestroy.md | 56 + .../scripting/functions/TextDrawFont.md | 76 + .../functions/TextDrawGetAlignment.md | 56 + .../functions/TextDrawGetBackgroundColor.md | 57 + .../functions/TextDrawGetBackgroundColour.md | 57 + .../functions/TextDrawGetBoxColor.md | 57 + .../functions/TextDrawGetBoxColour.md | 57 + .../scripting/functions/TextDrawGetColor.md | 56 + .../scripting/functions/TextDrawGetColour.md | 56 + .../scripting/functions/TextDrawGetFont.md | 57 + .../functions/TextDrawGetLetterSize.md | 60 + .../scripting/functions/TextDrawGetOutline.md | 57 + .../scripting/functions/TextDrawGetPos.md | 55 + .../functions/TextDrawGetPreviewModel.md | 61 + .../functions/TextDrawGetPreviewRot.md | 57 + .../functions/TextDrawGetPreviewVehCol.md | 51 + .../TextDrawGetPreviewVehicleColours.md | 51 + .../scripting/functions/TextDrawGetShadow.md | 57 + .../scripting/functions/TextDrawGetString.md | 60 + .../functions/TextDrawGetTextSize.md | 60 + .../scripting/functions/TextDrawHideForAll.md | 51 + .../functions/TextDrawHideForPlayer.md | 56 + .../scripting/functions/TextDrawIsBox.md | 65 + .../functions/TextDrawIsProportional.md | 65 + .../functions/TextDrawIsSelectable.md | 67 + .../scripting/functions/TextDrawLetterSize.md | 71 + .../scripting/functions/TextDrawSetOutline.md | 61 + .../scripting/functions/TextDrawSetPos.md | 53 + .../functions/TextDrawSetPreviewModel.md | 67 + .../functions/TextDrawSetPreviewRot.md | 62 + .../functions/TextDrawSetPreviewVehCol.md | 58 + .../TextDrawSetPreviewVehicleColours.md | 60 + .../functions/TextDrawSetProportional.md | 62 + .../functions/TextDrawSetSelectable.md | 57 + .../scripting/functions/TextDrawSetShadow.md | 69 + .../scripting/functions/TextDrawSetString.md | 80 + .../functions/TextDrawSetStringForPlayer.md | 91 + .../scripting/functions/TextDrawShowForAll.md | 48 + .../functions/TextDrawShowForPlayer.md | 54 + .../scripting/functions/TextDrawTextSize.md | 77 + .../scripting/functions/TextDrawUseBox.md | 63 + .../current/scripting/functions/Tickcount.md | 24 + .../functions/ToggleChatTextReplacement.md | 48 + .../scripting/functions/TogglePlayerClock.md | 46 + .../functions/TogglePlayerControllable.md | 46 + .../functions/TogglePlayerGhostMode.md | 40 + .../functions/TogglePlayerSpectating.md | 57 + .../functions/TogglePlayerWidescreen.md | 52 + .../functions/ToggleVehicleSirenEnabled.md | 30 + .../scripting/functions/UnBlockIpAddress.md | 37 + .../functions/Update3DTextLabelText.md | 55 + .../functions/UpdatePlayer3DTextLabelText.md | 38 + .../functions/UpdateVehicleDamageStatus.md | 66 + .../scripting/functions/UseGangZoneCheck.md | 84 + .../functions/UsePlayerGangZoneCheck.md | 87 + .../scripting/functions/UsePlayerPedAnims.md | 44 + .../current/scripting/functions/VectorSize.md | 35 + .../functions/VehicleCanHaveComponent.md | 49 + .../functions/VehicleColourIndexToColour.md | 30 + .../current/scripting/functions/acos.md | 44 + .../current/scripting/functions/argcount.md | 20 + .../current/scripting/functions/argindex.md | 33 + .../current/scripting/functions/argstr.md | 30 + .../current/scripting/functions/argvalue.md | 36 + .../current/scripting/functions/asin.md | 44 + .../current/scripting/functions/atan.md | 44 + .../current/scripting/functions/atan2.md | 52 + .../current/scripting/functions/clamp.md | 37 + .../current/scripting/functions/db_close.md | 120 ++ .../scripting/functions/db_debug_openfiles.md | 36 + .../functions/db_debug_openresults.md | 36 + .../scripting/functions/db_field_name.md | 109 + .../scripting/functions/db_free_result.md | 111 + .../scripting/functions/db_get_field.md | 161 ++ .../scripting/functions/db_get_field_assoc.md | 126 ++ .../functions/db_get_field_assoc_float.md | 125 ++ .../functions/db_get_field_assoc_int.md | 125 ++ .../scripting/functions/db_get_field_float.md | 159 ++ .../scripting/functions/db_get_field_int.md | 159 ++ .../scripting/functions/db_get_mem_handle.md | 89 + .../functions/db_get_result_mem_handle.md | 96 + .../scripting/functions/db_next_row.md | 123 ++ .../scripting/functions/db_num_fields.md | 159 ++ .../scripting/functions/db_num_rows.md | 126 ++ .../current/scripting/functions/db_open.md | 114 + .../current/scripting/functions/db_query.md | 112 + .../scripting/functions/deleteproperty.md | 42 + .../current/scripting/functions/diskfree.md | 68 + .../scripting/functions/existproperty.md | 45 + .../scripting/functions/existpubvar.md | 28 + .../current/scripting/functions/fattrib.md | 76 + .../current/scripting/functions/fblockread.md | 103 + .../scripting/functions/fblockwrite.md | 89 + .../current/scripting/functions/fclose.md | 83 + .../current/scripting/functions/fcopy.md | 70 + .../current/scripting/functions/fcreatedir.md | 69 + .../current/scripting/functions/fexist.md | 63 + .../current/scripting/functions/fflush.md | 74 + .../current/scripting/functions/fgetchar.md | 84 + .../current/scripting/functions/filecrc.md | 72 + .../current/scripting/functions/flength.md | 77 + .../current/scripting/functions/float.md | 33 + .../current/scripting/functions/floatabs.md | 36 + .../current/scripting/functions/floatadd.md | 39 + .../current/scripting/functions/floatcmp.md | 41 + .../current/scripting/functions/floatcos.md | 49 + .../current/scripting/functions/floatdiv.md | 39 + .../current/scripting/functions/floatfract.md | 32 + .../current/scripting/functions/floatlog.md | 37 + .../current/scripting/functions/floatmul.md | 47 + .../current/scripting/functions/floatpower.md | 34 + .../current/scripting/functions/floatround.md | 51 + .../current/scripting/functions/floatsin.md | 57 + .../scripting/functions/floatsqroot.md | 40 + .../current/scripting/functions/floatstr.md | 44 + .../current/scripting/functions/floatsub.md | 39 + .../current/scripting/functions/floattan.md | 49 + .../current/scripting/functions/fmatch.md | 71 + .../current/scripting/functions/fopen.md | 166 ++ .../current/scripting/functions/format.md | 95 + .../current/scripting/functions/fputchar.md | 78 + .../current/scripting/functions/fread.md | 122 ++ .../current/scripting/functions/fremove.md | 89 + .../current/scripting/functions/frename.md | 62 + .../current/scripting/functions/fseek.md | 89 + .../current/scripting/functions/fstat.md | 73 + .../current/scripting/functions/ftell.md | 69 + .../current/scripting/functions/ftemp.md | 131 ++ .../current/scripting/functions/funcidx.md | 36 + .../current/scripting/functions/fwrite.md | 140 ++ .../current/scripting/functions/getarg.md | 42 + .../current/scripting/functions/getdate.md | 35 + .../scripting/functions/getproperty.md | 52 + .../current/scripting/functions/getpubvar.md | 26 + .../current/scripting/functions/gettime.md | 48 + .../current/scripting/functions/gpci.md | 80 + .../current/scripting/functions/heapspace.md | 22 + .../current/scripting/functions/ispacked.md | 38 + .../current/scripting/functions/listenport.md | 40 + .../current/scripting/functions/max.md | 45 + .../current/scripting/functions/memcpy.md | 49 + .../current/scripting/functions/min.md | 45 + .../current/scripting/functions/numargs.md | 34 + .../current/scripting/functions/numpubvars.md | 22 + .../current/scripting/functions/print.md | 54 + .../current/scripting/functions/printf.md | 65 + .../current/scripting/functions/random.md | 56 + .../current/scripting/functions/sendpacket.md | 33 + .../current/scripting/functions/sendstring.md | 32 + .../current/scripting/functions/setarg.md | 27 + .../scripting/functions/setproperty.md | 57 + .../current/scripting/functions/setpubvar.md | 27 + .../current/scripting/functions/strcat.md | 42 + .../current/scripting/functions/strcmp.md | 75 + .../current/scripting/functions/strcopy.md | 38 + .../current/scripting/functions/strdel.md | 42 + .../current/scripting/functions/strequal.md | 54 + .../current/scripting/functions/strfind.md | 43 + .../current/scripting/functions/strfloat.md | 47 + .../current/scripting/functions/strins.md | 49 + .../current/scripting/functions/strlen.md | 37 + .../current/scripting/functions/strmid.md | 44 + .../current/scripting/functions/strpack.md | 40 + .../current/scripting/functions/strunpack.md | 45 + .../current/scripting/functions/strval.md | 38 + .../current/scripting/functions/swapchars.md | 20 + .../current/scripting/functions/tolower.md | 35 + .../current/scripting/functions/toupper.md | 35 + .../current/scripting/functions/uudecode.md | 33 + .../current/scripting/functions/uuencode.md | 34 + .../current/scripting/functions/valstr.md | 60 + .../scripting/language/ControlStructures.md | 713 +++++++ .../current/scripting/language/Directives.md | 340 +++ .../scripting/language/Initialisers.md | 886 ++++++++ .../current/scripting/language/Operators.md | 147 ++ .../current/scripting/language/Statements.md | 703 ++++++ .../current/scripting/language/Style.md | 257 +++ .../current/scripting/language/Tags.md | 186 ++ .../current/scripting/language/Variables.md | 218 ++ .../scripting/resources/Componentslots.md | 30 + .../current/scripting/resources/anglemodes.md | 18 + .../current/scripting/resources/animations.md | 1894 +++++++++++++++++ .../current/scripting/resources/bodyparts.md | 33 + .../current/scripting/resources/boneid.md | 31 + .../scripting/resources/bullethittypes.md | 24 + .../scripting/resources/callbacks-sequence.md | 79 + .../scripting/resources/cameracutstyles.md | 18 + .../scripting/resources/cameramodes.md | 38 + .../scripting/resources/carcomponentid.md | 423 ++++ .../scripting/resources/clicksources.md | 15 + .../current/scripting/resources/colorslist.md | 222 ++ .../scripting/resources/connectionstatus.md | 23 + .../current/scripting/resources/constants.md | 428 ++++ .../current/scripting/resources/crimelist.md | 33 + .../scripting/resources/damagestatus.md | 86 + .../scripting/resources/dialogstyles.md | 271 +++ .../current/scripting/resources/doorstates.md | 163 ++ .../scripting/resources/download-requests.md | 18 + .../scripting/resources/escapecodes.md | 31 + .../scripting/resources/explosionlist.md | 33 + .../scripting/resources/fightingstyles.md | 19 + .../current/scripting/resources/file-modes.md | 18 + .../scripting/resources/file-seek-whence.md | 17 + .../scripting/resources/floatroundmodes.md | 19 + .../scripting/resources/gametextstyles.md | 85 + .../current/scripting/resources/glossary.md | 21 + .../current/scripting/resources/hexcolors.md | 165 ++ .../resources/http-error-response-codes.md | 68 + .../resources/http-request-methods.md | 17 + .../scripting/resources/interiorids.md | 234 ++ .../current/scripting/resources/keys.md | 61 + .../scripting/resources/landinggearstate.md | 16 + .../scripting/resources/lightstates.md | 148 ++ .../current/scripting/resources/limits.md | 75 + .../current/scripting/resources/mapicons.md | 78 + .../scripting/resources/mapiconstyles.md | 18 + .../scripting/resources/markermodes.md | 16 + .../resources/materialtextalignment.md | 17 + .../scripting/resources/materialtextsizes.md | 28 + .../scripting/resources/networkstats.md | 32 + .../resources/objecteditionresponsetypes.md | 16 + .../current/scripting/resources/opcodes.md | 21 + .../resources/original-car-colors.md | 208 ++ .../current/scripting/resources/paintjobs.md | 59 + .../scripting/resources/panelstates.md | 62 + .../current/scripting/resources/pickupids.md | 125 ++ .../scripting/resources/pickuptypes.md | 39 + .../scripting/resources/playerstates.md | 25 + .../current/scripting/resources/pvartypes.md | 17 + .../resources/race-checkpoint-types.md | 24 + .../scripting/resources/recordtypes.md | 18 + .../scripting/resources/samp_objects.md | 1829 ++++++++++++++++ .../scripting/resources/selectobjecttypes.md | 15 + .../current/scripting/resources/shopnames.md | 21 + .../current/scripting/resources/skins.md | 334 +++ .../current/scripting/resources/sound-ids.md | 635 ++++++ .../scripting/resources/specialactions.md | 37 + .../scripting/resources/spectatemodes.md | 18 + .../scripting/resources/spectatetypes.md | 18 + .../scripting/resources/sqlite-open-flags.md | 43 + .../current/scripting/resources/start.md | 714 +++++++ .../scripting/resources/startingids.md | 24 + .../current/scripting/resources/svartypes.md | 19 + .../scripting/resources/textalignments.md | 17 + .../current/scripting/resources/textdraws.md | 232 ++ .../scripting/resources/textdrawsprites.md | 690 ++++++ .../current/scripting/resources/tirestates.md | 250 +++ .../resources/vehicle-door-status.md | 40 + .../resources/vehicle-light-status.md | 21 + .../resources/vehicle-panel-status.md | 16 + .../resources/vehicle-tire-status.md | 24 + .../scripting/resources/vehiclecolorid.md | 14 +- .../scripting/resources/vehiclehealth.md | 19 + .../current/scripting/resources/vehicleid.md | 220 ++ .../resources/vehicleinformationtypes.md | 25 + .../scripting/resources/vendingmachines.md | 115 + .../current/scripting/resources/weaponids.md | 73 + .../scripting/resources/weaponskills.md | 49 + .../scripting/resources/weaponslots.md | 28 + .../scripting/resources/weaponstates.md | 15 + .../current/scripting/resources/weatherid.md | 42 + .../current/server/CommonServerIssues.md | 83 + .../current/server/ControllingServer.md | 203 ++ .../current/server/Installation.md | 403 ++++ .../current/server/LagCompensation.md | 15 + .../current/server/LinuxServerInstallation.md | 213 ++ .../current/server/RemoteConsole.md | 24 + .../current/server/config.json.md | 249 +++ .../current/server/omp-functions.md | 237 +++ .../current/server/server.cfg.md | 126 ++ .../current/tutorials/AdvancedStructures.md | 322 +++ .../current/tutorials/Binary.md | 411 ++++ .../current/tutorials/MenuGuide.md | 159 ++ .../current/tutorials/PickupGuide.md | 89 + .../tutorials/PluginDevelopmentGuide.md | 1577 ++++++++++++++ .../current/tutorials/PortForwarding.md | 73 + .../current/tutorials/QueryMechanism.md | 125 ++ .../current/tutorials/_.md | 7 + .../current/tutorials/colorfix.md | 26 +- .../current/tutorials/cooldowns.md | 244 +++ .../tutorials/perplayervariablesystem.md | 44 + .../current/tutorials/servervariablesystem.md | 44 + .../current/tutorials/stringmanipulation.md | 177 +- .../current/awesome.md | 0 .../current/client/ClientCommands.md | 0 .../current/client/CommonClientIssues.md | 0 .../current/client/CrashAddresses.md | 0 .../current/client/_.md | 0 .../current/index.md | 0 .../current/meta/Contributing.md | 0 .../current/awesome.md | 161 -- .../current/client/ClientCommands.md | 46 - .../current/client/CommonClientIssues.md | 61 - .../current/client/CrashAddresses.md | 34 - .../current/client/_.md | 7 - .../current/client/sa-mp.cfg.md | 26 - .../current/index.md | 17 - .../current/meta/Contributing.md | 221 -- .../scripting/callbacks/OnActorStreamIn.md | 43 - .../scripting/callbacks/OnActorStreamOut.md | 43 - .../callbacks/OnClientCheckResponse.md | 60 - .../scripting/callbacks/OnClientMessage.md | 37 - .../scripting/callbacks/OnDialogResponse.md | 199 -- .../scripting/callbacks/OnEnterExitModShop.md | 59 - .../scripting/callbacks/OnFilterScriptExit.md | 30 - .../scripting/callbacks/OnFilterScriptInit.md | 30 - .../scripting/callbacks/OnGameModeExit.md | 50 - .../scripting/callbacks/OnGameModeInit.md | 36 - .../callbacks/OnIncomingConnection.md | 49 - .../scripting/callbacks/OnNPCConnect.md | 31 - .../scripting/callbacks/OnNPCDisconnect.md | 31 - .../scripting/callbacks/OnNPCEnterVehicle.md | 31 - .../scripting/callbacks/OnNPCExitVehicle.md | 27 - .../scripting/callbacks/OnNPCModeExit.md | 28 - .../scripting/callbacks/OnNPCModeInit.md | 27 - .../current/scripting/callbacks/OnNPCSpawn.md | 22 - .../scripting/callbacks/OnObjectMoved.md | 51 - .../scripting/callbacks/OnPickupStreamIn.md | 56 - .../scripting/callbacks/OnPickupStreamOut.md | 56 - .../callbacks/OnPlayerClickGangZone.md | 42 - .../scripting/callbacks/OnPlayerClickMap.md | 51 - .../callbacks/OnPlayerClickPlayer.md | 56 - .../callbacks/OnPlayerClickPlayerGangZone.md | 42 - .../callbacks/OnPlayerClickPlayerTextDraw.md | 87 - .../callbacks/OnPlayerClickTextDraw.md | 85 - .../callbacks/OnPlayerCommandText.md | 55 - .../scripting/callbacks/OnPlayerConnect.md | 50 - .../scripting/callbacks/OnPlayerDeath.md | 77 - .../scripting/callbacks/OnPlayerDisconnect.md | 86 - .../callbacks/OnPlayerEditAttachedObject.md | 97 - .../scripting/callbacks/OnPlayerEditObject.md | 106 - .../callbacks/OnPlayerEnterCheckpoint.md | 60 - .../callbacks/OnPlayerEnterGangZone.md | 47 - .../callbacks/OnPlayerEnterPlayerGangZone.md | 47 - .../callbacks/OnPlayerEnterRaceCheckpoint.md | 51 - .../callbacks/OnPlayerEnterVehicle.md | 55 - .../callbacks/OnPlayerExitVehicle.md | 54 - .../scripting/callbacks/OnPlayerExitedMenu.md | 41 - .../callbacks/OnPlayerFinishedDownloading.md | 47 - .../scripting/callbacks/OnPlayerGiveDamage.md | 67 - .../callbacks/OnPlayerGiveDamageActor.md | 76 - .../callbacks/OnPlayerInteriorChange.md | 46 - .../callbacks/OnPlayerKeyStateChange.md | 330 --- .../callbacks/OnPlayerLeaveCheckpoint.md | 51 - .../callbacks/OnPlayerLeaveGangZone.md | 46 - .../callbacks/OnPlayerLeavePlayerGangZone.md | 47 - .../callbacks/OnPlayerLeaveRaceCheckpoint.md | 51 - .../callbacks/OnPlayerObjectMoved.md | 49 - .../callbacks/OnPlayerPickUpPickup.md | 60 - .../callbacks/OnPlayerPickUpPlayerPickup.md | 62 - .../callbacks/OnPlayerPickupStreamIn.md | 56 - .../callbacks/OnPlayerPickupStreamOut.md | 56 - .../callbacks/OnPlayerRequestClass.md | 53 - .../callbacks/OnPlayerRequestDownload.md | 73 - .../callbacks/OnPlayerRequestSpawn.md | 49 - .../callbacks/OnPlayerSelectObject.md | 59 - .../callbacks/OnPlayerSelectedMenuRow.md | 77 - .../scripting/callbacks/OnPlayerSpawn.md | 65 - .../callbacks/OnPlayerStateChange.md | 58 - .../scripting/callbacks/OnPlayerStreamIn.md | 43 - .../scripting/callbacks/OnPlayerStreamOut.md | 43 - .../scripting/callbacks/OnPlayerTakeDamage.md | 94 - .../scripting/callbacks/OnPlayerText.md | 49 - .../scripting/callbacks/OnPlayerUpdate.md | 96 - .../scripting/callbacks/OnPlayerWeaponShot.md | 83 - .../scripting/callbacks/OnRconCommand.md | 68 - .../scripting/callbacks/OnRconLoginAttempt.md | 74 - .../callbacks/OnRecordingPlaybackEnd.md | 26 - .../scripting/callbacks/OnScriptCash.md | 51 - .../scripting/callbacks/OnScriptLoadPlayer.md | 46 - .../callbacks/OnScriptUnloadPlayer.md | 46 - .../scripting/callbacks/OnTrailerUpdate.md | 56 - .../callbacks/OnUnoccupiedVehicleUpdate.md | 57 - .../callbacks/OnVehicleDamageStatusUpdate.md | 67 - .../scripting/callbacks/OnVehicleDeath.md | 52 - .../scripting/callbacks/OnVehicleMod.md | 59 - .../scripting/callbacks/OnVehiclePaintjob.md | 54 - .../scripting/callbacks/OnVehicleRespray.md | 66 - .../callbacks/OnVehicleSirenStateChange.md | 57 - .../scripting/callbacks/OnVehicleSpawn.md | 53 - .../scripting/callbacks/OnVehicleStreamIn.md | 40 - .../scripting/callbacks/OnVehicleStreamOut.md | 40 - .../scripting/functions/AddCharModel.md | 59 - .../scripting/functions/AddMenuItem.md | 58 - .../scripting/functions/AddPlayerClass.md | 63 - .../scripting/functions/AddPlayerClassEx.md | 67 - .../scripting/functions/AddServerRule.md | 37 - .../scripting/functions/AddSimpleModel.md | 65 - .../functions/AddSimpleModelTimed.md | 63 - .../scripting/functions/AddStaticPickup.md | 57 - .../scripting/functions/AddStaticVehicle.md | 61 - .../scripting/functions/AddStaticVehicleEx.md | 65 - .../functions/AddVehicleComponent.md | 70 - .../scripting/functions/AllowAdminTeleport.md | 41 - .../functions/AllowInteriorWeapons.md | 57 - .../functions/AllowNickNameCharacter.md | 41 - .../functions/AllowPlayerTeleport.md | 50 - .../scripting/functions/AllowPlayerWeapons.md | 35 - .../functions/ApplyActorAnimation.md | 63 - .../scripting/functions/ApplyAnimation.md | 73 - .../functions/AreAllAnimationsEnabled.md | 37 - .../functions/AreInteriorWeaponsAllowed.md | 31 - .../functions/ArePlayerWeaponsAllowed.md | 40 - .../functions/Attach3DTextLabelToPlayer.md | 46 - .../functions/Attach3DTextLabelToVehicle.md | 55 - .../functions/AttachCameraToObject.md | 47 - .../functions/AttachCameraToPlayerObject.md | 49 - .../functions/AttachObjectToObject.md | 77 - .../functions/AttachObjectToPlayer.md | 57 - .../functions/AttachObjectToVehicle.md | 71 - .../functions/AttachPlayerObjectToObject.md | 64 - .../functions/AttachPlayerObjectToPlayer.md | 73 - .../functions/AttachPlayerObjectToVehicle.md | 74 - .../functions/AttachTrailerToVehicle.md | 42 - .../current/scripting/functions/Ban.md | 69 - .../current/scripting/functions/BanEx.md | 78 - .../scripting/functions/BeginObjectEditing.md | 64 - .../functions/BeginObjectSelecting.md | 49 - .../functions/BeginPlayerObjectEditing.md | 62 - .../scripting/functions/BlockIpAddress.md | 50 - .../scripting/functions/CallLocalFunction.md | 58 - .../scripting/functions/CallRemoteFunction.md | 57 - .../current/scripting/functions/CancelEdit.md | 43 - .../functions/CancelSelectTextDraw.md | 52 - .../scripting/functions/ChangeVehicleColor.md | 88 - .../functions/ChangeVehicleColours.md | 92 - .../functions/ChangeVehiclePaintjob.md | 54 - .../functions/ChatTextReplacementToggled.md | 28 - .../functions/ClearActorAnimations.md | 42 - .../scripting/functions/ClearAnimations.md | 51 - .../scripting/functions/ClearBanList.md | 55 - .../functions/ClearPlayerWorldBounds.md | 51 - .../current/scripting/functions/ConnectNPC.md | 45 - .../scripting/functions/CountRunningTimers.md | 28 - .../scripting/functions/Create3DTextLabel.md | 96 - .../scripting/functions/CreateActor.md | 91 - .../scripting/functions/CreateExplosion.md | 55 - .../functions/CreateExplosionForPlayer.md | 56 - .../current/scripting/functions/CreateMenu.md | 65 - .../scripting/functions/CreateObject.md | 66 - .../scripting/functions/CreatePickup.md | 94 - .../functions/CreatePlayer3DTextLabel.md | 82 - .../functions/CreatePlayerGangZone.md | 86 - .../scripting/functions/CreatePlayerObject.md | 69 - .../scripting/functions/CreatePlayerPickup.md | 87 - .../functions/CreatePlayerTextDraw.md | 100 - .../scripting/functions/CreateVehicle.md | 72 - .../scripting/functions/DB_ExecuteQuery.md | 121 -- .../scripting/functions/DB_FreeResultSet.md | 111 - .../DB_GetDatabaseConnectionCount.md | 41 - .../functions/DB_GetDatabaseResultSetCount.md | 41 - .../scripting/functions/DB_GetFieldCount.md | 177 -- .../scripting/functions/DB_GetFieldFloat.md | 178 -- .../functions/DB_GetFieldFloatByName.md | 138 -- .../scripting/functions/DB_GetFieldInt.md | 178 -- .../functions/DB_GetFieldIntByName.md | 138 -- .../scripting/functions/DB_GetFieldName.md | 115 - .../scripting/functions/DB_GetFieldString.md | 177 -- .../functions/DB_GetFieldStringByName.md | 137 -- .../functions/DB_GetLegacyDBResult.md | 101 - .../scripting/functions/DB_GetMemHandle.md | 96 - .../scripting/functions/DB_GetRowCount.md | 134 -- .../scripting/functions/DB_SelectNextRow.md | 134 -- .../scripting/functions/Delete3DTextLabel.md | 45 - .../current/scripting/functions/DeletePVar.md | 48 - .../functions/DeletePlayer3DTextLabel.md | 58 - .../current/scripting/functions/DeleteSVar.md | 47 - .../scripting/functions/DestroyActor.md | 44 - .../scripting/functions/DestroyMenu.md | 39 - .../scripting/functions/DestroyObject.md | 50 - .../scripting/functions/DestroyPickup.md | 41 - .../functions/DestroyPlayerObject.md | 51 - .../functions/DestroyPlayerPickup.md | 46 - .../scripting/functions/DestroyVehicle.md | 44 - .../functions/DetachTrailerFromVehicle.md | 30 - .../functions/DisableInteriorEnterExits.md | 44 - .../scripting/functions/DisableMenu.md | 59 - .../scripting/functions/DisableMenuRow.md | 67 - .../scripting/functions/DisableNameTagLOS.md | 43 - .../functions/DisablePlayerCheckpoint.md | 46 - .../functions/DisablePlayerRaceCheckpoint.md | 44 - .../DisableRemoteVehicleCollisions.md | 46 - .../scripting/functions/EditAttachedObject.md | 67 - .../current/scripting/functions/EditObject.md | 61 - .../scripting/functions/EditPlayerClass.md | 46 - .../scripting/functions/EditPlayerObject.md | 59 - .../functions/EnableAllAnimations.md | 52 - .../functions/EnablePlayerCameraTarget.md | 40 - .../functions/EnableStuntBonusForAll.md | 44 - .../functions/EnableStuntBonusForPlayer.md | 35 - .../scripting/functions/EnableTirePopping.md | 43 - .../functions/EnableVehicleFriendlyFire.md | 24 - .../scripting/functions/EnableZoneNames.md | 46 - .../scripting/functions/EndObjectEditing.md | 45 - .../functions/FindModelFileNameFromCRC.md | 28 - .../functions/FindTextureFileNameFromCRC.md | 28 - .../functions/ForceClassSelection.md | 52 - .../scripting/functions/GameModeExit.md | 23 - .../scripting/functions/GameTextForAll.md | 62 - .../scripting/functions/GameTextForPlayer.md | 65 - .../scripting/functions/GangZoneCreate.md | 77 - .../scripting/functions/GangZoneDestroy.md | 50 - .../functions/GangZoneFlashForAll.md | 49 - .../functions/GangZoneFlashForPlayer.md | 50 - .../functions/GangZoneGetColourForPlayer.md | 38 - .../GangZoneGetFlashColourForPlayer.md | 38 - .../scripting/functions/GangZoneGetPos.md | 61 - .../scripting/functions/GangZoneHideForAll.md | 52 - .../functions/GangZoneHideForPlayer.md | 55 - .../scripting/functions/GangZoneShowForAll.md | 54 - .../functions/GangZoneShowForPlayer.md | 50 - .../functions/GangZoneStopFlashForAll.md | 56 - .../functions/GangZoneStopFlashForPlayer.md | 55 - .../functions/Get3DTextLabelAttachedData.md | 56 - .../functions/Get3DTextLabelColor.md | 39 - .../functions/Get3DTextLabelColour.md | 35 - .../functions/Get3DTextLabelDrawDistance.md | 37 - .../scripting/functions/Get3DTextLabelLOS.md | 37 - .../scripting/functions/Get3DTextLabelPos.md | 41 - .../scripting/functions/Get3DTextLabelText.md | 40 - .../functions/Get3DTextLabelVirtualWorld.md | 37 - .../scripting/functions/GetActorAnimation.md | 60 - .../functions/GetActorFacingAngle.md | 37 - .../scripting/functions/GetActorHealth.md | 50 - .../scripting/functions/GetActorPoolSize.md | 33 - .../scripting/functions/GetActorPos.md | 38 - .../scripting/functions/GetActorSkin.md | 40 - .../scripting/functions/GetActorSpawnInfo.md | 53 - .../functions/GetActorVirtualWorld.md | 46 - .../current/scripting/functions/GetActors.md | 35 - .../scripting/functions/GetAnimationName.md | 46 - .../functions/GetAvailableClasses.md | 24 - .../functions/GetConsoleVarAsBool.md | 45 - .../functions/GetConsoleVarAsFloat.md | 41 - .../scripting/functions/GetConsoleVarAsInt.md | 38 - .../functions/GetConsoleVarAsString.md | 59 - .../scripting/functions/GetCustomModelPath.md | 42 - .../functions/GetDefaultPlayerColour.md | 30 - .../scripting/functions/GetGameText.md | 54 - .../current/scripting/functions/GetGravity.md | 53 - .../scripting/functions/GetMaxPlayers.md | 33 - .../functions/GetMenuColumnHeader.md | 36 - .../scripting/functions/GetMenuColumnWidth.md | 37 - .../scripting/functions/GetMenuColumns.md | 31 - .../scripting/functions/GetMenuItem.md | 38 - .../scripting/functions/GetMenuItems.md | 33 - .../current/scripting/functions/GetMenuPos.md | 33 - .../scripting/functions/GetModeRestartTime.md | 29 - .../scripting/functions/GetMyFacingAngle.md | 33 - .../current/scripting/functions/GetMyPos.md | 32 - .../scripting/functions/GetNetworkStats.md | 69 - .../functions/GetObjectAttachedData.md | 41 - .../functions/GetObjectAttachedOffset.md | 47 - .../functions/GetObjectDrawDistance.md | 33 - .../scripting/functions/GetObjectMaterial.md | 56 - .../functions/GetObjectMaterialText.md | 68 - .../scripting/functions/GetObjectModel.md | 39 - .../scripting/functions/GetObjectMoveSpeed.md | 36 - .../functions/GetObjectMovingTargetPos.md | 47 - .../functions/GetObjectMovingTargetRot.md | 47 - .../scripting/functions/GetObjectPos.md | 61 - .../scripting/functions/GetObjectRot.md | 60 - .../functions/GetObjectSyncRotation.md | 36 - .../scripting/functions/GetObjectType.md | 48 - .../scripting/functions/GetPVarFloat.md | 52 - .../current/scripting/functions/GetPVarInt.md | 55 - .../scripting/functions/GetPVarNameAtIndex.md | 28 - .../scripting/functions/GetPVarString.md | 58 - .../scripting/functions/GetPVarType.md | 72 - .../scripting/functions/GetPVarsUpperIndex.md | 51 - .../scripting/functions/GetPickupModel.md | 54 - .../scripting/functions/GetPickupPos.md | 66 - .../scripting/functions/GetPickupType.md | 56 - .../functions/GetPickupVirtualWorld.md | 54 - .../functions/GetPlayer3DTextLabelAttached.md | 70 - .../GetPlayer3DTextLabelAttachedData.md | 58 - .../functions/GetPlayer3DTextLabelColor.md | 43 - .../functions/GetPlayer3DTextLabelColour.md | 39 - .../functions/GetPlayer3DTextLabelDrawDist.md | 52 - .../GetPlayer3DTextLabelDrawDistance.md | 40 - .../functions/GetPlayer3DTextLabelLOS.md | 40 - .../functions/GetPlayer3DTextLabelPos.md | 37 - .../functions/GetPlayer3DTextLabelText.md | 39 - .../GetPlayer3DTextLabelVirtualWorld.md | 47 - .../scripting/functions/GetPlayerAmmo.md | 50 - .../scripting/functions/GetPlayerAnimFlags.md | 30 - .../functions/GetPlayerAnimationFlags.md | 65 - .../functions/GetPlayerAnimationIndex.md | 44 - .../scripting/functions/GetPlayerArmour.md | 57 - .../functions/GetPlayerAttachedObject.md | 56 - .../functions/GetPlayerBuildingsRemoved.md | 38 - .../functions/GetPlayerCameraAspectRatio.md | 42 - .../functions/GetPlayerCameraFrontVector.md | 69 - .../functions/GetPlayerCameraMode.md | 46 - .../scripting/functions/GetPlayerCameraPos.md | 51 - .../functions/GetPlayerCameraTargetActor.md | 82 - .../functions/GetPlayerCameraTargetObject.md | 64 - .../functions/GetPlayerCameraTargetPlayer.md | 46 - .../GetPlayerCameraTargetPlayerObject.md | 67 - .../functions/GetPlayerCameraTargetVehicle.md | 77 - .../functions/GetPlayerCameraUpVector.md | 34 - .../functions/GetPlayerCameraZoom.md | 40 - .../functions/GetPlayerCheckpoint.md | 54 - .../scripting/functions/GetPlayerClass.md | 70 - .../scripting/functions/GetPlayerColor.md | 42 - .../functions/GetPlayerCustomSkin.md | 43 - .../scripting/functions/GetPlayerDialog.md | 45 - .../functions/GetPlayerDialogData.md | 61 - .../scripting/functions/GetPlayerDialogID.md | 41 - .../functions/GetPlayerDistanceFromPoint.md | 47 - .../functions/GetPlayerDrunkLevel.md | 35 - .../functions/GetPlayerFacingAngle.md | 63 - .../functions/GetPlayerFightingStyle.md | 74 - .../scripting/functions/GetPlayerGhostMode.md | 34 - .../scripting/functions/GetPlayerGravity.md | 42 - .../scripting/functions/GetPlayerHealth.md | 60 - .../functions/GetPlayerHydraReactorAngle.md | 28 - .../scripting/functions/GetPlayerInterior.md | 47 - .../scripting/functions/GetPlayerIp.md | 66 - .../scripting/functions/GetPlayerKeys.md | 67 - .../functions/GetPlayerLandingGearState.md | 32 - .../functions/GetPlayerLastShotVectors.md | 68 - .../functions/GetPlayerLastSyncedTrailerID.md | 38 - .../functions/GetPlayerLastSyncedVehicleID.md | 38 - .../functions/GetPlayerMarkerForPlayer.md | 39 - .../scripting/functions/GetPlayerMenu.md | 47 - .../scripting/functions/GetPlayerMoney.md | 34 - .../scripting/functions/GetPlayerName.md | 61 - .../functions/GetPlayerNetworkStats.md | 56 - .../functions/GetPlayerObjectAttachedData.md | 42 - .../GetPlayerObjectAttachedOffset.md | 48 - .../functions/GetPlayerObjectDrawDistance.md | 34 - .../functions/GetPlayerObjectMaterial.md | 57 - .../functions/GetPlayerObjectMaterialText.md | 69 - .../functions/GetPlayerObjectModel.md | 40 - .../functions/GetPlayerObjectMoveSpeed.md | 37 - .../GetPlayerObjectMovingTargetPos.md | 48 - .../GetPlayerObjectMovingTargetRot.md | 48 - .../scripting/functions/GetPlayerObjectPos.md | 66 - .../scripting/functions/GetPlayerObjectRot.md | 62 - .../functions/GetPlayerObjectSyncRotation.md | 37 - .../functions/GetPlayerPickupModel.md | 50 - .../scripting/functions/GetPlayerPickupPos.md | 60 - .../functions/GetPlayerPickupType.md | 52 - .../functions/GetPlayerPickupVirtualWorld.md | 50 - .../scripting/functions/GetPlayerPing.md | 83 - .../scripting/functions/GetPlayerPoolSize.md | 30 - .../scripting/functions/GetPlayerPos.md | 55 - .../functions/GetPlayerRaceCheckpoint.md | 60 - .../scripting/functions/GetPlayerRawIp.md | 44 - .../functions/GetPlayerRotationQuat.md | 54 - .../scripting/functions/GetPlayerScore.md | 39 - .../functions/GetPlayerSirenState.md | 50 - .../functions/GetPlayerSkillLevel.md | 58 - .../scripting/functions/GetPlayerSkin.md | 54 - .../functions/GetPlayerSpecialAction.md | 41 - .../functions/GetPlayerSpectateID.md | 54 - .../functions/GetPlayerSpectateType.md | 46 - .../scripting/functions/GetPlayerState.md | 47 - .../functions/GetPlayerSurfingObjectID.md | 42 - .../functions/GetPlayerSurfingOffsets.md | 45 - .../GetPlayerSurfingPlayerObjectID.md | 44 - .../functions/GetPlayerSurfingVehicleID.md | 37 - .../functions/GetPlayerTargetActor.md | 52 - .../functions/GetPlayerTargetPlayer.md | 49 - .../scripting/functions/GetPlayerTeam.md | 48 - .../scripting/functions/GetPlayerTime.md | 41 - .../functions/GetPlayerTrainSpeed.md | 29 - .../scripting/functions/GetPlayerVehicleID.md | 38 - .../functions/GetPlayerVehicleSeat.md | 60 - .../scripting/functions/GetPlayerVelocity.md | 47 - .../scripting/functions/GetPlayerVersion.md | 56 - .../functions/GetPlayerVirtualWorld.md | 48 - .../functions/GetPlayerWantedLevel.md | 46 - .../scripting/functions/GetPlayerWeapon.md | 62 - .../functions/GetPlayerWeaponData.md | 66 - .../functions/GetPlayerWeaponState.md | 54 - .../scripting/functions/GetPlayerWeather.md | 38 - .../functions/GetPlayerWorldBounds.md | 51 - .../scripting/functions/GetPlayerZAim.md | 32 - .../current/scripting/functions/GetPlayers.md | 39 - .../functions/GetRandomVehicleColourPair.md | 37 - .../scripting/functions/GetRunningTimers.md | 32 - .../scripting/functions/GetSVarFloat.md | 41 - .../current/scripting/functions/GetSVarInt.md | 41 - .../scripting/functions/GetSVarNameAtIndex.md | 27 - .../scripting/functions/GetSVarString.md | 43 - .../scripting/functions/GetSVarType.md | 71 - .../scripting/functions/GetSVarsUpperIndex.md | 41 - .../scripting/functions/GetServerRuleFlags.md | 43 - .../scripting/functions/GetServerTickRate.md | 20 - .../scripting/functions/GetServerVarAsBool.md | 51 - .../scripting/functions/GetServerVarAsInt.md | 44 - .../functions/GetServerVarAsString.md | 62 - .../scripting/functions/GetSpawnInfo.md | 75 - .../scripting/functions/GetTickCount.md | 73 - .../scripting/functions/GetTimerInterval.md | 47 - .../scripting/functions/GetTimerRemaining.md | 47 - .../scripting/functions/GetVehicleCab.md | 30 - .../scripting/functions/GetVehicleColours.md | 46 - .../functions/GetVehicleComponentInSlot.md | 73 - .../functions/GetVehicleComponentType.md | 53 - .../functions/GetVehicleDamageStatus.md | 62 - .../functions/GetVehicleDistanceFromPoint.md | 48 - .../scripting/functions/GetVehicleDriver.md | 42 - .../scripting/functions/GetVehicleHealth.md | 73 - .../functions/GetVehicleHydraReactorAngle.md | 28 - .../scripting/functions/GetVehicleInterior.md | 40 - .../functions/GetVehicleLandingGearState.md | 32 - .../functions/GetVehicleLastDriver.md | 52 - .../scripting/functions/GetVehicleMatrix.md | 48 - .../scripting/functions/GetVehicleModel.md | 42 - .../functions/GetVehicleModelCount.md | 37 - .../functions/GetVehicleModelInfo.md | 41 - .../functions/GetVehicleModelsUsed.md | 25 - .../functions/GetVehicleNumberPlate.md | 39 - .../functions/GetVehicleOccupiedTick.md | 39 - .../scripting/functions/GetVehiclePaintjob.md | 40 - .../functions/GetVehicleParamsCarDoors.md | 44 - .../functions/GetVehicleParamsCarWindows.md | 44 - .../scripting/functions/GetVehicleParamsEx.md | 50 - .../functions/GetVehicleParamsSirenState.md | 56 - .../scripting/functions/GetVehiclePoolSize.md | 29 - .../scripting/functions/GetVehiclePos.md | 59 - .../functions/GetVehicleRespawnDelay.md | 35 - .../functions/GetVehicleRespawnTick.md | 39 - .../functions/GetVehicleRotationQuat.md | 53 - .../scripting/functions/GetVehicleSeats.md | 38 - .../functions/GetVehicleSirenState.md | 41 - .../functions/GetVehicleSpawnInfo.md | 48 - .../scripting/functions/GetVehicleTower.md | 34 - .../scripting/functions/GetVehicleTrailer.md | 40 - .../functions/GetVehicleTrainSpeed.md | 30 - .../scripting/functions/GetVehicleVelocity.md | 65 - .../functions/GetVehicleVirtualWorld.md | 31 - .../scripting/functions/GetVehicleZAngle.md | 55 - .../scripting/functions/GetVehicles.md | 35 - .../scripting/functions/GetWeaponName.md | 62 - .../scripting/functions/GetWeaponSlot.md | 49 - .../current/scripting/functions/GetWeather.md | 31 - .../scripting/functions/GetWorldTime.md | 26 - .../scripting/functions/GivePlayerMoney.md | 43 - .../scripting/functions/GivePlayerWeapon.md | 39 - .../current/scripting/functions/HTTP.md | 88 - .../scripting/functions/HasGameText.md | 44 - .../functions/HasObjectCameraCollision.md | 40 - .../HasPlayerObjectCameraCollision.md | 41 - .../functions/HasVehicleBeenOccupied.md | 41 - .../scripting/functions/HideGameTextForAll.md | 46 - .../functions/HideGameTextForPlayer.md | 40 - .../scripting/functions/HideMenuForPlayer.md | 73 - .../functions/HideObjectForPlayer.md | 49 - .../functions/HidePickupForPlayer.md | 58 - .../scripting/functions/HidePlayerDialog.md | 49 - .../scripting/functions/HideVehicle.md | 40 - .../functions/InterpolateCameraLookAt.md | 63 - .../functions/InterpolateCameraPos.md | 61 - .../functions/Is3DTextLabelStreamedIn.md | 47 - .../functions/IsActorInvulnerable.md | 49 - .../scripting/functions/IsActorStreamedIn.md | 47 - .../functions/IsAdminTeleportAllowed.md | 33 - .../current/scripting/functions/IsBanned.md | 46 - .../functions/IsGangZoneFlashingForPlayer.md | 38 - .../functions/IsGangZoneVisibleForPlayer.md | 37 - .../scripting/functions/IsMenuDisabled.md | 25 - .../scripting/functions/IsMenuRowDisabled.md | 25 - .../functions/IsNickNameCharacterAllowed.md | 39 - .../functions/IsObjectHiddenForPlayer.md | 66 - .../functions/IsObjectMaterialSlotUsed.md | 55 - .../scripting/functions/IsObjectMoving.md | 47 - .../functions/IsPickupHiddenForPlayer.md | 63 - .../scripting/functions/IsPickupStreamedIn.md | 61 - .../scripting/functions/IsPlayerAdmin.md | 42 - .../IsPlayerAttachedObjectSlotUsed.md | 56 - .../functions/IsPlayerCameraTargetEnabled.md | 40 - .../functions/IsPlayerCheckpointActive.md | 38 - .../scripting/functions/IsPlayerConnected.md | 53 - .../functions/IsPlayerControllable.md | 41 - .../scripting/functions/IsPlayerCuffed.md | 32 - .../functions/IsPlayerGangZoneFlashing.md | 71 - .../functions/IsPlayerGangZoneVisible.md | 72 - .../functions/IsPlayerInAnyVehicle.md | 46 - .../functions/IsPlayerInCheckpoint.md | 43 - .../functions/IsPlayerInDriveByMode.md | 30 - .../scripting/functions/IsPlayerInGangZone.md | 44 - .../scripting/functions/IsPlayerInModShop.md | 52 - .../functions/IsPlayerInPlayerGangZone.md | 69 - .../functions/IsPlayerInRaceCheckpoint.md | 45 - .../functions/IsPlayerInRangeOfPoint.md | 47 - .../scripting/functions/IsPlayerInVehicle.md | 51 - .../scripting/functions/IsPlayerNPC.md | 40 - .../IsPlayerObjectMaterialSlotUsed.md | 56 - .../functions/IsPlayerObjectMoving.md | 66 - .../functions/IsPlayerPickupStreamedIn.md | 57 - .../functions/IsPlayerRaceCheckpointActive.md | 38 - .../scripting/functions/IsPlayerSpawned.md | 40 - .../scripting/functions/IsPlayerStreamedIn.md | 58 - .../functions/IsPlayerTeleportAllowed.md | 45 - .../functions/IsPlayerTextDrawVisible.md | 63 - .../functions/IsPlayerUsingOfficialClient.md | 39 - .../functions/IsPlayerWidescreenToggled.md | 40 - .../scripting/functions/IsRepeatingTimer.md | 49 - .../functions/IsTextDrawVisibleForPlayer.md | 56 - .../functions/IsTrailerAttachedToVehicle.md | 35 - .../scripting/functions/IsValid3DTextLabel.md | 42 - .../scripting/functions/IsValidActor.md | 45 - .../functions/IsValidAnimationLibrary.md | 41 - .../scripting/functions/IsValidCustomModel.md | 28 - .../scripting/functions/IsValidGangZone.md | 34 - .../scripting/functions/IsValidMenu.md | 36 - .../scripting/functions/IsValidNickName.md | 47 - .../scripting/functions/IsValidObject.md | 71 - .../scripting/functions/IsValidPickup.md | 56 - .../functions/IsValidPlayer3DTextLabel.md | 41 - .../functions/IsValidPlayerGangZone.md | 63 - .../functions/IsValidPlayerObject.md | 63 - .../functions/IsValidPlayerPickup.md | 53 - .../functions/IsValidPlayerTextDraw.md | 64 - .../scripting/functions/IsValidServerRule.md | 38 - .../scripting/functions/IsValidTextDraw.md | 64 - .../scripting/functions/IsValidTimer.md | 58 - .../scripting/functions/IsValidVehicle.md | 63 - .../scripting/functions/IsVehicleDead.md | 41 - .../scripting/functions/IsVehicleHidden.md | 48 - .../scripting/functions/IsVehicleOccupied.md | 41 - .../functions/IsVehicleSirenEnabled.md | 43 - .../functions/IsVehicleStreamedIn.md | 50 - .../current/scripting/functions/Kick.md | 62 - .../current/scripting/functions/KillTimer.md | 54 - .../functions/LimitGlobalChatRadius.md | 38 - .../functions/LimitPlayerMarkerRadius.md | 33 - .../functions/LinkVehicleToInterior.md | 41 - .../functions/ManualVehicleEngineAndLights.md | 44 - .../current/scripting/functions/MoveObject.md | 85 - .../scripting/functions/MovePlayerObject.md | 72 - .../functions/NetStats_BytesReceived.md | 48 - .../scripting/functions/NetStats_BytesSent.md | 48 - .../functions/NetStats_ConnectionStatus.md | 71 - .../functions/NetStats_GetConnectedTime.md | 56 - .../scripting/functions/NetStats_GetIpPort.md | 52 - .../functions/NetStats_MessagesReceived.md | 48 - .../NetStats_MessagesRecvPerSecond.md | 46 - .../functions/NetStats_MessagesSent.md | 46 - .../functions/NetStats_PacketLossPercent.md | 88 - .../functions/PauseRecordingPlayback.md | 15 - .../functions/PlayAudioStreamForPlayer.md | 52 - .../functions/PlayCrimeReportForPlayer.md | 45 - .../functions/PlayerGangZoneDestroy.md | 64 - .../functions/PlayerGangZoneFlash.md | 60 - .../functions/PlayerGangZoneGetColour.md | 58 - .../functions/PlayerGangZoneGetFlashColour.md | 61 - .../functions/PlayerGangZoneGetPos.md | 62 - .../scripting/functions/PlayerGangZoneHide.md | 61 - .../scripting/functions/PlayerGangZoneShow.md | 57 - .../functions/PlayerGangZoneStopFlash.md | 69 - .../functions/PlayerHasClockEnabled.md | 49 - .../scripting/functions/PlayerPlaySound.md | 51 - .../functions/PlayerSpectatePlayer.md | 53 - .../functions/PlayerSpectateVehicle.md | 49 - .../functions/PlayerTextDrawAlignment.md | 72 - .../PlayerTextDrawBackgroundColor.md | 61 - .../PlayerTextDrawBackgroundColour.md | 63 - .../functions/PlayerTextDrawBoxColor.md | 52 - .../functions/PlayerTextDrawBoxColour.md | 54 - .../functions/PlayerTextDrawColor.md | 62 - .../functions/PlayerTextDrawColour.md | 64 - .../functions/PlayerTextDrawDestroy.md | 55 - .../scripting/functions/PlayerTextDrawFont.md | 74 - .../functions/PlayerTextDrawGetAlignment.md | 58 - .../PlayerTextDrawGetBackgroundCol.md | 57 - .../PlayerTextDrawGetBackgroundColour.md | 57 - .../functions/PlayerTextDrawGetBoxColor.md | 57 - .../functions/PlayerTextDrawGetBoxColour.md | 57 - .../functions/PlayerTextDrawGetColor.md | 56 - .../functions/PlayerTextDrawGetColour.md | 56 - .../functions/PlayerTextDrawGetFont.md | 59 - .../functions/PlayerTextDrawGetLetterSize.md | 63 - .../functions/PlayerTextDrawGetOutline.md | 58 - .../functions/PlayerTextDrawGetPos.md | 57 - .../PlayerTextDrawGetPreviewModel.md | 64 - .../functions/PlayerTextDrawGetPreviewRot.md | 57 - .../PlayerTextDrawGetPreviewVehCol.md | 52 - .../PlayerTextDrawGetPreviewVehicleColours.md | 52 - .../functions/PlayerTextDrawGetShadow.md | 59 - .../functions/PlayerTextDrawGetString.md | 62 - .../functions/PlayerTextDrawGetTextSize.md | 63 - .../scripting/functions/PlayerTextDrawHide.md | 57 - .../functions/PlayerTextDrawIsBox.md | 68 - .../functions/PlayerTextDrawIsProportional.md | 67 - .../functions/PlayerTextDrawIsSelectable.md | 69 - .../functions/PlayerTextDrawLetterSize.md | 69 - .../functions/PlayerTextDrawSetOutline.md | 54 - .../functions/PlayerTextDrawSetPos.md | 55 - .../PlayerTextDrawSetPreviewModel.md | 63 - .../functions/PlayerTextDrawSetPreviewRot.md | 62 - .../PlayerTextDrawSetPreviewVehCol.md | 60 - .../PlayerTextDrawSetPreviewVehicleColours.md | 62 - .../PlayerTextDrawSetProportional.md | 54 - .../functions/PlayerTextDrawSetSelectable.md | 66 - .../functions/PlayerTextDrawSetShadow.md | 64 - .../functions/PlayerTextDrawSetString.md | 101 - .../scripting/functions/PlayerTextDrawShow.md | 59 - .../functions/PlayerTextDrawTextSize.md | 69 - .../functions/PlayerTextDrawUseBox.md | 53 - .../scripting/functions/PutPlayerInVehicle.md | 65 - .../scripting/functions/RedirectDownload.md | 71 - .../functions/RemoveBuildingForPlayer.md | 63 - .../functions/RemovePlayerAttachedObject.md | 44 - .../functions/RemovePlayerFromVehicle.md | 49 - .../functions/RemovePlayerMapIcon.md | 34 - .../scripting/functions/RemovePlayerWeapon.md | 40 - .../scripting/functions/RemoveServerRule.md | 31 - .../functions/RemoveVehicleComponent.md | 45 - .../scripting/functions/RepairVehicle.md | 46 - .../scripting/functions/ResetPlayerMoney.md | 36 - .../scripting/functions/ResetPlayerWeapons.md | 45 - .../functions/ResumeRecordingPlayback.md | 15 - .../scripting/functions/SHA256_PassHash.md | 61 - .../scripting/functions/SelectObject.md | 44 - .../scripting/functions/SelectTextDraw.md | 53 - .../current/scripting/functions/SendChat.md | 31 - .../scripting/functions/SendClientCheck.md | 71 - .../scripting/functions/SendClientMessage.md | 71 - .../functions/SendClientMessageToAll.md | 61 - .../functions/SendClientMessageToAllf.md | 47 - .../scripting/functions/SendClientMessagef.md | 74 - .../scripting/functions/SendCommand.md | 35 - .../scripting/functions/SendDeathMessage.md | 56 - .../functions/SendDeathMessageToPlayer.md | 43 - .../functions/SendPlayerMessageToAll.md | 53 - .../functions/SendPlayerMessageToPlayer.md | 56 - .../scripting/functions/SendRconCommand.md | 61 - .../functions/Set3DTextLabelDrawDistance.md | 37 - .../scripting/functions/Set3DTextLabelLOS.md | 33 - .../functions/Set3DTextLabelVirtualWorld.md | 33 - .../functions/SetActorFacingAngle.md | 57 - .../scripting/functions/SetActorHealth.md | 42 - .../functions/SetActorInvulnerable.md | 48 - .../scripting/functions/SetActorPos.md | 53 - .../scripting/functions/SetActorSkin.md | 41 - .../functions/SetActorVirtualWorld.md | 44 - .../functions/SetCameraBehindPlayer.md | 31 - .../scripting/functions/SetDeathDropAmount.md | 51 - .../scripting/functions/SetGameModeText.md | 41 - .../current/scripting/functions/SetGravity.md | 45 - .../functions/SetMenuColumnHeader.md | 59 - .../scripting/functions/SetModeRestartTime.md | 57 - .../scripting/functions/SetMyFacingAngle.md | 32 - .../current/scripting/functions/SetMyPos.md | 30 - .../functions/SetNameTagDrawDistance.md | 38 - .../scripting/functions/SetObjectMaterial.md | 71 - .../functions/SetObjectMaterialText.md | 77 - .../scripting/functions/SetObjectMoveSpeed.md | 39 - .../functions/SetObjectNoCameraCol.md | 49 - .../functions/SetObjectNoCameraCollision.md | 50 - .../scripting/functions/SetObjectPos.md | 49 - .../scripting/functions/SetObjectRot.md | 55 - .../functions/SetObjectsDefaultCameraCol.md | 74 - .../SetObjectsDefaultCameraCollision.md | 74 - .../scripting/functions/SetPVarFloat.md | 54 - .../current/scripting/functions/SetPVarInt.md | 49 - .../scripting/functions/SetPVarString.md | 59 - .../scripting/functions/SetPickupForPlayer.md | 71 - .../scripting/functions/SetPickupModel.md | 55 - .../scripting/functions/SetPickupPos.md | 57 - .../scripting/functions/SetPickupType.md | 55 - .../functions/SetPickupVirtualWorld.md | 54 - .../SetPlayer3DTextLabelVirtualWorld.md | 44 - .../scripting/functions/SetPlayerAdmin.md | 44 - .../scripting/functions/SetPlayerAmmo.md | 48 - .../functions/SetPlayerArmedWeapon.md | 64 - .../scripting/functions/SetPlayerArmour.md | 52 - .../functions/SetPlayerAttachedObject.md | 71 - .../functions/SetPlayerCameraLookAt.md | 50 - .../scripting/functions/SetPlayerCameraPos.md | 49 - .../functions/SetPlayerChatBubble.md | 52 - .../functions/SetPlayerCheckpoint.md | 76 - .../scripting/functions/SetPlayerColor.md | 48 - .../functions/SetPlayerDrunkLevel.md | 52 - .../functions/SetPlayerFacingAngle.md | 49 - .../functions/SetPlayerFightingStyle.md | 50 - .../scripting/functions/SetPlayerGravity.md | 49 - .../scripting/functions/SetPlayerHealth.md | 63 - .../functions/SetPlayerHoldingObject.md | 54 - .../scripting/functions/SetPlayerInterior.md | 38 - .../scripting/functions/SetPlayerMapIcon.md | 64 - .../functions/SetPlayerMarkerForPlayer.md | 44 - .../scripting/functions/SetPlayerName.md | 73 - .../functions/SetPlayerObjectMaterial.md | 69 - .../functions/SetPlayerObjectMaterialText.md | 64 - .../functions/SetPlayerObjectMoveSpeed.md | 40 - .../functions/SetPlayerObjectNoCameraCol.md | 50 - .../SetPlayerObjectNoCameraCollision.md | 50 - .../scripting/functions/SetPlayerObjectPos.md | 61 - .../scripting/functions/SetPlayerObjectRot.md | 68 - .../functions/SetPlayerPickupModel.md | 51 - .../scripting/functions/SetPlayerPickupPos.md | 53 - .../functions/SetPlayerPickupType.md | 51 - .../functions/SetPlayerPickupVirtualWorld.md | 50 - .../scripting/functions/SetPlayerPos.md | 59 - .../scripting/functions/SetPlayerPosFindZ.md | 45 - .../functions/SetPlayerRaceCheckpoint.md | 88 - .../scripting/functions/SetPlayerScore.md | 39 - .../scripting/functions/SetPlayerShopName.md | 53 - .../functions/SetPlayerSkillLevel.md | 49 - .../scripting/functions/SetPlayerSkin.md | 108 - .../functions/SetPlayerSpecialAction.md | 57 - .../scripting/functions/SetPlayerTeam.md | 48 - .../scripting/functions/SetPlayerTime.md | 55 - .../scripting/functions/SetPlayerVelocity.md | 43 - .../functions/SetPlayerVirtualWorld.md | 48 - .../functions/SetPlayerWantedLevel.md | 41 - .../scripting/functions/SetPlayerWeather.md | 52 - .../functions/SetPlayerWorldBounds.md | 64 - .../scripting/functions/SetSVarFloat.md | 42 - .../current/scripting/functions/SetSVarInt.md | 42 - .../scripting/functions/SetSVarString.md | 45 - .../scripting/functions/SetServerRule.md | 47 - .../scripting/functions/SetServerRuleFlags.md | 47 - .../scripting/functions/SetSpawnInfo.md | 64 - .../scripting/functions/SetTeamCount.md | 34 - .../current/scripting/functions/SetTimer.md | 78 - .../current/scripting/functions/SetTimerEx.md | 101 - .../functions/SetVehicleAngularVelocity.md | 58 - .../functions/SetVehicleBeenOccupied.md | 35 - .../scripting/functions/SetVehicleDead.md | 35 - .../scripting/functions/SetVehicleHealth.md | 61 - .../functions/SetVehicleNumberPlate.md | 55 - .../functions/SetVehicleOccupiedTick.md | 47 - .../functions/SetVehicleParamsCarDoors.md | 32 - .../functions/SetVehicleParamsCarWindows.md | 32 - .../scripting/functions/SetVehicleParamsEx.md | 93 - .../functions/SetVehicleParamsForPlayer.md | 122 -- .../functions/SetVehicleParamsSirenState.md | 31 - .../scripting/functions/SetVehiclePos.md | 47 - .../functions/SetVehicleRespawnDelay.md | 35 - .../functions/SetVehicleRespawnTick.md | 47 - .../functions/SetVehicleSpawnInfo.md | 43 - .../functions/SetVehicleToRespawn.md | 35 - .../scripting/functions/SetVehicleVelocity.md | 51 - .../functions/SetVehicleVirtualWorld.md | 31 - .../scripting/functions/SetVehicleZAngle.md | 58 - .../current/scripting/functions/SetWeather.md | 51 - .../scripting/functions/SetWorldTime.md | 46 - .../scripting/functions/ShowMenuForPlayer.md | 63 - .../scripting/functions/ShowNameTags.md | 53 - .../functions/ShowObjectForPlayer.md | 55 - .../functions/ShowPickupForPlayer.md | 58 - .../scripting/functions/ShowPlayerDialog.md | 97 - .../scripting/functions/ShowPlayerMarkers.md | 55 - .../functions/ShowPlayerNameTagForPlayer.md | 55 - .../scripting/functions/ShowVehicle.md | 55 - .../scripting/functions/SpawnPlayer.md | 54 - .../functions/StartRecordingPlayback.md | 28 - .../functions/StartRecordingPlayerData.md | 46 - .../functions/StopAudioStreamForPlayer.md | 37 - .../current/scripting/functions/StopObject.md | 65 - .../functions/StopPlayerHoldingObject.md | 43 - .../scripting/functions/StopPlayerObject.md | 67 - .../functions/StopRecordingPlayback.MD | 24 - .../functions/StopRecordingPlayerData.md | 36 - .../scripting/functions/TextDrawAlignment.md | 73 - .../functions/TextDrawBackgroundColor.md | 68 - .../functions/TextDrawBackgroundColour.md | 69 - .../scripting/functions/TextDrawBoxColor.md | 61 - .../scripting/functions/TextDrawBoxColour.md | 63 - .../scripting/functions/TextDrawColor.md | 60 - .../scripting/functions/TextDrawColour.md | 62 - .../scripting/functions/TextDrawCreate.md | 109 - .../scripting/functions/TextDrawDestroy.md | 56 - .../scripting/functions/TextDrawFont.md | 76 - .../functions/TextDrawGetAlignment.md | 56 - .../functions/TextDrawGetBackgroundColor.md | 57 - .../functions/TextDrawGetBackgroundColour.md | 57 - .../functions/TextDrawGetBoxColor.md | 57 - .../functions/TextDrawGetBoxColour.md | 57 - .../scripting/functions/TextDrawGetColor.md | 56 - .../scripting/functions/TextDrawGetColour.md | 56 - .../scripting/functions/TextDrawGetFont.md | 57 - .../functions/TextDrawGetLetterSize.md | 60 - .../scripting/functions/TextDrawGetOutline.md | 57 - .../scripting/functions/TextDrawGetPos.md | 55 - .../functions/TextDrawGetPreviewModel.md | 61 - .../functions/TextDrawGetPreviewRot.md | 57 - .../functions/TextDrawGetPreviewVehCol.md | 51 - .../TextDrawGetPreviewVehicleColours.md | 51 - .../scripting/functions/TextDrawGetShadow.md | 57 - .../scripting/functions/TextDrawGetString.md | 60 - .../functions/TextDrawGetTextSize.md | 60 - .../scripting/functions/TextDrawHideForAll.md | 51 - .../functions/TextDrawHideForPlayer.md | 56 - .../scripting/functions/TextDrawIsBox.md | 65 - .../functions/TextDrawIsProportional.md | 65 - .../functions/TextDrawIsSelectable.md | 67 - .../scripting/functions/TextDrawLetterSize.md | 71 - .../scripting/functions/TextDrawSetOutline.md | 61 - .../scripting/functions/TextDrawSetPos.md | 53 - .../functions/TextDrawSetPreviewModel.md | 67 - .../functions/TextDrawSetPreviewRot.md | 62 - .../functions/TextDrawSetPreviewVehCol.md | 58 - .../TextDrawSetPreviewVehicleColours.md | 60 - .../functions/TextDrawSetProportional.md | 62 - .../functions/TextDrawSetSelectable.md | 57 - .../scripting/functions/TextDrawSetShadow.md | 69 - .../scripting/functions/TextDrawSetString.md | 80 - .../functions/TextDrawSetStringForPlayer.md | 91 - .../scripting/functions/TextDrawShowForAll.md | 48 - .../functions/TextDrawShowForPlayer.md | 54 - .../scripting/functions/TextDrawTextSize.md | 71 - .../scripting/functions/TextDrawUseBox.md | 63 - .../current/scripting/functions/Tickcount.md | 24 - .../functions/ToggleChatTextReplacement.md | 48 - .../scripting/functions/TogglePlayerClock.md | 46 - .../functions/TogglePlayerControllable.md | 46 - .../functions/TogglePlayerGhostMode.md | 41 - .../functions/TogglePlayerSpectating.md | 57 - .../functions/TogglePlayerWidescreen.md | 52 - .../functions/ToggleVehicleSirenEnabled.md | 30 - .../scripting/functions/UnBlockIpAddress.md | 37 - .../functions/Update3DTextLabelText.md | 55 - .../functions/UpdatePlayer3DTextLabelText.md | 38 - .../functions/UpdateVehicleDamageStatus.md | 66 - .../scripting/functions/UseGangZoneCheck.md | 84 - .../functions/UsePlayerGangZoneCheck.md | 87 - .../scripting/functions/UsePlayerPedAnims.md | 45 - .../current/scripting/functions/VectorSize.md | 35 - .../functions/VehicleCanHaveComponent.md | 49 - .../functions/VehicleColourIndexToColour.md | 30 - .../current/scripting/functions/acos.md | 44 - .../current/scripting/functions/argcount.md | 20 - .../current/scripting/functions/argindex.md | 33 - .../current/scripting/functions/argstr.md | 28 - .../current/scripting/functions/argvalue.md | 32 - .../current/scripting/functions/asin.md | 44 - .../current/scripting/functions/atan.md | 44 - .../current/scripting/functions/atan2.md | 52 - .../current/scripting/functions/clamp.md | 35 - .../current/scripting/functions/db_close.md | 120 -- .../scripting/functions/db_debug_openfiles.md | 37 - .../functions/db_debug_openresults.md | 37 - .../scripting/functions/db_field_name.md | 115 - .../scripting/functions/db_free_result.md | 111 - .../scripting/functions/db_get_field.md | 177 -- .../scripting/functions/db_get_field_assoc.md | 137 -- .../functions/db_get_field_assoc_float.md | 138 -- .../functions/db_get_field_assoc_int.md | 138 -- .../scripting/functions/db_get_field_float.md | 178 -- .../scripting/functions/db_get_field_int.md | 178 -- .../scripting/functions/db_get_mem_handle.md | 98 - .../functions/db_get_result_mem_handle.md | 103 - .../scripting/functions/db_next_row.md | 134 -- .../scripting/functions/db_num_fields.md | 177 -- .../scripting/functions/db_num_rows.md | 134 -- .../current/scripting/functions/db_open.md | 123 -- .../current/scripting/functions/db_query.md | 120 -- .../scripting/functions/deleteproperty.md | 42 - .../current/scripting/functions/diskfree.md | 68 - .../scripting/functions/existproperty.md | 45 - .../scripting/functions/existpubvar.md | 26 - .../current/scripting/functions/fattrib.md | 74 - .../current/scripting/functions/fblockread.md | 108 - .../scripting/functions/fblockwrite.md | 92 - .../current/scripting/functions/fclose.md | 79 - .../current/scripting/functions/fcopy.md | 70 - .../current/scripting/functions/fcreatedir.md | 69 - .../current/scripting/functions/fexist.md | 63 - .../current/scripting/functions/fflush.md | 74 - .../current/scripting/functions/fgetchar.md | 84 - .../current/scripting/functions/filecrc.md | 72 - .../current/scripting/functions/flength.md | 77 - .../current/scripting/functions/float.md | 33 - .../current/scripting/functions/floatabs.md | 30 - .../current/scripting/functions/floatadd.md | 39 - .../current/scripting/functions/floatcmp.md | 33 - .../current/scripting/functions/floatcos.md | 49 - .../current/scripting/functions/floatdiv.md | 39 - .../current/scripting/functions/floatfract.md | 30 - .../current/scripting/functions/floatlog.md | 36 - .../current/scripting/functions/floatmul.md | 47 - .../current/scripting/functions/floatpower.md | 33 - .../current/scripting/functions/floatround.md | 51 - .../current/scripting/functions/floatsin.md | 57 - .../scripting/functions/floatsqroot.md | 39 - .../current/scripting/functions/floatstr.md | 35 - .../current/scripting/functions/floatsub.md | 39 - .../current/scripting/functions/floattan.md | 49 - .../current/scripting/functions/fmatch.md | 71 - .../current/scripting/functions/fopen.md | 184 -- .../current/scripting/functions/format.md | 92 - .../current/scripting/functions/fputchar.md | 78 - .../current/scripting/functions/fread.md | 122 -- .../current/scripting/functions/fremove.md | 89 - .../current/scripting/functions/frename.md | 62 - .../current/scripting/functions/fseek.md | 89 - .../current/scripting/functions/fstat.md | 74 - .../current/scripting/functions/ftell.md | 69 - .../current/scripting/functions/ftemp.md | 139 -- .../current/scripting/functions/funcidx.md | 37 - .../current/scripting/functions/fwrite.md | 144 -- .../current/scripting/functions/getarg.md | 42 - .../current/scripting/functions/getdate.md | 35 - .../scripting/functions/getproperty.md | 49 - .../current/scripting/functions/getpubvar.md | 26 - .../current/scripting/functions/gettime.md | 48 - .../current/scripting/functions/gpci.md | 80 - .../current/scripting/functions/heapspace.md | 22 - .../current/scripting/functions/ispacked.md | 37 - .../current/scripting/functions/listenport.md | 40 - .../current/scripting/functions/max.md | 45 - .../current/scripting/functions/memcpy.md | 49 - .../current/scripting/functions/min.md | 46 - .../current/scripting/functions/numargs.md | 34 - .../current/scripting/functions/numpubvars.md | 22 - .../current/scripting/functions/print.md | 54 - .../current/scripting/functions/printf.md | 65 - .../current/scripting/functions/random.md | 56 - .../current/scripting/functions/sendpacket.md | 33 - .../current/scripting/functions/sendstring.md | 32 - .../current/scripting/functions/setarg.md | 27 - .../scripting/functions/setproperty.md | 57 - .../current/scripting/functions/setpubvar.md | 27 - .../current/scripting/functions/strcat.md | 42 - .../current/scripting/functions/strcmp.md | 76 - .../current/scripting/functions/strcopy.md | 38 - .../current/scripting/functions/strdel.md | 40 - .../current/scripting/functions/strequal.md | 54 - .../current/scripting/functions/strfind.md | 43 - .../current/scripting/functions/strfloat.md | 45 - .../current/scripting/functions/strins.md | 49 - .../current/scripting/functions/strlen.md | 37 - .../current/scripting/functions/strmid.md | 42 - .../current/scripting/functions/strpack.md | 40 - .../current/scripting/functions/strunpack.md | 44 - .../current/scripting/functions/strval.md | 38 - .../current/scripting/functions/swapchars.md | 18 - .../current/scripting/functions/tolower.md | 35 - .../current/scripting/functions/toupper.md | 35 - .../current/scripting/functions/uudecode.md | 33 - .../current/scripting/functions/uuencode.md | 34 - .../current/scripting/functions/valstr.md | 58 - .../scripting/resources/Componentslots.md | 30 - .../current/scripting/resources/anglemodes.md | 17 - .../current/scripting/resources/animations.md | 1893 ---------------- .../current/scripting/resources/bodyparts.md | 32 - .../current/scripting/resources/boneid.md | 31 - .../scripting/resources/bullethittypes.md | 28 - .../scripting/resources/callbacks-sequence.md | 79 - .../scripting/resources/cameracutstyles.md | 17 - .../scripting/resources/cameramodes.md | 38 - .../scripting/resources/carcomponentid.md | 423 ---- .../scripting/resources/clicksources.md | 16 - .../scripting/resources/connectionstatus.md | 24 - .../current/scripting/resources/constants.md | 408 ---- .../current/scripting/resources/crimelist.md | 33 - .../scripting/resources/damagestatus.md | 86 - .../scripting/resources/dialogstyles.md | 269 --- .../current/scripting/resources/doorstates.md | 163 -- .../scripting/resources/download-requests.md | 18 - .../scripting/resources/escapecodes.md | 31 - .../scripting/resources/explosionlist.md | 33 - .../scripting/resources/fightingstyles.md | 19 - .../current/scripting/resources/file-modes.md | 18 - .../scripting/resources/file-seek-whence.md | 17 - .../scripting/resources/floatroundmodes.md | 19 - .../scripting/resources/gametextstyles.md | 94 - .../current/scripting/resources/glossary.md | 21 - .../current/scripting/resources/hexcolors.md | 168 -- .../resources/http-error-response-codes.md | 68 - .../resources/http-request-methods.md | 17 - .../scripting/resources/interiorids.md | 239 --- .../current/scripting/resources/keys.md | 61 - .../scripting/resources/landinggearstate.md | 16 - .../scripting/resources/lightstates.md | 146 -- .../current/scripting/resources/limits.md | 73 - .../current/scripting/resources/mapicons.md | 78 - .../scripting/resources/mapiconstyles.md | 18 - .../scripting/resources/markermodes.md | 16 - .../resources/materialtextalignment.md | 18 - .../scripting/resources/materialtextsizes.md | 28 - .../scripting/resources/networkstats.md | 32 - .../resources/objecteditionresponsetypes.md | 16 - .../current/scripting/resources/opcodes.md | 21 - .../resources/original-car-colors.md | 208 -- .../current/scripting/resources/paintjobs.md | 60 - .../scripting/resources/panelstates.md | 62 - .../current/scripting/resources/pickupids.md | 125 -- .../scripting/resources/pickuptypes.md | 39 - .../scripting/resources/playerstates.md | 25 - .../current/scripting/resources/pvartypes.md | 17 - .../resources/race-checkpoint-types.md | 24 - .../scripting/resources/recordtypes.md | 18 - .../scripting/resources/samp_objects.md | 1886 ---------------- .../scripting/resources/selectobjecttypes.md | 15 - .../current/scripting/resources/shopnames.md | 21 - .../current/scripting/resources/skins.md | 334 --- .../current/scripting/resources/sound-ids.md | 635 ------ .../scripting/resources/specialactions.md | 37 - .../scripting/resources/spectatemodes.md | 18 - .../scripting/resources/spectatetypes.md | 18 - .../scripting/resources/sqlite-open-flags.md | 43 - .../current/scripting/resources/start.md | 714 ------- .../scripting/resources/startingids.md | 24 - .../current/scripting/resources/svartypes.md | 19 - .../scripting/resources/textalignments.md | 18 - .../current/scripting/resources/textdraws.md | 240 --- .../scripting/resources/textdrawsprites.md | 690 ------ .../current/scripting/resources/tirestates.md | 250 --- .../resources/vehicle-door-status.md | 40 - .../resources/vehicle-light-status.md | 21 - .../resources/vehicle-panel-status.md | 16 - .../resources/vehicle-tire-status.md | 24 - .../scripting/resources/vehiclehealth.md | 19 - .../current/scripting/resources/vehicleid.md | 220 -- .../resources/vehicleinformationtypes.md | 25 - .../scripting/resources/vendingmachines.md | 115 - .../current/scripting/resources/weaponids.md | 73 - .../scripting/resources/weaponskills.md | 49 - .../scripting/resources/weaponslots.md | 28 - .../scripting/resources/weaponstates.md | 15 - .../current/scripting/resources/weatherid.md | 42 - .../current/server/CommonServerIssues.md | 83 - .../current/server/ControllingServer.md | 203 -- .../current/server/LagCompensation.md | 16 - .../current/server/RemoteConsole.md | 19 - .../current/server/config.json.md | 248 --- .../current/server/omp-functions.md | 452 ---- .../current/server/server.cfg.md | 127 -- .../current/tutorials/AdvancedStructures.md | 337 --- .../current/tutorials/Binary.md | 411 ---- .../current/tutorials/MenuGuide.md | 157 -- .../current/tutorials/PickupGuide.md | 80 - .../tutorials/PluginDevelopmentGuide.md | 1577 -------------- .../current/tutorials/PortForwarding.md | 73 - .../current/tutorials/_.md | 7 - .../current/tutorials/cooldowns.md | 244 --- .../tutorials/perplayervariablesystem.md | 52 - .../current/tutorials/servervariablesystem.md | 48 - frontend/src/components/templates/index.ts | 12 +- .../{zh-cn => zh-CN}/lowercase-note.tsx | 0 .../{zh-cn => zh-CN}/npc-callbacks-tip.tsx | 0 .../{zh-cn => zh-CN}/version-warning.tsx | 2 +- 2125 files changed, 72224 insertions(+), 68035 deletions(-) create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/awesome.md rename frontend/i18n/{zh-cn => zh-CN}/docusaurus-plugin-content-docs/current/changelog.md (76%) create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/ClientCommands.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/ClientOnLinux.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/CommonClientIssues.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/CrashAddresses.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/_.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/sa-mp.cfg.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/meta/Contributing.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientCheckResponse.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientMessage.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnEnterExitModShop.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptExit.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptInit.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnIncomingConnection.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCConnect.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDisconnect.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCEnterVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCExitVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeExit.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeInit.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCSpawn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnObjectMoved.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamOut.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickMap.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerTextDraw.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditAttachedObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterPlayerGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitedMenu.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerFinishedDownloading.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamage.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamageActor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerInteriorChange.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeavePlayerGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerObjectMoved.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPlayerPickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamOut.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestDownload.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectedMenuRow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStateChange.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamOut.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconLoginAttempt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRecordingPlaybackEnd.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptCash.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptLoadPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptUnloadPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnTrailerUpdate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDamageStatusUpdate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleRespray.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSirenStateChange.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamOut.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddMenuItem.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClass.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClassEx.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddServerRule.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModelTimed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticPickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicleEx.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddVehicleComponent.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowAdminTeleport.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowInteriorWeapons.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowNickNameCharacter.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerTeleport.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerWeapons.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ApplyActorAnimation.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ApplyAnimation.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AreAllAnimationsEnabled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AreInteriorWeaponsAllowed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ArePlayerWeaponsAllowed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToPlayerObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachTrailerToVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectEditing.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectSelecting.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginPlayerObjectEditing.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BlockIpAddress.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CallLocalFunction.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CallRemoteFunction.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelEdit.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColours.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehiclePaintjob.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChatTextReplacementToggled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearActorAnimations.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearAnimations.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearBanList.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearPlayerWorldBounds.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ConnectNPC.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CountRunningTimers.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Create3DTextLabel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateActor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosion.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosionForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateMenu.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayer3DTextLabel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerPickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_ExecuteQuery.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_FreeResultSet.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseConnectionCount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseResultSetCount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldCount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloatByName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldInt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldIntByName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldStringByName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetLegacyDBResult.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetMemHandle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetRowCount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_SelectNextRow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Delete3DTextLabel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeletePVar.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeletePlayer3DTextLabel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeleteSVar.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyActor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyMenu.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerPickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DetachTrailerFromVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableInteriorEnterExits.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenu.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableNameTagLOS.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerRaceCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableRemoteVehicleCollisions.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditAttachedObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerClass.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableAllAnimations.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnablePlayerCameraTarget.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableTirePopping.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableVehicleFriendlyFire.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableZoneNames.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EndObjectEditing.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/FindModelFileNameFromCRC.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/FindTextureFileNameFromCRC.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ForceClassSelection.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameModeExit.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneCreate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneDestroy.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetColourForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetFlashColourForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelAttachedData.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelDrawDistance.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelLOS.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorAnimation.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorFacingAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorHealth.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPoolSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSkin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSpawnInfo.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActors.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetAnimationName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetAvailableClasses.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsBool.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsFloat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsInt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetCustomModelPath.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetDefaultPlayerColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetGameText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetGravity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnHeader.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnWidth.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumns.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItem.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItems.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetModeRestartTime.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMyFacingAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMyPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetNetworkStats.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedData.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedOffset.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectDrawDistance.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterial.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterialText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMoveSpeed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectSyncRotation.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarFloat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarInt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarNameAtIndex.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarsUpperIndex.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttached.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttachedData.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDist.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDistance.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelLOS.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAmmo.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimFlags.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationFlags.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationIndex.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerArmour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAttachedObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerBuildingsRemoved.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraAspectRatio.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraFrontVector.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraMode.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetActor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayerObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraUpVector.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraZoom.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerClass.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCustomSkin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialog.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogData.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogID.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDistanceFromPoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDrunkLevel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFacingAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFightingStyle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGhostMode.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGravity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHealth.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHydraReactorAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerInterior.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerIp.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerKeys.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLandingGearState.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastShotVectors.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedTrailerID.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedVehicleID.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMarkerForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMenu.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMoney.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerNetworkStats.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedData.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedOffset.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectDrawDistance.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterial.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterialText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMoveSpeed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectSyncRotation.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPing.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPoolSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRaceCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRawIp.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRotationQuat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerScore.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSirenState.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkillLevel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpecialAction.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateID.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerState.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingObjectID.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingOffsets.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingPlayerObjectID.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingVehicleID.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetActor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTeam.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTime.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTrainSpeed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleID.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleSeat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVelocity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVersion.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWantedLevel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeapon.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponData.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponState.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeather.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWorldBounds.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerZAim.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayers.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetRandomVehicleColourPair.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetRunningTimers.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarFloat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarInt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarNameAtIndex.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarsUpperIndex.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerRuleFlags.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerTickRate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsBool.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsInt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSpawnInfo.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTickCount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerInterval.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerRemaining.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleCab.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleColours.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentInSlot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDamageStatus.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDistanceFromPoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDriver.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHealth.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHydraReactorAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleInterior.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLandingGearState.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLastDriver.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleMatrix.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelCount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelInfo.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelsUsed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleNumberPlate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleOccupiedTick.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePaintjob.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarDoors.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarWindows.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsEx.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsSirenState.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePoolSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnDelay.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnTick.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRotationQuat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSeats.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSirenState.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSpawnInfo.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTower.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrailer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrainSpeed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVelocity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleZAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicles.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponSlot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeather.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWorldTime.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerMoney.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerWeapon.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HTTP.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasGameText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasObjectCameraCollision.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasPlayerObjectCameraCollision.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasVehicleBeenOccupied.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideMenuForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideObjectForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HidePickupForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HidePlayerDialog.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraLookAt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Is3DTextLabelStreamedIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsActorInvulnerable.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsActorStreamedIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsAdminTeleportAllowed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsBanned.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneFlashingForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneVisibleForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuDisabled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuRowDisabled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsNickNameCharacterAllowed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectHiddenForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMaterialSlotUsed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMoving.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupHiddenForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupStreamedIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAdmin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAttachedObjectSlotUsed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCameraTargetEnabled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCheckpointActive.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerConnected.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerControllable.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCuffed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneFlashing.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneVisible.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInAnyVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInDriveByMode.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInModShop.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInPlayerGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRaceCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRangeOfPoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerNPC.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMaterialSlotUsed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMoving.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerPickupStreamedIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerRaceCheckpointActive.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerSpawned.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerStreamedIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTeleportAllowed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTextDrawVisible.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOfficialClient.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOmp.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerWidescreenToggled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsRepeatingTimer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsTextDrawVisibleForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsTrailerAttachedToVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValid3DTextLabel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidActor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidAnimationLibrary.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidCustomModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidMenu.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidNickName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayer3DTextLabel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerGangZone.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerPickup.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerTextDraw.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidServerRule.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTextDraw.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTimer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleDead.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleHidden.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleOccupied.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleSirenEnabled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleStreamedIn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Kick.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/KillTimer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LimitGlobalChatRadius.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LimitPlayerMarkerRadius.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LinkVehicleToInterior.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ManualVehicleEngineAndLights.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/MovePlayerObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesReceived.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesSent.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_ConnectionStatus.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetConnectedTime.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetIpPort.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesReceived.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesRecvPerSecond.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesSent.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_PacketLossPercent.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PauseRecordingPlayback.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayAudioStreamForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayCrimeReportForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneDestroy.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneFlash.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetFlashColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneHide.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneShow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneStopFlash.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerHasClockEnabled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerPlaySound.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectatePlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectateVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawAlignment.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawDestroy.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawFont.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetAlignment.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundCol.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetFont.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetLetterSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetOutline.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehCol.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetShadow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetTextSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawHide.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsBox.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsProportional.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsSelectable.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawLetterSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetOutline.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehCol.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetProportional.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetSelectable.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetShadow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawShow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawTextSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawUseBox.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RedirectDownload.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerAttachedObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerFromVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerMapIcon.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerWeapon.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveServerRule.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveVehicleComponent.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RepairVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerMoney.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerWeapons.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResumeRecordingPlayback.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SHA256_PassHash.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SelectObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SelectTextDraw.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendChat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientCheck.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessage.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAllf.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessagef.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendCommand.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessage.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessageToPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendRconCommand.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelDrawDistance.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelLOS.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorFacingAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorHealth.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorInvulnerable.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorSkin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetCameraBehindPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetDeathDropAmount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetGameModeText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetGravity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMenuColumnHeader.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetModeRestartTime.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMyFacingAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMyPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetNameTagDrawDistance.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterial.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterialText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMoveSpeed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCol.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCollision.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCol.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCollision.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarFloat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarInt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAdmin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAmmo.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAttachedObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraLookAt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerChatBubble.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerDrunkLevel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFightingStyle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerGravity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHealth.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHoldingObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerInterior.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMapIcon.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMarkerForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterial.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterialText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMoveSpeed.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCol.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCollision.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupType.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPosFindZ.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerRaceCheckpoint.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerScore.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerShopName.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkillLevel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSpecialAction.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTeam.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTime.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVelocity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWantedLevel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWeather.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWorldBounds.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarFloat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarInt.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRule.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRuleFlags.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSpawnInfo.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTeamCount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimerEx.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleAngularVelocity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleBeenOccupied.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleDead.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleHealth.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleNumberPlate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleOccupiedTick.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarDoors.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarWindows.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsSirenState.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehiclePos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnDelay.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnTick.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleSpawnInfo.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleToRespawn.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVelocity.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVirtualWorld.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleZAngle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetWeather.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetWorldTime.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowMenuForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowNameTags.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowObjectForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPickupForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerDialog.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerMarkers.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerNameTagForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowVehicle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SpawnPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayback.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayerData.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopAudioStreamForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerHoldingObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerObject.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayback.MD create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayerData.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawAlignment.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawDestroy.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawFont.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetAlignment.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColor.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetFont.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetLetterSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetOutline.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehCol.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehicleColours.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetShadow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetTextSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsBox.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsProportional.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsSelectable.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawLetterSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetOutline.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewModel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewRot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehCol.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehicleColours.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetProportional.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetSelectable.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetShadow.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetString.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetStringForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForAll.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForPlayer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawTextSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawUseBox.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Tickcount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ToggleChatTextReplacement.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerClock.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerControllable.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerGhostMode.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerSpectating.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerWidescreen.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ToggleVehicleSirenEnabled.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UnBlockIpAddress.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Update3DTextLabelText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UpdatePlayer3DTextLabelText.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UpdateVehicleDamageStatus.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UseGangZoneCheck.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerGangZoneCheck.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VectorSize.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VehicleCanHaveComponent.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VehicleColourIndexToColour.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/acos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argcount.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argindex.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argstr.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argvalue.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/asin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/atan.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/atan2.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/clamp.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_close.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openfiles.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openresults.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_field_name.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_free_result.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_float.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_int.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_float.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_int.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_mem_handle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_result_mem_handle.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_next_row.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_num_fields.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_num_rows.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_open.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_query.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/deleteproperty.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/diskfree.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/existproperty.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/existpubvar.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fattrib.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fblockread.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fblockwrite.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fclose.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fcopy.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fcreatedir.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fexist.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fflush.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fgetchar.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/filecrc.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/flength.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/float.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatabs.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatadd.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatcmp.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatcos.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatdiv.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatfract.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatlog.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatmul.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatpower.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatround.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsin.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsqroot.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatstr.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsub.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floattan.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fmatch.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/format.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fputchar.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fread.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fremove.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/frename.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fseek.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fstat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ftell.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/funcidx.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getarg.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getdate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getproperty.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getpubvar.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/gettime.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/gpci.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/heapspace.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ispacked.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/listenport.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/max.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/memcpy.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/min.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/numargs.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/numpubvars.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/print.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/printf.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/random.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/sendpacket.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/sendstring.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setarg.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setpubvar.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcmp.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcopy.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strdel.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strequal.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strfind.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strfloat.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strins.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strlen.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strmid.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strpack.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strunpack.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strval.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/swapchars.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/tolower.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/toupper.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/uudecode.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/uuencode.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/ControlStructures.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Directives.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Initialisers.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Operators.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Statements.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Style.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Tags.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Variables.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/Componentslots.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/anglemodes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/animations.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/bodyparts.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/boneid.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/bullethittypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/callbacks-sequence.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/cameracutstyles.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/cameramodes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/carcomponentid.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/clicksources.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/colorslist.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/connectionstatus.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/constants.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/crimelist.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/damagestatus.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/doorstates.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/download-requests.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/escapecodes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/explosionlist.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/fightingstyles.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/file-modes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/file-seek-whence.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/floatroundmodes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/gametextstyles.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/glossary.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/hexcolors.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/http-error-response-codes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/http-request-methods.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/interiorids.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/keys.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/landinggearstate.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/lightstates.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/limits.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/mapicons.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/mapiconstyles.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/markermodes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/materialtextalignment.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/materialtextsizes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/networkstats.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/objecteditionresponsetypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/opcodes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/original-car-colors.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/paintjobs.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/panelstates.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pickupids.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pickuptypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/playerstates.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pvartypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/race-checkpoint-types.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/recordtypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/samp_objects.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/selectobjecttypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/shopnames.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/skins.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/sound-ids.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/specialactions.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/spectatemodes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/spectatetypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/sqlite-open-flags.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/start.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/startingids.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/svartypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/textalignments.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/textdraws.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/textdrawsprites.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/tirestates.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-door-status.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-light-status.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-panel-status.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-tire-status.md rename frontend/i18n/{zh-cn => zh-CN}/docusaurus-plugin-content-docs/current/scripting/resources/vehiclecolorid.md (88%) create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehiclehealth.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicleid.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicleinformationtypes.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vendingmachines.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/weaponids.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/weaponskills.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/weaponslots.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/weaponstates.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/weatherid.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/CommonServerIssues.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/ControllingServer.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/Installation.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/LagCompensation.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/LinuxServerInstallation.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/RemoteConsole.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/config.json.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/omp-functions.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/server/server.cfg.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/AdvancedStructures.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/Binary.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/MenuGuide.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/PickupGuide.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/PluginDevelopmentGuide.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/PortForwarding.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/QueryMechanism.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/_.md rename frontend/i18n/{zh-cn => zh-CN}/docusaurus-plugin-content-docs/current/tutorials/colorfix.md (88%) create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/cooldowns.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/perplayervariablesystem.md create mode 100644 frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/servervariablesystem.md rename frontend/i18n/{zh-cn => zh-CN}/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md (93%) rename frontend/i18n/{zh-tw => zh-TW}/docusaurus-plugin-content-docs/current/awesome.md (100%) rename frontend/i18n/{zh-tw => zh-TW}/docusaurus-plugin-content-docs/current/client/ClientCommands.md (100%) rename frontend/i18n/{zh-tw => zh-TW}/docusaurus-plugin-content-docs/current/client/CommonClientIssues.md (100%) rename frontend/i18n/{zh-tw => zh-TW}/docusaurus-plugin-content-docs/current/client/CrashAddresses.md (100%) rename frontend/i18n/{zh-tw => zh-TW}/docusaurus-plugin-content-docs/current/client/_.md (100%) rename frontend/i18n/{zh-tw => zh-TW}/docusaurus-plugin-content-docs/current/index.md (100%) rename frontend/i18n/{zh-tw => zh-TW}/docusaurus-plugin-content-docs/current/meta/Contributing.md (100%) delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/awesome.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/client/ClientCommands.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/client/CommonClientIssues.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/client/CrashAddresses.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/client/_.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/client/sa-mp.cfg.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/index.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/meta/Contributing.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientCheckResponse.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientMessage.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnEnterExitModShop.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptExit.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptInit.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnIncomingConnection.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCConnect.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDisconnect.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCEnterVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCExitVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeExit.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeInit.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCSpawn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnObjectMoved.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamOut.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickMap.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerTextDraw.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditAttachedObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterPlayerGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitedMenu.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerFinishedDownloading.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamage.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamageActor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerInteriorChange.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeavePlayerGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerObjectMoved.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPlayerPickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamOut.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestDownload.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectedMenuRow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStateChange.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamOut.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconLoginAttempt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRecordingPlaybackEnd.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptCash.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptLoadPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptUnloadPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnTrailerUpdate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDamageStatusUpdate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleRespray.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSirenStateChange.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamOut.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddMenuItem.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClass.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClassEx.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddServerRule.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModelTimed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticPickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicleEx.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AddVehicleComponent.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AllowAdminTeleport.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AllowInteriorWeapons.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AllowNickNameCharacter.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerTeleport.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerWeapons.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ApplyActorAnimation.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ApplyAnimation.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AreAllAnimationsEnabled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AreInteriorWeaponsAllowed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ArePlayerWeaponsAllowed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToPlayerObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/AttachTrailerToVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectEditing.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectSelecting.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/BeginPlayerObjectEditing.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/BlockIpAddress.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CallLocalFunction.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CallRemoteFunction.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CancelEdit.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColours.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehiclePaintjob.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ChatTextReplacementToggled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ClearActorAnimations.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ClearAnimations.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ClearBanList.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ClearPlayerWorldBounds.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ConnectNPC.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CountRunningTimers.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Create3DTextLabel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreateActor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosion.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosionForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreateMenu.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreatePickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayer3DTextLabel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerPickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/CreateVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_ExecuteQuery.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_FreeResultSet.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseConnectionCount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseResultSetCount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldCount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloatByName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldInt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldIntByName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldStringByName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetLegacyDBResult.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetMemHandle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetRowCount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DB_SelectNextRow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Delete3DTextLabel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DeletePVar.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DeletePlayer3DTextLabel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DeleteSVar.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DestroyActor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DestroyMenu.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DestroyObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerPickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DestroyVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DetachTrailerFromVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DisableInteriorEnterExits.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenu.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DisableNameTagLOS.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerRaceCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/DisableRemoteVehicleCollisions.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EditAttachedObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EditObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerClass.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EnableAllAnimations.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EnablePlayerCameraTarget.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EnableTirePopping.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EnableVehicleFriendlyFire.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EnableZoneNames.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/EndObjectEditing.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/FindModelFileNameFromCRC.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/FindTextureFileNameFromCRC.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ForceClassSelection.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GameModeExit.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneCreate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneDestroy.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetColourForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetFlashColourForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelAttachedData.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelDrawDistance.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelLOS.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActorAnimation.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActorFacingAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActorHealth.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPoolSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSkin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSpawnInfo.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActorVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetActors.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetAnimationName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetAvailableClasses.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsBool.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsFloat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsInt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetCustomModelPath.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetDefaultPlayerColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetGameText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetGravity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnHeader.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnWidth.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumns.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItem.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItems.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetModeRestartTime.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMyFacingAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetMyPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetNetworkStats.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedData.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedOffset.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectDrawDistance.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterial.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterialText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMoveSpeed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectSyncRotation.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarFloat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarInt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarNameAtIndex.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarsUpperIndex.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttached.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttachedData.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDist.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDistance.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelLOS.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAmmo.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimFlags.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationFlags.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationIndex.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerArmour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAttachedObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerBuildingsRemoved.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraAspectRatio.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraFrontVector.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraMode.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetActor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayerObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraUpVector.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraZoom.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerClass.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCustomSkin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialog.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogData.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogID.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDistanceFromPoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDrunkLevel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFacingAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFightingStyle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGhostMode.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGravity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHealth.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHydraReactorAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerInterior.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerIp.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerKeys.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLandingGearState.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastShotVectors.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedTrailerID.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedVehicleID.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMarkerForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMenu.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMoney.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerNetworkStats.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedData.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedOffset.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectDrawDistance.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterial.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterialText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMoveSpeed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectSyncRotation.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPing.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPoolSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRaceCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRawIp.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRotationQuat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerScore.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSirenState.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkillLevel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpecialAction.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateID.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerState.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingObjectID.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingOffsets.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingPlayerObjectID.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingVehicleID.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetActor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTeam.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTime.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTrainSpeed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleID.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleSeat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVelocity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVersion.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWantedLevel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeapon.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponData.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponState.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeather.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWorldBounds.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerZAim.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayers.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetRandomVehicleColourPair.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetRunningTimers.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarFloat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarInt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarNameAtIndex.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarsUpperIndex.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetServerRuleFlags.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetServerTickRate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsBool.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsInt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetSpawnInfo.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetTickCount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerInterval.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerRemaining.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleCab.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleColours.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentInSlot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDamageStatus.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDistanceFromPoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDriver.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHealth.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHydraReactorAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleInterior.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLandingGearState.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLastDriver.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleMatrix.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelCount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelInfo.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelsUsed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleNumberPlate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleOccupiedTick.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePaintjob.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarDoors.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarWindows.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsEx.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsSirenState.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePoolSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnDelay.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnTick.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRotationQuat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSeats.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSirenState.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSpawnInfo.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTower.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrailer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrainSpeed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVelocity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleZAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicles.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponSlot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetWeather.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GetWorldTime.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerMoney.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerWeapon.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HTTP.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HasGameText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HasObjectCameraCollision.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HasPlayerObjectCameraCollision.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HasVehicleBeenOccupied.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HideMenuForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HideObjectForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HidePickupForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HidePlayerDialog.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/HideVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraLookAt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Is3DTextLabelStreamedIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsActorInvulnerable.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsActorStreamedIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsAdminTeleportAllowed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsBanned.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneFlashingForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneVisibleForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuDisabled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuRowDisabled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsNickNameCharacterAllowed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectHiddenForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMaterialSlotUsed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMoving.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupHiddenForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupStreamedIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAdmin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAttachedObjectSlotUsed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCameraTargetEnabled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCheckpointActive.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerConnected.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerControllable.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCuffed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneFlashing.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneVisible.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInAnyVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInDriveByMode.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInModShop.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInPlayerGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRaceCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRangeOfPoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerNPC.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMaterialSlotUsed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMoving.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerPickupStreamedIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerRaceCheckpointActive.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerSpawned.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerStreamedIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTeleportAllowed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTextDrawVisible.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOfficialClient.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerWidescreenToggled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsRepeatingTimer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsTextDrawVisibleForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsTrailerAttachedToVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValid3DTextLabel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidActor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidAnimationLibrary.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidCustomModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidMenu.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidNickName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayer3DTextLabel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerGangZone.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerPickup.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerTextDraw.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidServerRule.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTextDraw.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTimer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsValidVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleDead.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleHidden.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleOccupied.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleSirenEnabled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleStreamedIn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Kick.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/KillTimer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/LimitGlobalChatRadius.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/LimitPlayerMarkerRadius.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/LinkVehicleToInterior.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ManualVehicleEngineAndLights.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/MovePlayerObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesReceived.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesSent.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_ConnectionStatus.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetConnectedTime.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetIpPort.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesReceived.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesRecvPerSecond.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesSent.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_PacketLossPercent.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PauseRecordingPlayback.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayAudioStreamForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayCrimeReportForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneDestroy.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneFlash.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetFlashColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneHide.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneShow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneStopFlash.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerHasClockEnabled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerPlaySound.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectatePlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectateVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawAlignment.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawDestroy.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawFont.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetAlignment.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundCol.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetFont.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetLetterSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetOutline.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehCol.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetShadow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetTextSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawHide.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsBox.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsProportional.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsSelectable.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawLetterSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetOutline.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehCol.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetProportional.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetSelectable.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetShadow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawShow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawTextSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawUseBox.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RedirectDownload.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerAttachedObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerFromVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerMapIcon.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerWeapon.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RemoveServerRule.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RemoveVehicleComponent.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/RepairVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerMoney.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerWeapons.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ResumeRecordingPlayback.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SHA256_PassHash.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SelectObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SelectTextDraw.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendChat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendClientCheck.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessage.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAllf.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessagef.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendCommand.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessage.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessageToPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SendRconCommand.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelDrawDistance.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelLOS.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetActorFacingAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetActorHealth.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetActorInvulnerable.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetActorPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetActorSkin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetActorVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetCameraBehindPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetDeathDropAmount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetGameModeText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetGravity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetMenuColumnHeader.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetModeRestartTime.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetMyFacingAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetMyPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetNameTagDrawDistance.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterial.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterialText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMoveSpeed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCol.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCollision.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCol.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCollision.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarFloat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarInt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAdmin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAmmo.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAttachedObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraLookAt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerChatBubble.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerDrunkLevel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFightingStyle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerGravity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHealth.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHoldingObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerInterior.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMapIcon.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMarkerForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterial.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterialText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMoveSpeed.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCol.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCollision.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupType.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPosFindZ.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerRaceCheckpoint.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerScore.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerShopName.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkillLevel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSpecialAction.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTeam.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTime.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVelocity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWantedLevel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWeather.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWorldBounds.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarFloat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarInt.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRule.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRuleFlags.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetSpawnInfo.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetTeamCount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetTimerEx.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleAngularVelocity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleBeenOccupied.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleDead.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleHealth.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleNumberPlate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleOccupiedTick.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarDoors.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarWindows.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsSirenState.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehiclePos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnDelay.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnTick.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleSpawnInfo.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleToRespawn.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVelocity.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVirtualWorld.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleZAngle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetWeather.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SetWorldTime.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ShowMenuForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ShowNameTags.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ShowObjectForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ShowPickupForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerDialog.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerMarkers.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerNameTagForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ShowVehicle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/SpawnPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayback.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayerData.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/StopAudioStreamForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/StopObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerHoldingObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerObject.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayback.MD delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayerData.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawAlignment.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawDestroy.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawFont.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetAlignment.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColor.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetFont.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetLetterSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetOutline.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehCol.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehicleColours.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetShadow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetTextSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsBox.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsProportional.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsSelectable.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawLetterSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetOutline.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewModel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewRot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehCol.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehicleColours.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetProportional.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetSelectable.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetShadow.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetString.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetStringForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForAll.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForPlayer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawTextSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawUseBox.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Tickcount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ToggleChatTextReplacement.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerClock.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerControllable.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerGhostMode.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerSpectating.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerWidescreen.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ToggleVehicleSirenEnabled.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/UnBlockIpAddress.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/Update3DTextLabelText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/UpdatePlayer3DTextLabelText.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/UpdateVehicleDamageStatus.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/UseGangZoneCheck.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerGangZoneCheck.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/VectorSize.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/VehicleCanHaveComponent.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/VehicleColourIndexToColour.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/acos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/argcount.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/argindex.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/argstr.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/argvalue.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/asin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/atan.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/atan2.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/clamp.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_close.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openfiles.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openresults.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_field_name.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_free_result.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_float.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_int.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_float.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_int.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_get_mem_handle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_get_result_mem_handle.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_next_row.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_num_fields.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_num_rows.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_open.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/db_query.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/deleteproperty.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/diskfree.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/existproperty.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/existpubvar.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fattrib.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fblockread.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fblockwrite.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fclose.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fcopy.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fcreatedir.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fexist.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fflush.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fgetchar.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/filecrc.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/flength.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/float.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatabs.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatadd.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatcmp.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatcos.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatdiv.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatfract.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatlog.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatmul.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatpower.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatround.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatsin.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatsqroot.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatstr.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floatsub.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/floattan.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fmatch.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/format.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fputchar.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fread.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fremove.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/frename.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fseek.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fstat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ftell.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/funcidx.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/getarg.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/getdate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/getproperty.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/getpubvar.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/gettime.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/gpci.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/heapspace.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/ispacked.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/listenport.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/max.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/memcpy.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/min.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/numargs.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/numpubvars.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/print.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/printf.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/random.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/sendpacket.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/sendstring.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/setarg.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/setpubvar.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strcat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strcmp.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strcopy.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strdel.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strequal.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strfind.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strfloat.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strins.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strlen.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strmid.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strpack.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strunpack.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/strval.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/swapchars.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/tolower.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/toupper.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/uudecode.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/uuencode.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/Componentslots.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/anglemodes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/animations.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/bodyparts.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/boneid.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/bullethittypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/callbacks-sequence.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/cameracutstyles.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/cameramodes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/carcomponentid.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/clicksources.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/connectionstatus.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/constants.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/crimelist.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/damagestatus.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/doorstates.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/download-requests.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/escapecodes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/explosionlist.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/fightingstyles.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/file-modes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/file-seek-whence.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/floatroundmodes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/gametextstyles.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/glossary.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/hexcolors.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/http-error-response-codes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/http-request-methods.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/interiorids.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/keys.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/landinggearstate.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/lightstates.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/limits.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/mapicons.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/mapiconstyles.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/markermodes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/materialtextalignment.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/materialtextsizes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/networkstats.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/objecteditionresponsetypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/opcodes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/original-car-colors.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/paintjobs.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/panelstates.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/pickupids.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/pickuptypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/playerstates.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/pvartypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/race-checkpoint-types.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/recordtypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/samp_objects.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/selectobjecttypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/shopnames.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/skins.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/sound-ids.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/specialactions.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/spectatemodes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/spectatetypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/sqlite-open-flags.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/start.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/startingids.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/svartypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/textalignments.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/textdraws.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/textdrawsprites.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/tirestates.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-door-status.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-light-status.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-panel-status.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-tire-status.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/vehiclehealth.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/vehicleid.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/vehicleinformationtypes.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/vendingmachines.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/weaponids.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/weaponskills.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/weaponslots.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/weaponstates.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/scripting/resources/weatherid.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/server/CommonServerIssues.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/server/ControllingServer.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/server/LagCompensation.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/server/RemoteConsole.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/server/config.json.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/server/omp-functions.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/server/server.cfg.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/AdvancedStructures.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/Binary.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/MenuGuide.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/PickupGuide.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/PluginDevelopmentGuide.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/PortForwarding.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/_.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/cooldowns.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/perplayervariablesystem.md delete mode 100644 frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/tutorials/servervariablesystem.md rename frontend/src/components/templates/translations/{zh-cn => zh-CN}/lowercase-note.tsx (100%) rename frontend/src/components/templates/translations/{zh-cn => zh-CN}/npc-callbacks-tip.tsx (100%) rename frontend/src/components/templates/translations/{zh-cn => zh-CN}/version-warning.tsx (93%) diff --git a/CODEOWNERS b/CODEOWNERS index 7e6b5789a35..7e24daf0bcf 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -5,7 +5,8 @@ /frontend/i18n/sr/ @Trysha-rbrn /frontend/i18n/es/ @Woscript @DestinyDragon49 @FreddieCrew @Fede5432 /frontend/i18n/tl/ @MySekwel -/frontend/i18n/zh-tw/ @SumiHeart +/frontend/i18n/zh-CN/ @dockfries +/frontend/i18n/zh-TW/ @SumiHeart /frontend/i18n/ar/ @midosvt @ImOver00 /frontend/i18n/sv/ @fusez /frontend/i18n/vi/ @PHATBENTRE diff --git a/frontend/docusaurus.config.ts b/frontend/docusaurus.config.ts index 4996d7d74ac..b956b9cb45b 100644 --- a/frontend/docusaurus.config.ts +++ b/frontend/docusaurus.config.ts @@ -66,8 +66,8 @@ const config: Config = { "th", "tr", "vi", - "zh-cn", - "zh-tw", + "zh-CN", + "zh-TW", ], }, diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/awesome.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/awesome.md new file mode 100644 index 00000000000..148c7025338 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/awesome.md @@ -0,0 +1,163 @@ +--- +title: Awesome +sidebar_label: Awesome +description: 精心整理的实用工具、库、游戏模式、滤镜脚本和插件列表,用于SA-MP开发。 +--- + +## 工具 + +- **[社区编译器](https://github.com/pawn-lang/compiler)** - 经过大量更新的编译器版本,包含多项修复和增强功能。 +- **[sampctl](https://github.com/Southclaws/sampctl)** - 用于安装库和运行服务器的包管理器。 +- **[插件运行器](https://github.com/Zeex/samp-plugin-runner)** - 直接从命令行运行轻量级服务器版本的工具(无需server.cfg),用于测试插件。 +- **[插件模板](https://github.com/Southclaws/samp-plugin-boilerplate)** - 通过模板快速创建插件。 +- **[SA:MP 插件模板库](https://github.com/katursis/samp-ptl)** - 使用此模板库快速轻松地创建自定义插件。 +- **[SA-MP 代码试验场](https://fiddle.sa-mp.dev)** - 测试脚本片段(代码片段、概念验证、调试等)并与他人分享的平台。 +- **[Pawn语法 - Sublime](https://packagecontrol.io/packages/Pawn%20syntax)** - Sublime Text的Pawn自动补全插件。 +- **[Pawn语法 - Visual市场](https://marketplace.visualstudio.com/items?itemName=southclaws.vscode-pawn)** - Visual Studio Code的Pawn自动补全插件。 +- **[SA-MP区域编辑器](https://bitbucket.org/Grimrandomer/samp-zone-editor/downloads)** - 用于创建区域和其他内容的区域编辑器。 +- **[SA-MP地图编辑器](https://github.com/openmultiplayer/archive/raw/master/tools/Map%20Editor.zip)** - 流行的SA:MP地图编辑器。 +- **[open.mp服务器浏览器](https://github.com/adib-yg/openmp-server-browser)** - 桌面版open.mp服务器浏览器GUI。 + +## 库 + +- **[samp-stdlib](https://github.com/pawn-lang/samp-stdlib)** - 更新版默认包含文件,包含`const`修正、完整文档和功能。 +- **[fixes.inc](https://github.com/pawn-lang/sa-mp-fixes)** - 针对大量SA:MP服务器bug的高度优化修复方案,即插即用。 +- **[YSI-Includes](https://github.com/pawn-lang/YSI-Includes)** - 最古老、最庞大、测试最充分的SA:MP/pawn库,提供大量新游戏和语言功能。 +- **[foreach](https://github.com/Open-GTO/foreach)** - 独立版foreach包含文件(非y_iterate版本)。 +- **[amx_assembly](https://github.com/Zeex/amx_assembly)** - 提供对pawn脚本底层的访问。 +- **[md-sort](https://github.com/oscar-broman/md-sort)** - 在Pawn中排序多维数组。通过修改数组内部指针实现,避免数据复制。 +- **[indirection](https://github.com/Y-Less/indirection)** - 通过抽象方法自定义调用的指针传递和间接函数调用系统。 +- **[code-parse.inc](https://github.com/Y-Less/code-parse.inc)** - 在编译时解析和自定义pawn代码。 +- **[扩展车辆信息](https://github.com/Vince0789/sa-mp-extended-vehicle-information)** - 将单机版大量车辆标志导入SQLite数据库。 +- **[sqlitei](https://github.com/oscar-broman/sqlitei)** - SA-MP SQLite函数的高级API。 +- **[weapon-config](https://github.com/oscar-broman/samp-weapon-config)** - 更稳定、响应更快的伤害系统,包含多项新功能。 +- **[samp-geoip](https://github.com/Southclaws/SAMP-geoip)** - 基于IP地址的地理信息查询。 +- **[progress2](https://github.com/Southclaws/progress2)** - 以进度条形式显示时间、生命值、车辆燃油等信息。 +- **[weapon-data](https://github.com/Southclaws/samp-weapon-data)** - 精细调整、可自定义的武器数据。 +- **[MV_Youtube](https://github.com/MichaelBelgium/MV_Youtube)** - 音频流的Youtube转换API。 +- **[MySQL预处理语句](https://github.com/PatrickGTR/MySQL-Prepared-Statements)** - 为PAWN MySQL插件模拟预处理语句。 +- **[samp-server-weapons](https://github.com/Brunoo16/samp-server-weapons)** - 完全由服务器控制的武器系统。 +- **[actor_robbery](https://github.com/PatrickGTR/actor_robbery)** - 灵感来自GTA V商店抢劫,实现类似功能的actor_robbery.inc。 +- **[samp-aviation](https://github.com/Southclaws/samp-aviation)** - SA-MP基础俯仰高度和滚转航向自动驾驶系统。 +- **[samp-logger](https://github.com/Southclaws/samp-logger)** - 结构化日志记录工具,提供简单的日志记录和调试功能。 +- **[TDW递归扫描器](https://github.com/tdworg/samp-include-rscan)** - 检测代码中递归调用的库。 +- **[easyDialog](https://github.com/Awsomedude/easyDialog)** - 简化对话框使用流程。 +- **[mdialog](https://github.com/Open-GTO/mdialog)** - 现代化对话框系统,类似easyDialog。 +- **[模型尺寸增强版](https://github.com/Crayder/Model-Sizes-Plus)** - 更新版modelsizes包含文件,更精确的模型尺寸数据。 +- **[physics.inc](https://github.com/uPeppe/physics.inc)** - 模拟2D和3D物理效果(真实运动、碰撞等)。 +- **[samp-async-dialogs](https://github.com/AGraber/samp-async-dialogs)** - 通过PawnPlus任务实现异步对话框处理。 +- **[speedcap.inc](https://github.com/openmultiplayer/archive/blob/master/includes/speedcap.inc)** - 控制车辆速度的包含文件。 +- **[SA:MP指令猜测](https://github.com/Kirima2nd/samp-command-guess)** - 使用Levenshtein距离函数实现的SA:MP指令猜测器。 +- **[vending](https://github.com/wuzi/vending)** - SA-MP服务端自动售货机系统。 +- **[strlib](https://github.com/oscar-broman/strlib)** - 实用字符串函数集合。 +- **[mathutil](https://github.com/ScavengeSurvive/mathutil)** - 实用数学函数集合。 +- **[rotations.inc](https://github.com/sampctl/rotations.inc)** - Nero_3D rotations.inc提供的实用旋转函数集合。 +- **[SA-MP距离函数](https://github.com/Y-Less/samp-distance)** - 实用距离检测函数集合。 +- **[新SA-MP回调](https://github.com/emmet-jones/New-SA-MP-callbacks)** - 实用新回调函数集合。 +- **[替代对话框](https://github.com/NexiusTailer/Alternative-Dialogs)** - 采用新设计的文本绘图对话框。 +- **[eSelection](https://github.com/TommyB123/eSelection)** - 在游戏模式中创建动态模型选择菜单的功能。 +- **[mSelection](https://github.com/alextwothousand/mSelection)** - 类似eSelection,但采用不同风格。 +- **[RGB-文本绘图](https://github.com/adib-yg/SAMP-RGB-Textdraw)** - 为文本绘图添加RGB色彩支持。 +- **[LangPlus](https://github.com/mysy00/LangPlus)** - open.mp服务器多语言支持库。 +- **[beckzy的改装店](https://beckzy.net/index.php?action=downloads;sa=view;id=41)** - 服务端改装店包含文件。 + +## 指令处理器 + +- **[I-ZCMD](https://github.com/YashasSamaga/I-ZCMD)** - ZCMD的改进版本。 +- **[Pawn.CMD](https://github.com/katursis/Pawn.CMD)** - 比任何其他指令处理器更快速。 +- **[y_commands](https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Visual/y_commands.md)** - YSI包含文件中的指令处理器 + +## 插件 + +- **[JIT](https://github.com/Zeex/samp-plugin-jit)** - 代码稳定后使用可显著提升运行速度。 +- **[CrashDetect](https://github.com/Zeex/samp-plugin-crashdetect)** - 开发阶段用于发现错误的工具。 +- **[性能分析器](https://github.com/Zeex/samp-plugin-profiler)** - SA-MP服务器性能分析插件。 +- **[sscanf](https://github.com/Y-Less/sscanf)** - 将字符串转换为多种值类型(整数、浮点数、玩家等)。 +- **[MySQL插件](https://github.com/pBlueG/SA-MP-MySQL)** - 连接服务器到MySQL数据库。 +- **[流加载插件](https://github.com/samp-incognito/samp-streamer-plugin)** - 突破SA:MP多项限制(物体、拾取物等)。 +- **[原生检查器](https://github.com/openmultiplayer/archive/raw/master/plugins/nativechecker.zip)** - 服务器启动时检查原生函数。 +- **[FCNPC](https://github.com/ziggi/FCNPC)** - 增强标准NPC功能的插件(截至2023年1月暂不支持open.mp)。 +- **[文件管理器](https://github.com/JaTochNietDan/SA-MP-FileManager)** - 允许管理根目录文件(不限于scriptfiles目录)。 +- **[Pawn.Raknet](https://github.com/katursis/Pawn.RakNet)** - 分析RakNet网络流量。 +- **[samp-precise-timers](https://github.com/bmisiak/samp-precise-timers)** - 提供精确定时器的Rust插件(open.mp已内置此功能)。 +- **[PawnPlus](https://github.com/IllidanS4/PawnPlus)** - 通过新结构、数据类型和编程技术扩展Pawn语言。 +- **[PAWN内存访问](https://github.com/BigETI/pawn-memory)** - 允许在PAWN中分配和释放堆内存。 +- **[原生回退](https://github.com/IllidanS4/NativeFallback)** - 为未注册原生函数提供回退实现。 +- **[YSF](https://github.com/IllidanS4/YSF)** - 通过内存编辑和钩子实现服务器功能扩展(部分功能已集成至open.mp)。 +- **[SKY](https://github.com/oscar-broman/SKY)** - 提供底层功能实现强大脚本操作。 +- **[Pawn.Regex](https://github.com/katursis/Pawn.Regex)** - 为Pawn添加正则表达式支持。 +- **[pawn-scraper](https://github.com/Sreyas-Sreelal/pawn-scraper)** - 支持HTML解析和CSS选择器的强大爬虫插件。 +- **[TOTP](https://github.com/philip1337/samp-plugin-totp)** - 在游戏模式中使用TOTP身份验证。 +- **[DNS插件](https://github.com/samp-incognito/samp-dns-plugin)** - 提供DNS正反向查询功能。 +- **[MapAndreas](https://github.com/Southclaws/samp-plugin-mapandreas)** - 加载不同高度图并查询坐标海拔。 +- **[ColAndreas](https://github.com/Pottus/ColAndreas)** - 使用Bullet物理库模拟圣安地列斯世界碰撞。 +- **[路径查找器](https://bitbucket.org/Pamdex/pathfinder/src/master)** - 计算圣安地列斯地图点对点路径。 +- **[自定义查询洪水检测](https://github.com/spmn/samp-custom-query-flood-check)** - 自定义防御查询洪水攻击。 +- **[sampml](https://github.com/YashasSamaga/sampml)** - 简化机器学习工具包(包含自瞄检测功能)。 +- **[TgConnector](https://github.com/Sreyas-Sreelal/tgconnector)** - 通过SA-MP与Telegram机器人交互的插件。 +- **[Discord连接器](https://github.com/maddinat0r/samp-discord-connector)** - 在PAWN脚本中控制Discord机器人。 +- **[TS连接器](https://github.com/maddinat0r/samp-tsconnector)** - 在PAWN脚本中控制TeamSpeak3服务器。 +- **[IRC插件](https://github.com/samp-incognito/samp-irc-plugin)** - 创建和管理IRC机器人。 +- **[pawn-requests](https://github.com/Southclaws/pawn-requests)** - 提供HTTP(S) API交互接口,支持文本和JSON数据类型。 +- **[pawn-redis](https://github.com/Southclaws/pawn-redis)** - 访问快速内存数据库和异步消息通道。 +- **[Chrono](https://github.com/Southclaws/pawn-chrono)** - 现代日期时间处理库。 +- **[俄语文本修复](https://github.com/ziggi/rustext)** - 修复GameText、TextDraw和Menu的俄语显示问题。 +- **[高级昵称系统](https://github.com/KrYpToDeN/Advanced-SA-NickName)** - 支持任意字符的昵称系统。 +- **[SAMPSON](https://github.com/Hual/SAMPSON)** - SA-MP JSON插件。 +- **[samp-chatbot](https://github.com/SimoSbara/samp-chatbot)** - 游戏内AI聊天机器人插件。 +- **[SA-MP BitStream崩溃修复](https://github.com/AmyrAhmady/samp-bscrashfix)** - 修复BitStream读取溢出问题。 +- **[pawn-json](https://github.com/Southclaws/pawn-json)** - Pawn版JSON处理库。 + +## 客户端-服务器插件 + +- **[SA-MP+](https://github.com/Hual/SA-MP-Plus)** - 通过插件SDK与服务器交互并添加新功能的客户端修改版。 +- **[CHandling](https://github.com/dotSILENT/chandling)** - 为单个车辆分配独立操控数据的功能。 +- **[SAMPVOICE](https://github.com/CyberMor/sampvoice)** - 为SA:MP服务器实现语音通信系统。 +- **[按键监听器](https://github.com/CyberMor/keylistener)** - 追踪任意按键操作的客户端-服务器插件。 +- **[SA-MP CEF](https://github.com/ZOTTCE/samp-cef)** - 嵌入CEF的客户端和服务器插件。 +- **[SAMP_AC_v2](https://github.com/Whitetigerswt/SAMP_AC_v2)** - SA:MP客户端反作弊系统。 + +## 加密插件 + +- **[whirlpool](https://github.com/Southclaws/samp-whirlpool)** - SA:MP版Whirlpool加密插件。 +- **[SyS的bcrypt插件](https://github.com/Sreyas-Sreelal/samp-bcrypt)** - Sreyas Sreelal开发的Bcrypt加密插件。 +- **[lassir的bcrypt插件](https://github.com/lassir/bcrypt-samp)** - lassir开发的Bcrypt加密插件。 +- **[samp-crypto](https://github.com/alextwothousand/samp-crypto)** - 支持Argon2、Scrypt和Bcrypt的加密函数集合。 +- **[SHA512](https://github.com/openmultiplayer/archive/raw/master/plugins/SHA512.zip)** - SA:MP版SHA512加密插件。 + +## GDK/SDK + +现在无需插件即可使用open.mp通过其他语言编写脚本,详见[此博客文章](https://www.open.mp/blog/release-candidate-1) + +- **[sampsdk](https://github.com/Zeex/samp-plugin-sdk)** - 插件开发基础SDK。 +- **[sampgdk](https://github.com/Zeex/sampgdk)** - C/C++语言支持(编写SA:MP游戏模式) +- **[SampSharp](https://github.com/ikkentim/SampSharp)** - C#语言支持(编写SA:MP游戏模式) +- **[.NET插件](https://github.com/Seregamil/.NET-plugin)** - C#语言支持(编写SA:MP插件) +- **[sampgo](https://github.com/sampgo/sampgo)** - Go语言支持(编写SA:MP游戏模式/插件) +- **[samp-node](https://github.com/AmyrAhmady/samp-node)** - JavaScript/TypeScript语言支持(编写SA:MP游戏模式) +- **[Shoebill项目](https://github.com/Shoebill/ShoebillPlugin)** - Java语言支持(编写SA:MP游戏模式) +- **[pySAMP](https://github.com/habecker/PySAMP)** - Python语言支持(编写SA:MP游戏模式) +- **[samp-rs](https://github.com/ZOTTCE/samp-rs)** - Rust语言支持(编写SA:MP插件) +- **[Yet Another Lua插件](https://github.com/IllidanS4/YALP)** - Lua语言支持(编写SA:MP游戏模式) +- **[SAMPHP](https://github.com/Lapayo/SAMPHP)** - PHP语言支持(编写SA:MP游戏模式) +- **[SA-MP S[D]K](https://github.com/Hual/SA-MP-S-D-K)** - D语言支持(编写SA:MP游戏模式) +- **[Kamp](https://github.com/Double-O-Seven/kamp)** - Kotlin语言支持(编写SA:MP游戏模式) + +## 游戏模式 + +- **[简单基础脚本](https://github.com/midosvt/omp-base-script)** - 帮助新手入门的简单基础脚本。 +- **[ScavengeSurvive](https://github.com/Southclaws/ScavengeSurvive)** - 基于PvP的生存游戏模式。 +- **[gta-open](https://github.com/PatrickGTR/gta-open)** - 以洛圣都为背景的警察与劫匪模式。 +- **[SF-CnR](https://github.com/zeelorenc/sf-cnr)** - 圣菲耶罗警察与劫匪游戏模式。 +- **[次世代角色扮演](https://github.com/NextGenerationGamingLLC/SA-MP-Development)** - 次世代游戏公司的SA:MP游戏模式。 +- **[SC-RP](https://github.com/seanny/SC-RP)** - 支持MySQL的角色扮演游戏模式。 + +## 滤镜脚本 + +- **[地图修复](https://github.com/NexiusTailer/MapFix)** - 修复GTA圣安地列斯地图的纹理错误。 +- **[SA:MP动画浏览器](https://github.com/Southclaws/samp-animbrowse)** - SA:MP动画浏览工具。 +- **[检测安卓用户](https://github.com/Fairuz-Afdhal/IsPlayerUsingAndroid)** - 检测玩家是否使用安卓设备。 +- **[文本绘图编辑器](https://github.com/Nickk888SAMP/TextDraw-Editor)** - 功能丰富的文本绘图编辑器。 +- **[终极创造器](https://github.com/NexiusTailer/Ultimate-Creator)** - 具备多项功能的先进地图编辑器。 +- **[Fusez地图编辑器](https://github.com/fusez/Map-Editor-V3)** - 游戏内地图编辑器。 +- **[材质工作室](https://github.com/Pottus/Texture-Studio)** - 支持16种材质索引和颜色设置的室内地图编辑器。 diff --git a/frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/changelog.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/changelog.md similarity index 76% rename from frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/changelog.md rename to frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/changelog.md index 1b1b5863d59..6b2042e52d0 100644 --- a/frontend/i18n/zh-cn/docusaurus-plugin-content-docs/current/changelog.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/changelog.md @@ -1,46 +1,86 @@ --- title: 更新日志 sidebar_label: 更新日志 -description: open.mp 开发进度和更新日志. +description: open.mp开发进度与更新日志。 --- -## **[v1.3.1.2748](https://github.com/openmultiplayer/open.mp/releases/tag/v1.3.1.2748) (最新版本)** +## **[v1.4.0.2779](https://github.com/openmultiplayer/open.mp/releases/tag/v1.4.0.2779) (最新版)** -open.mp 服务器的新版本终于发布了,其中有大量修复、大量性能改进和一些新增功能. +我们很高兴宣布最新服务器版本的发布! -我们的启动器现在也获得了新的更新,只需打开启动器并通过更新对话框更新即可。有关更新日志,请点击此处阅读: https://github.com/openmultiplayer/launcher/releases/tag/v1.4.0 +本次更新带来了多项重要修复,并引入激动人心的新功能:**open.mp 数据包加密**。 -### 服务器 +完整更新日志请查阅[此处](https://github.com/openmultiplayer/open.mp/releases/tag/v1.4.0.2779)。 -**新增:** +**新增功能:** -- 将服务器logo配置变量添加到 [config.json](server/config.json), 允许服务器设置显示在启动器和 Discord 状态中的logo. -- 为对话框响应添加更多数据有效性检查. -- 为菜单行添加有效性检查. -- 添加人类可读的 HTTP 错误. -- 通用 SA-MP API 兼容性的新定义. (`#define SAMP_COMPAT`) -- 消除传统脚本应用程序警告的新定义. (`#define LEGACY_SCRIPTING_API`) +- 实现与 open.mp 启动器配套使用的加密功能(需在`config.json`中启用`network.use_omp_encryption`) +- 通过[IsPlayerUsingOmp](scripting/functions/IsPlayerUsingOmp)原生函数检测 open.mp 玩家 +- 递归加载文件夹中的组件 +- 优先加载以$开头的组件(Linux 系统使用 RTLD_GLOBAL 加载) -**更改:** +**功能调整:** -- 当脚本(filterscript)(未)加载时, 删除不必要的 OnPlayerConnect 和 OnPlayerDisconnect。取而代之的是引入 [OnScriptLoadPlayer](scripting/callbacks/OnScriptLoadPlayer) 和 [OnScriptUnloadPlayer](scripting/callbacks/OnScriptUnloadPlayer) 回调. -- 从运行时警告中移除了一堆pawn原生已废弃内容. -- 检查 CDN URL 的有效性. -- 当传播时停止观察者同步. -- 生命值和护甲的默认值. -- 提高响应 Scores 和 Pings RPC 的性能。(记分板) -- 将无效武器插槽更改为 `-1` +- 优化视角模式有效性检查 +- 禁用 AMX 运行时的动态 DLL 加载(特别是用户安装 Compuphase 官网默认 Pawn 时) -**修复:** +**问题修复:** -- 修复我们从一开始就在处理的臭名昭著的 RakNet 崩溃问题,该问题影响了一些服务器. -- 修复在极少数情况下使用格式时字符串不显示的问题. -- 修复加载多个脚本时 crashdetect 无法找到文件名和行号的问题. -- 修复大量 RakNet 崩溃问题,内部内存管理更安全. -- 修复若干连接问题,并适当清理内部玩家池. -- 修复 [GetGameText](scripting/functions/GetGameText) 函数给出错误/损坏的值. -- 修复当用户的windows设置为使用非符号名称的语言时,open.mp windows版本无法加载的问题. -- 修正 `qawno/filterscript.new` 和 `qawno/gamemode.new` 文件中的回调标题. +- 修复移动端玩家设置皮肤的小问题 +- 修正 Windows 系统 GetTickCount 返回值 +- 修复特定事件和 Pawn 回调中销毁车辆导致的崩溃 +- 修正 GetVehicleLandingGearState 返回值反转问题 +- 修复玩家退出后启动器列表残留问题 +- 增强拖车和拖车同步的校验机制 +- 修复移动物体相关的崩溃问题 +- 修正 OnPlayerDeath 回调前玩家车辆数据重置问题 + +
+ +
+ +## [v1.3.1.2748](https://github.com/openmultiplayer/open.mp/releases/tag/v1.3.1.2748) + +
+点击展开 + +新版 open.mp 服务器终于发布!本次更新包含大量修复、多项性能改进和新增功能。 + +启动器已同步更新,打开启动器即可通过更新对话框获取新版。完整更新日志请查阅:https://github.com/openmultiplayer/launcher/releases/tag/v1.4.0 + +### 服务器端 + +**新增功能:** + +- 在[config.json](server/config.json)中添加服务器 Logo 配置项,可在启动器和 Discord 状态显示 +- 增强对话框响应的数据校验 +- 新增菜单行的有效性检查 +- 添加人性化 HTTP 错误提示 +- 新增 SA-MP API 兼容性定义(`#define SAMP_COMPAT`) +- 新增旧版脚本 API 警告静默定义(`#define LEGACY_SCRIPTING_API`) + +**功能调整:** + +- 移除侧脚本加载/卸载时不必要的 OnPlayerConnect/OnPlayerDisconnect 回调,改用[OnScriptLoadPlayer](scripting/callbacks/OnScriptLoadPlayer)和[OnScriptUnloadPlayer](scripting/callbacks/OnScriptUnloadPlayer) +- 移除 Pawn 原生函数的废弃警告 +- 校验 CDN 链接有效性 +- 停止广播观战者同步数据 +- 调整生命值和护甲默认值 +- 优化 Scores And Pings RPC 响应性能(计分板) +- 无效武器槽位返回`-1` + +**问题修复:** + +- 修复长期存在的 RakNet 崩溃问题 +- 修复罕见情况下格式化字符串显示异常 +- 解决多个脚本加载时 crashdetect 无法定位文件行号的问题 +- 修复多个 RakNet 崩溃问题,优化内存管理 +- 修复若干连接问题和玩家池清理机制 +- 修正[GetGameText](scripting/functions/GetGameText)返回值异常 +- 修复非 ASCII 系统语言环境下 Windows 版加载失败问题 +- 修正`qawno/filterscript.new`和`qawno/gamemode.new`回调头信息 + +

@@ -49,27 +89,27 @@ open.mp 服务器的新版本终于发布了,其中有大量修复、大量性 ## [v1.2.0.2670](https://github.com/openmultiplayer/open.mp/releases/tag/v1.2.0.2670)
-点击此处展开 +点击展开 -我们鼓励所有 open.mp 服务器更新到该版本。该版本不仅在性能上有明显改善,而且还进行了**重要的安全修复**. +我们强烈建议所有 open.mp 服务器升级至此版本。本次更新不仅显著提升性能,还包含**关键安全修复**。 -### 服务器 +### 服务器端 -**新增:** +**新增功能:** -- 新增配置变量,用于设置在 [open.mp 启动器](https://github.com/openmultiplayer/launcher/releases/latest) 中显示的横幅和 discord 邀请链接. -- 用于连接信息的新配置变量. (`logging.log_connection_messages`) -- 用于动画验证的新配置变量. (`game.validate_animations`) -- 新定义允许在代码中使用混合拼写功能. (`#define MIXED_SPELLINGS`) +- 新增横幅和 Discord 邀请链接配置项(显示于[open.mp 启动器](https://github.com/openmultiplayer/launcher/releases/latest)) +- 新增连接消息日志开关(`logging.log_connection_messages`) +- 新增动画验证配置项(`game.validate_animations`) +- 新增混合拼写函数兼容定义(`#define MIXED_SPELLINGS`) -**修复:** +**问题修复:** -- 一些安全修复. -- 播报系统现在默认使用 IPv4,而不是在可用时使用 IPv6. -- 修复 `Get(Player)ObjectMaterial(Text)` 以错误的格式和 modelid 返回颜色的问题. -- 修复 `Get(Player)Gravity` 返回整数而不是浮点数. -- 在不同地方验证造成伤害的原因(武器). -- 同步封禁,以便在需要时同时封禁多名玩家. +- 多项安全修复 +- 公告系统默认使用 IPv4(原 IPv6 优先问题) +- 修正`Get(Player)ObjectMaterial(Text)`返回颜色格式和模型 ID 错误 +- 修正`Get(Player)Gravity`返回整型而非浮点型问题 +- 完善多处伤害原因(武器)验证机制 +- 同步封禁操作以支持批量处理
@@ -80,28 +120,32 @@ open.mp 服务器的新版本终于发布了,其中有大量修复、大量性 ## [v1.1.0.2612](https://github.com/openmultiplayer/open.mp/releases/tag/v1.1.0.2612)
-点击此处展开 +点击展开 + +open.mp 现已结束 RC 阶段,正式进入稳定开发周期。v1.1.0.2612 修复了大量问题并统一了多项行为差异,建议及时更新以获得最佳体验。 + +open.mp 官方启动器正式发布!您现在可以: -open.mp 现已脱离 RC 阶段, 我们很高兴地宣布,我们终于足够稳定,可以走上持续开发的道路了. 在 v1.1.0.2612 版本中, 我们修复了大量错误和问题,并解决了许多行为差异. 因此,请确保您更新到最新版本,并顺利运行您的服务器. +- 可靠地浏览服务器列表 +- 选择心仪服务器 +- 一键加入游戏 -open.mp 启动器终于发布了,您现在可以可靠地浏览服务器、选择要玩的服务器并加入它了! -与以往使用 samp launcher 的体验相比,它将为您带来更多新功能,让您获得更好的体验. -可在该网址找到 https://github.com/openmultiplayer/launcher/releases +相较于传统启动器,新版带来诸多改进,访问地址:https://github.com/openmultiplayer/launcher/releases -### 服务器 +### 服务器端 -**新增:** +**新增功能:** -- x64 版本的 omp-server. -- 自动在插件名称中添加 `.so`. +- 发布 omp-server x64 版本 +- 自动为插件名添加`.so`扩展 -**更改:** +**功能调整:** -- 在 `Move(Player)Object` 函数中返回 `estimatedTime`. +- 在`Move(Player)Object`函数中返回`estimatedTime` -**修复:** +**问题修复:** -- 修复了当传递无效的 `vehicleid` 时 `GetVehicleLastDriver` 返回 0 的问题. +- 修正`GetVehicleLastDriver`参数无效时返回 0 的问题
@@ -112,17 +156,17 @@ open.mp 启动器终于发布了,您现在可以可靠地浏览服务器、选 ## [RC2](https://github.com/openmultiplayer/open.mp/releases/tag/v1-RC2)
-点击此处展开 +点击展开 -open.mp 服务器的候选发布版本 2 (RC2) . +open.mp 服务器第二候选发布版(RC2) -### 服务器 +### 服务器端 -**新的函数:** +**新增函数:** - [GetPlayerMarkerForPlayer](scripting/functions/GetPlayerMarkerForPlayer) -**已废弃的功能:** +**废弃函数:** - GetPlayer3DTextLabelVirtualW - SetPlayer3DTextLabelDrawDist @@ -177,11 +221,11 @@ open.mp 服务器的候选发布版本 2 (RC2) . - GetVehicleTower - ChangeVehicleColor -**修复:** +**问题修复:** -- 修复 Linux legacy插件需要使用 `.so` 的问题. -- 向其他玩家正确显示附加对象. -- 修复加载无效pawn内存时崩溃的问题. +- 修复 Linux 旧版插件需要`.so`的问题 +- 正确显示附加物体给其他玩家 +- 修复加载无效 Pawn 内存导致的崩溃
@@ -192,19 +236,19 @@ open.mp 服务器的候选发布版本 2 (RC2) . ## [RC1](https://github.com/openmultiplayer/open.mp/releases/tag/v1-RC1)
-点击此处展开 +点击展开 -open.mp 服务器的[候选发布版本 1 (RC1)](https://www.open.mp/blog/release-candidate-1)!我们现已脱离测试阶段. +[第一候选发布版(RC1)](https://www.open.mp/blog/release-candidate-1)!我们已结束测试阶段。 -### 服务器 +### 服务器端 -**新增:** +**新增功能:** -- 为 `AddMenuItem`, `Create3DTextLabel`, `CreateMenu`, `CreatePlayer3DTextLabel`, `CreatePlayerTextDraw`, `GameTextForAll`, `GameTextForPlayer`, `PlayerTextDrawSetString`, `SendClientMessage`, `SendClientMessageToAll`, `SendRconCommand`, `SetMenuColumnHeader`, `SetObjectMaterialText`, `SetPlayerObjectMaterialText`, `SetPVarString`, `SetSVarString`, `ShowPlayerDialog`, `TextDrawCreate`, `TextDrawSetString`, `Update3DTextLabelText`, `UpdatePlayer3DTextLabelText` 函数新增了 `\{Float, _}:...` . 它们现在都已格式化. +- 为`AddMenuItem`, `Create3DTextLabel`, `CreateMenu`, `CreatePlayer3DTextLabel`, `CreatePlayerTextDraw`, `GameTextForAll`, `GameTextForPlayer`, `PlayerTextDrawSetString`, `SendClientMessage`, `SendClientMessageToAll`, `SendRconCommand`, `SetMenuColumnHeader`, `SetObjectMaterialText`, `SetPlayerObjectMaterialText`, `SetPVarString`, `SetSVarString`, `ShowPlayerDialog`, `TextDrawCreate`, `TextDrawSetString`, `Update3DTextLabelText`, `UpdatePlayer3DTextLabelText`函数添加`\{Float, _\}:...`格式化支持 -**修复:** +**问题修复:** -- 降低内存. +- 内存优化
@@ -215,11 +259,11 @@ open.mp 服务器的[候选发布版本 1 (RC1)](https://www.open.mp/blog/releas ## [Beta v0.0.11.2331](https://github.com/openmultiplayer/open.mp/releases/tag/v0.0.11.2331)
-点击此处展开 +点击展开 -### 服务器 +### 服务器端 -**新的函数:** +**新增函数:** - [TogglePlayerWidescreen](scripting/functions/TogglePlayerWidescreen) - [IsPlayerWidescreenToggled](scripting/functions/IsPlayerWidescreenToggled) @@ -458,7 +502,7 @@ open.mp 服务器的[候选发布版本 1 (RC1)](https://www.open.mp/blog/releas - [EnableAllAnimations](scripting/functions/EnableAllAnimations) - [GetWeather](scripting/functions/GetWeather) -**新的回调:** +**新增回调:** - [OnPlayerEnterGangZone](scripting/callbacks/OnPlayerEnterGangZone) - [OnPlayerLeaveGangZone](scripting/callbacks/OnPlayerLeaveGangZone) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/ClientCommands.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/ClientCommands.md new file mode 100644 index 00000000000..b94bdb64dc5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/ClientCommands.md @@ -0,0 +1,45 @@ +--- +title: 客户端命令列表 +sidebar_label: 客户端命令列表 +description: 所有客户端命令列表。 +--- + +## 命令 + +| 命令 | 说明 | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| /quit (/q) | 该命令的功能不言自明,用于退出游戏。您也可以使用更简短的 /q 命令,其功能完全相同。 | +| /save | /save 可能是最常用的默认命令,也是最实用的命令。输入该命令后,您当前的位置会被保存到用户文件目录下的 savedpositions.txt 文件中,可在脚本中使用这些坐标。 | +| /rs | /rs(原始保存)与 /save 类似,但仅保存当前位置和朝向角度到用户文件目录下的 rawpositions.txt 文件中。不会保存职业和武器等额外信息。 | +| /interior | 与 /save 同等重要的命令,直接在聊天框显示您当前所处的室内场景编号。 | +| /vw | 与 /save 同等重要的命令,直接在聊天框显示您当前所在的虚拟世界编号。 | +| /fpslimit | 设置游戏帧率上限(FPS)。数值越高游戏越流畅。若在图形选项中关闭帧率限制则此命令无效。可设置范围 20-90,默认 50。对应 sa-mp.cfg 文件的 'fpslimit' 选项。 | +| /pagesize | 设置聊天窗口显示的行数(10-20 行),默认显示 10 行。对应 sa-mp.cfg 文件的 'pagesize' 选项。 | +| /headmove | 控制玩家头部是否随视角转动(本地生效,其他玩家仍会看到头部转动)。对应 sa-mp.cfg 文件的 'disableheadmove' 选项。 | +| /timestamp | 切换聊天框消息时间戳显示(显示本地计算机时间而非服务器时间)。对应 sa-mp.cfg 文件的 'timestamp' 选项。 | +| /dl | 调试标签(Debug Labels)功能开关。开启后会在车辆上显示调试信息,包括:车辆 ID、模型、耐久度、预加载状态、与玩家距离、拖挂信息、可用座位、当前位置和生成坐标。 | +| /nametagstatus | 切换暂停玩家昵称标签旁沙漏图标显示(默认开启)。包括最小化游戏(alt-tab)、暂停菜单(ESC)、断线(崩溃/超时)和截图导致游戏冻结超过 3 秒的情况。对应 sa-mp.cfg 文件的 'nonametagstatus' 选项。 | +| /mem | 显示当前内存使用量(通常仅显示 128 MB)。 | +| /audiomsg | 切换音频流 URL 加载提示信息显示。对应 sa-mp.cfg 文件的 'audiomsgoff' 选项。 | +| /fontsize | 调整 UI 字体大小(聊天框/对话框等),有效范围-3 至 5。 | +| /ctd | 该命令在 SA-MP 0.3.7 RC2 版本加入。启用玩家视角目标的客户端调试功能。 | +| /rcon | 主要用于服务器管理。执行远程控制台命令(RCON 是内置管理员系统,全称[远程控制](../server/ControllingServer#using-rcon))。 | +| /hudscalefix | 该命令在 SA-MP 0.3.7 R3 版本加入。启用/禁用雷达比例修正,使宽屏分辨率下雷达显示更协调(解决'彩蛋式显示'问题)。对应 sa-mp.cfg 文件的 'nohudscale' 选项。 | + +## 配置文件 sa-mp.cfg + +| 选项 | 说明 | +| --------------- | ------------------------------------------------------------------------------------------ | +| pagesize | 参见 /pagesize | +| fpslimit | 参见 /fpslimit | +| disableheadmove | 参见 /headmove | +| timestamp | 参见 /timestamp | +| ime | 控制聊天窗口是否支持输入法文本编辑和语言切换。1 启用 IME,0 禁用 | +| audiomsgoff | 参见 /audiomsg | +| multicore | 多核 CPU 支持开关。默认 1(启用多核支持)。若出现鼠标问题可设为 0 | +| directmode | 为存在聊天文本显示问题的玩家启用直接屏幕渲染模式(0 禁用,1 启用) | +| audioproxyoff | 设为 1 时,即使 Windows 网络设置中配置了代理服务器,SA-MP 音频流也不会使用代理 | +| nonametagstatus | 参见 /nametagstatus | +| fontface | 自定义聊天/对话框/积分板字体(如:fontface="Comic Sans MS")。非官方支持功能,可能导致问题 | +| fontweight | 字体粗细设置。0=粗体(默认),1=正常 | +| nohudscale | 该选项在 0.3.7 R3 版本加入。参见 /hudscalefix | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/ClientOnLinux.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/ClientOnLinux.md new file mode 100644 index 00000000000..dedbba90183 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/ClientOnLinux.md @@ -0,0 +1,47 @@ +--- +title: 在Linux上运行open.mp客户端 +sidebar_label: 在Linux上运行open.mp客户端 +description: 在Linux系统运行open.mp客户端的操作指南 +--- + +# 在 Linux 系统运行 open.mp 客户端的操作指南 + +:::warning + +当前方案无法获得完整图形界面,必须通过命令行在 Wine 容器中执行。 + +::: + +### 测试环境 + +- Lutris: wine-ge 8-26 32 位容器 +- Bottles: soda-9.0-1 + +### 操作步骤 + +1. 确保已创建包含 GTA San Andreas 安装的 Wine 容器 +2. 下载[open.mp 启动器](https://github.com/openmultiploader/launcher/releases/latest)并安装到 Wine 容器内 +3. 获取[SA-MP 客户端](https://github.com/KrustyKoyle/files.sa-mp.com-Archive)并安装至同一 Wine 容器 +4. 下载[omp-client.dll](https://assets.open.mp/omp-client.dll)文件,复制到容器用户目录的`AppData\Local\mp.open.launcher\omp\`路径 + +最后可通过 Wine 容器的命令行执行启动器,或编写.bat 脚本实现快捷启动。 + +### 示例启动命令 + +``` +Z:\path\to\omp-launcher.exe -h server.ip -p port -n user.name -g Z:\home\yourname\path\to\gta-san-andreas\install\ +``` + +:::tip + +可通过添加--help 参数查看完整命令行选项:`omp-launcher.exe --help` + +::: + +## 故障排查 + +| 问题现象 | 解决方案 | +| ---------------------- | ------------------------------------------------------------------ | +| 暂停游戏时崩溃 | 安装 winetricks 的 allfonts 组件补全缺失字体 | +| 服务器登录界面无法显示 | 在 Lutris 中切换"优先使用系统库"选项 | +| 出现黑框且游戏无法加载 | 检查命令行参数是否完整,确认安装路径参数(-g)指向正确的 GTA SA 目录 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/CommonClientIssues.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/CommonClientIssues.md new file mode 100644 index 00000000000..8d6404114ae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/CommonClientIssues.md @@ -0,0 +1,82 @@ +--- +title: 常见客户端问题 +sidebar_label: 常见客户端问题 +--- + +### 出现"San Andreas 无法找到"错误 + +San Andreas Multiplayer **并非**独立程序!它需要基于《侠盗猎车手:圣安地列斯》PC 版(必须为**欧美 v1.0 版本**)运行。v2.0、Steam 版或 Direct2Drive 版本均不兼容。[点击此处下载降级补丁](http://grandtheftauto.filefront.com/file/GTA_SA_Downgrader_Patch;74661) + +### 服务器列表无法显示 + +SA:MP 内置浏览器已失效。请下载新版[open.mp 启动器](https://github.com/openmultiplayer/launcher/releases/latest)。若仍无法显示服务器,请确保防火墙已放行 open.mp。由于防火墙软件种类繁多,建议查阅厂商文档或通过搜索引擎解决。同时请确认使用最新稳定版 open.mp! + +### 载入单机模式而非 SA:MP + +:::warning + +正确加载 SA:MP 时不应出现"新游戏/载入游戏"等单机菜单选项。若看到"新游戏",说明加载的是单机模式。 + +::: + +该问题通常由两种原因导致:SA:MP 安装路径错误或游戏版本不符。若版本问题,请使用降级补丁。[点击下载](http://grandtheftauto.filefront.com/file/GTA_SA_Downgrader_Patch;74661) + +有时单机菜单会短暂显示但 SA:MP 实际已加载。此时选择任意菜单项后按 ESC 退出即可继续加载。 + +### 连接服务器时提示"昵称不可用" + +请检查昵称是否符合规范: + +- 仅允许使用 0-9、a-z、$$$$、()、\$、@、.、\_ 和 = 字符 +- 长度不超过 20 字符 +- 服务器存在同名在线玩家(快速重连时可能触发) +- Windows 服务器运行超过 50 天可能引发此 BUG + +### 卡在"正在连接 IP:端口..."界面 + +可能原因: + +1. 服务器离线 +2. 防火墙拦截(尝试临时禁用防火墙测试) +3. SA:MP 版本过旧[下载最新版](https://sa-mp.mp/downloads/) + +### 改装版 GTA 导致 SA:MP 无法加载 + +移除所有游戏模组(MOD)即可解决。 + +### 启动游戏后无响应 + +解决方案: + +1. 删除用户文件夹中的 gta_sa.set 文件 +2. 移除所有作弊工具/模组 + +### 车辆爆炸时游戏崩溃(双显示器用户) + +三种解决方案: + +1. 游戏时禁用副屏 +2. 设置视觉特效质量为低(ESC > 选项 > 显示设置 > 高级) +3. 重命名游戏文件夹(如"GTA San Andreas2") + +### 暂停菜单返回后鼠标失灵 + +解决方案: + +1. 在[sa-mp.cfg](ClientCommands#file-sa-mpcfg)中禁用多核支持(设置 multicore=0) +2. 反复按 ESC 键直至鼠标恢复响应 + +### 缺失 dinput8.dll 文件 + +解决方案: + +1. 重新安装 DirectX 并重启系统 +2. 手动复制 C:\\Windows\\System32\\dinput.dll 到游戏根目录 + +### 无法显示玩家昵称标签 + +可能原因: + +1. 服务器全局禁用名牌 +2. 使用 Intel HD 集成显卡(建议安装独立显卡) +3. 目前暂无通用解决方案,与硬件兼容性相关 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/CrashAddresses.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/CrashAddresses.md new file mode 100644 index 00000000000..01aef1a0afd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/CrashAddresses.md @@ -0,0 +1,34 @@ +--- +title: 崩溃地址 +sidebar_label: 崩溃地址 +--- + +下表列出了常见崩溃地址,可用于问题追踪和预防。多数客户端崩溃由脚本问题引发,但需注意当前 SA:MP 已具备较高稳定性。 + +## 客户端崩溃地址 + +| 出现频率 | 内存地址 | 原因 | 解决方案 | +| -------- | ------------------------ | --------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| 罕见 | 0x00000000 | SA:MP 初始化失败 | 重新安装游戏并确保单机模式可运行,移除所有模组 | +| 罕见 | 0x006E3D17 | 角色皮肤相关。常见于玩家在车辆内/进出车辆时更换皮肤 | 确保玩家处于步行状态时更换皮肤 | +| 罕见 | 0x0058370A | 车辆/视角相关。当脚本尝试将玩家传送至未完成加载的车辆时触发 | 创建新车辆后等待数百毫秒再传送玩家,或使用 SetCameraBehindPlayer 预先调整视角 | +| 罕见 | 0x0040F64C | Windows 7/Vista 权限问题,与 SA:MP 安装程序相关 | 升级至 SA:MP 0.3.7,重命名游戏目录 | +| 罕见 | 0x0059F8B4 | 客户端加载 SA:MP 物体失败(通常因 samp.img 文件缺失) | 以管理员权限重新安装客户端 | +| 罕见 | 0x00746929 或 0x0081214A | 客户端配置异常 | 通过任务管理器终止 gta_sa.exe 进程 | +| 常见 | 0x007F0BF7 | 车辆改装异常(如为摩托车添加氮气加速/尾翼)或客户端车辆模组冲突 | 使用论坛提供的改装校验脚本 | +| 常见 | 0x00544BC8 | 物体数量超限(超过客户端渲染能力) | 使用物体流加载器(streamer),配置可见物体上限 | +| 常见 | 0x00415D47 或 0x00536DF4 | 物体贴图过载(可能与碰撞体相关) | 通过分组排除法定位问题物体并移除 | +| 罕见 | 0x593C6F | 房屋抢劫任务可拾取物体过多 | 减少可拾取物体数量 | + +## 聊天框警告代码 + +| 错误信息 | 原因 | 解决方案 | +| -------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------- | +| Exception 0xC0000005 at 0x5E5815 | 复杂系统级错误(涉及角色动画混合/音频处理)。常见于进入车辆时触发脚本事件(如获得武器/传送) | - | +| Exception 0x0000005 at 0x534134 | Windows 7/Vista 权限问题 | 以管理员权限运行 SA:MP | +| Exception 0xC0000005 at 0x544BC8 | 同 0x00544BC8 崩溃地址 | 参考 0x00544BC8 解决方案 | +| Exception 0xC0000005 at 0x536DF4 | 同 0x00544BC8 崩溃地址 | 参考 0x00544BC8 解决方案 | +| Exception 0xC0000005 at 0x7F120E | 非法车辆改装(客户端安装的 handling.cfg/vehicles.ide 修改未被 SA:MP 加载) | 移除车辆数据修改以保证公平性 | +| Exception At Address: 0x0040FB80 | Windows 7 x64 兼容模式问题(使用 Windows 2000/XP/Vista 兼容模式时触发) | 禁用兼容模式并以管理员权限运行 | +| Exception At Address:0x0071A708 | 未知错误 | 关闭选项>显示设置中的"Legend"选项 | +| Exception at Address: 0x004DFE92 | 配置文件损坏 | 删除文档中的 gta_sa.set 文件 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/_.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/_.md new file mode 100644 index 00000000000..76324690ab4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/_.md @@ -0,0 +1,7 @@ +--- +title: 客户端 +sidebar_label: 客户端 +description: 本类别包含有关SA-MP客户端功能及支持的信息。 +--- + +本类别包含有关SA-MP客户端功能及支持的信息。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/sa-mp.cfg.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/sa-mp.cfg.md new file mode 100644 index 00000000000..a09f3270e04 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/client/sa-mp.cfg.md @@ -0,0 +1,26 @@ +--- +title: sa-mp.cfg +sidebar_label: sa-mp.cfg +description: SA-MP客户端配置文件 +--- + +## 配置文件说明 + +`sa-mp.cfg` 是用于配置 SA-MP 客户端设置的配置文件。该文件位于 Windows 用户账户下的`我的文档\GTA San Andreas User Files\SAMP`文件夹中,可使用记事本等文本编辑器进行编辑。 + +## 配置选项 + +| 选项 | 说明 | +| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **pagesize** | 设置聊天窗口显示的行数(10-20 行),默认显示 10 行。可通过游戏内命令 `/pagesize` 实时调整。 | +| **fpslimit** | 设置帧率上限(需在 GTA:SA 菜单中启用帧率限制器)。有效值 20-90,默认 50。对应游戏内命令 `/fpslimit`。[帧率说明](http://en.wikipedia.org/wiki/Frame_rate "http://en.wikipedia.org/wiki/Frame_rate") | +| **disableheadmove** | 控制玩家头部是否随视角转动(1=禁用 0=启用)。可通过 `/headmove` 命令切换。 | +| **timestamp** | 在聊天消息旁显示本地时间戳(1=启用 0=禁用)。使用 `/timestamp` 命令切换。 | +| **ime** | 控制聊天窗口是否支持输入法文本编辑和语言切换(1=启用 0=禁用)。 | +| **multicore** | 多核 CPU 支持开关(默认 1=启用)。若出现鼠标问题可设为 0。 | +| **directmode** | 为存在聊天文本显示问题的玩家启用直接屏幕渲染模式(0=禁用 1=启用)。 | +| **audiomsgoff** | 禁用音频流 URL 加载提示(1=不显示提示)。对应 `/audiomsg` 命令。 | +| **audioproxyoff** | 禁用 Windows 代理服务器进行音频流传输(1=绕过代理)。 | +| **nonametagstatus** | 暂停玩家昵称标签旁显示沙漏图标(默认 0=启用)。使用 `/nametagstatus` 命令调整。 | +| **fontface** | 自定义 UI 字体(示例:`fontface="Comic Sans MS"`)。非官方支持功能,可能导致异常。 | +| **fontweight** | 字体粗细设置(0=粗体[默认] 1=正常)。 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.md new file mode 100644 index 00000000000..25966796040 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.md @@ -0,0 +1,31 @@ +--- +title: 简介 +sidebar_label: 简介 +description: 关于 open.mp 和 SA-MP 修改版的文档 +sidebar_position: 1 +--- + +# SA-MP Wiki 与 open.mp 文档 + +欢迎来到由 open.mp 团队及广大 SA-MP 社区共同维护的 SA-MP/open.mp 知识库! + +本站致力于为 SA-MP 和 open.mp 提供易于访问且方便贡献的文档资源。 + +## SA-MP 原版 Wiki 现状 + +遗憾的是,原 SA-MP Wiki 已于 2020 年 9 月下旬下线,后以不可编辑的存档形式恢复。 + +我们需要社区的力量将原 Wiki 内容迁移至这个新家!若您有意参与,请查阅[贡献指南](/docs/meta/Contributing)了解详情。 + +如果您不熟悉 GitHub 使用或 HTML 转换也无需担心!您可以通过以下方式提供帮助: + +- 通过 [Discord](https://discord.gg/samp)、[论坛](https://forum.open.mp) 或社交媒体反馈问题 +- 最重要的事:_广而告之!_ 欢迎收藏本站并分享给所有寻找 SA-MP Wiki 下落的开发者 + +我们诚邀您参与以下内容的完善: + +- 文档改进 +- 常见任务教程(如构建基础游戏模式) +- 常用库与插件使用指南 + +若您有意贡献,请访问 [GitHub 项目页](https://github.com/openmultiplayer/web)。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/meta/Contributing.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/meta/Contributing.md new file mode 100644 index 00000000000..146c836f786 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/meta/Contributing.md @@ -0,0 +1,120 @@ +--- +title: 贡献指南 +sidebar_label: 贡献指南 +description: 参与SA-MP Wiki与open.mp文档贡献的完整指南 +--- + +本文档源码向所有人开放贡献!您只需拥有[GitHub](https://github.com)账号即可参与,无需掌握 Git 技术,所有操作均可通过网页界面完成! + +如需维护特定语言版本,请向[`CODEOWNERS`](https://github.com/openmultiplayer/web/blob/master/CODEOWNERS)文件提交 PR,在对应语言目录添加您的 GitHub 用户名。 + +## 内容编辑 + +每个页面顶部均设有编辑入口: + +![每个Wiki页面上的"编辑此页面"链接](https://assets.open.mp/assets/images/contributing/edit-this-page.png) + +以[SetVehicleAngularVelocity](../scripting/functions/SetVehicleAngularVelocity.md)页面为例,点击编辑按钮将跳转至[GitHub 编辑界面](https://github.com/openmultiplayer/web/blob/master/docs/scripting/functions/SetVehicleAngularVelocity.mdxx),登录后可直接在线修改内容。 + +提交修改后创建"Pull Request",Wiki 维护者与社区成员将审核您的变更,经讨论确认后合并至主分支。 + +## 新增内容 + +### GitHub 网页端 + +在 GitHub 目录页点击右上角"Add file"按钮: + +![新增文件按钮](https://assets.open.mp/assets/images/contributing/add-new-file.png) + +支持直接上传 Markdown 文件或在线编辑。文件扩展名必须为`.md`,格式规范参考[Markdown 指南](https://guides.github.com/features/mastering-markdown/)。 + +### Git 本地操作 + +克隆仓库至本地: + +```sh +git clone https://github.com/openmultiplayer/wiki.git +``` + +推荐使用 Visual Studio Code 编辑,安装以下扩展提升效率: + +- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) - 语法规范检查 +- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) - 自动格式化工具 + +启用"保存时格式化"功能确保风格统一。 + +## 格式规范 + +### 内部链接 + +使用相对路径: + +```md +✅ [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer) +❌ [OnPlayerClickPlayer](https://www.open.mp/docs/scripting/callbacks/OnPlayerClickPlayer) +``` + +### 图片资源 + +存放路径:`/static/images/子目录` + +引用方式:`![描述](/images/文件名.png)` + +### 元数据头 + +每个文档开头必须包含: + +```mdx +--- +title: 文档标题 +sidebar_label: 侧边栏标签 +description: 页面描述 +--- +``` + +### 标题层级 + +禁止使用一级标题(由系统自动生成),从二级标题开始: + +```md +✅ ## 子章节 +❌ # 主标题 +``` + +### 技术术语标注 + +函数名、参数等技术要素使用反引号标注: + +```md +`fopen`函数返回带`File:`标签的值 +``` + +### 表格规范 + +必须包含表头: + +```md +| 生命值 | 引擎状态 | +| ------ | -------- | +| 650 | 完好无损 | +``` + +## SA-MP Wiki 迁移指南 + +### HTML 内容提取 + +1. 使用浏览器开发者工具定位`
`元素 +2. 复制内部 HTML 代码 + +### 格式转换工具 + +- 基础 HTML 转 Markdown:[Turndown](https://mixmark-io.github.io/turndown/) +- 表格转换:[Markdown Tables](https://jmalarcon.github.io/markdowntables/) + +### 内容清理 + +转换后需人工校验格式,未完成稿件可提交 PR 由社区协作完善。 + +## 贡献者协议 + +所有贡献需签署[贡献者许可协议(CLA)](https://cla-assistant.io/openmultiplayer/homepage),首次提交 PR 时系统将自动提示签署流程。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md new file mode 100644 index 00000000000..91be7aa404e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md @@ -0,0 +1,43 @@ +--- +title: OnActorStreamIn +sidebar_label: OnActorStreamIn +description: 当角色被玩家客户端流加载时触发该回调。 +tags: ["角色"] +--- + + + +## 描述 + +当角色被玩家客户端流加载时触发该回调。 + +| 参数 | 说明 | +| ----------- | ---------------------- | +| actorid | 已为玩家流加载的角色ID | +| forplayerid | 触发流加载操作的玩家ID | + +## 返回值 + +在滤镜脚本中总是优先被调用。 + +## 示例 + +```c +public OnActorStreamIn(actorid, forplayerid) +{ + new string[48]; + format(string, sizeof(string), "角色 %d 已为您完成流加载。", actorid); + SendClientMessage(forplayerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 注意 + + + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnActorStreamOut](OnActorStreamOut): 当角色被玩家客户端流卸载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md new file mode 100644 index 00000000000..038f5b02d49 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md @@ -0,0 +1,43 @@ +--- +title: OnActorStreamOut +sidebar_label: OnActorStreamOut +description: 当角色被玩家客户端流卸载时触发该回调。 +tags: ["角色"] +--- + + + +## 描述 + +当角色被玩家客户端流卸载时触发该回调。 + +| 参数 | 说明 | +| ----------- | ---------------------- | +| actorid | 已为玩家流卸载的角色ID | +| forplayerid | 触发流卸载操作的玩家ID | + +## 返回值 + +在滤镜脚本中总是优先被调用。 + +## 示例 + +```c +public OnActorStreamOut(actorid, forplayerid) +{ + new string[48]; + format(string, sizeof(string), "角色 %d 已为您完成流卸载。", actorid); + SendClientMessage(forplayerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 注意 + + + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnActorStreamIn](OnActorStreamIn): 当角色被玩家客户端流加载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientCheckResponse.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientCheckResponse.md new file mode 100644 index 00000000000..be7172adf23 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientCheckResponse.md @@ -0,0 +1,60 @@ +--- +title: OnClientCheckResponse +sidebar_label: OnClientCheckResponse +description: 当SendClientCheck请求完成时触发该回调 +tags: [] +--- + +## 描述 + +当SendClientCheck请求完成时触发该回调。 + +| 参数 | 说明 | +| -------- | -------------- | +| playerid | 被检测的玩家ID | +| actionid | 执行的检测类型 | +| memaddr | 请求的内存地址 | +| retndata | 检测结果 | + +## 返回值 + +在滤镜脚本中总是优先被调用。 + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + SendClientCheck(playerid, 0x48, 0, 0, 2); + return 1; +} + +public OnClientCheckResponse(playerid, actionid, memaddr, retndata) +{ + if (actionid == 0x48) // 或72 + { + print("玩家正在使用PC客户端连接。"); + } + return 1; +} +``` + +## 注意 + +:::warning + +**SA:MP 服务端**:该回调仅在滤镜脚本中触发 + +**Open Multiplayer 服务端**:该回调在游戏模式/滤镜脚本中均可正常触发 + +::: + +## 相关函数 + +以下函数可能与当前回调存在关联: + +- [SendClientCheck](../functions/SendClientCheck):对客户端执行内存检测 + +## 相关资源 + +- [操作码](../resources/opcodes):检测类型ID及其用途说明 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientMessage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientMessage.md new file mode 100644 index 00000000000..f3f18f984d9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnClientMessage.md @@ -0,0 +1,42 @@ +--- +title: OnClientMessage +sidebar_label: OnClientMessage +description: 当NPC接收到客户端消息时触发该回调 +tags: [] +--- + +## 描述 + +当NPC检测到客户端消息时触发该回调。以下情况均会触发: + +- 使用[SendClientMessageToAll](../functions/SendClientMessageToAll)函数时 +- 向NPC发送[SendClientMessage](../functions/SendClientMessage)函数时 + +该回调不会在玩家发送聊天消息时触发,相关功能请参阅[NPC:OnPlayerText](OnPlayerText)。 + +| 参数 | 说明 | +| ------ | ------------------ | +| color | 客户端消息的颜色值 | +| text[] | 实际消息内容 | + +## 返回值 + +本回调不处理返回值。 + +## 示例 + +```c +public OnClientMessage(color, text[]) +{ + if (strfind(text,"银行余额: $0") != -1) + { + SendClientMessage(playerid, -1, "我是个穷光蛋 :("); + } +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerText](OnPlayerText):当任意实体(玩家、其他NPC或当前NPC自身)发送聊天消息时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md new file mode 100644 index 00000000000..0982df170fc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -0,0 +1,187 @@ +--- +title: OnDialogResponse +sidebar_label: OnDialogResponse +description: 当玩家响应通过ShowPlayerDialog显示的对话框时触发该回调。响应方式包括点击按钮、按下ENTER/ESC键或双击列表项(列表式对话框)。 +tags: ["对话框"] +--- + +## 描述 + +当玩家响应通过ShowPlayerDialog显示的对话框时触发该回调。响应方式包括: + +- 点击按钮 +- 按下ENTER/ESC键 +- 双击列表项(针对列表式对话框) + +| 参数 | 说明 | +| ----------- | ----------------------------------------------------------- | +| playerid | 响应对话框的玩家ID | +| dialogid | 对话框ID(与ShowPlayerDialog中设置的ID对应) | +| response | 按钮响应值:1=左按钮,0=右按钮(若仅显示单个按钮则始终为1) | +| listitem | 玩家选择的列表项ID(从0开始计数),非列表式对话框该值为-1 | +| inputtext[] | 玩家在输入框中输入的文本内容 或 选中的列表项文本 | + +## 返回值 + +该回调在滤镜脚本中总是优先触发。返回1将阻止其他滤镜脚本处理该回调。 + +## 示例 + +**消息框样式 (DIALOG_STYLE_MSGBOX)** + +```c +// 定义对话框ID +#define DIALOG_RULES 1 + +// 在某个指令中 +ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "服务器规则", +"- 禁止作弊\n- 禁止刷屏\n- 尊重管理员\n\n您是否同意遵守这些规则?", "同意", "拒绝"); + +public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) +{ + if (dialogid == DIALOG_RULES) + { + if (response) // 点击左按钮或按下ENTER + { + SendClientMessage(playerid, COLOR_GREEN, "感谢您同意遵守服务器规则!"); + } + else // 按下ESC或点击右按钮 + { + Kick(playerid); + } + return 1; // 返回1表示已处理该对话框 + } + + return 0; // 返回0表示未处理其他对话框 +} +``` + +**输入框样式 (DIALOG_STYLE_INPUT)** + +```c +#define DIALOG_LOGIN 2 + +// 在某个指令中 +ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "登录", +"请输入您的密码:", "登录", "取消"); + +public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) +{ + if (dialogid == DIALOG_LOGIN) + { + if (!response) // 按下ESC或点击右按钮 + { + Kick(playerid); + } + else + { + if (CheckPassword(playerid, inputtext)) + { + SendClientMessage(playerid, COLOR_RED, "登录成功!"); + } + else + { + SendClientMessage(playerid, COLOR_RED, "登录失败"); + + // 重新显示登录对话框 + ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, + "登录", "请输入您的密码:", "登录", "取消"); + } + } + return 1; + } + + return 0; +} +``` + +**列表样式 (DIALOG_STYLE_LIST)** + +```c +#define DIALOG_WEAPONS 3 + +// 在某个指令中 +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "武器库", +"沙漠之鹰\nAK-47\n战斗霰弹枪", "选择", "关闭"); + +public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) +{ + if (dialogid == DIALOG_WEAPONS) + { + if (response) // 点击选择按钮或双击列表项 + { + switch (listitem) + { + case 0: GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14); // 沙漠之鹰 + case 1: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // AK-47 + case 2: GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28); // 战斗霰弹枪 + } + } + return 1; + } + + return 0; +} +``` + +**表格列表样式 (DIALOG_STYLE_TABLIST)** + +```c +#define DIALOG_WEAPONS 3 + +// 在某个指令中 +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "武器商店", +"武器\t弹药\t价格\n\ +M4\t120\t500\n\ +MP5\t90\t350\n\ +AK-47\t120\t400", +"购买", "关闭"); + +public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) +{ + if (dialogid == DIALOG_WEAPONS) + { + if (response) // 点击购买或双击武器 + { + switch (listitem) + { + case 0: GivePlayerWeapon(playerid, WEAPON_M4, 120); // M4 + case 1: GivePlayerWeapon(playerid, WEAPON_MP5, 90); // MP5 + case 2: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // AK-47 + } + } + return 1; + } + + return 0; +} +``` + +## 注意 + +:::tip + +参数值会根据对话框样式不同而变化([点击查看详细示例](../resources/dialogstyles)) + +::: + +:::tip + +使用switch-case语句处理多个对话框比if语句更高效 + +::: + +:::warning + +服务器重启后玩家的对话框不会自动关闭。若玩家在服务器重启后响应对话框,服务端会提示警告:"Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID" + +::: + +## 相关函数 + +以下函数可能与当前回调相关: + +- [ShowPlayerDialog](../functions/ShowPlayerDialog):向玩家显示对话框 +- [GetPlayerDialogID](../functions/GetPlayerDialogID):获取玩家当前对话框ID +- [GetPlayerDialogData](../functions/GetPlayerDialogData):获取玩家当前对话框数据 +- [HidePlayerDialog](../functions/HidePlayerDialog):隐藏玩家当前对话框 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnEnterExitModShop.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnEnterExitModShop.md new file mode 100644 index 00000000000..2b7422f344e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnEnterExitModShop.md @@ -0,0 +1,59 @@ +--- +title: OnEnterExitModShop +sidebar_label: OnEnterExitModShop +description: 当玩家进入或离开改装店时触发该回调 +tags: ["玩家"] +--- + +## 描述 + +当玩家进入或离开车辆改装店时触发该回调。 + +| 参数 | 说明 | +| ---------- | ----------------------------------------- | +| playerid | 触发事件的玩家 ID | +| enterexit | 状态标识:1=进入改装店,0=离开改装店 | +| interiorid | 玩家进入的改装店室内空间 ID(离开时为 0) | + +## 返回值 + +在滤镜脚本中总是优先被调用。 + +## 示例 + +```c +public OnEnterExitModShop(playerid, enterexit, interiorid) +{ + if (enterexit == 0) // 当enterexit为0时表示玩家离开 + { + SendClientMessage(playerid, COLOR_WHITE, "改装完成!已扣除改装费¥100。"); + GivePlayerMoney(playerid, -100); + } + return 1; +} +``` + +## 注意 + +:::warning + +已知问题: + +- 多名玩家同时进入同一改装店时会发生模型碰撞 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnVehicleMod](OnVehicleMod):当车辆被改装时触发 +- [OnVehicleRespray](OnVehicleRespray):玩家离开改装店时触发(即使未更改颜色) +- [OnVehiclePaintjob](OnVehiclePaintjob):玩家在改装店内预览车辆涂装时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [IsPlayerInModShop](../functions/IsPlayerInModShop):检测玩家是否在改装店内 +- [AddVehicleComponent](../functions/AddVehicleComponent):为车辆添加改装组件 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptExit.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptExit.md new file mode 100644 index 00000000000..d3e17bf299c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptExit.md @@ -0,0 +1,30 @@ +--- +title: OnFilterScriptExit +sidebar_label: OnFilterScriptExit +description: 当滤镜脚本卸载时触发该回调 +tags: [] +--- + +## 描述 + +当滤镜脚本被卸载时触发该回调。该回调仅在当前被卸载的滤镜脚本内部触发。 + +## 示例 + +```c +public OnFilterScriptExit() +{ + print("\n--------------------------------------"); + print(" 我的滤镜脚本已卸载"); + print("--------------------------------------\n"); + return 1; +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnFilterScriptInit](OnFilterScriptInit):当滤镜脚本加载时触发 +- [OnGameModeInit](OnGameModeInit):当游戏模式启动时触发 +- [OnGameModeExit](OnGameModeExit):当游戏模式结束时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptInit.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptInit.md new file mode 100644 index 00000000000..ee266179885 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnFilterScriptInit.md @@ -0,0 +1,30 @@ +--- +title: OnFilterScriptInit +sidebar_label: OnFilterScriptInit +description: 当滤镜脚本初始化(加载)时触发该回调 +tags: [] +--- + +## 描述 + +当滤镜脚本初始化(加载)时触发该回调。该回调仅在当前启动的滤镜脚本内部触发。 + +## 示例 + +```c +public OnFilterScriptInit() +{ + print("\n--------------------------------------"); + print("滤镜脚本已加载"); + print("--------------------------------------\n"); + return 1; +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnFilterSciptExit](OnFilterScriptExit):当滤镜脚本卸载时触发 +- [OnGameModeInit](OnGameModeInit):当游戏模式启动时触发 +- [OnGameModeExit](OnGameModeExit):当游戏模式结束时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md new file mode 100644 index 00000000000..e99a4dcd3f9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md @@ -0,0 +1,56 @@ +--- +title: OnGameModeExit +sidebar_label: OnGameModeExit +description: 当游戏模式结束时触发该回调(可能由'gmx'指令、服务器关闭或GameModeExit函数触发) +tags: [] +--- + +## 描述 + +当游戏模式结束时触发该回调。触发条件包括: + +- 执行'gmx'指令 +- 服务器关闭 +- 调用GameModeExit函数 + +## 示例 + +```c +public OnGameModeExit() +{ + print("游戏模式已结束。"); + return 1; +} +``` + +## 注意 + +:::tip + +该回调也可用于滤镜脚本中,通过RCON指令(如changemode或gmx)检测游戏模式变更,因为更换游戏模式不会重新加载滤镜脚本 + +::: + +:::warning + +使用OnGameModeExit时需注意: + +- 配合`rcon gmx`指令使用时可能导致客户端异常 +- 在[OnGameModeInit](OnGameModeInit)中过度调用[RemoveBuildingForPlayer](../functions/RemoveBuildingForPlayer)可能引发客户端崩溃 +- 服务器崩溃或进程被强制终止(如Linux kill命令/Windows控制台关闭按钮)不会触发本回调 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnGameModeInit](OnGameModeInit):当游戏模式启动时触发 +- [OnFilterScriptInit](OnFilterScriptInit):当滤镜脚本加载时触发 +- [OnFilterSciptExit](OnFilterScriptExit):当滤镜脚本卸载时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [GameModeExit](../functions/GameModeExit):退出当前游戏模式 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md new file mode 100644 index 00000000000..dee86aef248 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md @@ -0,0 +1,36 @@ +--- +title: OnGameModeInit +sidebar_label: OnGameModeInit +description: 当游戏模式启动时触发该回调 +tags: [] +--- + +## 描述 + +当游戏模式启动时触发该回调。 + +## 示例 + +```c +public OnGameModeInit() +{ + print("游戏模式已启动!"); + return 1; +} +``` + +## 注意 + +:::tip + +该回调也可用于滤镜脚本中,通过RCON指令(如changemode或gmx)检测游戏模式变更,因为更换游戏模式不会重新加载滤镜脚本 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnGameModeExit](OnGameModeExit):当游戏模式结束时触发 +- [OnFilterScriptInit](OnFilterScriptInit):当滤镜脚本加载时触发 +- [OnFilterSciptExit](OnFilterScriptExit):当滤镜脚本卸载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnIncomingConnection.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnIncomingConnection.md new file mode 100644 index 00000000000..7fd7a4bf6c8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnIncomingConnection.md @@ -0,0 +1,48 @@ +--- +title: OnIncomingConnection +sidebar_label: OnIncomingConnection +description: 当IP地址尝试连接服务器时触发该回调 +tags: [] +--- + +## 描述 + +当IP地址尝试连接服务器时触发该回调。如需阻止连接,请使用BlockIpAddress函数。 + +| 参数 | 说明 | +| ------------ | -------------------- | +| playerid | 尝试连接的玩家临时ID | +| ip_address[] | 尝试连接的玩家IP地址 | +| port | 连接使用的端口号 | + +## 返回值 + +1 - 阻止其他滤镜脚本接收此回调 +0 - 允许传递给后续滤镜脚本 + +该回调在滤镜脚本中总是优先触发。 + +## 示例 + +```c +public OnIncomingConnection(playerid, ip_address[], port) +{ + printf("玩家ID %i 的入站连接请求 [IP/端口: %s:%i]", playerid, ip_address, port); + return 1; +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerConnect](OnPlayerConnect):当玩家成功连接服务器时触发 +- [OnPlayerDisconnect](OnPlayerDisconnect):当玩家断开连接时触发 +- [OnPlayerFinishedDownloading](OnPlayerFinishedDownloading):当玩家完成自定义模型下载时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [BlockIpAddress](../functions/BlockIpAddress):阻止指定IP地址在指定时间内连接服务器 +- [UnBlockIpAddress](../functions/UnBlockIpAddress):解除已被阻止的IP地址 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCConnect.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCConnect.md new file mode 100644 index 00000000000..496e53e986f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCConnect.md @@ -0,0 +1,31 @@ +--- +title: OnNPCConnect +sidebar_label: OnNPCConnect +description: 当NPC成功连接服务器时触发该回调 +tags: ["npc"] +--- + +## 描述 + +当NPC成功连接至服务器时触发该回调。 + +| 参数 | 说明 | +| ---------- | ----------------- | +| myplayerid | NPC被分配的玩家ID | + +## 示例 + +```c +public OnNPCConnect(myplayerid) +{ + printf("已成功连接服务器,分配ID为 %i!", myplayerid); +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnNPCDisconnect](OnNPCDisconnect):当NPC断开服务器连接时触发 +- [OnPlayerConnect](OnPlayerConnect):当玩家连接服务器时触发 +- [OnPlayerDisconnect](OnPlayerDisconnect):当玩家断开服务器连接时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDisconnect.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDisconnect.md new file mode 100644 index 00000000000..74941a05031 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDisconnect.md @@ -0,0 +1,31 @@ +--- +title: OnNPCDisconnect +sidebar_label: OnNPCDisconnect +description: 当NPC断开服务器连接时触发该回调 +tags: ["npc"] +--- + +## 描述 + +当NPC与服务器断开连接时触发该回调。 + +| 参数 | 说明 | +| -------- | ------------------------ | +| reason[] | 断开连接的原因描述字符串 | + +## 示例 + +```c +public OnNPCDisconnect(reason[]) +{ + printf("已从服务器断开连接。原因:%s", reason); +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnNPCConnect](OnNPCConnect):当NPC成功连接服务器时触发 +- [OnPlayerDisconnect](OnPlayerDisconnect):当玩家断开服务器连接时触发 +- [OnPlayerConnect](OnPlayerConnect):当玩家连接服务器时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCEnterVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCEnterVehicle.md new file mode 100644 index 00000000000..d179540ca29 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCEnterVehicle.md @@ -0,0 +1,31 @@ +--- +title: OnNPCEnterVehicle +sidebar_label: OnNPCEnterVehicle +description: 当NPC进入车辆时触发该回调 +tags: ["npc"] +--- + +## 描述 + +当NPC进入车辆时触发该回调。 + +| 参数 | 说明 | +| --------- | --------------- | +| vehicleid | NPC进入的车辆ID | +| seatid | NPC使用的座位ID | + +## 示例 + +```c +public OnNPCEnterVehicle(vehicleid, seatid) +{ + printf("NPC进入车辆事件 - 车辆ID: %d 座位ID: %d", vehicleid, seatid); + return 1; +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnNPCExitVehicle](OnNPCExitVehicle):当NPC离开车辆时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCExitVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCExitVehicle.md new file mode 100644 index 00000000000..eed983e230e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCExitVehicle.md @@ -0,0 +1,26 @@ +--- +title: OnNPCExitVehicle +sidebar_label: OnNPCExitVehicle +description: 当NPC离开车辆时触发该回调 +tags: ["npc"] +--- + +## 描述 + +当NPC离开车辆时触发该回调。 + +## 示例 + +```c +public OnNPCExitVehicle() +{ + print("NPC已离开车辆"); + return 1; +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnNPCEnterVehicle](OnNPCEnterVehicle):当NPC进入车辆时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeExit.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeExit.md new file mode 100644 index 00000000000..13f85630f7c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeExit.md @@ -0,0 +1,26 @@ +--- +title: OnNPCModeExit +sidebar_label: OnNPCModeExit +description: 当NPC脚本卸载时触发该回调 +tags: ["npc"] +--- + +## 描述 + +当NPC脚本卸载时触发该回调。 + +## 示例 + +```c +public OnNPCModeExit() +{ + print("NPC脚本已卸载"); + return 1; +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnNPCModeInit](OnNPCModeInit):当NPC脚本加载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeInit.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeInit.md new file mode 100644 index 00000000000..fb8932bba93 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCModeInit.md @@ -0,0 +1,26 @@ +--- +title: OnNPCModeInit +sidebar_label: OnNPCModeInit +description: 当NPC脚本加载时会调用此回调函数。 +tags: ["npc"] +--- + +## 说明 + +当 NPC 脚本加载时会调用此回调函数。 + +## 示例 + +```c +public OnNPCModeInit() +{ + print("NPC脚本已加载"); + return 1; +} +``` + +## 相关回调 + +以下回调函数可能与当前回调存在关联,可提供额外功能参考: + +- [OnNPCModeExit](OnNPCModeExit): 当 NPC 脚本卸载时会调用此回调函数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCSpawn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCSpawn.md new file mode 100644 index 00000000000..afd6ca727ab --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCSpawn.md @@ -0,0 +1,21 @@ +--- +title: OnNPCSpawn +sidebar_label: OnNPCSpawn +description: 当NPC生成时触发该回调 +tags: ["npc"] +--- + +## 描述 + +当NPC生成时触发该回调。 + +## 示例 + +```c +public OnNPCSpawn() +{ + print("NPC已生成"); + SendChat("大家好,我是一个机器人。"); + return 1; +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnObjectMoved.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnObjectMoved.md new file mode 100644 index 00000000000..7b911f88b72 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnObjectMoved.md @@ -0,0 +1,51 @@ +--- +title: OnObjectMoved +sidebar_label: OnObjectMoved +description: 当物体通过MoveObject移动并停止时触发该回调 +tags: ["物体"] +--- + +## 描述 + +当物体通过MoveObject函数移动并停止时触发该回调。 + +| 参数 | 说明 | +| -------- | ------------------ | +| objectid | 已完成移动的物体ID | + +## 返回值 + +该回调在滤镜脚本中总是优先触发。 + +## 示例 + +```c +public OnObjectMoved(objectid) +{ + printf("物体 %d 移动完成。", objectid); + return 1; +} +``` + +## 注意 + +:::tip + +在回调中使用[SetObjectPos](../functions/SetObjectPos)函数无效,需通过重新创建物体解决此问题 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerObjectMoved](OnPlayerObjectMoved):当玩家物体停止移动时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [MoveObject](../functions/MoveObject):移动全局物体 +- [MovePlayerObject](../functions/MovePlayerObject):移动玩家个人物体 +- [IsObjectMoving](../functions/IsObjectMoving):检测物体是否在移动中 +- [StopObject](../functions/StopObject):停止物体移动 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamIn.md new file mode 100644 index 00000000000..de032b6bf71 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamIn.md @@ -0,0 +1,56 @@ +--- +title: OnPickupStreamIn +sidebar_label: OnPickupStreamIn +description: 当拾取物进入玩家的可视范围时触发该回调 +tags: ["玩家"] +--- + + + +## 描述 + +当拾取物进入玩家的可视范围时触发该回调。 + +| 参数 | 说明 | +| -------- | --------------------------------------------------------------- | +| pickupid | 拾取物ID(由[CreatePickup](../functions/CreatePickup)函数返回) | +| playerid | 触发流加载的玩家ID | + +## 返回值 + +该回调在游戏模式中总是优先触发。 + +## 示例 + +```c +new g_PickupHealth; + +public OnGameModeInit() +{ + g_PickupHealth = CreatePickup(1240, 2, 2009.8474, 1218.0459, 10.8175); + return 1; +} + +public OnPickupStreamIn(pickupid, playerid) +{ + if (pickupid == g_PickupHealth) + { + printf("生命值拾取物已为玩家 %d 完成流加载", playerid); + } + return 1; +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerPickUpPickup](OnPlayerPickUpPickup):当玩家拾取物品时触发 +- [OnPickupStreamOut](OnPickupStreamOut):当拾取物离开玩家可视范围时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [CreatePickup](../functions/CreatePickup):创建拾取物 +- [DestroyPickup](../functions/DestroyPickup):销毁拾取物 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamOut.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamOut.md new file mode 100644 index 00000000000..de032b6bf71 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPickupStreamOut.md @@ -0,0 +1,56 @@ +--- +title: OnPickupStreamIn +sidebar_label: OnPickupStreamIn +description: 当拾取物进入玩家的可视范围时触发该回调 +tags: ["玩家"] +--- + + + +## 描述 + +当拾取物进入玩家的可视范围时触发该回调。 + +| 参数 | 说明 | +| -------- | --------------------------------------------------------------- | +| pickupid | 拾取物ID(由[CreatePickup](../functions/CreatePickup)函数返回) | +| playerid | 触发流加载的玩家ID | + +## 返回值 + +该回调在游戏模式中总是优先触发。 + +## 示例 + +```c +new g_PickupHealth; + +public OnGameModeInit() +{ + g_PickupHealth = CreatePickup(1240, 2, 2009.8474, 1218.0459, 10.8175); + return 1; +} + +public OnPickupStreamIn(pickupid, playerid) +{ + if (pickupid == g_PickupHealth) + { + printf("生命值拾取物已为玩家 %d 完成流加载", playerid); + } + return 1; +} +``` + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerPickUpPickup](OnPlayerPickUpPickup):当玩家拾取物品时触发 +- [OnPickupStreamOut](OnPickupStreamOut):当拾取物离开玩家可视范围时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [CreatePickup](../functions/CreatePickup):创建拾取物 +- [DestroyPickup](../functions/DestroyPickup):销毁拾取物 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickGangZone.md new file mode 100644 index 00000000000..b84f97d5a83 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickGangZone.md @@ -0,0 +1,42 @@ +--- +title: OnPlayerClickGangZone +sidebar_label: OnPlayerClickGangZone +description: 当玩家在暂停菜单地图上右键点击帮派区域时触发该回调 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +当玩家在暂停菜单地图上右键点击帮派区域时触发该回调。 + +| 参数 | 说明 | +| -------- | -------------------- | +| playerid | 点击帮派区域的玩家ID | +| zoneid | 被点击的帮派区域ID | + +## 返回值 + +本回调不处理返回值。 + +该回调在游戏模式中总是优先触发。 + +## 示例 + +```c +public OnPlayerClickGangZone(playerid, zoneid) +{ + new string[128]; + format(string, sizeof(string), "您点击了帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 相关函数 + +以下函数可能与当前回调相关: + +- [GangZoneCreate](../functions/GangZoneCreate):创建帮派区域(彩色雷达区域) +- [GangZoneDestroy](../functions/GangZoneDestroy):销毁帮派区域 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickMap.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickMap.md new file mode 100644 index 00000000000..d910180eec0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickMap.md @@ -0,0 +1,50 @@ +--- +title: OnPlayerClickMap +sidebar_label: OnPlayerClickMap +description: 当玩家在暂停菜单地图上右键点击放置目标/路径点时触发该回调 +tags: ["玩家"] +--- + +## 描述 + +当玩家在暂停菜单地图上右键点击放置目标/路径点时触发该回调。 + +| 参数 | 说明 | +| -------- | ------------------------------------- | +| playerid | 放置目标/路径点的玩家ID | +| Float:fX | 玩家点击位置的X坐标(浮点数) | +| Float:fY | 玩家点击位置的Y坐标(浮点数) | +| Float:fZ | 玩家点击位置的Z坐标(浮点数,不精确) | + +## 返回值 + +1 - 阻止其他滤镜脚本接收此回调 +0 - 允许传递给后续滤镜脚本 + +该回调在游戏模式中总是优先触发。 + +## 示例 + +```c +public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) +{ + SetPlayerPosFindZ(playerid, fX, fY, fZ); + return 1; +} +``` + +## 注意 + +:::tip + +本回调仅在玩家通过点击地图标记目标时触发,按键操作不会触发。若点击位置距离玩家过远,返回的Z坐标将为0(无效值),建议使用[MapAndreas](https://github.com/philip1337/samp-plugin-mapandreas)或[ColAndreas](https://github.com/Pottus/ColAndreas)插件获取精确Z坐标 + +::: + +## 相关函数 + +以下函数可能与当前回调相关: + +- [GetPlayerPos](../functions/GetPlayerPos):获取玩家当前位置 +- [SetPlayerPos](../functions/SetPlayerPos):设置玩家位置 +- [SetPlayerPosFindZ](../functions/SetPlayerPosFindZ):设置玩家位置并自动获取地面高度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md new file mode 100644 index 00000000000..ad448bd015b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md @@ -0,0 +1,54 @@ +--- +title: OnPlayerClickPlayer +sidebar_label: OnPlayerClickPlayer +description: 当玩家在记分牌上双击其他玩家时触发该回调 +tags: ["玩家"] +--- + +## 描述 + +当玩家在记分牌上双击其他玩家时触发该回调。 + +| 参数 | 说明 | +| --------------- | --------------------------------------------------------- | +| playerid | 触发点击操作的玩家ID | +| clickedplayerid | 被点击的玩家ID | +| source | 点击来源(参见[点击来源](../resources/clicksources)文档) | + +## 返回值 + +1 - 阻止其他滤镜脚本接收此回调 +0 - 允许传递给后续滤镜脚本 + +该回调在滤镜脚本中总是优先触发。 + +## 示例 + +```c +public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) +{ + new string[32]; + format(string, sizeof(string), "您点击了玩家 %d", clickedplayerid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 注意 + +:::tip + +当前仅支持一个来源类型(0 - `CLICK_SOURCE_SCOREBOARD`表示记分牌点击) +参数设计为未来扩展更多点击来源类型预留了支持空间 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerClickTextDraw](OnPlayerClickTextDraw):当玩家点击文本绘图时触发 + +## 相关资源 + +- [点击来源类型](../resources/clicksources) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerGangZone.md new file mode 100644 index 00000000000..5a0f29a7bf1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerGangZone.md @@ -0,0 +1,42 @@ +--- +title: OnPlayerClickPlayerGangZone +sidebar_label: OnPlayerClickPlayerGangZone +description: 当玩家在暂停菜单地图上右键点击个人帮派区域时触发该回调 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +当玩家在暂停菜单地图上右键点击个人帮派区域时触发该回调。 + +| 参数 | 说明 | +| -------- | ---------------------- | +| playerid | 触发点击操作的玩家ID | +| zoneid | 被点击的个人帮派区域ID | + +## 返回值 + +本回调不处理返回值。 + +该回调在游戏模式中总是优先触发。 + +## 示例 + +```c +public OnPlayerClickPlayerGangZone(playerid, zoneid) +{ + new string[128]; + format(string, sizeof(string), "您点击了个人帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 相关函数 + +以下函数可能与当前回调相关: + +- [CreatePlayerGangZone](../functions/CreatePlayerGangZone):创建个人帮派区域 +- [PlayerGangZoneDestroy](../functions/PlayerGangZoneDestroy):销毁个人帮派区域 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerTextDraw.md new file mode 100644 index 00000000000..9596075f465 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayerTextDraw.md @@ -0,0 +1,91 @@ +--- +title: OnPlayerClickPlayerTextDraw +sidebar_label: OnPlayerClickPlayerTextDraw +description: 当玩家点击个人文本绘图时触发该回调 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +当玩家点击个人文本绘图(player-textdraw)时触发该回调。注意:玩家按ESC取消选择模式时会触发[OnPlayerClickTextDraw](OnPlayerClickTextDraw)而非本回调。 + +| 参数 | 说明 | +| ----------------------- | ---------------------- | +| playerid | 触发点击操作的玩家ID | +| PlayerText:playertextid | 被点击的个人文本绘图ID | + +## 返回值 + +该回调在滤镜脚本中总是优先触发,返回1将阻止其他脚本处理此事件。 + +## 示例 + +```c +new PlayerText:gPlayerTextDraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建个人文本绘图 + gPlayerTextDraw[playerid] = CreatePlayerTextDraw(playerid, 10.000000, 141.000000, "我的文本"); + PlayerTextDrawTextSize(playerid, gPlayerTextDraw[playerid], 60.000000, 20.000000); + PlayerTextDrawAlignment(playerid, gPlayerTextDraw[playerid], TEXT_DRAW_ALIGN_LEFT); + PlayerTextDrawBackgroundColor(playerid, gPlayerTextDraw[playerid], 0x000000FF); + PlayerTextDrawFont(playerid, gPlayerTextDraw[playerid], TEXT_DRAW_FONT_1); + PlayerTextDrawLetterSize(playerid, gPlayerTextDraw[playerid], 0.250000, 1.000000); + PlayerTextDrawColor(playerid, gPlayerTextDraw[playerid], -1); + PlayerTextDrawSetProportional(playerid, gPlayerTextDraw[playerid], true); + PlayerTextDrawSetShadow(playerid, gPlayerTextDraw[playerid], 1); + + // 设置为可点击 + PlayerTextDrawSetSelectable(playerid, gPlayerTextDraw[playerid], true); + + // 向玩家显示 + PlayerTextDrawShow(playerid, gPlayerTextDraw[playerid]); + return 1; +} + +public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) +{ + if (newkeys == KEY_SUBMISSION) + { + SelectTextDraw(playerid, 0xFF4040AA); + } + return 1; +} + +public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) +{ + if (playertextid == gPlayerTextDraw[playerid]) + { + SendClientMessage(playerid, 0xFFFFFFAA, "您点击了个人文本绘图"); + CancelSelectTextDraw(playerid); + return 1; + } + return 0; +} +``` + +## 注意 + +:::warning + +当玩家按ESC取消选择时: + +- 会触发[OnPlayerClickTextDraw](OnPlayerClickTextDraw)并返回`INVALID_TEXT_DRAW` +- 本回调不会被触发 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerClickTextDraw](OnPlayerClickTextDraw):当玩家点击全局文本绘图时触发 +- [OnPlayerClickPlayer](OnPlayerClickPlayer):当玩家点击其他玩家时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [PlayerTextDrawSetSelectable](../functions/PlayerTextDrawSetSelectable):设置个人文本绘图的可点击状态 +- [SelectTextDraw](../functions/SelectTextDraw):启用玩家文本绘图选择模式 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md new file mode 100644 index 00000000000..b94cee378d8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md @@ -0,0 +1,85 @@ +--- +title: OnPlayerClickTextDraw +sidebar_label: OnPlayerClickTextDraw +description: 当玩家点击文本绘图或按ESC键取消选择模式时触发该回调 +tags: ["玩家", "文本绘图"] +--- + +## 描述 + +当玩家点击文本绘图或按ESC键取消选择模式时触发该回调。 + +| 参数 | 说明 | +| -------------- | ----------------------------------------------------- | +| playerid | 触发点击操作的玩家ID | +| Text:clickedid | 被点击的文本绘图ID(取消选择时返回INVALID_TEXT_DRAW) | + +## 返回值 + +该回调在滤镜脚本中总是优先触发,返回1将阻止其他脚本处理此事件。 + +## 示例 + +```c +new Text:gTextDraw; + +public OnGameModeInit() +{ + gTextDraw = TextDrawCreate(10.000000, 141.000000, "我的文本"); + TextDrawTextSize(gTextDraw, 60.000000, 20.000000); + TextDrawAlignment(gTextDraw, TEXT_DRAW_ALIGN_LEFT); + TextDrawBackgroundColor(gTextDraw, 0x000000FF); + TextDrawFont(gTextDraw, TEXT_DRAW_FONT_1); + TextDrawLetterSize(gTextDraw, 0.250000, 1.000000); + TextDrawColor(gTextDraw, -1); + TextDrawSetProportional(gTextDraw, true); + TextDrawSetShadow(gTextDraw, 1); + TextDrawSetSelectable(gTextDraw, true); + return 1; +} + +public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) +{ + if (newkeys == KEY_SUBMISSION) + { + TextDrawShowForPlayer(playerid, gTextDraw); + SelectTextDraw(playerid, 0xFF4040AA); + } + return 1; +} + +public OnPlayerClickTextDraw(playerid, Text:clickedid) +{ + if (clickedid == gTextDraw) + { + SendClientMessage(playerid, 0xFFFFFFAA, "您点击了文本绘图"); + CancelSelectTextDraw(playerid); + return 1; + } + return 0; +} +``` + +## 注意 + +:::warning + +- 点击区域由[TextDrawTextSize](../functions/TextDrawTextSize)定义 +- 该函数的x/y参数值不可为零或负数 +- 禁止无条件调用[CancelSelectTextDraw](../functions/CancelSelectTextDraw),否则会导致无限循环 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerClickPlayerTextDraw](OnPlayerClickPlayerTextDraw):当玩家点击个人文本绘图时触发 +- [OnPlayerClickPlayer](OnPlayerClickPlayer):当玩家点击其他玩家时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [SelectTextDraw](../functions/SelectTextDraw):启用鼠标选择文本绘图模式 +- [CancelSelectTextDraw](../functions/CancelSelectTextDraw):取消文本绘图选择模式 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md new file mode 100644 index 00000000000..77f2e876b36 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md @@ -0,0 +1,55 @@ +--- +title: OnPlayerCommandText +sidebar_label: OnPlayerCommandText +description: 当玩家在聊天窗口输入命令时触发该回调 +tags: ["玩家"] +--- + +## 描述 + +当玩家在客户端聊天窗口输入命令时触发该回调。命令需以斜杠`/`开头,例如`/help`。 + +| 参数 | 说明 | +| --------- | -------------------------------- | +| playerid | 输入命令的玩家ID | +| cmdtext[] | 输入的命令内容(包含开头的斜杠) | + +## 返回值 + +该回调在滤镜脚本中总是优先触发,返回1将阻止其他脚本处理此命令。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/help", true)) + { + SendClientMessage(playerid, -1, "服务器:这是 /help 命令!"); + return 1; + // 返回1表示命令已被处理 + // 其他脚本将不会触发OnPlayerCommandText + } + return 0; + // 返回0表示命令未被当前脚本处理 + // 其他脚本将继续尝试处理该命令 + // 若所有脚本均未处理,玩家将看到'SERVER: Unknown Command'提示 +} +``` + +## 注意 + + + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerText](OnPlayerText):当玩家发送聊天消息时触发 +- [OnRconCommand](OnRconCommand):当通过服务器控制台、远程RCON或游戏内/rcon命令执行时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [SendRconCommand](../functions/SendRconCommand):通过脚本发送RCON命令 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md new file mode 100644 index 00000000000..0ff0afb9d8d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md @@ -0,0 +1,49 @@ +--- +title: OnPlayerConnect +sidebar_label: OnPlayerConnect +description: 当玩家连接到服务器时触发该回调 +tags: ["玩家"] +--- + +## 描述 + +当玩家成功连接到服务器时触发该回调。 + +| 参数 | 说明 | +| -------- | ------------ | +| playerid | 连接的玩家ID | + +## 返回值 + +0 - 阻止其他滤镜脚本接收此回调 +1 - 允许传递给后续滤镜脚本 + +该回调在滤镜脚本中总是优先触发。 + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + new + string[64], + playerName[MAX_PLAYER_NAME]; + + GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); + format(string, sizeof string, "%s 加入了服务器,欢迎!", playerName); + SendClientMessageToAll(0xFFFFFFAA, string); + return 1; +} +``` + +## 注意 + + + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerDisconnect](OnPlayerDisconnect):当玩家离开服务器时触发 +- [OnIncomingConnection](OnIncomingConnection):当玩家尝试连接服务器时触发 +- [OnPlayerFinishedDownloading](OnPlayerFinishedDownloading):当玩家完成自定义模型下载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md new file mode 100644 index 00000000000..ed6b5d2c46b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -0,0 +1,88 @@ +--- +title: OnPlayerDeath +sidebar_label: OnPlayerDeath +description: 当玩家死亡时触发该回调(自杀或被其他玩家击杀) +tags: ["玩家"] +--- + +## 描述 + +当玩家死亡时触发该回调,包括以下情况: + +- 自杀 +- 被其他玩家击杀 + +| 参数 | 说明 | +| ------------- | ------------------------------------------------ | +| playerid | 死亡的玩家ID | +| killerid | 凶手玩家ID(若无凶手则为INVALID_PLAYER_ID) | +| WEAPON:reason | 死亡原因(对应[武器ID](../resources/weaponids)) | + +## 返回值 + +0 - 阻止其他滤镜脚本接收此回调 +1 - 允许传递给后续滤镜脚本 + +该回调在滤镜脚本中总是优先触发。 + +## 示例 + +```c +new PlayerDeaths[MAX_PLAYERS]; +new PlayerKills[MAX_PLAYERS]; + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + SendDeathMessage(killerid, playerid, reason); // 在击杀feed中显示击杀信息 + + // 使用前必须验证killerid有效性 + if (killerid != INVALID_PLAYER_ID) + { + PlayerKills[killerid]++; + } + + // 处理死亡玩家数据(playerid始终有效) + PlayerDeaths[playerid]++; + return 1; +} +``` + +## 注意 + +:::tip + +特殊原因ID说明: + +- 火焰伤害(如燃烧瓶/武器18)会返回37(火焰喷射器ID) +- 爆炸伤害(如RPG/手雷)会返回51 + [SendDeathMessage](../functions/SendDeathMessage)函数可直接使用INVALID_PLAYER_ID作为参数 + 只有实际死亡的玩家会触发此回调(可用于反伪造死亡检测) + +::: + +:::warning + +必须在使用killerid前检查有效性: + +- INVALID_PLAYER_ID定义为65535 +- 若数组大小为MAX_PLAYERS(默认500),访问索引65535将导致数组越界错误 +- 可能引发OnPlayerDeath脚本崩溃(不会影响整个服务端) + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerSpawn](OnPlayerSpawn):当玩家重生时触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [SendDeathMessage](../functions/SendDeathMessage):向击杀列表添加记录 +- [SetPlayerHealth](../functions/SetPlayerHealth):设置玩家生命值 + +## 相关资源 + +- [武器ID对照表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md new file mode 100644 index 00000000000..32e49030817 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md @@ -0,0 +1,86 @@ +--- +title: OnPlayerDisconnect +sidebar_label: OnPlayerDisconnect +description: 当玩家与服务器断开连接时触发该回调 +tags: ["玩家"] +--- + +## 描述 + +当玩家与服务器断开连接时触发该回调。 + +| 参数 | 说明 | +| -------- | ------------------ | +| playerid | 断开连接的玩家ID | +| reason | 断开原因(见下表) | + +## 返回值 + +0 - 阻止其他滤镜脚本接收此回调 +1 - 允许传递给后续滤镜脚本 + +该回调在滤镜脚本中总是优先触发。 + +## 断开原因 + +| ID | 原因类型 | 详细说明 | +| --- | ---------- | ------------------------------------------ | +| 0 | 超时/崩溃 | 玩家连接丢失(游戏崩溃或网络故障) | +| 1 | 主动退出 | 玩家通过/quit命令或暂停菜单主动退出 | +| 2 | 踢出/封禁 | 被服务器踢出或封禁 | +| 3 | 自定义原因 | 由部分库使用,保留给模式的私有用途 | +| 4 | 模式结束 | 当前模式结束导致玩家断开(玩家仍在服务器) | + +:::warning + +原因ID 3最初由[fixes.inc](https://github.com/pawn-lang/sa-mp-fixes)添加 +原因ID 3和4由Open Multiplayer服务端新增 + +::: + +## 示例 + +```c +public OnPlayerDisconnect(playerid, reason) +{ + new + szString[64], + playerName[MAX_PLAYER_NAME]; + + GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); + + new szDisconnectReason[5][] = + { + "超时/崩溃", + "主动退出", + "踢出/封禁", + "自定义原因", + "模式结束" + }; + + format(szString, sizeof szString, "%s 离开了服务器(原因:%s)。", playerName, szDisconnectReason[reason]); + + SendClientMessageToAll(0xC4C4C4FF, szString); + return 1; +} +``` + +## 注意 + +:::tip + +由于玩家已断开连接,部分函数可能无法正常工作: + +- [GetPlayerIp](../functions/GetPlayerIp) 获取IP +- [GetPlayerPos](../functions/GetPlayerPos) 获取坐标 + 该问题已在open.mp服务端修复 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerConnect](OnPlayerConnect):当玩家连接服务器时触发 +- [OnIncomingConnection](OnIncomingConnection):当玩家尝试连接时触发 +- [OnPlayerFinishedDownloading](OnPlayerFinishedDownloading):当玩家完成模型下载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditAttachedObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditAttachedObject.md new file mode 100644 index 00000000000..42796369001 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditAttachedObject.md @@ -0,0 +1,115 @@ +--- +title: OnPlayerEditAttachedObject +sidebar_label: OnPlayerEditAttachedObject +description: 当玩家结束附加物体编辑模式时触发该回调 +tags: ["玩家", "物体", "附加物体"] +--- + +## 描述 + +当玩家结束附加物体编辑模式时触发该回调。 + +| 参数 | 说明 | +| ---------------------- | ----------------------------------------------- | +| playerid | 结束编辑的玩家ID | +| EDIT_RESPONSE:response | 操作结果:0=取消(ESC),1=保存(点击保存图标) | +| index | 附加物体的索引号(0-9) | +| modelid | 被编辑附加物体的模型ID | +| boneid | 被编辑附加物体的骨骼ID | +| Float:fOffsetX | 被编辑附加物体的X轴偏移量 | +| Float:fOffsetY | 被编辑附加物体的Y轴偏移量 | +| Float:fOffsetZ | 被编辑附加物体的Z轴偏移量 | +| Float:fRotX | 被编辑附加物体的X轴旋转角度 | +| Float:fRotY | 被编辑附加物体的Y轴旋转角度 | +| Float:fRotZ | 被编辑附加物体的Z轴旋转角度 | +| Float:fScaleX | 被编辑附加物体的X轴缩放比例 | +| Float:fScaleY | 被编辑附加物体的Y轴缩放比例 | +| Float:fScaleZ | 被编辑附加物体的Z轴缩放比例 | + +## 返回值 + +1 - 阻止其他脚本接收此回调 +0 - 允许传递给后续脚本 + +该回调在滤镜脚本中总是优先触发。 + +## 示例 + +```c +enum attached_object_data +{ + Float:ao_x, + Float:ao_y, + Float:ao_z, + Float:ao_rx, + Float:ao_ry, + Float:ao_rz, + Float:ao_sx, + Float:ao_sy, + Float:ao_sz +} + +new ao[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][attached_object_data]; + +// 当附加物体被附加时,应将数据存储到上述数组中 + +public OnPlayerEditAttachedObject(playerid, EDIT_RESPONSE:response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ) +{ + if (response == EDIT_RESPONSE_FINAL) + { + SendClientMessage(playerid, COLOR_GREEN, "附加物体编辑已保存"); + + ao[playerid][index][ao_x] = fOffsetX; + ao[playerid][index][ao_y] = fOffsetY; + ao[playerid][index][ao_z] = fOffsetZ; + ao[playerid][index][ao_rx] = fRotX; + ao[playerid][index][ao_ry] = fRotY; + ao[playerid][index][ao_rz] = fRotZ; + ao[playerid][index][ao_sx] = fScaleX; + ao[playerid][index][ao_sy] = fScaleY; + ao[playerid][index][ao_sz] = fScaleZ; + } + else if (response == EDIT_RESPONSE_CANCEL) + { + SendClientMessage(playerid, COLOR_RED, "附加物体编辑未保存"); + + new i = index; + SetPlayerAttachedObject(playerid, index, modelid, boneid, + ao[playerid][i][ao_x], + ao[playerid][i][ao_y], + ao[playerid][i][ao_z], + ao[playerid][i][ao_rx], + ao[playerid][i][ao_ry], + ao[playerid][i][ao_rz], + ao[playerid][i][ao_sx], + ao[playerid][i][ao_sy], + ao[playerid][i][ao_sz]); + } + return 1; +} +``` + +## 注意 + +:::tip + +使用[SetPlayerAttachedObject](../functions/SetPlayerAttachedObject)可还原附加物体的原始参数 + +::: + +## 相关回调 + +以下回调可能与当前回调存在关联: + +- [OnPlayerEditObject](OnPlayerEditObject):当玩家结束普通物体编辑时触发 +- [OnPlayerSelectObject](OnPlayerSelectObject):当玩家通过[SelectObject](../functions/SelectObject)选择物体后触发 + +## 相关函数 + +以下函数可能与当前回调相关: + +- [EditAttachedObject](../functions/EditAttachedObject):进入附加物体编辑模式 +- [SetPlayerAttachedObject](../functions/SetPlayerAttachedObject):为玩家附加物体 +- [RemovePlayerAttachedObject](../functions/RemovePlayerAttachedObject):移除玩家的附加物体 +- [IsPlayerEditingAttachedObject](../functions/IsPlayerEditingAttachedObject):检测玩家是否正在编辑附加物体 +- [CancelEdit](../functions/CancelEdit):取消物体编辑 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditObject.md new file mode 100644 index 00000000000..908f16d422b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEditObject.md @@ -0,0 +1,106 @@ +--- +title: OnPlayerEditObject +sidebar_label: OnPlayerEditObject +description: 当玩家完成物体编辑时(通过BeginObjectEditing/BeginPlayerObjectEditing)会触发该回调函数。 +tags: ["玩家", "物体"] +--- + +## 描述 + +当玩家完成物体编辑([BeginObjectEditing](../functions/BeginObjectEditing)/[BeginPlayerObjectEditing](../functions/BeginPlayerObjectEditing))时触发该回调函数。 + +| 参数名 | 说明 | +| ---------------------- | ------------------------------------------------------- | +| playerid | 进行物体编辑的玩家ID | +| playerobject | 0表示全局物体,1表示玩家物体 | +| objectid | 被编辑物体的ID | +| EDIT_RESPONSE:response | [编辑响应类型](../resources/objecteditionresponsetypes) | +| Float:fX | 物体编辑后的X轴偏移量 | +| Float:fY | 物体编辑后的Y轴偏移量 | +| Float:fZ | 物体编辑后的Z轴偏移量 | +| Float:fRotX | 物体编辑后的X轴旋转角度 | +| Float:fRotY | 物体编辑后的Y轴旋转角度 | +| Float:fRotZ | 物体编辑后的Z轴旋转角度 | + +## 返回值 + +1 - 阻止其他脚本接收此回调 + +0 - 允许将此回调传递给下一个脚本 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +public OnPlayerEditObject(playerid, playerobject, objectid, EDIT_RESPONSE:response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ) +{ + new + Float: oldX, + Float: oldY, + Float: oldZ, + Float: oldRotX, + Float: oldRotY, + Float: oldRotZ; + + GetObjectPos(objectid, oldX, oldY, oldZ); + GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ); + + if (!playerobject) // 如果是全局物体,同步位置给其他玩家 + { + if (!IsValidObject(objectid)) + { + return 1; + } + SetObjectPos(objectid, fX, fY, fZ); + SetObjectRot(objectid, fRotX, fRotY, fRotZ); + } + + switch (response) + { + case EDIT_RESPONSE_FINAL: + { + // 玩家点击了保存图标 + // 在此保存物体新位置(和旋转角度) + } + + case EDIT_RESPONSE_CANCEL: + { + // 玩家取消编辑,还原物体位置 + if (!playerobject) // 非玩家物体 + { + SetObjectPos(objectid, oldX, oldY, oldZ); + SetObjectRot(objectid, oldRotX, oldRotY, oldRotZ); + } + else + { + SetPlayerObjectPos(playerid, objectid, oldX, oldY, oldZ); + SetPlayerObjectRot(playerid, objectid, oldRotX, oldRotY, oldRotZ); + } + } + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用'EDIT_RESPONSE_UPDATE'时需注意:当编辑中途释放操作时,最后一次'EDIT_RESPONSE_UPDATE'的物体位置可能与实际最终位置不同步。 + +::: + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [BeginPlayerObjectEditing](../functions/BeginPlayerObjectEditing): 开始编辑玩家物体 +- [BeginObjectEditing](../functions/BeginObjectEditing): 开始编辑物体 +- [CreateObject](../functions/CreateObject): 创建物体 +- [DestroyObject](../functions/DestroyObject): 销毁物体 +- [MoveObject](../functions/MoveObject): 移动物体 + +## 相关资源 + +- [物体编辑响应类型](../resources/objecteditionresponsetypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterCheckpoint.md new file mode 100644 index 00000000000..fdabc9e8385 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterCheckpoint.md @@ -0,0 +1,60 @@ +--- +title: OnPlayerEnterCheckpoint +sidebar_label: OnPlayerEnterCheckpoint +description: 当玩家进入为其设置的检查点时触发该回调函数。 +tags: ["玩家", "检查点"] +--- + +## 描述 + +当玩家进入为其设置的检查点时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ------------------ | +| playerid | 进入检查点的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +// 这个示例中,玩家生成时会创建检查点 +// 当进入检查点时生成车辆并禁用检查点 +public OnPlayerSpawn(playerid) +{ + SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); + return 1; +} + +public OnPlayerEnterCheckpoint(playerid) +{ + CreateVehicle(520, 1982.6150, -221.0145, -0.2432, 82.2873, -1, -1, 60000); + DisablePlayerCheckpoint(playerid); + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerLeaveCheckpoint](OnPlayerLeaveCheckpoint): 当玩家离开检查点时触发 +- [OnPlayerEnterRaceCheckpoint](OnPlayerEnterRaceCheckpoint): 当玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](OnPlayerLeaveRaceCheckpoint): 当玩家离开竞速检查点时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): 为玩家创建检查点 +- [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): 禁用玩家的当前检查点 +- [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint): 检测玩家是否在检查点内 +- [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): 为玩家创建竞速检查点 +- [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): 禁用玩家的当前竞速检查点 +- [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): 检测玩家是否在竞速检查点内 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterGangZone.md new file mode 100644 index 00000000000..959affa6502 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterGangZone.md @@ -0,0 +1,47 @@ +--- +title: OnPlayerEnterGangZone +sidebar_label: OnPlayerEnterGangZone +description: 当玩家进入帮派区域时触发该回调函数 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +当玩家进入帮派区域时触发该回调函数 + +| 参数名 | 说明 | +| -------- | -------------------- | +| playerid | 进入帮派区域的玩家ID | +| zoneid | 玩家进入的帮派区域ID | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +public OnPlayerEnterGangZone(playerid, zoneid) +{ + new string[128]; + format(string, sizeof(string), "你正在进入帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerLeaveGangZone](OnPlayerLeaveGangZone): 当玩家离开帮派区域时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [GangZoneCreate](../functions/GangZoneCreate): 创建帮派区域(彩色雷达区域) +- [GangZoneDestroy](../functions/GangZoneDestroy): 销毁帮派区域 +- [UseGangZoneCheck](../functions/UseGangZoneCheck): 启用玩家进入该区域时的回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterPlayerGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterPlayerGangZone.md new file mode 100644 index 00000000000..aa91c67f4da --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterPlayerGangZone.md @@ -0,0 +1,47 @@ +--- +title: OnPlayerEnterPlayerGangZone +sidebar_label: OnPlayerEnterPlayerGangZone +description: 当玩家进入玩家帮派区域时触发该回调函数 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +当玩家进入玩家帮派区域时触发该回调函数 + +| 参数名 | 说明 | +| -------- | ------------------------ | +| playerid | 进入玩家帮派区域的玩家ID | +| zoneid | 玩家进入的玩家帮派区域ID | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +public OnPlayerEnterPlayerGangZone(playerid, zoneid) +{ + new string[128]; + format(string, sizeof(string), "你正在进入玩家帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerLeavePlayerGangZone](OnPlayerLeavePlayerGangZone): 当玩家离开玩家帮派区域时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreatePlayerGangZone](../functions/CreatePlayerGangZone): 创建玩家帮派区域 +- [PlayerGangZoneDestroy](../functions/PlayerGangZoneDestroy): 销毁玩家帮派区域 +- [UsePlayerGangZoneCheck](../functions/UsePlayerGangZoneCheck): 启用玩家进入该区域时的回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md new file mode 100644 index 00000000000..41e3edbe528 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md @@ -0,0 +1,51 @@ +--- +title: OnPlayerEnterRaceCheckpoint +sidebar_label: OnPlayerEnterRaceCheckpoint +description: 当玩家进入竞速检查点时触发该回调函数。 +tags: ["玩家", "检查点", "竞速检查点"] +--- + +## 描述 + +当玩家进入竞速检查点时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ---------------------- | +| playerid | 进入竞速检查点的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +public OnPlayerEnterRaceCheckpoint(playerid) +{ + printf("玩家 %d 进入了竞速检查点!", playerid); + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerEnterCheckpoint](OnPlayerEnterCheckpoint): 当玩家进入检查点时触发 +- [OnPlayerLeaveCheckpoint](OnPlayerLeaveCheckpoint): 当玩家离开检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](OnPlayerLeaveRaceCheckpoint): 当玩家离开竞速检查点时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): 为玩家创建检查点 +- [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): 禁用玩家的当前检查点 +- [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint): 检测玩家是否在检查点内 +- [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): 为玩家创建竞速检查点 +- [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): 禁用玩家的当前竞速检查点 +- [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): 检测玩家是否在竞速检查点内 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterVehicle.md new file mode 100644 index 00000000000..e587ad9490f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerEnterVehicle.md @@ -0,0 +1,55 @@ +--- +title: OnPlayerEnterVehicle +sidebar_label: OnPlayerEnterVehicle +description: 当玩家开始进入车辆时触发该回调函数(此时玩家尚未完全进入车辆)。 +tags: ["玩家", "车辆"] +--- + +## 描述 + +当玩家开始进入车辆时触发该回调函数(此时玩家尚未完全进入车辆)。 + +| 参数名 | 说明 | +| ----------- | -------------------------------------- | +| playerid | 尝试进入车辆的玩家ID | +| vehicleid | 玩家尝试进入的车辆ID | +| ispassenger | 0表示作为驾驶员进入,1表示作为乘客进入 | + +## 返回值 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) +{ + new string[128]; + format(string, sizeof(string), "你正在进入车辆 %i", vehicleid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 该回调在玩家开始进入车辆时触发,而非完全进入后触发。详见 [OnPlayerStateChange](OnPlayerStateChange) +- 即使玩家被拒绝进入车辆(例如车辆已上锁或满员),该回调仍会被触发(但仅限作为乘客的情况) + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerExitVehicle](OnPlayerExitVehicle): 当玩家离开车辆时触发 +- [OnPlayerStateChange](OnPlayerStateChange): 当玩家状态改变时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [PutPlayerInVehicle](../functions/PutPlayerInVehicle): 将玩家放入车辆中 +- [GetPlayerVehicleSeat](../functions/GetPlayerVehicleSeat): 获取玩家所在车辆座位 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitVehicle.md new file mode 100644 index 00000000000..caa2c1a813f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitVehicle.md @@ -0,0 +1,58 @@ +--- +title: OnPlayerExitVehicle +sidebar_label: OnPlayerExitVehicle +description: 当玩家开始退出车辆时触发该回调函数。 +tags: ["玩家", "车辆"] +--- + +## 描述 + +当玩家开始退出车辆时触发该回调函数。 + +| 参数名 | 说明 | +| --------- | -------------------- | +| playerid | 正在退出车辆的玩家ID | +| vehicleid | 玩家正在退出的车辆ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +public OnPlayerExitVehicle(playerid, vehicleid) +{ + new string[64]; + format(string, sizeof(string), "提示:你正在退出车辆 %i", vehicleid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + +:::warning + +- 以下情况不会触发该回调: + - 玩家从摩托车上摔落 + - 使用[SetPlayerPos](../functions/SetPlayerPos)等函数强制移出玩家 +- 如需检测这些情况,请使用[OnPlayerStateChange](OnPlayerStateChange)回调: + - 检查旧状态是否为`PLAYER_STATE_DRIVER`(驾驶员)或`PLAYER_STATE_PASSENGER`(乘客) + - 检查新状态是否为`PLAYER_STATE_ONFOOT`(步行状态) + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerEnterVehicle](OnPlayerEnterVehicle): 当玩家开始进入车辆时触发 +- [OnPlayerStateChange](OnPlayerStateChange): 当玩家状态改变时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [RemovePlayerFromVehicle](../functions/RemovePlayerFromVehicle): 强制将玩家移出车辆 +- [GetPlayerVehicleSeat](../functions/GetPlayerVehicleSeat): 获取玩家所在车辆座位 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitedMenu.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitedMenu.md new file mode 100644 index 00000000000..5a5cc939e6f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerExitedMenu.md @@ -0,0 +1,41 @@ +--- +title: OnPlayerExitedMenu +sidebar_label: OnPlayerExitedMenu +description: 当玩家退出菜单时触发该回调函数。 +tags: ["玩家", "菜单"] +--- + +## 描述 + +当玩家退出菜单时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ---------------- | +| playerid | 退出菜单的玩家ID | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +public OnPlayerExitedMenu(playerid) +{ + TogglePlayerControllable(playerid, true); // 当玩家退出菜单时解除冻结状态 + return 1; +} +``` + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerSelectedMenuRow](OnPlayerSelectedMenuRow): 当玩家选择菜单中的某行时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreateMenu](../functions/CreateMenu): 创建菜单 +- [DestroyMenu](../functions/DestroyMenu): 销毁菜单 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerFinishedDownloading.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerFinishedDownloading.md new file mode 100644 index 00000000000..0bd0d88d5f2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerFinishedDownloading.md @@ -0,0 +1,47 @@ +--- +title: OnPlayerFinishedDownloading +sidebar_label: OnPlayerFinishedDownloading +description: 当玩家完成自定义模型下载时触发该回调函数。 +tags: ["玩家"] +--- + + + +## 描述 + +当玩家完成自定义模型下载时触发该回调函数。关于如何添加自定义模型的详细信息,请参考[发布帖](https://sampforum.blast.hk/showthread.php?tid=644105)和[教程](https://sampforum.blast.hk/showthread.php?tid=644123)。 + +| 参数名 | 说明 | +| ------------ | ---------------------------- | +| playerid | 完成自定义模型下载的玩家ID | +| virtualworld | 玩家完成下载的所属虚拟世界ID | + +## 返回值 + +本回调函数不处理返回值 + +## 示例 + +```c +public OnPlayerFinishedDownloading(playerid, virtualworld) +{ + SendClientMessage(playerid, 0xFFFFFFFF, "下载完成。"); + return 1; +} +``` + +## 注意事项 + +:::tip + +每次玩家切换虚拟世界时都会触发该回调,即使该世界中没有自定义模型。 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerConnect](OnPlayerConnect): 当玩家连接服务器时触发 +- [OnPlayerDisconnect](OnPlayerDisconnect): 当玩家断开连接时触发 +- [OnIncomingConnection](OnIncomingConnection): 当玩家尝试连接服务器时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamage.md new file mode 100644 index 00000000000..d7bdd5516bb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamage.md @@ -0,0 +1,70 @@ +--- +title: OnPlayerGiveDamage +sidebar_label: OnPlayerGiveDamage +description: 当玩家对另一名玩家造成伤害时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当玩家对另一名玩家造成伤害时触发该回调函数。 + +| 参数名 | 说明 | +| --------------- | ------------------------------------------ | +| playerid | 造成伤害的玩家ID | +| damagedid | 受到伤害的玩家ID | +| Float:amount | 损失的生命值/护甲值总和(单位:浮点数) | +| WEAPON:weaponid | 造成伤害的武器类型 | +| bodypart | 被击中的[身体部位](../resources/bodyparts) | + +## 返回值 + +1 - 阻止其他滤镜脚本接收此回调 + +0 - 允许将此回调传递给其他滤镜脚本 + +该回调始终在滤镜脚本中优先触发,返回1将阻止其他滤镜脚本处理 + +## 示例 + +```c +public OnPlayerGiveDamage(playerid, damagedid, Float:amount, WEAPON:weaponid, bodypart) +{ + new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME]; + new weaponname[24]; + GetPlayerName(playerid, attacker, sizeof (attacker)); + GetPlayerName(damagedid, victim, sizeof (victim)); + + GetWeaponName(weaponid, weaponname, sizeof (weaponname)); + format(string, sizeof(string), "%s 对 %s 造成了 %.0f 点伤害,武器:%s,部位:%d", attacker, amount, victim, weaponname, bodypart); + SendClientMessageToAll(0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 请注意本函数在某些情况下可能不够精确 +- 如需阻止特定玩家互相伤害,请使用[SetPlayerTeam](../functions/SetPlayerTeam) +- 火焰类武器(如燃烧瓶/18号武器)会返回37号武器ID(火焰喷射器) +- 爆炸类武器(如RPG、手雷)会返回51号武器ID +- 只有**playerid**(攻击者)能触发此回调 +- 伤害值始终显示武器最大伤害值,即使剩余生命值不足。例如: + - 玩家当前生命值100.0 + - 使用沙漠之鹰(单发伤害46.2)射击 + - 前两发显示伤害46.2,第三发剩余7.6生命时仍显示46.2 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerTakeDamage](OnPlayerTakeDamage): 当玩家受到伤害时触发 +- [OnPlayerWeaponShot](OnPlayerWeaponShot): 当玩家开火时触发 + +## 相关资源 + +- [身体部位列表](../resources/bodyparts) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamageActor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamageActor.md new file mode 100644 index 00000000000..25f31b5daf1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerGiveDamageActor.md @@ -0,0 +1,76 @@ +--- +title: OnPlayerGiveDamageActor +sidebar_label: OnPlayerGiveDamageActor +description: 当玩家对角色造成伤害时触发该回调函数。 +tags: ["玩家", 角色] +--- + + + +## 描述 + +当玩家对角色造成伤害时触发该回调函数。 + +| 参数名 | 说明 | +| --------------- | ------------------------------------------ | +| playerid | 造成伤害的玩家ID | +| damaged_actorid | 受到伤害的角色ID | +| Float:amount | 损失的生命值/护甲值(单位:浮点数) | +| WEAPON:weaponid | 造成伤害的武器类型 | +| bodypart | 被击中的[身体部位](../resources/bodyparts) | + +## 返回值 + +1 - 阻止其他滤镜脚本接收此回调 + +0 - 允许将此回调传递给其他滤镜脚本 + +该回调始终在滤镜脚本中优先触发,返回1将阻止其他滤镜脚本处理 + +## 示例 + +```c +public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, WEAPON:weaponid, bodypart) +{ + new string[128]; + new attackerName[MAX_PLAYER_NAME]; + new weaponName[24]; + + GetPlayerName(playerid, attackerName, sizeof (attackerName)); + GetWeaponName(weaponid, weaponName, sizeof (weaponName)); + + format(string, sizeof(string), "%s 对角色ID %d 造成了 %.0f 点伤害,武器:%s", attackerName, damaged_actorid, amount, weaponName); + SendClientMessageToAll(0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + +:::tip + +若角色设置为无敌状态(默认状态),此回调不会被触发。详见[SetActorInvulnerable](../functions/SetActorInvulnerable)。 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnActorStreamOut](OnActorStreamOut): 当角色被玩家客户端流卸载时触发 +- [OnActorStreamIn](OnActorStreamOut): 当角色被玩家客户端流加载时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreateActor](../functions/CreateActor): 创建角色(静态NPC) +- [SetActorInvulnerable](../functions/SetActorInvulnerable): 设置角色无敌状态 +- [SetActorHealth](../functions/SetActorHealth): 设置角色生命值 +- [GetActorHealth](../functions/GetActorHealth): 获取角色生命值 +- [IsActorInvulnerable](../functions/IsActorInvulnerable): 检测角色是否无敌 +- [IsValidActor](../functions/IsValidActor): 验证角色ID有效性 + +## 相关资源 + +- [身体部位列表](../resources/bodyparts) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerInteriorChange.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerInteriorChange.md new file mode 100644 index 00000000000..e4f5873bbd1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerInteriorChange.md @@ -0,0 +1,46 @@ +--- +title: OnPlayerInteriorChange +sidebar_label: OnPlayerInteriorChange +description: 当玩家切换室内区域时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当玩家切换室内区域时触发该回调函数。可能由[SetPlayerInterior](../functions/SetPlayerInterior)触发,或当玩家进入/离开建筑物时触发。 + +| 参数名 | 说明 | +| ------------- | ------------------------ | +| playerid | 切换室内区域的玩家ID | +| newinteriorid | 玩家当前所在室内区域ID | +| oldinteriorid | 玩家之前所在的室内区域ID | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) +{ + new string[42]; + format(string, sizeof(string), "你从室内区域 %d 切换到了 %d 号区域!", oldinteriorid, newinteriorid); + SendClientMessage(playerid, COLOR_ORANGE, string); + return 1; +} +``` + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerStateChange](OnPlayerStateChange): 当玩家状态改变时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [SetPlayerInterior](../functions/SetPlayerInterior): 设置玩家室内区域 +- [GetPlayerInterior](../functions/GetPlayerInterior): 获取玩家当前室内区域 +- [LinkVehicleToInterior](../functions/LinkVehicleToInterior): 设置车辆关联的室内区域 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md new file mode 100644 index 00000000000..65806240b45 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md @@ -0,0 +1,277 @@ +--- +title: OnPlayerKeyStateChange +sidebar_label: OnPlayerKeyStateChange +description: 当玩家操作任何受支持的按键状态发生改变(按下/释放)时触发此回调。 +tags: ["玩家"] +--- + +## 描述 + +当玩家操作任何[受支持按键](../resources/keys)的状态发生改变(按下/释放)时触发此回调。
方向键(上/下/左/右)不会触发 OnPlayerKeyStateChange。 + +| 参数名 | 说明 | +| -------- | ---------------------------------------------------------- | +| playerid | 操作按键的玩家 ID | +| newkeys | 当前按下的按键位掩码 - [详见此处](../resources/keys) | +| oldkeys | 状态改变前按下的按键位掩码 - [详见此处](../resources/keys) | + +## 返回值 + +- 本回调不处理返回值 +- 始终在游戏模式脚本中优先触发 + +## 注意事项 + +:::info + +NPC 也会触发此回调 + +::: + +:::tip + +方向键(上/下/左/右)不会触发 OnPlayerKeyStateChange
需通过[GetPlayerKeys](../functions/GetPlayerKeys)在[OnPlayerUpdate](../callbacks/OnPlayerUpdate)或定时器中检测 + +::: + +## 相关函数 + +以下函数可能与本回调有关联: + +- [GetPlayerKeys](../functions/GetPlayerKeys): 检测玩家当前按下的按键 + +## 扩展说明 + +### 基本原理 + +本回调在玩家按下或释放任何受支持按键时触发(参见[按键列表](../resources/keys))。
这些"按键"并非真实键盘映射,而是《圣安地列斯》的功能键绑定。例如无法直接检测空格键,但可以检测"冲刺"功能键(默认绑定为空格)。 + +### 参数解析 + +参数包含按键状态变化前后的位掩码。通过对比新旧掩码可以精确判断具体按键变化。由于采用位掩码机制,单个变量可能包含多个按键组合状态,直接值比较可能失效。 + +### 错误检测方式 + +假设需要检测"开火"键按下: + +```c +if (newkeys == KEY_FIRE) +``` + +该代码在玩家同时蹲下时失效,因为 newkeys 此时包含 KEY_FIRE | KEY_CROUCH + +### 正确检测方式 + +使用位掩码检测: + +```c +if (newkeys & KEY_FIRE) +``` + +此方式可正确检测组合键中的目标按键 + +### 精确按键检测 + +检测按键刚被按下: + +```c +if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE)) +``` + +检测按键刚被释放: + +```c +if ((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) +``` + +### 组合键检测 + +检测同时按住两个按键: + +```c +if ((newkeys & KEY_FIRE) && (newkeys & KEY_CROUCH)) +``` + +精确检测同时按下两个按键: + +```c +if ((newkeys & (KEY_FIRE | KEY_CROUCH)) == (KEY_FIRE | KEY_CROUCH) && (oldkeys & (KEY_FIRE | KEY_CROUCH)) != (KEY_FIRE | KEY_CROUCH)) +``` + +## 快捷方式定义 + +### 持续按住按键 + +定义宏: + +```c +// HOLDING(keys) +#define HOLDING(%0) \ + ((newkeys & (%0)) == (%0)) +``` + +单键检测: + +```c +if (HOLDING( KEY_FIRE )) +``` + +组合键检测: + +```c +if (HOLDING( KEY_FIRE | KEY_CROUCH )) +``` + +### 首次按下按键 + +定义宏: + +```c +// PRESSED(keys) +#define PRESSED(%0) \ + (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) +``` + +单键检测: + +```c +if (PRESSED( KEY_FIRE )) +``` + +组合键检测: + +```c +if (PRESSED( KEY_FIRE | KEY_CROUCH )) +``` + +### 实时按键状态 + +定义宏: + +```c +// PRESSING(keyVariable, keys) +#define PRESSING(%0,%1) \ + (%0 & (%1)) +``` + +单键检测: + +```c +if (PRESSING( newkeys, KEY_FIRE )) +``` + +组合键检测: + +```c +if (PRESSING( newkeys, KEY_FIRE | KEY_CROUCH )) +``` + +### 释放按键检测 + +定义宏: + +```c +// RELEASED(keys) +#define RELEASED(%0) \ + (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) +``` + +单键检测: + +```c +if (RELEASED( KEY_FIRE )) +``` + +组合键检测: + +```c +if (RELEASED( KEY_FIRE | KEY_CROUCH )) +``` + +## 应用示例 + +### 按下开火键安装氮气 + +```c +public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) +{ + if (PRESSED(KEY_FIRE)) + { + if (IsPlayerInAnyVehicle(playerid)) + { + AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); + } + } + return 1; +} +``` + +### 超级跳跃 + +```c +public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) +{ + if (PRESSED(KEY_JUMP)) + { + new + Float:x, + Float:y, + Float:z; + GetPlayerPos(playerid, x, y, z); + SetPlayerPos(playerid, x, y, z + 10.0); + } + return 1; +} +``` + +### 使用动作键无敌 + +```c +new + Float:gPlayerHealth[MAX_PLAYERS]; + +#if !defined INFINITY + #define INFINITY (Float:0x7F800000) +#endif + +public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) +{ + if (PRESSED(KEY_ACTION)) + { + // 按下动作键时保存当前生命值 + GetPlayerHealth(playerid, gPlayerHealth[playerid]); + SetPlayerHealth(playerid, INFINITY); + } + else if (RELEASED(KEY_ACTION)) + { + // 释放动作键时恢复生命值 + SetPlayerHealth(playerid, gPlayerHealth[playerid]); + } + return 1; +} +``` + +### 底层原理 + +HOLDING 检测持续按住状态,PRESSED 检测刚按下状态,RELEASED 检测刚释放状态。通过位掩码的二进制运算实现精确判断: + +KEY_SPRINT 二进制表示: + +``` +0b00001000 +``` + +KEY_JUMP 二进制表示: + +``` +0b00100000 +``` + +当玩家同时按下跳跃和冲刺时: + +``` +newkeys = 0b00101010 +wanted = 0b00101000 +``` + +通过位与运算和等值比较,可准确判断组合键状态,避免其他干扰按键的影响。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveCheckpoint.md new file mode 100644 index 00000000000..47fa87d7506 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveCheckpoint.md @@ -0,0 +1,51 @@ +--- +title: OnPlayerLeaveCheckpoint +sidebar_label: OnPlayerLeaveCheckpoint +description: 当玩家离开通过SetPlayerCheckpoint设置的检查点时触发该回调函数。 +tags: ["玩家", "检查点"] +--- + +## 描述 + +当玩家离开通过[SetPlayerCheckpoint](../functions/SetPlayerCheckpoint)设置的检查点时触发该回调函数。同一时间只能设置一个检查点。 + +| 参数名 | 说明 | +| -------- | ------------------ | +| playerid | 离开检查点的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +public OnPlayerLeaveCheckpoint(playerid) +{ + printf("玩家 %i 离开了检查点!", playerid); + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerEnterCheckpoint](OnPlayerEnterCheckpoint): 当玩家进入检查点时触发 +- [OnPlayerEnterRaceCheckpoint](OnPlayerEnterRaceCheckpoint): 当玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](OnPlayerLeaveRaceCheckpoint): 当玩家离开竞速检查点时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): 为玩家创建检查点 +- [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): 禁用玩家的当前检查点 +- [IsPlayerInCheckpoint](../functions/IsPlayerInCheckpoint): 检测玩家是否在检查点内 +- [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): 为玩家创建竞速检查点 +- [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): 禁用玩家的当前竞速检查点 +- [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): 检测玩家是否在竞速检查点内 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveGangZone.md new file mode 100644 index 00000000000..a7523e34623 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveGangZone.md @@ -0,0 +1,46 @@ +--- +title: OnPlayerLeaveGangZone +sidebar_label: OnPlayerLeaveGangZone +description: 当玩家离开帮派区域时触发该回调函数 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +当玩家离开帮派区域时触发该回调函数 + +| 参数名 | 说明 | +| -------- | -------------------- | +| playerid | 离开帮派区域的玩家ID | +| zoneid | 玩家离开的帮派区域ID | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +public OnPlayerLeaveGangZone(playerid, zoneid) +{ + new string[128]; + format(string, sizeof(string), "你正在离开帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerEnterGangZone](OnPlayerEnterGangZone): 当玩家进入帮派区域时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [GangZoneCreate](../functions/GangZoneCreate): 创建帮派区域(彩色雷达区域) +- [GangZoneDestroy](../functions/GangZoneDestroy): 销毁帮派区域 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeavePlayerGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeavePlayerGangZone.md new file mode 100644 index 00000000000..bef9788fa8f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeavePlayerGangZone.md @@ -0,0 +1,47 @@ +--- +title: OnPlayerLeavePlayerGangZone +sidebar_label: OnPlayerLeavePlayerGangZone +description: 当玩家退出玩家帮派区域时触发该回调函数 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +当玩家退出玩家帮派区域时触发该回调函数 + +| 参数名 | 说明 | +| -------- | ------------------------ | +| playerid | 退出玩家帮派区域的玩家ID | +| zoneid | 玩家退出的玩家帮派区域ID | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +public OnPlayerLeavePlayerGangZone(playerid, zoneid) +{ + new string[128]; + format(string, sizeof(string), "你正在退出玩家帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerEnterPlayerGangZone](OnPlayerEnterPlayerGangZone): 当玩家进入玩家帮派区域时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreatePlayerGangZone](../functions/CreatePlayerGangZone): 创建玩家帮派区域 +- [PlayerGangZoneDestroy](../functions/PlayerGangZoneDestroy): 销毁玩家帮派区域 +- [UsePlayerGangZoneCheck](../functions/UsePlayerGangZoneCheck): 启用玩家退出该区域时的回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md new file mode 100644 index 00000000000..c77c3b90987 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md @@ -0,0 +1,51 @@ +--- +title: OnPlayerLeaveRaceCheckpoint +sidebar_label: OnPlayerLeaveRaceCheckpoint +description: 当玩家离开竞速检查点时触发该回调函数。 +tags: ["玩家", "检查点", "竞速检查点"] +--- + +## 描述 + +当玩家离开竞速检查点时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ---------------------- | +| playerid | 离开竞速检查点的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +public OnPlayerLeaveRaceCheckpoint(playerid) +{ + printf("玩家 %d 离开了竞速检查点!", playerid); + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerEnterCheckpoint](OnPlayerEnterCheckpoint): 当玩家进入检查点时触发 +- [OnPlayerLeaveCheckpoint](OnPlayerLeaveCheckpoint): 当玩家离开检查点时触发 +- [OnPlayerEnterRaceCheckpoint](OnPlayerEnterRaceCheckpoint): 当玩家进入竞速检查点时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): 为玩家创建检查点 +- [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): 禁用玩家的当前检查点 +- [IsPlayerInCheckpoint](../functions/IsPlayerInCheckpoint): 检测玩家是否在检查点内 +- [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): 为玩家创建竞速检查点 +- [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): 禁用玩家的当前竞速检查点 +- [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): 检测玩家是否在竞速检查点内 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerObjectMoved.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerObjectMoved.md new file mode 100644 index 00000000000..99f2be34569 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerObjectMoved.md @@ -0,0 +1,49 @@ +--- +title: OnPlayerObjectMoved +sidebar_label: OnPlayerObjectMoved +description: 当玩家物体通过MovePlayerObject移动完成后触发该回调函数。 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +当玩家物体通过[MovePlayerObject](../functions/MovePlayerObject)移动并停止时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ---------------------- | +| playerid | 该玩家物体所属的玩家ID | +| objectid | 被移动的玩家物体ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +public OnPlayerObjectMoved(playerid, objectid) +{ + printf("玩家物体已移动:物体ID: %d 所属玩家: %d", objectid, playerid); + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnObjectMoved](OnObjectMoved): 当全局物体停止移动时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [MovePlayerObject](../functions/MovePlayerObject): 移动玩家物体 +- [IsPlayerObjectMoving](../functions/IsPlayerObjectMoving): 检测玩家物体是否在移动中 +- [StopPlayerObject](../functions/StopPlayerObject): 停止玩家物体的移动 +- [CreatePlayerObject](../functions/CreatePlayerObject): 创建玩家私有物体 +- [DestroyPlayerObject](../functions/DestroyPlayerObject): 销毁玩家物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPickup.md new file mode 100644 index 00000000000..42af008f326 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPickup.md @@ -0,0 +1,72 @@ +--- +title: OnPlayerPickUpPickup +sidebar_label: OnPlayerPickUpPickup +description: 当玩家拾取通过CreatePickup创建的拾取物时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当玩家拾取通过[CreatePickup](../functions/CreatePickup)创建的拾取物时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ----------------------------------------------------------- | +| playerid | 拾取拾取物的玩家ID | +| pickupid | 拾取物ID(由[CreatePickup](../functions/CreatePickup)返回) | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +new pickup_Cash; +new pickup_Health; + +public OnGameModeInit() +{ + // 创建现金和生命值拾取物 + pickup_Cash = CreatePickup(1274, 2, 2009.8658, 1220.0293, 10.8206, -1); + pickup_Health = CreatePickup(1240, 2, 2009.8474, 1218.0459, 10.8175, -1); + return 1; +} + +public OnPlayerPickUpPickup(playerid, pickupid) +{ + if (pickupid == pickup_Cash) + { + GivePlayerMoney(playerid, 1000); // 给予玩家$1000 + } + else if (pickupid == pickup_Health) + { + SetPlayerHealth(playerid, 100.0); // 恢复玩家满生命值 + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 仅适用于通过CreatePickup创建的常规拾取物 +- 武器拾取物(通过CreateWeaponPickup创建)不会触发此回调 +- 使用前请用IsValidPickup验证拾取物有效性 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPickupStreamIn](OnPickupStreamIn): 当拾取物进入玩家可视范围时触发 +- [OnPickupStreamOut](OnPickupStreamOut): 当拾取物离开玩家可视范围时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreatePickup](../functions/CreatePickup): 创建常规拾取物 +- [DestroyPickup](../functions/DestroyPickup): 销毁拾取物 +- [IsValidPickup](../functions/IsValidPickup): 验证拾取物ID有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPlayerPickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPlayerPickup.md new file mode 100644 index 00000000000..ea78ff6d9fd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickUpPlayerPickup.md @@ -0,0 +1,74 @@ +--- +title: OnPlayerPickUpPlayerPickup +sidebar_label: OnPlayerPickUpPlayerPickup +description: 当玩家拾取通过CreatePlayerPickup创建的玩家拾取物时触发该回调函数 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +当玩家拾取通过[CreatePlayerPickup](../functions/CreatePlayerPickup)创建的玩家专属拾取物时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ------------------------------------------------------------------------------- | +| playerid | 拾取玩家专属拾取物的玩家ID | +| pickupid | 玩家专属拾取物ID(由[CreatePlayerPickup](../functions/CreatePlayerPickup)返回) | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +new player_pickup_Cash[MAX_PLAYERS]; +new player_pickup_Health[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 为每个玩家创建专属拾取物 + player_pickup_Cash[playerid] = CreatePlayerPickup(playerid, 1274, 2, 2009.8658, 1220.0293, 10.8206, -1); + player_pickup_Health[playerid] = CreatePlayerPickup(playerid, 1240, 2, 2009.8474, 1218.0459, 10.8175, -1); + return 1; +} + +public OnPlayerPickUpPlayerPickup(playerid, pickupid) +{ + if (pickupid == player_pickup_Cash[playerid]) + { + GivePlayerMoney(playerid, 1000); // 给予玩家$1000 + } + else if (pickupid == player_pickup_Health[playerid]) + { + SetPlayerHealth(playerid, 100.0); // 恢复玩家满生命值 + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 仅适用于通过CreatePlayerPickup创建的玩家专属拾取物 +- 使用前请用IsValidPlayerPickup验证拾取物有效性 +- 每个玩家拾取物独立存在,不同玩家的拾取物ID可能重复 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerPickupStreamIn](OnPlayerPickupStreamIn): 当玩家专属拾取物流加载时触发 +- [OnPlayerPickupStreamOut](OnPlayerPickupStreamOut): 当玩家专属拾取物流卸载时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreatePlayerPickup](../functions/CreatePlayerPickup): 创建玩家专属拾取物 +- [DestroyPlayerPickup](../functions/DestroyPlayerPickup): 销毁玩家专属拾取物 +- [IsValidPlayerPickup](../functions/IsValidPlayerPickup): 验证玩家专属拾取物有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamIn.md new file mode 100644 index 00000000000..aa94c6f204d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamIn.md @@ -0,0 +1,68 @@ +--- +title: OnPlayerPickupStreamIn +sidebar_label: OnPlayerPickupStreamIn +description: 当玩家拾取物流加载时触发该回调函数 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +当玩家专属拾取物进入玩家可视范围时触发该回调函数 + +| 参数名 | 说明 | +| -------- | ------------------------------------------------------------------------------- | +| pickupid | 玩家专属拾取物ID(由[CreatePlayerPickup](../functions/CreatePlayerPickup)返回) | +| playerid | 所属玩家ID | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +new g_PlayerPickupHealth[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 为每个玩家创建生命值拾取物 + g_PlayerPickupHealth[playerid] = CreatePlayerPickup(playerid, 1240, 2, 2009.8474, 1218.0459, 10.8175); + return 1; +} + +public OnPlayerPickupStreamIn(pickupid, playerid) +{ + if (pickupid == g_PlayerPickupHealth[playerid]) + { + printf("玩家 %d 的生命值拾取物已完成流加载", playerid); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 仅适用于通过CreatePlayerPickup创建的玩家专属拾取物 +- 使用前请用IsValidPlayerPickup验证拾取物有效性 +- 流加载范围受服务器流距离设置影响 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerPickUpPlayerPickup](OnPlayerPickUpPlayerPickup): 当玩家拾取专属拾取物时触发 +- [OnPlayerPickupStreamOut](OnPlayerPickupStreamOut): 当玩家专属拾取物流卸载时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreatePlayerPickup](../functions/CreatePlayerPickup): 创建玩家专属拾取物 +- [DestroyPlayerPickup](../functions/DestroyPlayerPickup): 销毁玩家专属拾取物 +- [IsValidPlayerPickup](../functions/IsValidPlayerPickup): 验证玩家专属拾取物有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamOut.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamOut.md new file mode 100644 index 00000000000..02536f5472a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerPickupStreamOut.md @@ -0,0 +1,68 @@ +--- +title: OnPlayerPickupStreamOut +sidebar_label: OnPlayerPickupStreamOut +description: 当玩家专属拾取物流卸载时触发该回调函数 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +当玩家专属拾取物离开玩家可视范围时触发该回调函数 + +| 参数名 | 说明 | +| -------- | ------------------------------------------------------------------------------- | +| pickupid | 玩家专属拾取物ID(由[CreatePlayerPickup](../functions/CreatePlayerPickup)返回) | +| playerid | 所属玩家ID | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +new g_PlayerPickupHealth[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 为每个玩家创建生命值拾取物 + g_PlayerPickupHealth[playerid] = CreatePlayerPickup(playerid, 1240, 2, 2009.8474, 1218.0459, 10.8175); + return 1; +} + +public OnPlayerPickupStreamOut(pickupid, playerid) +{ + if (pickupid == g_PlayerPickupHealth[playerid]) + { + printf("玩家 %d 的生命值拾取物已流卸载", playerid); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 仅适用于通过CreatePlayerPickup创建的玩家专属拾取物 +- 流卸载操作由客户端自动执行,受玩家位置变化影响 +- 使用前请用IsValidPlayerPickup验证拾取物有效性 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerPickUpPlayerPickup](OnPlayerPickUpPlayerPickup): 当玩家拾取专属拾取物时触发 +- [OnPlayerPickupStreamIn](OnPlayerPickupStreamIn): 当玩家专属拾取物流加载时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreatePlayerPickup](../functions/CreatePlayerPickup): 创建玩家专属拾取物 +- [DestroyPlayerPickup](../functions/DestroyPlayerPickup): 销毁玩家专属拾取物 +- [IsValidPlayerPickup](../functions/IsValidPlayerPickup): 验证玩家专属拾取物有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md new file mode 100644 index 00000000000..09c2f789347 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md @@ -0,0 +1,56 @@ +--- +title: OnPlayerRequestClass +sidebar_label: OnPlayerRequestClass +description: 当玩家在职业选择界面切换职业类别(或首次进入选择界面)时触发该回调函数。 +tags: ["玩家", "class"] +--- + +## 描述 + +当玩家在职业选择界面切换职业类别(或首次进入选择界面)时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | --------------------------------------------------------------------------- | +| playerid | 切换职业类别的玩家ID | +| classid | 当前查看的职业类别ID(由[AddPlayerClass](../functions/AddPlayerClass)返回) | + +## 返回值 + +该回调始终在滤镜脚本中优先触发 + +## 示例 + +```c +public OnPlayerRequestClass(playerid, classid) +{ + // 若选择第3号职业且非管理员,则禁止选择 + if (classid == 3 && !IsPlayerAdmin(playerid)) + { + SendClientMessage(playerid, COLOR_RED, "该皮肤仅管理员可用!"); + return 0; // 阻止选择 + } + return 1; // 允许选择 +} +``` + +## 注意事项 + +:::tip + +当玩家按下F4键时也会触发此回调 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerRequestSpawn](OnPlayerRequestSpawn): 当玩家尝试通过职业选择界面生成时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [AddPlayerClass](../functions/AddPlayerClass): 添加职业类别 +- [SetSpawnInfo](../functions/SetSpawnInfo): 设置玩家生成信息 +- [SetPlayerTeam](../functions/SetPlayerTeam): 设置玩家队伍(影响职业选择) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestDownload.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestDownload.md new file mode 100644 index 00000000000..1a8c95bf89c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestDownload.md @@ -0,0 +1,85 @@ +--- +title: OnPlayerRequestDownload +sidebar_label: OnPlayerRequestDownload +description: 当玩家请求下载自定义模型时触发该回调函数 +tags: ["玩家"] +--- + + + +## 描述 + +当玩家请求下载自定义模型资源时触发该回调函数 + +| 参数名 | 说明 | +| --------------------- | ---------------------------------------------- | +| playerid | 发起下载请求的玩家ID | +| DOWNLOAD_REQUEST:type | [下载请求类型](../resources/download-requests) | +| crc | 自定义模型文件的CRC校验值 | + +## 返回值 + +0 - 拒绝下载请求 + +1 - 接受下载请求 + +## 示例 + +```c +#define DOWNLOAD_REQUEST_EMPTY (DOWNLOAD_REQUEST:0) // 空请求 +#define DOWNLOAD_REQUEST_MODEL_FILE (DOWNLOAD_REQUEST:1) // 模型文件请求 +#define DOWNLOAD_REQUEST_TEXTURE_FILE (DOWNLOAD_REQUEST:2) // 纹理文件请求 + +new baseUrl[] = "https://assets.open.mp"; // 资源服务器基础地址 + +public OnPlayerRequestDownload(playerid, DOWNLOAD_REQUEST:type, crc) +{ + if (!IsPlayerConnected(playerid)) + { + return 0; // 玩家未连接时拒绝请求 + } + + new fullUrl[256 + 1]; // 完整下载URL + new dlFileName[64 + 1]; // 待下载文件名 + new foundFileName = 0; // 文件查找标记 + + // 根据请求类型处理 + if (type == DOWNLOAD_REQUEST_TEXTURE_FILE) + { + foundFileName = FindTextureFileNameFromCRC(crc, dlFileName, 64); + } + else if (type == DOWNLOAD_REQUEST_MODEL_FILE) + { + foundFileName = FindModelFileNameFromCRC(crc, dlFileName, 64); + } + + if (foundFileName) + { + // 拼接完整下载地址 + format(fullUrl, sizeof(fullUrl), "%s/%s", baseUrl, dlFileName); + RedirectDownload(playerid, fullUrl); // 重定向下载 + } + + return 0; // 拒绝默认下载流程 +} +``` + +## 注意事项 + +:::tip + +- 需在服务器配置中启用UsePlayerPedAnims选项 +- 可通过CRC校验确保文件完整性 +- 使用RedirectDownload函数可自定义下载源 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerFinishedDownloading](OnPlayerFinishedDownloading): 当玩家完成下载时触发 + +## 相关资源 + +- [下载请求类型说明](../resources/download-requests) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md new file mode 100644 index 00000000000..9a1405a20c7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md @@ -0,0 +1,57 @@ +--- +title: OnPlayerRequestSpawn +sidebar_label: OnPlayerRequestSpawn +description: 当玩家通过职业选择界面尝试生成角色时触发该回调函数(按下SHIFT或点击生成按钮)。 +tags: ["玩家", "class"] +--- + +## 描述 + +当玩家通过职业选择界面尝试生成角色时触发该回调函数(按下SHIFT或点击生成按钮)。 + +| 参数名 | 说明 | +| -------- | -------------------- | +| playerid | 请求生成角色的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发,返回0将阻止其他脚本处理 + +## 示例 + +```c +public OnPlayerRequestSpawn(playerid) +{ + if (!IsPlayerAdmin(playerid)) // 非管理员玩家 + { + SendClientMessage(playerid, -1, "您无权生成角色。"); + return 0; // 阻止生成 + } + return 1; // 允许生成 +} +``` + +## 注意事项 + + + +:::tip + +如需限制玩家使用特定职业生成,需在OnPlayerRequestClass回调中保存最后查看的职业类别 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerSpawn](OnPlayerSpawn): 当玩家成功生成时触发 +- [OnPlayerRequestClass](OnPlayerRequestClass): 当玩家切换职业类别时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [SpawnPlayer](../functions/SpawnPlayer): 强制生成玩家角色 +- [SetSpawnInfo](../functions/SetSpawnInfo): 设置玩家生成信息 +- [AddPlayerClass](../functions/AddPlayerClass): 添加职业类别 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectObject.md new file mode 100644 index 00000000000..34f50d4d716 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectObject.md @@ -0,0 +1,59 @@ +--- +title: OnPlayerSelectObject +sidebar_label: OnPlayerSelectObject +description: 当玩家使用BeginObjectSelecting后选择物体时触发该回调函数。 +tags: ["玩家", "物体"] +--- + +## 描述 + +当玩家使用 [BeginObjectSelecting](../functions/BeginObjectSelecting) 后选择物体时触发该回调函数。 + +| 参数名 | 说明 | +| ------------------ | -------------------------------------------- | +| playerid | 选择物体的玩家ID | +| SELECT_OBJECT:type | 选择的[类型](../resources/selectobjecttypes) | +| objectid | 被选物体的ID | +| modelid | 被选物体的模型ID | +| Float:fX | 被选物体的X坐标 | +| Float:fY | 被选物体的Y坐标 | +| Float:fZ | 被选物体的Z坐标 | + +## 返回值 + +1 - 阻止其他脚本接收此回调。 + +0 - 表示此回调将继续传递给下一个脚本。 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnPlayerSelectObject(playerid, SELECT_OBJECT:type, objectid, modelid, Float:fX, Float:fY, Float:fZ) +{ + printf("玩家 %d 选择了物体 %d", playerid, objectid); + + if (type == SELECT_OBJECT_GLOBAL_OBJECT) + { + BeginObjectEditing(playerid, objectid); + } + else + { + BeginPlayerObjectEditing(playerid, objectid); + } + + SendClientMessage(playerid, 0xFFFFFFFF, "您现在可以编辑您的物体了!"); + return 1; +} +``` + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [BeginObjectSelecting](../functions/BeginObjectSelecting): 开始物体选择流程 + +## 相关资源 + +- [选择物体类型](../resources/selectobjecttypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectedMenuRow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectedMenuRow.md new file mode 100644 index 00000000000..f36ffbf0896 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSelectedMenuRow.md @@ -0,0 +1,81 @@ +--- +title: OnPlayerSelectedMenuRow +sidebar_label: OnPlayerSelectedMenuRow +description: 当玩家从菜单中选择项目时触发该回调函数(通过ShowMenuForPlayer显示菜单)。 +tags: ["玩家", "菜单"] +--- + +## 描述 + +当玩家从菜单(通过[ShowMenuForPlayer](../functions/ShowMenuForPlayer)显示)中选择项目时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 选择菜单项的玩家ID | +| row | 被选中的行号(首行ID为0) | + +## 返回值 + +该回调始终在游戏模式中优先触发 + +## 示例 + +```c +new Menu:MyMenu; + +public OnGameModeInit() +{ + // 创建菜单并添加选项 + MyMenu = CreateMenu("示例菜单", 1, 50.0, 180.0, 200.0, 200.0); + AddMenuItem(MyMenu, 0, "选项1"); + AddMenuItem(MyMenu, 0, "选项2"); + return 1; +} + +public OnPlayerSelectedMenuRow(playerid, row) +{ + if (GetPlayerMenu(playerid) == MyMenu) + { + switch (row) + { + case 0: // 第一行被选中 + { + print("选项1 被选中"); + SendClientMessage(playerid, 0xFFFFFFFF, "你选择了选项1"); + } + case 1: // 第二行被选中 + { + print("选项2 被选中"); + SendClientMessage(playerid, 0xFFFFFFFF, "你选择了选项2"); + } + } + } + return 1; +} +``` + +## 注意事项 + +:::tip + +回调函数不会直接传递菜单ID,需使用[GetPlayerMenu](../functions/GetPlayerMenu)获取当前菜单 + +::: + +## 相关回调 + +以下回调函数可能与本回调相关: + +- [OnPlayerExitedMenu](OnPlayerExitedMenu): 当玩家退出菜单时触发 +- [OnDialogResponse](OnDialogResponse): 当玩家响应对话框时触发 + +## 相关函数 + +以下函数可能与本回调函数相关: + +- [CreateMenu](../functions/CreateMenu): 创建菜单 +- [DestroyMenu](../functions/DestroyMenu): 销毁菜单 +- [AddMenuItem](../functions/AddMenuItem): 添加菜单项 +- [ShowMenuForPlayer](../functions/ShowMenuForPlayer): 向玩家显示菜单 +- [HideMenuForPlayer](../functions/HideMenuForPlayer): 隐藏玩家的菜单 +- [GetPlayerMenu](../functions/GetPlayerMenu): 获取玩家当前查看的菜单 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md new file mode 100644 index 00000000000..2bb11a88dfe --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md @@ -0,0 +1,65 @@ +--- +title: OnPlayerSpawn +sidebar_label: OnPlayerSpawn +description: 当玩家生成时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当玩家生成时触发该回调函数(例如调用 [SpawnPlayer](../functions/SpawnPlayer) 函数之后)。 + +| 参数名 | 说明 | +| -------- | -------------- | +| playerid | 已生成玩家的ID | + +## 返回值 + +0 - 阻止其他滤镜脚本接收此回调。 + +1 - 表示此回调将继续传递给下一个滤镜脚本。 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + new PlayerName[MAX_PLAYER_NAME]; + GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); + + new string[64]; + format(string, sizeof(string), "%s 已成功生成。", PlayerName); + + SendClientMessageToAll(0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + +:::tip + +在圣安地列斯原版中,玩家死亡时会自动扣除$100作为医院费用。SA:MP 保留了这个机制,但 open.mp 移除了该功能以便脚本自主管理金钱。许多脚本通过在玩家死亡后或生成时添加$100来修复这个问题。如果这是您的脚本,建议删除额外的修复代码(尽管 open.mp 的代码已尝试兼容这类脚本)。如果您的脚本依赖此功能,请在 [OnPlayerDeath](OnPlayerDeath) 中添加以下代码: + +```c +GivePlayerMoney(playerid, -100); +``` + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnPlayerDeath](OnPlayerDeath): 当玩家死亡时触发 +- [OnVehicleSpawn](OnVehicleSpawn): 当车辆重新生成时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [SpawnPlayer](../functions/SpawnPlayer): 强制玩家生成 +- [AddPlayerClass](../functions/AddPlayerClass): 添加玩家职业 +- [SetSpawnInfo](../functions/SetSpawnInfo): 设置玩家生成信息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStateChange.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStateChange.md new file mode 100644 index 00000000000..96664bb2579 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStateChange.md @@ -0,0 +1,58 @@ +--- +title: OnPlayerStateChange +sidebar_label: OnPlayerStateChange +description: 当玩家状态发生改变时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当玩家状态发生改变时触发该回调函数。例如:当玩家从车辆驾驶员状态切换为步行状态时。 + +| 参数名 | 说明 | +| --------------------- | -------------------- | +| playerid | 状态发生改变的玩家ID | +| PLAYER_STATE:newstate | 玩家当前的新状态 | +| PLAYER_STATE:oldstate | 玩家之前的旧状态 | + +完整状态列表请参考[玩家状态](../resources/playerstates)。 + +## 返回值 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) +{ + if (oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // 玩家以驾驶员身份进入车辆 + { + new vehicleid = GetPlayerVehicleID(playerid); + AddVehicleComponent(vehicleid, 1010); // 为车辆添加氮气加速系统 + } + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnPlayerInteriorChange](OnPlayerInteriorChange): 当玩家切换室内场景时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [GetPlayerState](../functions/GetPlayerState): 获取玩家当前状态 +- [GetPlayerSpecialAction](../functions/GetPlayerSpecialAction): 获取玩家特殊动作 +- [SetPlayerSpecialAction](../functions/SetPlayerSpecialAction): 设置玩家特殊动作 + +## 相关资源 + +- [玩家状态](../resources/playerstates) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamIn.md new file mode 100644 index 00000000000..250f9e827be --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamIn.md @@ -0,0 +1,43 @@ +--- +title: OnPlayerStreamIn +sidebar_label: OnPlayerStreamIn +description: 当某个玩家的客户端流加载其他玩家时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当某个玩家的客户端流加载其他玩家时触发该回调函数。 + +| 参数名 | 说明 | +| ----------- | ------------------ | +| playerid | 被流加载的玩家ID | +| forplayerid | 发起流加载的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnPlayerStreamIn(playerid, forplayerid) +{ + new string[40]; + format(string, sizeof(string), "玩家 %d 现在已被流加载到您的客户端。", playerid); + SendClientMessage(forplayerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnPlayerStreamOut](OnPlayerStreamOut): 当玩家被其他客户端流卸载时触发 +- [OnActorStreamIn](OnPlayerStreamOut): 当角色被玩家客户端流加载时触发 +- [OnVehicleStreamIn](OnVehicleStreamIn): 当车辆被玩家客户端流加载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamOut.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamOut.md new file mode 100644 index 00000000000..565d9de7aaa --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerStreamOut.md @@ -0,0 +1,49 @@ +--- +title: OnPlayerStreamOut +sidebar_label: OnPlayerStreamOut +description: 当某个玩家的客户端流卸载其他玩家时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当某个玩家的客户端流卸载其他玩家时触发该回调函数。 + +| 参数名 | 说明 | +| ----------- | ------------------ | +| playerid | 被流卸载的玩家ID | +| forplayerid | 发起流卸载的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnPlayerStreamOut(playerid, forplayerid) +{ + new string[80]; + format(string, sizeof(string), "您的计算机刚刚卸载了玩家ID %d", playerid); + SendClientMessage(forplayerid, 0xFF0000FF, string); + return 1; +} +``` + +## 注意事项 + + + +:::warning + +当玩家断开连接时,OnPlayerStreamOut不会为双方玩家触发 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnPlayerStreamIn](OnPlayerStreamIn): 当玩家被其他客户端流加载时触发 +- [OnActorStreamIn](OnPlayerStreamOut): 当角色被玩家客户端流加载时触发 +- [OnVehicleStreamIn](OnPlayerStreamOut): 当车辆被玩家客户端流加载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md new file mode 100644 index 00000000000..6101e0251d0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md @@ -0,0 +1,94 @@ +--- +title: OnPlayerTakeDamage +sidebar_label: OnPlayerTakeDamage +description: 当玩家受到伤害时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当玩家受到伤害时触发该回调函数。 + +| 参数名 | 说明 | +| --------------- | --------------------------------------------------- | +| playerid | 受到伤害的玩家ID | +| issuerid | 造成伤害的玩家ID(若为自伤则返回INVALID_PLAYER_ID) | +| Float:amount | 玩家承受的伤害值(生命值与护甲值合计) | +| WEAPON:weaponid | 造成伤害的武器ID/原因 | +| bodypart | 受击的[身体部位](../resources/bodyparts) | + +## 返回值 + +1 - 阻止其他滤镜脚本接收此回调。 + +0 - 允许此回调传递给其他滤镜脚本。 + +该回调始终在滤镜脚本中优先触发,返回1将阻止其他滤镜脚本处理该事件。 + +## 示例 + +```c +public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) +{ + if (issuerid != INVALID_PLAYER_ID) // 若非自伤 + { + new + infoString[128], + weaponName[24], + victimName[MAX_PLAYER_NAME], + attackerName[MAX_PLAYER_NAME]; + + GetPlayerName(playerid, victimName, sizeof (victimName)); + GetPlayerName(issuerid, attackerName, sizeof (attackerName)); + + GetWeaponName(weaponid, weaponName, sizeof (weaponName)); + + format(infoString, sizeof(infoString), "%s 对 %s 造成了 %.0f 点伤害,武器:%s,部位:%d", attackerName, amount, victimName, weaponName, bodypart); + SendClientMessageToAll(-1, infoString); + } + return 1; +} +``` + +
+ +```c +public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) +{ + if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) + { + // 使用狙击步枪爆头一击必杀 + SetPlayerHealth(playerid, 0.0); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 火焰类武器(如燃烧瓶,ID18)的weaponid将始终返回37(火焰喷射器) +- 爆炸类武器(如RPG,手雷)的weaponid将始终返回51 +- 只有**playerid**参数对应的玩家会触发此回调 +- 伤害值始终显示武器最大伤害值,即使实际剩余生命值不足。例如:玩家有100点生命值时,使用伤害值46.2的沙漠之鹰需要3枪致死,所有3次伤害都会显示46.2点 + +::: + +:::warning + +- [GetPlayerHealth](../functions/GetPlayerHealth) 和 [GetPlayerArmour](../functions/GetPlayerArmour) 将返回玩家受伤前的数值 +- 使用issuerid作为数组索引前请务必验证其有效性 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnPlayerGiveDamage](OnPlayerGiveDamage): 当玩家造成伤害时触发 +- [OnPlayerWeaponShot](OnPlayerWeaponShot): 当玩家发射武器时触发 + +## 相关资源 + +- [身体部位](../resources/bodyparts) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md new file mode 100644 index 00000000000..5149d0602bf --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md @@ -0,0 +1,58 @@ +--- +title: OnPlayerText +sidebar_label: OnPlayerText +description: 当玩家发送聊天消息时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当玩家在聊天框发送消息时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | ------------------ | +| playerid | 发送消息的玩家ID | +| text[] | 玩家发送的消息内容 | + +## 返回值 + +该回调始终在滤镜脚本中优先触发,返回0将阻止其他脚本处理此消息。 + +## 示例 + +```c +public OnPlayerText(playerid, text[]) +{ + new string[144]; + format(string, sizeof (string), "(%d) %s", playerid, text); + SendPlayerMessageToAll(playerid, string); + + // 返回0将忽略默认消息格式,发送自定义消息 + // 返回1会导致消息重复显示(默认消息也会发送) + return 0; +} +``` + +## 注意事项 + + + +:::tip + +默认情况下,此回调会发送包含玩家昵称、ID和消息内容的系统格式消息。返回0可禁用此默认行为(如示例代码所示)。 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnPlayerCommandText](OnPlayerCommandText): 当玩家输入指令时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [SendPlayerMessageToPlayer](../functions/SendPlayerMessageToPlayer): 向指定玩家发送玩家消息 +- [SendPlayerMessageToAll](../functions/SendPlayerMessageToAll): 向全体玩家发送玩家消息 +- [ToggleChatTextReplacement](../functions/ToggleChatTextReplacement): 切换聊天过滤器状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md new file mode 100644 index 00000000000..2cbdaf3e32b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -0,0 +1,111 @@ +--- +title: OnPlayerUpdate +sidebar_label: OnPlayerUpdate +description: 当客户端/玩家向服务器发送状态更新时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +每当客户端/玩家向服务器发送状态更新时触发该回调函数。常用于创建服务器未主动追踪的客户端状态更新回调,例如生命值/护甲更新或武器切换。 + +| 参数名 | 说明 | +| -------- | ---------------------- | +| playerid | 发送更新数据包的玩家ID | + +## 返回值 + +0 - 阻止该玩家的更新同步到其他客户端 + +1 - 表示该更新可正常处理并发送给其他玩家 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +**示例 1** + +```c +new WEAPON:gPlayerCurrentWeapon[MAX_PLAYERS]; + +public OnPlayerUpdate(playerid) +{ + new WEAPON:weapon = GetPlayerWeapon(playerid); // 获取玩家当前武器 + if (weapon != gPlayerCurrentWeapon[playerid]) // 检测武器变更 + { + // 调用自定义回调 OnPlayerWeaponChange + CallLocalFunction("OnPlayerWeaponChange", "iii", playerid, gPlayerCurrentWeapon[playerid], weapon); + gPlayerCurrentWeapon[playerid] = weapon; // 更新武器记录 + } + return 1; // 允许更新同步给其他玩家 +} + +forward OnPlayerWeaponChange(playerid, WEAPON:oldWeapon, WEAPON:newWeapon); +public OnPlayerWeaponChange(playerid, WEAPON:oldWeapon, WEAPON:newWeapon) +{ + new + string[128], + oldWeaponName[24], + newWeaponName[24]; + + GetWeaponName(oldWeapon, oldWeaponName, sizeof(oldWeaponName)); + GetWeaponName(newWeapon, newWeaponName, sizeof(newWeaponName)); + + format(string, sizeof(string), "您已将武器从 %s 切换为 %s!", oldWeaponName, newWeaponName); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; +} +``` + +**示例 2** + +```c +public OnPlayerUpdate(playerid) +{ + new Float:fHealth; + GetPlayerHealth(playerid, fHealth); + + if (fHealth != GetPVarFloat(playerid, "faPlayerHealth")) + { + // 检测生命值变化,可用于反作弊检测 + if (fHealth > GetPVarFloat(playerid, "faPlayerHealth")) + { + /* 生命值异常增加,可能作弊 */ + } + else + { + /* 正常生命值减少 */ + } + + SetPVarFloat(playerid, "faPlayerHealth", fHealth); + } +} +``` + +## 注意事项 + + + +:::warning + +本回调函数平均每秒触发30次/玩家,请谨慎使用。触发频率会根据玩家行为变化:驾驶或射击时更新频率远高于静止状态。 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnPlayerWeaponShot](OnPlayerWeaponShot): 当玩家发射武器时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [GetPlayerWeapon](../functions/GetPlayerWeapon): 获取玩家当前武器 +- [GetPlayerHealth](../functions/GetPlayerHealth): 获取玩家生命值 +- [SetPlayerHealth](../functions/SetPlayerHealth): 设置玩家生命值 + +## 相关资源 + +- [武器ID列表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md new file mode 100644 index 00000000000..ecda6b7bd8d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md @@ -0,0 +1,79 @@ +--- +title: OnPlayerWeaponShot +sidebar_label: OnPlayerWeaponShot +description: 当玩家射击时触发该回调函数。 +tags: ["玩家"] +--- + +## 描述 + +当玩家射击时触发该回调函数(仅支持枪械类武器)。 + +| 参数名 | 说明 | +| ----------------------- | ------------------------------------------------- | +| playerid | 射击的玩家ID | +| WEAPON:weaponid | 使用的[武器ID](../resources/weaponids) | +| BULLET_HIT_TYPE:hittype | 子弹命中的[目标类型](../resources/bullethittypes) | +| hitid | 被击中的玩家/车辆/物体ID | +| Float:fX | 命中点的X坐标 | +| Float:fY | 命中点的Y坐标 | +| Float:fZ | 命中点的Z坐标 | + +## 返回值 + +0 - 阻止子弹造成伤害 + +1 - 允许子弹造成伤害 + +该回调始终在滤镜脚本中优先触发,返回0将阻止其他脚本处理此事件。 + +## 示例 + +```c +public OnPlayerWeaponShot(playerid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hitid, Float:fX, Float:fY, Float:fZ) +{ + new string[144]; + format(string, sizeof(string), "武器ID %i,命中类型: %i,目标ID: %i,坐标: %f, %f, %f", weaponid, hittype, hitid, fX, fY, fZ); + SendClientMessage(playerid, -1, string); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 仅在启用延迟补偿时触发此回调 +- 当hittype为BULLET_HIT_TYPE_NONE时,fX/fY/fZ为绝对坐标(若未命中则返回0.0) +- 其他命中类型时,坐标为相对于hitid的偏移量 +- 使用[GetPlayerLastShotVectors](../functions/GetPlayerLastShotVectors)可获取更详细的弹道向量信息 + +::: + +:::warning + +**已知问题** + +- 作为车辆驾驶员射击时不会触发 +- 开启瞄准镜向后射击时不会触发 +- 击中车辆内玩家时返回BULLET_HIT_TYPE_VEHICLE而非PLAYER类型 +- 0.3.7版本后需校验weaponid真实性以防止客户端崩溃 +- 武装车辆(如直升机机炮)射击时不会触发 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnPlayerGiveDamage](OnPlayerGiveDamage): 当玩家造成伤害时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [GetPlayerLastShotVectors](../functions/GetPlayerLastShotVectors): 获取玩家最后发射的子弹向量 + +## 相关资源 + +- [子弹命中类型](../resources/bullethittypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md new file mode 100644 index 00000000000..e690aeeb321 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -0,0 +1,74 @@ +--- +title: OnRconCommand +sidebar_label: OnRconCommand +description: 当通过服务器控制台、RCON或游戏内"/rcon command"发送命令时触发该回调函数。 +tags: ["rcon", "管理"] +--- + +## 描述 + +当通过以下方式发送命令时触发该回调函数: + +- 服务器控制台 +- RCON远程控制台 +- 游戏内指令`/rcon command` + +| 参数名 | 说明 | +| ------ | -------------------------- | +| cmd[] | 包含完整命令及参数的字符串 | + +## 返回值 + +该回调始终在滤镜脚本中优先触发,返回1将阻止主脚本处理该命令。 + +## 示例 + +```c +public OnRconCommand(cmd[]) +{ + printf("[RCON]: 您输入了 '/rcon %s'!", cmd); + return 0; +} + +public OnRconCommand(cmd[]) +{ + if (!strcmp(cmd, "hello", true)) + { + SendClientMessageToAll(0xFFFFFFAA, "Hello World!"); + print("您向世界打了招呼"); // 该消息会显示在输入者的聊天框(白色文字) + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +- 当玩家输入指令时,`/rcon`前缀不会包含在cmd参数中 +- 在此回调中使用`print`函数会同时向玩家聊天框和服务器日志输出信息 +- 仅当玩家已登录RCON管理员时才会触发此回调 +- 玩家使用`/rcon login`登录时会触发[OnRconLoginAttempt](OnRconLoginAttempt)而非本回调 + +::: + +:::warning + +**版本差异** +SA-MP需在滤镜脚本中实现此回调才能生效,该问题已在open.mp修复 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnRconLoginAttempt](OnRconLoginAttempt): 当尝试登录RCON时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [IsPlayerAdmin](../functions/IsPlayerAdmin): 检测玩家是否为RCON管理员 +- [SetPlayerAdmin](../functions/SetPlayerAdmin): 设置玩家为RCON管理员 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconLoginAttempt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconLoginAttempt.md new file mode 100644 index 00000000000..ffce8f6e6d0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconLoginAttempt.md @@ -0,0 +1,75 @@ +--- +title: OnRconLoginAttempt +sidebar_label: OnRconLoginAttempt +description: 当玩家尝试在游戏中登录RCON时触发该回调函数(无论成功与否)。 +tags: ["rcon", "管理"] +--- + +## 描述 + +当玩家在游戏内尝试登录RCON时触发该回调函数,无论登录是否成功。 + +| 参数名 | 说明 | +| ---------- | -------------------------- | +| ip[] | 尝试登录的玩家IP地址 | +| password[] | 使用的登录密码 | +| success | 登录结果(0=失败,1=成功) | + +## 返回值 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnRconLoginAttempt(ip[], password[], success) +{ + if (!success) // 若密码错误 + { + printf("RCON登录失败:IP %s 使用密码 %s", ip, password); + + new ipAddress[16]; + + for (new i = 0; i < MAX_PLAYERS; i++) // 遍历所有玩家 + { + if (!IsPlayerConnected(i)) + { + continue; + } + + GetPlayerIp(i, ipAddress, sizeof(ipAddress)); + + if (!strcmp(ip, ipAddress, true)) // 匹配IP地址 + { + SendClientMessage(i, 0xFFFFFFFF, "密码错误,即将踢出!"); + Kick(i); // 踢出玩家 + break; + } + } + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 本回调仅在游戏内使用`/rcon login`时触发 +- 仅在玩家未登录RCON时触发,登录成功后触发[OnRconCommand](OnRconCommand) + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnRconCommand](OnRconCommand): 当发送RCON命令时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [IsPlayerAdmin](../functions/IsPlayerAdmin): 检测玩家是否为RCON管理员 +- [SetPlayerAdmin](../functions/SetPlayerAdmin): 设置玩家为RCON管理员 +- [SendRconCommand](../functions/SendRconCommand): 通过脚本发送RCON命令 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRecordingPlaybackEnd.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRecordingPlaybackEnd.md new file mode 100644 index 00000000000..c44a2e61c33 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRecordingPlaybackEnd.md @@ -0,0 +1,26 @@ +--- +title: OnRecordingPlaybackEnd +sidebar_label: OnRecordingPlaybackEnd +description: 当使用StartRecordingPlayback播放的录制文件结束时触发该回调函数。 +tags: [] +--- + +## 描述 + +当使用 [StartRecordingPlayback](../functions/StartRecordingPlayback) 播放的.rec文件到达结尾时触发该回调函数。 + +## 示例 + +```c +public OnRecordingPlaybackEnd() +{ + StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER, "all_around_lv_bus"); // 当回放结束时将重新开始播放录制 +} +``` + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [StartRecordingPlayback](../functions/StartRecordingPlayback): 开始回放录制文件 +- [StopRecordingPlayback](../functions/StopRecordingPlayback): 停止回放录制文件 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptCash.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptCash.md new file mode 100644 index 00000000000..cc9c0762a41 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptCash.md @@ -0,0 +1,51 @@ +--- +title: OnScriptCash +sidebar_label: OnScriptCash +description: 当游戏内系统(如赌场)向玩家发放金钱时触发该回调函数。 +tags: ["玩家"] +--- + +:::warning + +该回调函数当前**不可用** + +::: + +## 描述 + +当游戏内系统(如赌场)向玩家发放或扣除金钱时触发该回调函数。 + +| 参数名 | 说明 | +| -------- | -------------------------------------- | +| playerid | 获得/失去游戏内金钱的玩家ID | +| amount | 金钱变动数值(正数为获得,负数为扣除) | +| source | 金钱来源标识 | + +## 返回值 + +由于该功能当前不可用,返回值状态未知。 + +## 示例 + +```c +// 假设性示例: + +public OnScriptCash(playerid, amount, source) +{ + if (source == SCRIPT_CASH_CASINO) + { + SendClientMessage(playerid, -1, "您从赌场赢得了$%d!", amount); + } + else if (source == SCRIPT_CASH_VENDING_MACHINE) + { + SendClientMessage(playerid, -1, "您花费$%d从自动售货机购买了可乐", amount); + } + return 1; +} +``` + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [GetPlayerMoney](../functions/GetPlayerMoney): 获取玩家当前持有金额 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptLoadPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptLoadPlayer.md new file mode 100644 index 00000000000..cf6617503e2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptLoadPlayer.md @@ -0,0 +1,46 @@ +--- +title: OnScriptLoadPlayer +sidebar_label: OnScriptLoadPlayer +description: 当脚本加载时,会为每个已连接的玩家调用该回调函数。 +tags: ["玩家"] +--- + + + +## 描述 + +当脚本加载时,会为每个已连接的玩家调用该回调函数。 + +| 参数名 | 说明 | +| ------------------ | ------------------------------------------------ | +| playerid | 脚本加载对应的玩家ID | +| bool:isEntryScript | 标识是否为入口脚本(主脚本)或侧脚本(滤镜脚本) | + +## 返回值 + +本回调函数不处理返回值。 + +## 示例 + +```c +public OnScriptLoadPlayer(playerid, bool:isEntryScript) +{ + printf("为玩家ID %d 加载脚本(主脚本:%s)", playerid, isEntryScript ? "是" : "否"); +} +``` + +## 注意事项 + +:::tip + +本回调在**运行时加载**侧脚本(滤镜脚本)时触发 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnScriptUnloadPlayer](OnScriptUnloadPlayer): 当脚本卸载时为每个玩家触发 +- [OnPlayerConnect](OnPlayerConnect): 当玩家连接服务器时触发 +- [OnPlayerDisconnect](OnPlayerDisconnect): 当玩家断开连接时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptUnloadPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptUnloadPlayer.md new file mode 100644 index 00000000000..b2cb4a9f111 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnScriptUnloadPlayer.md @@ -0,0 +1,46 @@ +--- +title: OnScriptUnloadPlayer +sidebar_label: OnScriptUnloadPlayer +description: 当脚本卸载时,会为每个已连接的玩家调用该回调函数。 +tags: ["玩家"] +--- + + + +## 描述 + +当脚本卸载时,会为每个已连接的玩家调用该回调函数。 + +| 参数名 | 说明 | +| ------------------ | ------------------------------------------------ | +| playerid | 脚本卸载对应的玩家ID | +| bool:isEntryScript | 标识是否为入口脚本(主脚本)或侧脚本(滤镜脚本) | + +## 返回值 + +本回调函数不处理返回值。 + +## 示例 + +```c +public OnScriptUnloadPlayer(playerid, bool:isEntryScript) +{ + printf("为玩家ID %d 卸载脚本(主脚本:%s)", playerid, isEntryScript ? "是" : "否"); +} +``` + +## 注意事项 + +:::tip + +本回调在**运行时卸载**侧脚本(滤镜脚本)时触发 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnScriptLoadPlayer](OnScriptLoadPlayer): 当脚本加载时为每个玩家触发 +- [OnPlayerConnect](OnPlayerConnect): 当玩家连接服务器时触发 +- [OnPlayerDisconnect](OnPlayerDisconnect): 当玩家断开连接时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnTrailerUpdate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnTrailerUpdate.md new file mode 100644 index 00000000000..4501930d6ef --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnTrailerUpdate.md @@ -0,0 +1,56 @@ +--- +title: OnTrailerUpdate +sidebar_label: OnTrailerUpdate +description: 当玩家发送拖车状态更新时触发该回调函数。 +tags: ["车辆"] +--- + +## 描述 + +当玩家客户端发送拖车状态同步数据时触发该回调函数。 + +| 参数名 | 说明 | +| --------- | ------------------------ | +| playerid | 发送拖车状态更新的玩家ID | +| vehicleid | 被更新的拖车ID | + +## 返回值 + +0 - 阻止向其他玩家同步该拖车更新(仍会更新发送者客户端) + +1 - 正常处理拖车更新并同步给所有玩家 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnTrailerUpdate(playerid, vehicleid) +{ + DetachTrailerFromVehicle(GetPlayerVehicleID(playerid)); // 强制分离拖车 + return 0; // 阻止更新同步 +} +``` + +## 注意事项 + +:::warning + +本回调触发频率极高(每秒多次/每个拖车),请避免在此执行复杂计算或文件读写操作 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnUnoccupiedVehicleUpdate](OnUnoccupiedVehicleUpdate): 当无驾驶员车辆位置同步时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [GetVehicleTrailer](../functions/GetVehicleTrailer): 获取车辆牵引的拖车ID +- [IsTrailerAttachedToVehicle](../functions/IsTrailerAttachedToVehicle): 检测拖车是否连接 +- [AttachTrailerToVehicle](../functions/AttachTrailerToVehicle): 连接拖车到车辆 +- [DetachTrailerFromVehicle](../functions/DetachTrailerFromVehicle): 分离拖车连接 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md new file mode 100644 index 00000000000..f57d53e9ebd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md @@ -0,0 +1,71 @@ +--- +title: OnUnoccupiedVehicleUpdate +sidebar_label: OnUnoccupiedVehicleUpdate +description: 当玩家的客户端同步未驾驶车辆的位置时触发该回调函数。 +tags: ["车辆"] +--- + +## 描述 + +当玩家的客户端同步其未驾驶车辆的位置时触发该回调函数。触发场景包括: + +- 玩家处于车辆外部时 +- 玩家作为乘客乘坐无驾驶员车辆时 + +| 参数名 | 说明 | +| -------------- | ------------------------------------------------------------------------------------- | +| vehicleid | 被同步位置的车辆ID | +| playerid | 发起位置同步的玩家ID | +| passenger_seat | 乘客座位号(0=不在车辆内,1=前排乘客,2=左后座,3=右后座,4+为巴士/客车等多座位车辆) | +| Float:new_x | 车辆新的X坐标 | +| Float:new_y | 车辆新的Y坐标 | +| Float:new_z | 车辆新的Z坐标 | +| Float:vel_x | 车辆X轴速度分量 | +| Float:vel_y | 车辆Y轴速度分量 | +| Float:vel_z | 车辆Z轴速度分量 | + +## 返回值 + +0 - 阻止其他脚本处理此同步事件 +1 - 允许正常处理同步数据 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z) +{ + // 检测移动距离是否过大 + if (GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z) > 50.0) + { + // 拒绝此次同步 + return 0; + } + + return 1; +} +``` + +## 注意事项 + +:::warning + +- 本回调触发频率极高(每秒多次/每个车辆),请避免在此执行复杂计算或文件操作 +- [GetVehiclePos](../functions/GetVehiclePos) 将返回同步前的旧坐标 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnTrailerUpdate](OnTrailerUpdate): 当拖车位置同步时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [SetVehiclePos](../functions/SetVehiclePos): 强制设置车辆位置 +- [GetVehicleVelocity](../functions/GetVehicleVelocity): 获取车辆速度向量 +- [SetVehicleVelocity](../functions/SetVehicleVelocity): 设置车辆速度向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDamageStatusUpdate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDamageStatusUpdate.md new file mode 100644 index 00000000000..4e0d22ae274 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDamageStatusUpdate.md @@ -0,0 +1,66 @@ +--- +title: OnVehicleDamageStatusUpdate +sidebar_label: OnVehicleDamageStatusUpdate +description: 当车辆部件(车门/轮胎/面板/车灯)的损坏状态发生变更时触发该回调函数。 +tags: ["车辆"] +--- + +:::tip + +处理车辆损坏状态的相关实用函数请参阅[此处](../resources/damagestatus) + +::: + +## 描述 + +当车辆部件(车门、轮胎、面板或车灯)的损坏状态发生变更时触发该回调函数。 + +| 参数名 | 说明 | +| --------- | ---------------------------------------------------- | +| vehicleid | 损坏状态发生变化的车辆ID | +| playerid | 同步损坏状态变更的玩家ID(造成损坏或修复车辆的玩家) | + +## 返回值 + +**1** - 阻止其他滤镜脚本接收此回调 +**0** - 允许此回调传递给其他滤镜脚本 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnVehicleDamageStatusUpdate(vehicleid, playerid) +{ + // 获取所有部件的损坏状态 + new + VEHICLE_PANEL_STATUS:panels, + VEHICLE_DOOR_STATUS:doors, + VEHICLE_LIGHT_STATUS:lights, + VEHICLE_TYRE_STATUS:tyres; + + GetVehicleDamageStatus(vehicleid, panels, doors, lights, tyres); + + // 将轮胎状态重置为未爆胎 + tyres = VEHICLE_TYRE_STATUS_NONE; + + // 更新车辆损坏状态(修复所有轮胎) + UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tyres); + return 1; +} +``` + +## 注意事项 + +:::tip + +本回调不包含车辆生命值(Health)变化的检测 + +::: + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [GetVehicleDamageStatus](../functions/GetVehicleDamageStatus): 获取车辆各部件损坏状态 +- [UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus): 更新车辆损坏状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md new file mode 100644 index 00000000000..252f3b30fb5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md @@ -0,0 +1,57 @@ +--- +title: OnVehicleDeath +sidebar_label: OnVehicleDeath +description: 当车辆被摧毁(爆炸或浸没水中)时触发该回调函数。 +tags: ["车辆"] +--- + +## 描述 + +当车辆被摧毁时触发该回调函数,触发条件包括: + +- 车辆爆炸 +- 车辆完全浸没水中 + +| 参数名 | 说明 | +| --------- | --------------------------------------------------------------------- | +| vehicleid | 被摧毁的车辆ID | +| killerid | 报告车辆摧毁状态的玩家ID(参数名易误解,通常为驾驶员/乘客或最近玩家) | + +## 返回值 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnVehicleDeath(vehicleid, killerid) +{ + new string[64]; + format(string, sizeof(string), "车辆 %i 已被摧毁。报告者:玩家 %i。", vehicleid, killerid); + SendClientMessageToAll(0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 车辆部分浸没水中时也会触发本回调,此时通过传送或驶出水域仍可挽救车辆 +- 车辆完全摧毁后,当驾驶员离开或经过短暂时间,车辆会消失且不会再次触发本回调 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnVehicleSpawn](OnVehicleSpawn): 当车辆重新生成时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [SetVehicleHealth](../functions/SetVehicleHealth): 设置车辆生命值 +- [GetVehicleHealth](../functions/GetVehicleHealth): 获取车辆生命值 +- [RepairVehicle](../functions/RepairVehicle): 完全修复车辆 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md new file mode 100644 index 00000000000..eda0d7690f9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md @@ -0,0 +1,65 @@ +--- +title: OnVehicleMod +sidebar_label: OnVehicleMod +description: 当车辆被改装时触发该回调函数。 +tags: ["车辆"] +--- + +## 描述 + +当车辆被改装(添加组件)时触发该回调函数。 + +| 参数名 | 说明 | +| ----------- | ------------------------------ | +| playerid | 进行改装的玩家ID(车辆驾驶员) | +| vehicleid | 被改装的车辆ID | +| componentid | 添加到车辆的改装组件ID | + +## 返回值 + +该回调始终在游戏模式中优先触发,返回0将阻止其他滤镜脚本处理此事件。 + +## 示例 + +```c +public OnVehicleMod(playerid, vehicleid, componentid) +{ + printf("车辆 %d 被玩家 %d 改装,使用组件ID %d", vehicleid, playerid, componentid); + + if (GetPlayerInterior(playerid) == 0) + { + BanEx(playerid, "非法改装"); // 反非法改装脚本 + return 0; // 阻止非法改装同步给其他玩家 + // 经测试有效,即使服务器允许通过指令/菜单等方式改装 + } + return 1; +} +``` + +## 注意事项 + +:::tip + +本回调不会通过 [AddVehicleComponent](../functions/AddVehicleComponent) 函数触发 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnEnterExitModShop](OnEnterExitModShop): 当车辆进入/离开改装店时触发 +- [OnVehiclePaintjob](OnVehiclePaintjob): 当车辆涂装变更时触发 +- [OnVehicleRespray](OnVehicleRespray): 当车辆重新涂装时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [AddVehicleComponent](../functions/AddVehicleComponent): 为车辆添加改装组件 +- [RemoveVehicleComponent](../functions/RemoveVehicleComponent): 移除车辆的改装组件 +- [GetVehicleComponentType](../functions/GetVehicleComponentType): 获取组件类型信息 + +## 相关资源 + +- [车辆改装组件列表](../resources/carcomponentid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md new file mode 100644 index 00000000000..0ffbc63d290 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md @@ -0,0 +1,60 @@ +--- +title: OnVehiclePaintjob +sidebar_label: OnVehiclePaintjob +description: 当玩家在改装店预览车辆涂装时触发该回调函数。 +tags: ["车辆"] +--- + +## 描述 + +当玩家在改装店内预览车辆涂装时触发该回调函数(注意:玩家购买涂装时不会触发)。 + +| 参数名 | 说明 | +| ---------- | -------------------- | +| playerid | 变更涂装预览的玩家ID | +| vehicleid | 变更涂装预览的车辆ID | +| paintjobid | 新预览的涂装ID | + +## 返回值 + +该回调始终在游戏模式中优先触发,返回0将阻止其他滤镜脚本处理此事件。 + +## 示例 + +```c +public OnVehiclePaintjob(playerid, vehicleid, paintjobid) +{ + new string[128]; + format(string, sizeof(string), "您已将车辆预览涂装变更为 %d 号样式!", paintjobid); + SendClientMessage(playerid, 0x33AA33AA, string); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 本回调不会通过 [ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob) 函数触发 +- 如需检测玩家购买涂装行为,可使用 vSync 插件的 OnVehicleChangePaintjob 回调 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnVehicleRespray](OnVehicleRespray): 当车辆重新涂装时触发 +- [OnVehicleMod](OnVehicleMod): 当车辆进行改装时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob): 变更车辆涂装样式 +- [ChangeVehicleColor](../functions/ChangeVehicleColor): 设置车辆颜色 +- [GetVehiclePaintjob](../functions/GetVehiclePaintjob): 获取车辆当前涂装样式 + +## 相关资源 + +- [车辆涂装样式列表](../resources/paintjobids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleRespray.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleRespray.md new file mode 100644 index 00000000000..199b2310357 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleRespray.md @@ -0,0 +1,70 @@ +--- +title: OnVehicleRespray +sidebar_label: OnVehicleRespray +description: 当玩家离开改装店时触发该回调函数,即使颜色未发生变更。 +tags: ["车辆"] +--- + +## 描述 + +当玩家驾驶车辆离开改装店时触发该回调函数,即使车辆颜色未发生改变。注意:该回调名称存在歧义,Pay 'n' Spray涂装店不会触发此回调。 + +| 参数名 | 说明 | +| --------- | ------------------------ | +| playerid | 驾驶车辆的玩家ID | +| vehicleid | 被重新涂装的车辆ID | +| color1 | 变更后的车辆主色调颜色值 | +| color2 | 变更后的车辆副色调颜色值 | + +## 返回值 + +该回调始终在游戏模式中优先触发,返回0将阻止其他滤镜脚本处理此事件。 + +## 示例 + +```c +public OnVehicleRespray(playerid, vehicleid, color1, color2) +{ + new string[48]; + format(string, sizeof(string), "您已将车辆 %d 颜色更改为 %d 和 %d 号色!", vehicleid, color1, color2); + SendClientMessage(playerid, COLOR_GREEN, string); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 本回调不会通过 [ChangeVehicleColor](../functions/ChangeVehicleColor) 函数触发 +- 仅改装店(Mod Shop)会触发此回调,Pay 'n' Spray涂装店不会触发 +- 修复方案参考:[http://pastebin.com/G81da7N1](http://pastebin.com/G81da7N1) + +::: + +:::warning + +**已知问题** +在改装店预览组件时可能意外触发此回调 + +::: + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnVehiclePaintjob](OnVehiclePaintjob): 当车辆涂装样式变更时触发 +- [OnVehicleMod](OnVehicleMod): 当车辆进行改装时触发 +- [OnEnterExitModShop](OnEnterExitModShop): 当车辆进入/离开改装店时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [ChangeVehicleColor](../functions/ChangeVehicleColor): 设置车辆颜色 +- [ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob): 变更车辆涂装样式 +- [GetVehicleColor](../functions/GetVehicleColor): 获取车辆当前颜色配置 + +## 相关资源 + +- [车辆颜色代码表](../resources/vehiclecolors) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSirenStateChange.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSirenStateChange.md new file mode 100644 index 00000000000..49705c35cb1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSirenStateChange.md @@ -0,0 +1,61 @@ +--- +title: OnVehicleSirenStateChange +sidebar_label: OnVehicleSirenStateChange +description: 当车辆警笛状态发生变更时触发该回调函数。 +tags: ["车辆"] +--- + + + +## 描述 + +当车辆的警笛状态被切换时触发该回调函数。 + +| 参数名 | 说明 | +| --------- | ------------------------------ | +| playerid | 切换警笛状态的玩家ID(驾驶员) | +| vehicleid | 警笛状态发生变更的车辆ID | +| newstate | 警笛新状态(0=关闭,1=开启) | + +## 返回值 + +1 - 阻止游戏模式接收此回调 +0 - 允许回调传递给游戏模式 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnVehicleSirenStateChange(playerid, vehicleid, newstate) +{ + if (newstate) + { + GameTextForPlayer(playerid, "~W~警笛 ~G~开启", 1000, 3); + } + else + { + GameTextForPlayer(playerid, "~W~警笛 ~r~关闭", 1000, 3); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +本回调仅在警笛开关状态切换时触发,长按喇叭触发的交替警笛声不会触发 + +::: + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [GetVehicleParamsSirenState](../functions/GetVehicleParamsSirenState): 检测车辆警笛当前状态 +- [SetVehicleParamsSirenState](../functions/SetVehicleParamsSirenState): 设置车辆警笛状态 + +## 相关资源 + +- [车辆参数类型](../resources/vehicleparams) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md new file mode 100644 index 00000000000..cf73353082a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md @@ -0,0 +1,51 @@ +--- +title: OnVehicleSpawn +sidebar_label: OnVehicleSpawn +description: 当车辆重生时触发该回调函数。 +tags: ["车辆"] +--- + +:::warning + +本回调**仅**在车辆**重新**生成时触发!使用CreateVehicle和AddStaticVehicle(Ex)创建车辆**不会**触发此回调 + +::: + +## 描述 + +当车辆重生时触发该回调函数。 + +| 参数名 | 说明 | +| --------- | ------------ | +| vehicleid | 重生的车辆ID | + +## 返回值 + +0 - 阻止其他滤镜脚本接收此回调 +1 - 允许此回调传递给其他滤镜脚本 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnVehicleSpawn(vehicleid) +{ + printf("车辆 %i 已重生!",vehicleid); + return 1; +} +``` + +## 相关回调 + +以下回调可能与该回调存在关联: + +- [OnVehicleDeath](OnVehicleDeath): 当车辆被摧毁时触发 +- [OnPlayerSpawn](OnPlayerSpawn): 当玩家生成时触发 + +## 相关函数 + +以下函数可能与该回调存在关联: + +- [SetVehicleToRespawn](../functions/SetVehicleToRespawn): 立即重生指定车辆 +- [CreateVehicle](../functions/CreateVehicle): 创建新车辆 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamIn.md new file mode 100644 index 00000000000..0a79142fd3a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamIn.md @@ -0,0 +1,41 @@ +--- +title: OnVehicleStreamIn +sidebar_label: OnVehicleStreamIn +description: 当车辆被流加载到玩家客户端时触发该回调函数。 +tags: ["车辆"] +--- + +## 描述 + +当车辆被流加载到玩家客户端时触发该回调函数。 + +| 参数名 | 说明 | +| ----------- | ------------------ | +| vehicleid | 被流加载的车辆ID | +| forplayerid | 发起流加载的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnVehicleStreamIn(vehicleid, forplayerid) +{ + new string[32]; + format(string, sizeof(string), "您现在可以看到车辆 %d。", vehicleid); + SendClientMessage(forplayerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +- [OnVehicleStreamOut](OnVehicleStreamOut): 当车辆从玩家客户端流卸载时触发 +- [OnPlayerStreamIn](OnPlayerStreamIn): 当玩家被其他客户端流加载时触发 +- [OnPlayerStreamOut](OnPlayerStreamOut): 当玩家被其他客户端流卸载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamOut.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamOut.md new file mode 100644 index 00000000000..0c19bc9f896 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleStreamOut.md @@ -0,0 +1,41 @@ +--- +title: OnVehicleStreamOut +sidebar_label: OnVehicleStreamOut +description: 当车辆从玩家客户端流卸载时触发该回调函数(车辆距离过远超出可视范围)。 +tags: ["车辆"] +--- + +## 描述 + +当车辆从玩家客户端流卸载时触发该回调函数(车辆距离过远超出可视范围)。 + +| 参数名 | 说明 | +| ----------- | ------------------------ | +| vehicleid | 被流卸载的车辆ID | +| forplayerid | 停止流加载该车辆的玩家ID | + +## 返回值 + +该回调始终在滤镜脚本中优先触发。 + +## 示例 + +```c +public OnVehicleStreamOut(vehicleid, forplayerid) +{ + new string[48]; + format(string, sizeof(string), "您的客户端已停止流加载车辆 %d", vehicleid); + SendClientMessage(forplayerid, 0xFFFFFFFF, string); + return 1; +} +``` + +## 注意事项 + + + +## 相关回调 + +- [OnVehicleStreamIn](OnVehicleStreamIn): 当车辆被玩家客户端流加载时触发 +- [OnPlayerStreamIn](OnPlayerStreamIn): 当玩家被其他客户端流加载时触发 +- [OnPlayerStreamOut](OnPlayerStreamOut): 当玩家被其他客户端流卸载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md new file mode 100644 index 00000000000..d6671e8f5ea --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -0,0 +1,59 @@ +--- +title: AddCharModel +sidebar_label: AddCharModel +description: 添加可供下载的新自定义角色模型 +tags: ["自定义皮肤", "角色模型"] +--- + + + +## 描述 + +添加可供下载的新自定义角色模型。模型文件将存储在玩家的「文档\GTA San Andreas User Files\SAMP\cache」目录下,按服务器 IP 和端口分类的文件夹中,并以 CRC 格式文件名保存。 + +| 参数名 | 说明 | +| ---------------------- | ------------------------------------------------------------------------------------ | +| baseid | 基础皮肤模型 ID(用于定义角色行为特性,当下载失败时将使用该原始角色模型)。 | +| newid | 新皮肤模型 ID(范围 20001-30000,共 10000 个槽位),后续可通过 SetPlayerSkin 使用 | +| const dff[] | .dff 模型碰撞文件名,默认位于服务器的 models 文件夹(可通过 artpath 配置修改路径)。 | +| const textureLibrary[] | .txd 模型贴图文件名,默认位于服务器的 models 文件夹(可通过 artpath 配置修改路径)。 | + +## 返回值 + +**1:** 函数执行成功。 + +**0:** 函数执行失败。 + +## 示例 + +```c +public OnGameModeInit() +{ + AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); + AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); + return 1; +} +``` + +```c +AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); +AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); +``` + +## 注意事项 + +:::tip + +需先在服务器配置中启用**useartwork**或**artwork.enable**选项才能使本功能生效。 + +::: + +:::warning + +当前对调用时机没有限制,但请注意:若未在[OnFilterScriptInit](../callbacks/OnFilterScriptInit)/[OnGameModeInit](../callbacks/OnGameModeInit)回调中调用,已连接的玩家可能无法下载这些模型。 + +::: + +## 相关函数 + +- [SetPlayerSkin](SetPlayerSkin): 设置玩家皮肤。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddMenuItem.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddMenuItem.md new file mode 100644 index 00000000000..3ffe4824995 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddMenuItem.md @@ -0,0 +1,58 @@ +--- +title: AddMenuItem +sidebar_label: AddMenuItem +description: 向指定菜单添加一个项目 +tags: ["菜单"] +--- + +## 描述 + +向指定菜单添加一个项目。 + +| 参数名 | 说明 | +| ---------------- | ---------------------- | +| Menu:menuid | 要添加项目的菜单 ID | +| column | 添加项目所在的列 | +| const title[] | 新增菜单项的标题 | +| OPEN_MP_TAGS:... | 不定数量的任意标签参数 | + +## 返回值 + +新增菜单项所在行的索引值。 + +## 示例 + +```c +new Menu:gExampleMenu; + +public OnGameModeInit() +{ + gExampleMenu = CreateMenu("你的菜单", 2, 200.0, 100.0, 150.0, 150.0); + AddMenuItem(gExampleMenu, 0, "项目1"); + AddMenuItem(gExampleMenu, 0, "项目2"); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 传入无效菜单 ID 会导致崩溃 +- 每个菜单最多容纳 12 个项目(第 13 个项目会显示在列名的右侧,第 14 个及后续项目不可见) +- 仅支持 2 列(0 和 1) +- 单个菜单项最多支持 8 个颜色代码(如~r~、~g~等),最大显示长度为 31 个字符 + +::: + +## 相关函数 + +- [CreateMenu](CreateMenu): 创建菜单 +- [SetMenuColumnHeader](SetMenuColumnHeader): 设置菜单列标题 +- [DestroyMenu](DestroyMenu): 销毁菜单 +- [IsMenuRowDisabled](IsMenuRowDisabled): 检测菜单行是否禁用 + +## 相关回调 + +- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): 当玩家选择菜单行时触发 +- [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu): 当玩家退出菜单时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClass.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClass.md new file mode 100644 index 00000000000..0f36437a8ad --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClass.md @@ -0,0 +1,63 @@ +--- +title: AddPlayerClass +sidebar_label: AddPlayerClass +description: 添加玩家职业到职业选择系统 +tags: ["玩家", "职业"] +--- + +## 描述 + +添加一个职业到职业选择系统。职业系统允许玩家使用自选皮肤进行重生。 + +| 参数名 | 说明 | +| -------------- | --------------------------------------------- | +| skin | 玩家重生时使用的[皮肤 ID](../resources/skins) | +| Float:spawnX | 该职业重生点的 X 坐标 | +| Float:spawnY | 该职业重生点的 Y 坐标 | +| Float:spawnZ | 该职业重生点的 Z 坐标 | +| Float:angle | 玩家重生后的初始朝向角度 | +| WEAPON:weapon1 | 玩家初始携带的第一把武器 | +| ammo1 | 主武器的弹药数量 | +| WEAPON:weapon2 | 玩家初始携带的第二把武器 | +| ammo2 | 副武器的弹药数量 | +| WEAPON:weapon3 | 玩家初始携带的第三把武器 | +| ammo3 | 特殊武器的弹药数量 | + +## 返回值 + +新添加职业的 ID 编号。 + +若达到职业上限(320 个)则返回 319。最大有效职业 ID 为 319。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 玩家可选择CJ皮肤(0)或The Truth皮肤(1)重生 + AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_BRASSKNUCKLE, 1); // CJ + AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_BRASSKNUCKLE, 1); // The Truth + return 1; +} +``` + +## 注意事项 + +:::tip + +最大职业 ID 为 319(从 0 开始共计 320 个职业)。达到上限后新增职业将覆盖 ID 319 的配置。 + +::: + +## 相关函数 + +- [AddPlayerClassEx](AddPlayerClassEx): 添加带有默认团队的职业 +- [GetAvailableClasses](GetAvailableClasses): 获取已定义的职业数量 +- [EditPlayerClass](EditPlayerClass): 修改职业配置数据 +- [SetSpawnInfo](SetSpawnInfo): 设置玩家重生参数 +- [SetPlayerSkin](SetPlayerSkin): 设置玩家皮肤 + +## 相关资源 + +- [皮肤 ID 列表](../resources/skins) +- [武器 ID 列表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClassEx.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClassEx.md new file mode 100644 index 00000000000..578f5f3e50b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddPlayerClassEx.md @@ -0,0 +1,67 @@ +--- +title: AddPlayerClassEx +sidebar_label: AddPlayerClassEx +description: 本函数与AddPlayerClass功能相同,新增团队参数 +tags: ["玩家", "职业"] +--- + +## 描述 + +本函数功能与 AddPlayerClass 完全一致,额外增加团队参数支持。 + +| 参数名 | 说明 | +| -------------- | --------------------------------------------- | +| team | 玩家所属的初始团队 | +| skin | 玩家重生时使用的[皮肤 ID](../resources/skins) | +| Float:spawnX | 该职业重生点的 X 坐标 | +| Float:spawnY | 该职业重生点的 Y 坐标 | +| Float:spawnZ | 该职业重生点的 Z 坐标 | +| Float:angle | 玩家重生后的初始朝向角度 | +| WEAPON:weapon1 | 玩家初始携带的第一把武器 | +| ammo1 | 主武器的弹药数量 | +| WEAPON:weapon2 | 玩家初始携带的第二把武器 | +| ammo2 | 副武器的弹药数量 | +| WEAPON:weapon3 | 玩家初始携带的第三把武器 | +| ammo3 | 特殊武器的弹药数量 | + +## 返回值 + +新添加职业的 ID 编号。 + +若达到职业上限(320 个)则返回 319。最大有效职业 ID 为 319。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 玩家可选择: + // 团队1中的CJ皮肤(ID 0) + // 团队2中的The Truth皮肤(ID 1) + AddPlayerClassEx(1, 0, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); // CJ + AddPlayerClassEx(2, 1, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); // The Truth + return 1; +} +``` + +## 注意事项 + +:::tip + +最大职业 ID 为 319(从 0 开始共计 320 个职业)。达到上限后新增职业将覆盖 ID 319 的配置。 + +::: + +## 相关函数 + +- [AddPlayerClass](AddPlayerClass): 添加基础职业 +- [GetAvailableClasses](GetAvailableClasses): 获取已定义的职业数量 +- [EditPlayerClass](EditPlayerClass): 修改职业配置数据 +- [SetSpawnInfo](SetSpawnInfo): 设置玩家重生参数 +- [SetPlayerTeam](SetPlayerTeam): 设置玩家团队 +- [SetPlayerSkin](SetPlayerSkin): 设置玩家皮肤 + +## 相关资源 + +- [皮肤 ID 列表](../resources/skins) +- [武器 ID 列表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddServerRule.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddServerRule.md new file mode 100644 index 00000000000..cb37ff6b382 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddServerRule.md @@ -0,0 +1,37 @@ +--- +title: AddServerRule +sidebar_label: AddServerRule +description: 添加服务器规则 +tags: ["规则"] +--- + + + +## 描述 + +添加服务器规则。 + +| 参数名 | 说明 | +| ---------------- | ---------------------- | +| const rule[] | 要添加的服务器规则名称 | +| const format[] | 服务器规则对应值 | +| OPEN_MP_TAGS:... | 不定数量的任意标签参数 | + +## 返回值 + +成功执行返回 true,否则返回 false。 + +## 示例 + +```c +public OnGameModeInit() +{ + AddServerRule("discord", "discord.gg/samp"); + return 1; +} +``` + +## 相关函数 + +- [RemoveServerRule](RemoveServerRule): 移除服务器规则 +- [IsValidServerRule](IsValidServerRule): 验证服务器规则有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md new file mode 100644 index 00000000000..768f911d884 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -0,0 +1,65 @@ +--- +title: AddSimpleModel +sidebar_label: AddSimpleModel +description: 添加可供下载的新自定义简单物体模型 +tags: ["自定义模型", "简单模型"] +--- + + + +## 描述 + +添加可供下载的新自定义简单物体模型。模型文件将存储在玩家的「文档\GTA San Andreas User Files\SAMP\cache」目录下,按服务器 IP 和端口分类的文件夹中,并以 CRC 格式文件名保存。 + +| 参数名 | 说明 | +| ---------------------- | -------------------------------------------------------------------------------------------------------- | +| virtualWorld | 模型生效的虚拟世界 ID,使用-1 表示全虚拟世界 | +| baseid | 基础物体模型 ID(当下载失败时将使用该原始物体模型) | +| newid | 新物体模型 ID(范围-1000 至-30000,共 29000 个槽位),后续可通过 CreateObject 或 CreatePlayerObject 使用 | +| const dff[] | .dff 模型碰撞文件名,默认位于服务器的 models 文件夹(可通过 artpath 配置修改路径) | +| const textureLibrary[] | .txd 模型贴图文件名,默认位于服务器的 models 文件夹(可通过 artpath 配置修改路径) | + +## 返回值 + +**1:** 函数执行成功。 + +**0:** 函数执行失败。 + +## 示例 + +```c +public OnGameModeInit() +{ + AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); + return 1; +} +``` + +```c +AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); +``` + +## 注意事项 + +:::tip + +需先在服务器配置中启用**useartwork**或**artwork.enable**选项才能使本功能生效。 + +当`virtualworld`参数设置时,模型将在玩家进入指定虚拟世界时自动下载。 + +::: + +:::warning + +当前对调用时机没有限制,但请注意:若未在[OnFilterScriptInit](../callbacks/OnFilterScriptInit)/[OnGameModeInit](../callbacks/OnGameModeInit)回调中调用,已连接的玩家可能无法下载这些模型。 + +::: + +## 相关函数 + +- [IsValidCustomModel](IsValidCustomModel): 验证自定义模型 ID 有效性 +- [GetCustomModelPath](GetCustomModelPath): 获取自定义模型路径 + +## 相关回调 + +- [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading): 当玩家完成自定义模型下载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModelTimed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModelTimed.md new file mode 100644 index 00000000000..1a3a91d0f18 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModelTimed.md @@ -0,0 +1,64 @@ +--- +title: AddSimpleModelTimed +sidebar_label: AddSimpleModelTimed +description: 添加具有时间限制的自定义简单物体模型 +tags: ["自定义模型", "简单模型"] +--- + + + +## 描述 + +添加具有时间限制的自定义简单物体模型。模型文件将存储在玩家的「文档\GTA San Andreas User Files\SAMP\cache」目录下,按服务器 IP 和端口分类的文件夹中,并以 CRC 格式文件名保存。 + +| 参数名 | 说明 | +| ---------------------- | -------------------------------------------------------------------------------------------------------- | +| virtualWorld | 模型生效的虚拟世界 ID,使用-1 表示全虚拟世界 | +| baseid | 基础物体模型 ID(当下载失败时将使用该原始物体模型) | +| newid | 新物体模型 ID(范围-1000 至-30000,共 29000 个槽位),后续可通过 CreateObject 或 CreatePlayerObject 使用 | +| const dff[] | .dff 模型碰撞文件名,默认位于服务器的 models 文件夹(可通过 artpath 配置修改路径) | +| const textureLibrary[] | .txd 模型贴图文件名,默认位于服务器的 models 文件夹(可通过 artpath 配置修改路径) | +| timeOn | 模型开始渲染的世界游戏时间(小时) | +| timeOff | 模型停止渲染的世界游戏时间(小时) | + +## 返回值 + +**1:** 函数执行成功。 + +**0:** 函数执行失败。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 这面墙仅在上午9点至下午6点间可见 + AddSimpleModelTimed(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd", 9, 18); + return 1; +} +``` + +## 注意事项 + +:::tip + +需先在服务器配置中启用**useartwork**或**artwork.enable**选项才能使本功能生效。 + +当 virtualworld 参数设置时,模型将在玩家进入指定虚拟世界时自动下载。 + +::: + +:::warning + +当前对调用时机没有限制,但请注意:若未在[OnFilterScriptInit](../callbacks/OnFilterScriptInit)/[OnGameModeInit](../callbacks/OnGameModeInit)回调中调用,已连接的玩家可能无法下载这些模型。 + +::: + +## 相关函数 + +- [IsValidCustomModel](IsValidCustomModel): 验证自定义模型 ID 有效性 +- [GetCustomModelPath](GetCustomModelPath): 获取自定义模型路径 + +## 相关回调 + +- [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading): 当玩家完成自定义模型下载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticPickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticPickup.md new file mode 100644 index 00000000000..e82851e6a2a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticPickup.md @@ -0,0 +1,57 @@ +--- +title: AddStaticPickup +sidebar_label: AddStaticPickup +description: 在游戏中添加一个静态拾取物 +tags: ["拾取物"] +--- + +## 描述 + +本函数用于在游戏中添加「静态」拾取物。这类拾取物支持武器、生命值、护甲等类型,无需额外脚本即可自动生效(武器/生命值/护甲会自动给予玩家)。 + +| 参数名 | 说明 | +| -------------------------------- | -------------------------------------------- | +| [model](../resources/pickupids) | 拾取物模型 ID | +| [type](../resources/pickuptypes) | 拾取物类型,决定被拾取时的响应方式 | +| Float:x | 拾取物生成的 X 坐标 | +| Float:y | 拾取物生成的 Y 坐标 | +| Float:z | 拾取物生成的 Z 坐标 | +| virtualWorld | 生效的虚拟世界 ID,使用-1 表示全虚拟世界生效 | + +## 返回值 + +**1** - 创建成功 + +**0** - 创建失败 + +## 示例 + +```c +public OnGameModeInit() +{ + // 创建护甲拾取物 + AddStaticPickup(1242, 2, 1503.3359, 1432.3585, 10.1191, 0); + + // 在护甲旁创建生命值拾取物 + AddStaticPickup(1240, 2, 1506.3359, 1432.3585, 10.1191, 0); + + return 1; +} +``` + +## 注意事项 + +:::tip + +本函数不会返回可用于 OnPlayerPickUpPickup 等回调的拾取物 ID。若需要分配 ID,请使用[CreatePickup](CreatePickup)函数。 + +::: + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建可追踪的拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 + +## 相关资源 + +- [拾取物 ID 列表](../resources/pickupids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicle.md new file mode 100644 index 00000000000..d38e237f05c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicle.md @@ -0,0 +1,61 @@ +--- +title: AddStaticVehicle +sidebar_label: AddStaticVehicle +description: 在游戏模式中添加静态车辆(模型会预加载给玩家) +tags: ["车辆"] +--- + +## 描述 + +在游戏模式中添加静态车辆(模型会预加载给玩家)。 + +| 参数名 | 说明 | +| -------------------------------------- | ------------------------------------- | +| modelid | [车辆模型 ID](../resources/vehicleid) | +| Float:spawnX | 生成点的 X 坐标 | +| Float:spawnY | 生成点的 Y 坐标 | +| Float:spawnZ | 生成点的 Z 坐标 | +| Float:angle | 车辆初始朝向角度 | +| [colour1](../resources/vehiclecolorid) | 主颜色 ID(-1 表示随机) | +| [colour2](../resources/vehiclecolorid) | 副颜色 ID(-1 表示随机) | + +## 返回值 + +成功创建的车辆 ID(范围 1 至 MAX_VEHICLES)。 + +若创建失败(达到车辆上限或无效模型 ID)返回 INVALID_VEHICLE_ID(65535)。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 添加一架九头蛇战斗机到游戏中 + AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); + + return 1; +} +``` + +## 相关函数 + +- [AddStaticVehicleEx](AddStaticVehicleEx): 添加可自定义重生时间的静态车辆 +- [CreateVehicle](CreateVehicle): 动态创建车辆 +- [DestroyVehicle](DestroyVehicle): 销毁车辆 +- [GetVehicleParamsSirenState](GetVehicleParamsSirenState): 检测车辆警笛状态 +- [SetVehicleSpawnInfo](SetVehicleSpawnInfo): 配置车辆生成参数 +- [GetVehicleSpawnInfo](GetVehicleSpawnInfo): 获取车辆生成信息 +- [ChangeVehicleColours](ChangeVehicleColours): 修改车辆颜色 +- [GetVehicleColours](GetVehicleColours): 获取车辆颜色配置 +- [SetVehicleRespawnDelay](SetVehicleRespawnDelay): 设置车辆重生延迟 +- [GetVehicleRespawnDelay](GetVehicleRespawnDelay): 获取车辆重生延迟 + +## 相关回调 + +- [OnVehicleSpawn](../callbacks/OnVehicleSpawn): 车辆重生时触发 +- [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): 车辆警笛状态变化时触发 + +## 相关资源 + +- [车辆模型列表](../resources/vehicleid): 游戏内所有车辆模型的完整清单 +- [车辆颜色 ID](../resources/vehiclecolorid): 所有车辆颜色 ID 对照表 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicleEx.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicleEx.md new file mode 100644 index 00000000000..cd9c5a55d34 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddStaticVehicleEx.md @@ -0,0 +1,65 @@ +--- +title: AddStaticVehicleEx +sidebar_label: AddStaticVehicleEx +description: 在游戏模式中添加可自定义重生时间的静态车辆(模型会预加载给玩家) +tags: ["车辆"] +--- + +## 描述 + +在游戏模式中添加静态车辆(模型会预加载给玩家)。 + +与 AddStaticVehicle 的唯一区别:可设置车辆无人驾驶后的重生时间。 + +| 参数名 | 说明 | +| -------------------------------------- | --------------------------------------------------- | +| modelid | [车辆模型 ID](../resources/vehicleid) | +| Float:spawnX | 生成点的 X 坐标 | +| Float:spawnY | 生成点的 Y 坐标 | +| Float:spawnZ | 生成点的 Z 坐标 | +| Float:angle | 车辆初始朝向角度 | +| [colour1](../resources/vehiclecolorid) | 主颜色 ID | +| [colour2](../resources/vehiclecolorid) | 副颜色 ID | +| respawnDelay | 车辆无人驾驶后的重生延迟(单位:秒) | +| bool:addSiren | 默认值'false'。为车辆添加警笛功能(需车辆自带喇叭) | + +## 返回值 + +成功创建的车辆 ID(范围 1 至 MAX_VEHICLES)。 + +若创建失败(达到车辆上限或无效模型 ID)返回 INVALID_VEHICLE_ID(65535)。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 添加一架九头蛇战斗机(520),无人驾驶15秒后重生 + AddStaticVehicleEx(520, 2109.1763, 1503.0453, 32.2887, 82.2873, -1, -1, 15); + + return 1; +} +``` + +## 相关函数 + +- [AddStaticVehicle](AddStaticVehicle): 添加基础静态车辆 +- [CreateVehicle](CreateVehicle): 动态创建车辆 +- [DestroyVehicle](DestroyVehicle): 销毁车辆 +- [GetVehicleParamsSirenState](GetVehicleParamsSirenState): 检测车辆警笛状态 +- [SetVehicleSpawnInfo](SetVehicleSpawnInfo): 配置车辆生成参数 +- [GetVehicleSpawnInfo](GetVehicleSpawnInfo): 获取车辆生成信息 +- [ChangeVehicleColours](ChangeVehicleColours): 修改车辆颜色 +- [GetVehicleColours](GetVehicleColours): 获取车辆颜色配置 +- [SetVehicleRespawnDelay](SetVehicleRespawnDelay): 设置车辆重生延迟 +- [GetVehicleRespawnDelay](GetVehicleRespawnDelay): 获取车辆重生延迟 + +## 相关回调 + +- [OnVehicleSpawn](../callbacks/OnVehicleSpawn): 车辆重生时触发 +- [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): 车辆警笛状态变化时触发 + +## 相关资源 + +- [车辆模型列表](../resources/vehicleid): 游戏内所有车辆模型的完整清单 +- [车辆颜色 ID](../resources/vehiclecolorid): 所有车辆颜色 ID 对照表 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddVehicleComponent.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddVehicleComponent.md new file mode 100644 index 00000000000..2146b1e0361 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddVehicleComponent.md @@ -0,0 +1,70 @@ +--- +title: AddVehicleComponent +sidebar_label: AddVehicleComponent +description: 为车辆添加一个「组件」(通常称为「改装件」) +tags: ["车辆"] +--- + +## 描述 + +为车辆添加一个「组件」(通常称为「改装件」)。有效改装件 ID 可参考此列表。 + +| 参数名 | 说明 | +| ---------------------------------------- | ------------------------------------------- | +| vehicleid | 需要添加组件的车辆 ID(注意与模型 ID 区分) | +| [component](../resources/carcomponentid) | 要添加的组件 ID | + +## 返回值 + +**true** - 组件添加成功 + +**false** - 车辆不存在导致添加失败 + +## 示例 + +```c +new gTaxi; + +public OnGameModeInit() +{ + gTaxi = AddStaticVehicle(420, -2482.4937, 2242.3936, 4.6225, 179.3656, 6, 1); // 出租车 + return 1; +} + +public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) +{ + if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) + { + if (GetPlayerVehicleID(playerid) == gTaxi) + { + AddVehicleComponent(gTaxi, 1010); // 氮气加速 + SendClientMessage(playerid, 0xFFFFFFAA, "已为出租车安装氮气加速装置"); + } + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用无效的组件 ID 会导致玩家游戏崩溃(该问题已在 open.mp 中修复) + +::: + +## 相关函数 + +- [RemoveVehicleComponent](RemoveVehicleComponent): 移除车辆组件 +- [GetVehicleComponentInSlot](GetVehicleComponentInSlot): 获取车辆指定插槽的组件 +- [GetVehicleComponentType](GetVehicleComponentType): 通过 ID 检测组件类型 +- [VehicleCanHaveComponent](VehicleCanHaveComponent): 验证组件是否适用于车辆 + +## 相关回调 + +- [OnVehicleMod](../callbacks/OnVehicleMod): 当车辆被改装时触发 +- [OnEnterExitModShop](../callbacks/OnEnterExitModShop): 当车辆进出改装店时触发 + +## 相关资源 + +- [车辆改装件 ID 列表](../resources/carcomponentid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowAdminTeleport.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowAdminTeleport.md new file mode 100644 index 00000000000..060dc7e00c4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowAdminTeleport.md @@ -0,0 +1,41 @@ +--- +title: AllowAdminTeleport +sidebar_label: AllowAdminTeleport +description: 控制远程控制台管理员是否可通过设置路径点传送 +tags: [] +--- + +:::warning + +本函数自 0.3d 版本起已弃用,请使用[OnPlayerClickMap](../callbacks/OnPlayerClickMap)回调替代。 + +::: + +## 描述 + +本函数用于控制远程控制台(RCON)管理员在设置路径点时是否会被传送到该位置。 + +| 参数名 | 说明 | +| ---------- | ------------------------------- | +| bool:allow | 'false'禁用功能,'true'启用功能 | + +## 返回值 + +本函数无特定返回值。 + +## 示例 + +```c +public OnGameModeInit() +{ + AllowAdminTeleport(true); // 启用管理员传送功能 + // 其他初始化代码 + return 1; +} +``` + +## 相关函数 + +- [IsAdminTeleportAllowed](IsAdminTeleportAllowed): 检测是否允许管理员通过地图右键传送 +- [IsPlayerAdmin](IsPlayerAdmin): 验证玩家是否具有管理员权限 +- [AllowPlayerTeleport](AllowPlayerTeleport): 控制玩家路径点传送功能开关 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowInteriorWeapons.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowInteriorWeapons.md new file mode 100644 index 00000000000..470d2a957ff --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowInteriorWeapons.md @@ -0,0 +1,57 @@ +--- +title: AllowInteriorWeapons +sidebar_label: AllowInteriorWeapons +description: 控制是否允许在室内场景使用武器 +tags: [] +--- + +## 描述 + +切换是否允许玩家在室内场景使用武器。 + +| 参数名 | 说明 | +| ---------- | ----------------------------------------------------------- | +| bool:allow | 'true'允许室内使用武器(默认启用),'false'禁止室内使用武器 | + +## 返回值 + +本函数无特定返回值。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 启用室内武器使用功能 + AllowInteriorWeapons(true); + return 1; +} +``` + +## 注意事项 + +:::warning + +本功能在当前 SA-MP 版本中无效! + +::: + +:::tip + +可通过[config.json](../../server/config.json)配置文件实现相同功能: + +```json +"allow_interior_weapons": true, +``` + +::: + +## 相关函数 + +- [AreInteriorWeaponsAllowed](AreInteriorWeaponsAllowed): 检测是否允许在室内使用武器 +- [SetPlayerInterior](SetPlayerInterior): 设置玩家所在室内场景 +- [GetPlayerInterior](GetPlayerInterior): 获取玩家当前室内场景 + +## 相关回调 + +- [OnPlayerInteriorChange](../callbacks/OnPlayerInteriorChange): 当玩家切换室内场景时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowNickNameCharacter.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowNickNameCharacter.md new file mode 100644 index 00000000000..2bb1aa4b701 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowNickNameCharacter.md @@ -0,0 +1,41 @@ +--- +title: AllowNickNameCharacter +sidebar_label: AllowNickNameCharacter +description: 允许或禁止特定字符在玩家昵称中使用 +tags: [] +--- + + + +## 描述 + +控制是否允许特定字符出现在玩家昵称中。 + +| 参数名 | 说明 | +| ---------- | ----------------------------- | +| character | 需要控制的 ASCII 字符 | +| bool:allow | true-允许使用,false-禁止使用 | + +## 返回值 + +本函数无特定返回值。 + +## 示例 + +```c +public OnGameModeInit() +{ + AllowNickNameCharacter('*', true); // 允许星号字符 + AllowNickNameCharacter('[', false); // 禁止左方括号 + AllowNickNameCharacter(']', false); // 禁止右方括号 + + return 1; +} +``` + +## 相关函数 + +- [IsNickNameCharacterAllowed](IsNickNameCharacterAllowed): 检测指定字符是否允许在昵称中使用 +- [IsValidNickName](IsValidNickName): 验证昵称格式是否合法 +- [SetPlayerName](SetPlayerName): 设置玩家昵称 +- [GetPlayerName](GetPlayerName): 获取玩家昵称 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerTeleport.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerTeleport.md new file mode 100644 index 00000000000..7b6766f39b7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerTeleport.md @@ -0,0 +1,50 @@ +--- +title: AllowPlayerTeleport +sidebar_label: AllowPlayerTeleport +description: 启用/禁用玩家通过右键点击地图进行传送的能力 +tags: ["玩家"] +--- + +:::warning + +本函数自 0.3d 版本起已弃用,请使用[OnPlayerClickMap](../callbacks/OnPlayerClickMap)回调替代。 + +::: + +## 描述 + +启用/禁用玩家通过右键点击地图进行传送的能力 + +| 参数名 | 说明 | +| ---------- | ------------------------------- | +| playerid | 需要启用传送功能的玩家 ID | +| bool:allow | 'false'禁用功能,'true'启用功能 | + +## 返回值 + +本函数无特定返回值。 + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + // 允许玩家通过右键点击地图传送 + // 由于在OnPlayerConnect回调中,将对所有玩家生效 + AllowPlayerTeleport(playerid, true); + return 1; +} +``` + +## 注意事项 + +:::warning + +需先启用[AllowAdminTeleport](AllowAdminTeleport)且玩家具有管理员权限,本功能方可生效。 + +::: + +## 相关函数 + +- [IsPlayerTeleportAllowed](IsPlayerTeleportAllowed): 检测玩家是否允许通过地图右键传送 +- [AllowAdminTeleport](AllowAdminTeleport): 控制管理员路径点传送功能开关 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerWeapons.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerWeapons.md new file mode 100644 index 00000000000..b29957528e5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AllowPlayerWeapons.md @@ -0,0 +1,35 @@ +--- +title: AllowPlayerWeapons +sidebar_label: AllowPlayerWeapons +description: 启用/禁用玩家的武器使用权限 +tags: ["玩家"] +--- + + + +## 描述 + +控制玩家是否可以使用武器。 + +| 参数名 | 说明 | +| ---------- | ------------------------------------- | +| playerid | 需要控制武器权限的玩家 ID | +| bool:allow | true 允许使用武器,false 禁止使用武器 | + +## 返回值 + +本函数始终返回 true。 + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + AllowPlayerWeapons(playerid, true); // 允许该玩家使用武器 + return 1; +} +``` + +## 相关函数 + +- [ArePlayerWeaponsAllowed](ArePlayerWeaponsAllowed): 检测玩家是否允许使用武器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ApplyActorAnimation.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ApplyActorAnimation.md new file mode 100644 index 00000000000..c6d1eeb73df --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ApplyActorAnimation.md @@ -0,0 +1,65 @@ +--- +title: ApplyActorAnimation +sidebar_label: ApplyActorAnimation +description: 为角色应用指定的动画效果 +tags: ["角色", "动画"] +--- + + + +## 描述 + +为游戏中的 NPC 角色应用指定的动画效果。 + +| 参数名 | 说明 | +| ------------------------ | ---------------------------------------------------------------------------------------------- | +| actorid | 要应用动画的角色 ID | +| const animationLibrary[] | 动画资源库名称 | +| const animationName[] | 动画名称(需在指定资源库中存在) | +| float:delta | 动画播放速度(建议使用 4.1) | +| bool:loop | 是否循环播放:true 循环播放,false 单次播放 | +| bool:lockX | X 轴位置锁定:false 在动画结束后恢复原始 X 坐标(适用于移动类动画),true 保持动画结束时的位置 | +| bool:lockY | Y 轴位置锁定(参数设置应与 lockX 保持一致) | +| bool:freeze | 动画结束后冻结角色:true 冻结角色,false 不冻结 | +| time | 动画持续时间(毫秒),0 表示无限循环 | + +## 返回值 + +**true** - 动画应用成功 + +**false** - 执行失败(角色不存在) + +## 示例 + +```c +new gMyActor; + +public OnGameModeInit() +{ + // 在武器店创建销售员角色 + gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); + // 应用付款动画 + ApplyActorAnimation(gMyActor, "DEALER", "shop_pay", 4.1, false, false, false, false, 0); + return 1; +} + +public OnPlayerConnect(playerid) +{ + // 为玩家预加载'DEALER'动画库 + ApplyAnimation(playerid, "DEALER", "null", 4.1, false, false, false, false, 0); + return 1; +} +``` + +## 重要提示 + +:::提示 + +必须通过 ApplyAnimation 为玩家预加载动画资源库,否则角色动画将在下次执行时生效 + +::: + +## 相关函数 + +- [ClearActorAnimations](ClearActorAnimations): 清除角色当前应用的动画 +- [GetActorAnimation](GetActorAnimation): 获取角色当前播放的动画信息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ApplyAnimation.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ApplyAnimation.md new file mode 100644 index 00000000000..729afa245d4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ApplyAnimation.md @@ -0,0 +1,73 @@ +--- +title: ApplyAnimation +sidebar_label: ApplyAnimation +description: 为玩家应用指定的动画效果 +tags: ["玩家", "动画"] +--- + +## 描述 + +为指定玩家应用动画效果。 + +| 参数名 | 说明 | +| ------------------------ | ------------------------------------------------------------------------------------------------------------------- | +| playerid | 需要应用动画的玩家 ID | +| const animationLibrary[] | [动画资源库](../resources/animations)名称 | +| const animationName[] | 动画名称(需在指定资源库中存在) | +| Float:delta | 动画播放速度(建议使用 4.1) | +| bool:loop | 是否循环播放:'true'循环播放,'false'单次播放 | +| bool:lockX | X 轴位置锁定:'false'在动画结束后恢复原始 X 坐标(适用于移动类动画),'true'保持动画结束时的位置 | +| bool:lockY | Y 轴位置锁定(参数设置应与 lockX 保持一致) | +| bool:freeze | 动画结束后冻结玩家:'true'冻结玩家,'false'不冻结 | +| time | 动画持续时间(毫秒),0 表示无限循环 | +| FORCE_SYNC:forceSync | 同步模式:1-向流式范围内的所有玩家同步动画(可选);2-仅同步给其他可见玩家(适用于 NPC 动画或需要持久化动画的场景) | + +## 返回值 + +本函数始终返回 true(即使玩家不存在或参数无效)。 + +## 示例 + +```c +ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, true, true, true, true, 1, 1); +``` + +open.mp 扩展示例: + +```c +ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, true, true, true, true, 1, SYNC_NONE); +// SYNC_NONE: 不向其他玩家同步 + +ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, true, true, true, true, 1, SYNC_ALL); +// SYNC_ALL: 同步给所有可见玩家 + +ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, true, true, true, true, 1, SYNC_OTHER); +// SYNC_OTHER: 仅同步给其他玩家(自身不同步) +``` + +## 注意事项 + +:::tip + +- forceSync 参数默认值为 0(SYNC_NONE),通常无需设置,玩家会自动同步动画 +- 强制同步模式适用于玩家无法自主同步的特殊场景(如暂停状态) + +::: + +:::warning + +使用无效的动画资源库会导致玩家游戏崩溃(该问题已在 open.mp 中修复) + +::: + +## 相关函数 + +- [ClearAnimations](ClearAnimations): 清除玩家当前动画 +- [SetPlayerSpecialAction](SetPlayerSpecialAction): 设置玩家特殊动作 +- [GetPlayerAnimFlags](GetPlayerAnimFlags): 获取动画标志位 +- [IsValidAnimationLibrary](IsValidAnimationLibrary): 验证动画资源库有效性 +- [EnableAllAnimations](EnableAllAnimations): 启用缺失版本动画支持 + +## 相关资源 + +- [动画资源列表](../resources/animations) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AreAllAnimationsEnabled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AreAllAnimationsEnabled.md new file mode 100644 index 00000000000..103d9d34f39 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AreAllAnimationsEnabled.md @@ -0,0 +1,37 @@ +--- +title: AreAllAnimationsEnabled +sidebar_label: AreAllAnimationsEnabled +description: 检测是否已启用某些版本缺失的动画支持 +tags: ["动画"] +--- + + + +## 描述 + +检测是否已启用某些版本缺失的动画支持功能。 + +## 返回值 + +true:已启用缺失动画支持 + +false:未启用缺失动画支持 + +## 示例 + +```c +if (AreAllAnimationsEnabled()) +{ + // 执行相关动画操作 +} +``` + +## 相关函数 + +- [EnableAllAnimations](EnableAllAnimations): 启用缺失版本动画支持 +- [ApplyAnimation](ApplyAnimation): 为玩家应用动画效果 +- [ClearAnimations](ClearAnimations): 清除玩家当前动画 + +## 相关资源 + +- [动画资源列表](../resources/animations) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AreInteriorWeaponsAllowed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AreInteriorWeaponsAllowed.md new file mode 100644 index 00000000000..eacdc7d43ca --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AreInteriorWeaponsAllowed.md @@ -0,0 +1,31 @@ +--- +title: AreInteriorWeaponsAllowed +sidebar_label: AreInteriorWeaponsAllowed +description: 检测是否允许在室内场景使用武器 +tags: [] +--- + + + +## 描述 + +检测当前服务器是否允许在室内场景使用武器。 + +## 返回值 + +true:允许使用武器 + +false:禁止使用武器 + +## 示例 + +```c +if (AreInteriorWeaponsAllowed()) +{ + // 执行与室内武器相关的操作 +} +``` + +## 相关函数 + +- [AllowInteriorWeapons](AllowInteriorWeapons): 控制室内武器使用权限开关 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ArePlayerWeaponsAllowed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ArePlayerWeaponsAllowed.md new file mode 100644 index 00000000000..c01ce8c1cd0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ArePlayerWeaponsAllowed.md @@ -0,0 +1,40 @@ +--- +title: ArePlayerWeaponsAllowed +sidebar_label: ArePlayerWeaponsAllowed +description: 检测玩家是否具有武器使用权限 +tags: ["玩家"] +--- + + + +## 描述 + +检测指定玩家是否被允许使用武器。 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +**true** - 允许使用武器 + +**false** - 禁止使用武器 + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + if (ArePlayerWeaponsAllowed(playerid)) + { + // 执行武器相关操作 + } + + return 1; +} +``` + +## 相关函数 + +- [AllowPlayerWeapons](AllowPlayerWeapons): 控制玩家武器权限开关 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToPlayer.md new file mode 100644 index 00000000000..4cda91403c3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToPlayer.md @@ -0,0 +1,46 @@ +--- +title: Attach3DTextLabelToPlayer +sidebar_label: Attach3DTextLabelToPlayer +description: 将3D文本标签附加到玩家身上。 +tags: ["玩家", "3d文本标签"] +--- + +## 描述 + +将 3D 文本标签附加到玩家身上。 + +| 名称 | 说明 | +| ------------- | ---------------------------------------------------- | +| Text3D:textid | 要附加的 3D 文本标签 ID(由 Create3DTextLabel 返回) | +| playerid | 要附加标签的玩家 ID | +| Float:offsetX | 玩家坐标的 X 轴偏移量 | +| Float:offsetY | 玩家坐标的 Y 轴偏移量 | +| Float:offsetZ | 玩家坐标的 Z 轴偏移量 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家和/或标签不存在) + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + new Text3D:textLabel = Create3DTextLabel("Hello, I am new here!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); + Attach3DTextLabelToPlayer(textLabel, playerid, 0.0, 0.0, 0.7); + return 1; +} +``` + +## 相关函数 + +- [Create3DTextLabel](Create3DTextLabel): 创建一个 3D 文本标签 +- [Delete3DTextLabel](Delete3DTextLabel): 删除 3D 文本标签 +- [Get3DTextLabelAttachedData](Get3DTextLabelAttachedData): 获取已附加的 3D 文本标签数据 +- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): 将 3D 文本标签附加到车辆 +- [Update3DTextLabelText](Update3DTextLabelText): 更新 3D 文本标签的文本内容 +- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): 为单个玩家创建 3D 文本标签 +- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): 删除玩家的 3D 文本标签 +- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): 更新玩家的 3D 文本标签文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToVehicle.md new file mode 100644 index 00000000000..588db9e5e89 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Attach3DTextLabelToVehicle.md @@ -0,0 +1,55 @@ +--- +title: Attach3DTextLabelToVehicle +sidebar_label: Attach3DTextLabelToVehicle +description: 将3D文本标签附加到指定车辆上。 +tags: ["车辆", "3d文本标签"] +--- + +## 描述 + +将 3D 文本标签附加到指定车辆上。 + +| 名称 | 说明 | +| ------------- | ------------------------------------------------------- | +| Text3D:textid | 要附加的 3D 文本标签 ID | +| parentid | 要附加的车辆 ID | +| Float:offsetX | 车辆坐标的 X 轴偏移量(原点为车辆坐标 `0.0, 0.0, 0.0`) | +| Float:offsetY | 车辆坐标的 Y 轴偏移量(原点为车辆坐标 `0.0, 0.0, 0.0`) | +| Float:offsetZ | 车辆坐标的 Z 轴偏移量(原点为车辆坐标 `0.0, 0.0, 0.0`) | + +## 返回值 + +本函数没有特定返回值。 + +## 示例 + +```c +new + Text3D:gVehicle3dText[MAX_VEHICLES], // Creating the TextLabel for later use + gVehicleId; + +public OnGameModeInit() +{ + gVehicleId = CreateVehicle(510, 0.0, 0.0, 15.0, 5, 0, 120); // Creating the Vehicle. + gVehicle3dText[gVehicleId] = Create3DTextLabel("Example Text", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1); + Attach3DTextLabelToVehicle(gVehicle3dText[gVehicleId], gVehicleId, 0.0, 0.0, 2.0); // Attaching Text Label To Vehicle. + return 1; +} + +public OnGameModeExit() +{ + Delete3DTextLabel(gVehicle3dText[gVehicleId]); + return 1; +} +``` + +## 相关函数 + +- [Create3DTextLabel](Create3DTextLabel): 创建一个 3D 文本标签 +- [Delete3DTextLabel](Delete3DTextLabel): 删除 3D 文本标签 +- [Get3DTextLabelAttachedData](Get3DTextLabelAttachedData): 获取已附加的 3D 文本标签数据 +- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): 将 3D 文本标签附加到玩家 +- [Update3DTextLabelText](Update3DTextLabelText): 更新 3D 文本标签的文本内容 +- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): 为单个玩家创建 3D 文本标签 +- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): 删除玩家的 3D 文本标签 +- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): 更新玩家的 3D 文本标签文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToObject.md new file mode 100644 index 00000000000..1d872d710b1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToObject.md @@ -0,0 +1,47 @@ +--- +title: AttachCameraToObject +sidebar_label: AttachCameraToObject +description: 您可以使用此功能将玩家视角附加到物体上。 +tags: ["玩家", "物体"] +--- + +## 描述 + +您可以使用此功能将玩家视角附加到物体上。 + +| 名称 | 说明 | +| -------- | ----------------------- | +| playerid | 需要附加视角的玩家 ID | +| objectid | 要附加玩家视角的物体 ID | + +## 返回值 + +本函数没有特定返回值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/attach", false)) + { + new objectId = CreateObject(1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0); + AttachCameraToObject(playerid, objectId); + SendClientMessage(playerid, 0xFFFFFFAA, "Your camera is attached on object now."); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +在附加玩家视角之前,必须先创建对应的物体。 + +::: + +## 相关函数 + +- [AttachCameraToPlayerObject](AttachCameraToPlayerObject): 将玩家视角附加到玩家创建的物体上 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToPlayerObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToPlayerObject.md new file mode 100644 index 00000000000..bc4ff28bbfa --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachCameraToPlayerObject.md @@ -0,0 +1,49 @@ +--- +title: AttachCameraToPlayerObject +sidebar_label: AttachCameraToPlayerObject +description: 将玩家的视角附加到玩家创建的物体上。 +tags: ["玩家", "视角"] +--- + +## 描述 + +将玩家的视角附加到玩家创建的物体上。玩家在视角附加期间仍可自由操控视角,可与 MovePlayerObject 及 AttachPlayerObjectToVehicle 配合使用。 + +| 名称 | 说明 | +| -------------- | ----------------------------- | +| playerid | 需要附加视角的玩家 ID | +| playerobjectid | 要附加视角的玩家创建的物体 ID | + +## 返回值 + +本函数没有特定返回值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/attach", false)) + { + new playerobject = CreatePlayerObject(playerid, 1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0); + AttachCameraToPlayerObject(playerid, playerobject); + SendClientMessage(playerid, 0xFFFFFFAA, "Your camera is now attached to an object."); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +在附加玩家视角之前,必须先创建对应的玩家创建的物体。 + +::: + +## 相关函数 + +- [AttachCameraToObject](AttachCameraToObject): 将玩家视角附加到全局物体上 +- [SetPlayerCameraPos](SetPlayerCameraPos): 设置玩家视角位置 +- [SetPlayerCameraLookAt](SetPlayerCameraLookAt): 设置玩家视角的观察点 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToObject.md new file mode 100644 index 00000000000..2f43ac6e060 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToObject.md @@ -0,0 +1,76 @@ +--- +title: AttachObjectToObject +sidebar_label: AttachObjectToObject +description: 将物体附加到其他物体上。 +tags: ["物体"] +--- + +## 描述 + +您可以使用此功能将物体附加到其他物体上。被附加的物体会跟随主物体移动。 + +| 名称 | 说明 | +| ----------------- | ----------------------------------------------------------- | +| objectid | 要附加的物体 ID | +| parentid | 目标物体 ID | +| Float:offsetX | 主物体与附加物体在 X 轴方向的距离 | +| Float:offsetY | 主物体与附加物体在 Y 轴方向的距离 | +| Float:offsetZ | 主物体与附加物体在 Z 轴方向的距离 | +| Float:rotationX | 附加物体相对于主物体 X 轴的旋转角度 | +| Float:rotationY | 附加物体相对于主物体 Y 轴的旋转角度 | +| Float:rotationZ | 附加物体相对于主物体 Z 轴的旋转角度 | +| bool:syncRotation | 是否同步旋转(设为`false`时附加物体的旋转不会随主物体改变) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(第一个物体不存在,不检测第二个物体是否存在) + +## 示例 + +```c +new gObjectId = CreateObject(...); +new gAttachToId = CreateObject(...); + +AttachObjectToObject(gObjectId, gAttachToId, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true); +``` + +## 注意事项 + +:::tip + +在附加操作前必须确保两个物体都已创建 + +::: + +:::tip + +SA-MP 原生版本没有玩家物体版的此函数 +但 open.mp 提供了[AttachPlayerObjectToObject](AttachPlayerObjectToObject) + +::: + +## 相关函数 + +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 +- [AttachObjectToVehicle](AttachObjectToVehicle): 将物体附加到车辆 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转 +- [CreatePlayerObject](CreatePlayerObject): 为单个玩家创建物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToPlayer.md new file mode 100644 index 00000000000..c4c766c3004 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToPlayer.md @@ -0,0 +1,57 @@ +--- +title: AttachObjectToPlayer +sidebar_label: AttachObjectToPlayer +description: 将物体附加到玩家身上。 +tags: ["物体", "玩家"] +--- + +## 描述 + +将物体附加到玩家身上。 + +| 名称 | 说明 | +| --------------- | ----------------------------- | +| objectid | 要附加的物体 ID | +| parentid | 要附加的玩家 ID | +| Float:offsetX | 玩家坐标的 X 轴偏移量 | +| Float:offsetY | 玩家坐标的 Y 轴偏移量 | +| Float:offsetZ | 玩家坐标的 Z 轴偏移量 | +| Float:rotationX | 物体相对于玩家 X 轴的旋转角度 | +| Float:rotationY | 物体相对于玩家 Y 轴的旋转角度 | +| Float:rotationZ | 物体相对于玩家 Z 轴的旋转角度 | + +## 返回值 + +本函数始终返回 **false**。 + +## 示例 + +```c +new gMyObject; +gMyObject = CreateObject(19341, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); +AttachObjectToPlayer(gMyObject, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2); +``` + +## 相关函数 + +- [AttachObjectToVehicle](AttachObjectToVehicle): 将物体附加到车辆 +- [AttachObjectToObject](AttachObjectToObject): 将物体附加到物体 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转 +- [CreatePlayerObject](CreatePlayerObject): 为单个玩家创建物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToVehicle.md new file mode 100644 index 00000000000..2dd3c76373f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachObjectToVehicle.md @@ -0,0 +1,71 @@ +--- +title: AttachObjectToVehicle +sidebar_label: AttachObjectToVehicle +description: 将物体附加到车辆上。 +tags: ["物体", "车辆"] +--- + +## 描述 + +将物体附加到车辆上。 + +| 名称 | 说明 | +| --------------- | --------------------------------------------------- | +| objectid | 要附加的物体 ID(必须是已创建的物体 ID,非模型 ID) | +| parentid | 目标车辆 ID | +| Float:offsetX | 车辆坐标系的 X 轴偏移量 | +| Float:offsetY | 车辆坐标系的 Y 轴偏移量 | +| Float:offsetZ | 车辆坐标系的 Z 轴偏移量 | +| Float:rotationX | 物体 X 轴旋转偏移量 | +| Float:rotationY | 物体 Y 轴旋转偏移量 | +| Float:rotationZ | 物体 Z 轴旋转偏移量 | + +## 返回值 + +本函数没有特定返回值。 + +## 示例 + +```c +new objectid = CreateObject(...); +new vehicleid = GetPlayerVehicleID(playerid); +AttachObjectToVehicle(objectid, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0); +``` + +## 注意事项 + +:::tip + +必须预先创建物体 + +::: + +:::warning + +当车辆被销毁或重置时,附加物体不会随之销毁,它们会保持在车辆消失的位置静止,并在新车辆占用该 ID 时重新附加 + +::: + +## 相关函数 + +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 +- [AttachObjectToObject](AttachObjectToObject): 将物体附加到物体 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转 +- [CreatePlayerObject](CreatePlayerObject): 为单个玩家创建物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToObject.md new file mode 100644 index 00000000000..ee67b0f93ea --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToObject.md @@ -0,0 +1,64 @@ +--- +title: AttachPlayerObjectToObject +sidebar_label: AttachPlayerObjectToObject +description: 将玩家物体附加到其他玩家物体上。 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +您可以使用此功能将玩家物体附加到其他玩家物体上。被附加的物体会跟随主物体移动。 + +| 名称 | 说明 | +| ----------------- | ----------------------------------------------------------- | +| playerid | 玩家 ID | +| objectid | 要附加的玩家物体 ID | +| parentid | 目标玩家物体 ID | +| Float:OffsetX | 主物体与附加物体在 X 轴方向的距离 | +| Float:OffsetY | 主物体与附加物体在 Y 轴方向的距离 | +| Float:OffsetZ | 主物体与附加物体在 Z 轴方向的距离 | +| Float:RotX | 附加物体相对于主物体 X 轴的旋转角度 | +| Float:RotY | 附加物体相对于主物体 Y 轴的旋转角度 | +| Float:RotZ | 附加物体相对于主物体 Z 轴的旋转角度 | +| bool:syncRotation | 是否同步旋转(设为`false`时附加物体的旋转不会随主物体改变) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(第一个物体不存在,不检测第二个物体是否存在) + +## 示例 + +```c +new objectid = CreatePlayerObject(...); +new parentid = CreatePlayerObject(...); + +AttachPlayerObjectToObject(playerid, objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true); +``` + +## 注意事项 + +:::tip + +在附加操作前必须确保两个物体都已创建 + +::: + +## 相关函数 + +- [AttachObjectToObject](AttachObjectToObject): 将物体附加到其他物体 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 +- [AttachObjectToVehicle](AttachObjectToVehicle): 将物体附加到车辆 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家 +- [CreatePlayerObject](CreatePlayerObject): 为单个玩家创建物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToPlayer.md new file mode 100644 index 00000000000..d40cfa754cd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToPlayer.md @@ -0,0 +1,73 @@ +--- +title: AttachPlayerObjectToPlayer +sidebar_label: AttachPlayerObjectToPlayer +description: 功能与AttachObjectToPlayer相同,但针对玩家创建的物体。 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +功能与[AttachObjectToPlayer](AttachObjectToPlayer)相同,但针对玩家创建的物体。 + +| 名称 | 说明 | +| --------------- | --------------------------- | +| playerid | 与物体关联的玩家 ID | +| objectid | 要附加的玩家物体 ID | +| parentid | 目标玩家 ID | +| Float:offsetX | 玩家与物体在 X 轴方向的距离 | +| Float:offsetY | 玩家与物体在 Y 轴方向的距离 | +| Float:offsetZ | 玩家与物体在 Z 轴方向的距离 | +| Float:rotationX | X 轴旋转角度 | +| Float:rotationY | Y 轴旋转角度 | +| Float:rotationZ | Z 轴旋转角度 | + +## 返回值 + +本函数没有特定返回值。 + +## 示例 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerSpawn(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + AttachPlayerObjectToPlayer(playerid, gPlayerObject[playerid], other_playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2.0); + return 1; +} +``` + +## 注意事项 + +:::warning + +此函数已在 SA-MP 0.3 版本中移除 + +::: + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 为单个玩家创建物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转 +- [SetPlayerAttachedObject](SetPlayerAttachedObject): 为玩家附加物体 +- [RemovePlayerAttachedObject](RemovePlayerAttachedObject): 移除玩家附加的物体 +- [IsPlayerAttachedObjectSlotUsed](IsPlayerAttachedObjectSlotUsed): 检测玩家附加物体槽位占用 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToVehicle.md new file mode 100644 index 00000000000..320c55f12a9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachPlayerObjectToVehicle.md @@ -0,0 +1,74 @@ +--- +title: AttachPlayerObjectToVehicle +sidebar_label: AttachPlayerObjectToVehicle +description: 将玩家物体附加到车辆上。 +tags: ["玩家", "物体", "玩家物体", "车辆"] +--- + +## 描述 + +将玩家物体附加到车辆上。 + +| 名称 | 说明 | +| --------------- | ----------------------- | +| playerid | 创建该物体的所属玩家 ID | +| objectid | 要附加的玩家物体 ID | +| parentid | 目标车辆 ID | +| Float:offsetX | X 轴位置偏移量 | +| Float:offsetY | Y 轴位置偏移量 | +| Float:offsetZ | Z 轴位置偏移量 | +| Float:rotationX | X 轴旋转偏移量 | +| Float:rotationY | Y 轴旋转偏移量 | +| Float:rotationZ | Z 轴旋转偏移量 | + +## 返回值 + +本函数没有特定返回值。 + +## 示例 + +```c +public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) +{ + if (newstate == PLAYER_STATE_DRIVER) // 玩家进入车辆时 + { + // 附加巨型奶牛模型 + new cowObject = CreatePlayerObject(playerid, 16442, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + new vehicleid = GetPlayerVehicleID(playerid); + + AttachPlayerObjectToVehicle(playerid, cowObject, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +在附加操作前必须创建物体 + +::: + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 为单个玩家创建物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachTrailerToVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachTrailerToVehicle.md new file mode 100644 index 00000000000..3820e999181 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AttachTrailerToVehicle.md @@ -0,0 +1,42 @@ +--- +title: AttachTrailerToVehicle +sidebar_label: AttachTrailerToVehicle +description: 将一个车辆作为拖车附加到另一个车辆上。 +tags: ["车辆"] +--- + +## 描述 + +将一个车辆作为拖车附加到另一个车辆上。 + +| 名称 | 说明 | +| --------- | ----------------- | +| trailerid | 被牵引的车辆 ID | +| vehicleid | 牵引拖车的车辆 ID | + +## 返回值 + +本函数始终返回 **true**,即使传入的车辆 ID 无效。 + +## 示例 + +```c +new vehicleId = CreateVehicle(403, 657.8788, 1721.9125, 7.7199, 41.0000, -1, -1, 100); +new trailerId = CreateVehicle(435, 651.8154, 1716.3301, 7.7700, 41.0000, -1, -1, 100); + +AttachTrailerToVehicle(trailerId, vehicleId); +``` + +## 注意事项 + +:::warning + +该功能仅在两个车辆均被玩家流加载时生效(参见[IsVehicleStreamedIn](IsVehicleStreamedIn))。 + +::: + +## 相关函数 + +- [DetachTrailerFromVehicle](DetachTrailerFromVehicle): 将拖车从车辆分离 +- [IsTrailerAttachedToVehicle](IsTrailerAttachedToVehicle): 检测拖车是否已连接 +- [GetVehicleTrailer](GetVehicleTrailer): 获取车辆牵引的拖车 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md new file mode 100644 index 00000000000..29397cf1073 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md @@ -0,0 +1,69 @@ +--- +title: Ban +sidebar_label: Ban +description: 封禁当前在线的玩家。 +tags: ["玩家", "管理"] +--- + +## 描述 + +封禁当前在线的玩家。被禁玩家将无法再次连接服务器。 + +封禁将基于 IP 地址,并保存在服务器根目录的 **bans.json** 文件中。 + +使用[BanEx](BanEx)可以指定封禁原因。 + +可通过 RCON 命令`banip`和`unbanip`管理 IP 封禁(需配合[SendRconCommand](SendRconCommand)使用)。 + +| 名称 | 说明 | +| -------- | --------------- | +| playerid | 要封禁的玩家 ID | + +## 返回值 + +本函数没有特定返回值。 + +## 注意事项 + +:::warning + +在 Ban()之前立即执行的操作(如使用[SendClientMessage](SendClientMessage)发送消息)将无法送达玩家。必须使用定时器延迟封禁操作。 + +::: + +## 示例 + +```c +// 为了在连接关闭前显示消息(如封禁原因) +// 必须使用定时器延迟操作。延迟仅需数毫秒, +// 本示例使用1秒确保可靠性 + +forward DelayedBan(playerid); +public DelayedBan(playerid) +{ + Ban(playerid); +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/banme", true) == 0) + { + // 封禁执行此命令的玩家 + + // 第一步:发送提示信息 + SendClientMessage(playerid, 0xFF0000FF, "您已被封禁!"); + + // 通过定时器在1秒后执行封禁 + SetTimerEx("DelayedBan", 1000, false, "d", playerid); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [BanEx](BanEx): 封禁玩家并指定原因 +- [Kick](Kick): 踢出服务器 +- [BlockIpAddress](BlockIpAddress): 临时封禁 IP 地址 +- [UnBlockIpAddress](UnBlockIpAddress): 解除 IP 封禁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md new file mode 100644 index 00000000000..dfbfb4a4ce0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md @@ -0,0 +1,82 @@ +--- +title: BanEx +sidebar_label: BanEx +description: 封禁玩家并指定原因。 +tags: ["玩家", "管理"] +--- + +## 描述 + +封禁玩家并指定原因。 + +| 名称 | 说明 | +| -------------- | --------------- | +| playerid | 要封禁的玩家 ID | +| const reason[] | 封禁原因 | + +## 返回值 + +本函数没有特定返回值。 + +## 注意事项 + +:::warning + +在 BanEx()之前立即执行的操作(如使用[SendClientMessage](SendClientMessage)发送消息)将无法送达玩家。必须使用定时器延迟封禁操作。 + +::: + +## 示例 + +```c +public OnPlayerCommandText( playerid, cmdtext[] ) +{ + if (!strcmp(cmdtext, "/banme", true)) + { + // 封禁执行此命令的玩家并指定原因("Request") + BanEx(playerid, "Request"); + return 1; + } +} +``` + +
+ +```c +// 为了在连接关闭前显示消息(如封禁原因) +// 必须使用定时器延迟操作。延迟仅需数毫秒, +// 本示例使用1秒确保可靠性 + +forward BanExPublic(playerid, reason[]); +public BanExPublic(playerid, reason[]) +{ + BanEx(playerid, reason); +} + +stock BanExWithMessage(playerid, color, message[], reason[]) +{ + // reason - 用于BanEx的封禁原因 + SendClientMessage(playerid, color, message); + SetTimerEx("BanExPublic", 1000, false, "ds", playerid, reason); +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/banme", true) == 0) + { + // 封禁执行此命令的玩家 + BanExWithMessage(playerid, 0xFF0000FF, "您已被封禁!", "Request"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [Ban](Ban): 永久封禁玩家 +- [Kick](Kick): 踢出服务器 + +``` + +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectEditing.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectEditing.md new file mode 100644 index 00000000000..489be7ceb40 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectEditing.md @@ -0,0 +1,64 @@ +--- +title: BeginObjectEditing +sidebar_label: BeginObjectEditing +description: 允许玩家通过图形用户界面(GUI)使用鼠标编辑物体(位置和旋转)。 +tags: ["玩家", "物体"] +--- + + + +## 描述 + +允许玩家通过图形用户界面(GUI)使用鼠标编辑物体(位置和旋转)。 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要进行物体编辑的玩家 ID | +| objectid | 玩家将要编辑的物体 ID | + +## 返回值 + +`true` - 函数执行成功。注意即使指定了不存在的物体也会返回成功(但不会产生实际效果) + +`false` - 函数执行失败。通常表示玩家未连接 + +## 示例代码 + +```c +new objectid; + +public OnGameModeInit() +{ + objectid = CreateObject(1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/oedit", true)) + { + BeginObjectEditing(playerid, objectid); + SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: 您现在可以编辑物体了!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +编辑过程中按住空格键(车辆中按 W 键)并移动鼠标可以控制视角移动 + +::: + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [MoveObject](MoveObject): 移动物体 +- [BeginPlayerObjectEditing](BeginPlayerObjectEditing): 编辑玩家物体 +- [EditAttachedObject](EditAttachedObject): 编辑附加物体 +- [BeginObjectSelecting](BeginObjectSelecting): 选择物体 +- [EndObjectEditing](EndObjectEditing): 取消物体编辑 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectSelecting.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectSelecting.md new file mode 100644 index 00000000000..abddea91ed9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginObjectSelecting.md @@ -0,0 +1,49 @@ +--- +title: BeginObjectSelecting +sidebar_label: BeginObjectSelecting +description: 显示光标并允许玩家选择物体。 +tags: ["物体"] +--- + + + +## 描述 + +显示光标并允许玩家选择物体。当玩家选择物体时会触发 OnPlayerSelectObject 回调函数。 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要进行物体选择的玩家 ID | + +## 返回值 + +本函数没有特定返回值 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/select", true)) + { + BeginObjectSelecting(playerid); + SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: 请选择您要编辑的物体!"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [MoveObject](MoveObject): 移动物体 +- [BeginObjectEditing](BeginObjectEditing): 编辑物体 +- [BeginPlayerObjectEditing](BeginPlayerObjectEditing): 编辑玩家物体 +- [EditAttachedObject](EditAttachedObject): 编辑附加物体 +- [EndObjectEditing](EndObjectEditing): 取消物体编辑 + +## 相关回调 + +- [OnPlayerSelectObject](../callbacks/OnPlayerSelectObject): 当玩家选择物体时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginPlayerObjectEditing.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginPlayerObjectEditing.md new file mode 100644 index 00000000000..8d2d85c0e1f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BeginPlayerObjectEditing.md @@ -0,0 +1,62 @@ +--- +title: BeginPlayerObjectEditing +sidebar_label: BeginPlayerObjectEditing +description: 允许玩家通过图形用户界面(GUI)使用鼠标编辑玩家物体(位置和旋转)。 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +允许玩家通过图形用户界面(GUI)使用鼠标编辑玩家物体(位置和旋转)。 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要进行物体编辑的玩家 ID | +| objectid | 玩家将要编辑的玩家物体 ID | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(玩家或物体无效) + +## 示例代码 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerSpawn(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/edit", true)) + { + BeginPlayerObjectEditing(playerid, gPlayerObject[playerid]); + SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: 您现在可以编辑您的玩家物体!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +编辑过程中按住空格键(车辆中按 W 键)并移动鼠标可以控制视角移动 + +::: + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [MoveObject](MoveObject): 移动物体 +- [EditAttachedObject](EditAttachedObject): 编辑附加物体 +- [BeginObjectSelecting](BeginObjectSelecting): 选择物体 +- [EndObjectEditing](EndObjectEditing): 取消物体编辑 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BlockIpAddress.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BlockIpAddress.md new file mode 100644 index 00000000000..a4cf0e4e93b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/BlockIpAddress.md @@ -0,0 +1,50 @@ +--- +title: BlockIpAddress +sidebar_label: BlockIpAddress +description: 阻止指定IP地址与服务器通信(允许使用通配符),持续指定时长。 +tags: ["ip地址"] +--- + +## 描述 + +阻止指定 IP 地址与服务器通信(允许使用通配符),持续指定时长。被封锁 IP 的玩家尝试连接时会收到通用提示信息"您已被封禁"。已在线的该 IP 玩家将在数秒后超时断开连接,重新连接时也会收到相同提示。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------- | +| const ipAddress[] | 要封锁的 IP 地址 | +| timeMS | 封锁时长(毫秒)。使用 0 表示永久封锁 | + +## 返回值 + +本函数没有特定返回值 + +## 示例代码 + +```c +public OnRconLoginAttempt(ip[], password[], success) +{ + if (!success) // 如果输入了错误密码 + { + BlockIpAddress(ip, 60 * 1000); // 封锁该IP地址1分钟 + } + return 1; +} +``` + +## 注意事项 + +:::tip + +本函数支持通配符使用,例如封锁'6.9._._'将匹配前两组为 6 和 9 的所有 IP 地址。下划线可替代任意数字组合 + +::: + +## 相关函数 + +- [UnBlockIpAddress](UnBlockIpAddress): 解除 IP 地址封锁 +- [IsBanned](IsBanned): 检测指定 IP 是否被封禁 + +## 相关回调 + +- [OnRconLoginAttempt](../callbacks/OnRconLoginAttempt): 当有人尝试登录 RCON 时触发 +- [OnIncomingConnection](../callbacks/OnIncomingConnection): 当玩家尝试连接服务器时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CallLocalFunction.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CallLocalFunction.md new file mode 100644 index 00000000000..fec3d64ecf0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CallLocalFunction.md @@ -0,0 +1,58 @@ +--- +title: CallLocalFunction +sidebar_label: CallLocalFunction +description: 调用当前脚本中的公共函数。 +tags: ["核心功能"] +--- + +## 描述 + +调用当前脚本中的公共函数。 + +| 参数名 | 说明 | +| -------------------- | ---------------------------------------- | +| const functionName[] | 目标公共函数名称 | +| const specifiers[] | 参数格式说明符(指定每个参数的数据类型) | +| OPEN_MP_TAGS:... | 不定数量且任意标签类型的参数 | + +## 返回值 + +若函数存在,返回被调用函数的执行结果 + +若函数不存在,返回 0 + +## 格式说明符 + +| **占位符** | **含义说明** | +| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `a` | 传递数组(需紧跟 d/i 说明符指定数组长度)

**注意**:仅支持一维数组,传递二维数组时需通过计算数组长度(如 sizeof(array) + sizeof(array)\*sizeof(array[])) | +| `c` | 传递单个字符 | +| `d`,`i` | 传递整型数值 | +| `x` | 传递十六进制数值 | +| `f` | 传递浮点数值 | +| `s` | 传递字符串 | + +## 示例代码 + +```c +forward publicFunc(number, Float:flt, const string[]); +public publicFunc(number, Float:flt, const string[]) +{ + printf("接收整型 %i,浮点型 %f,字符串 %s", number, flt, string); + return 1; +} + +CallLocalFunction("publicFunc", "ifs", 420, 68.999999999, "Hello world"); +``` + +## 注意事项 + +:::warning + +在传递空字符串时原版 SA-MP 会导致服务器崩溃(open.mp 版本已修复此问题) + +::: + +## 相关函数 + +- [CallRemoteFunction](CallRemoteFunction): 调用任意已加载脚本中的函数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CallRemoteFunction.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CallRemoteFunction.md new file mode 100644 index 00000000000..20474d078ed --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CallRemoteFunction.md @@ -0,0 +1,57 @@ +--- +title: CallRemoteFunction +sidebar_label: CallRemoteFunction +description: 调用任意已加载脚本中的公共函数。 +tags: ["核心"] +--- + +## 描述 + +调用任意已加载脚本中的公共函数。 + +| 参数名 | 说明 | +| -------------------- | ---------------------------------------- | +| const functionName[] | 目标公共函数名称 | +| const specifiers[] | 参数格式说明符(指定每个参数的数据类型) | +| OPEN_MP_TAGS:... | 不定数量且任意标签类型的参数 | + +## 返回值 + +返回最后一个被调用函数的执行结果 + +## 格式说明符 + +| **占位符** | **含义说明** | +| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `a` | 传递数组(需紧跟 d/i 说明符指定数组长度)

**注意**:仅支持一维数组,传递二维数组时需通过计算数组长度(如 sizeof(array) + sizeof(array)\*sizeof(array[])) | +| `c` | 传递单个字符 | +| `d`,`i` | 传递整型数值 | +| `x` | 传递十六进制数值 | +| `f` | 传递浮点数值 | +| `s` | 传递字符串 | + +## 示例代码 + +```c +forward CallMe(number, const string[]); +public CallMe(number, const string[]) +{ + printf("CallMe被调用。整型参数: %i 字符串参数: %s", number, string); + return 1; +} + +// 在另一个脚本文件中... +CallRemoteFunction("CallMe", "is", 69, "这是一个字符串"); +``` + +## 注意事项 + +:::warning + +在传递空字符串时原版 SA-MP 会导致服务器崩溃(open.mp 版本已修复此问题) + +::: + +## 相关函数 + +- [CallLocalFunction](CallLocalFunction): 调用当前脚本中的函数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelEdit.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelEdit.md new file mode 100644 index 00000000000..ae652deea81 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelEdit.md @@ -0,0 +1,43 @@ +--- +title: CancelEdit +sidebar_label: CancelEdit +description: 取消玩家的物体编辑模式 +tags: [] +--- + +## 描述 + +终止玩家当前的物体编辑状态 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要终止编辑的玩家 ID | + +## 返回值 + +本函数没有特定返回值 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/stopedit", true)) + { + CancelEdit(playerid); + SendClientMessage(playerid, 0xFFFFFFFF, "服务器: 您已终止物体编辑!"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SelectObject](SelectObject): 选择物体 +- [EditObject](EditObject): 编辑物体 +- [EditPlayerObject](EditPlayerObject): 编辑玩家物体 +- [EditAttachedObject](EditAttachedObject): 编辑附加物体 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [MoveObject](MoveObject): 移动物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md new file mode 100644 index 00000000000..cacf9aaa678 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md @@ -0,0 +1,52 @@ +--- +title: CancelSelectTextDraw +sidebar_label: CancelSelectTextDraw +description: 取消玩家通过鼠标选择文本绘图的功能 +tags: ["文本绘图"] +--- + +## 描述 + +终止玩家当前的文本绘图选择状态 + +| 参数名 | 说明 | +| -------- | ----------------------------- | +| playerid | 需要禁用文本绘图选择的玩家 ID | + +## 返回值 + +本函数没有特定返回值 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/cancelselect", true)) + { + CancelSelectTextDraw(playerid); + SendClientMessage(playerid, 0xFFFFFFFF, "服务器: 文本绘图选择已禁用!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +本函数会触发 [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) 回调并传入 INVALID_TEXT_DRAW (65535) + +在 OnPlayerClickTextDraw 回调中使用此函数时,若未处理该无效值情况会导致客户端进入无限循环 + +::: + +## 相关函数 + +- [SelectTextDraw](SelectTextDraw): 启用鼠标选择文本绘图功能 +- [TextDrawSetSelectable](TextDrawSetSelectable): 设置文本绘图是否可被选择 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColor.md new file mode 100644 index 00000000000..1279fda1552 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColor.md @@ -0,0 +1,66 @@ +--- +title: ChangeVehicleColor +sidebar_label: ChangeVehicleColor +description: 修改车辆的主色和副色 +tags: ["车辆"] +--- + +## 描述 + +修改指定车辆的主色和副色 + +| 参数名 | 说明 | +| --------- | ------------- | +| vehicleid | 目标车辆 ID | +| color1 | 新的主颜色 ID | +| color2 | 新的副颜色 ID | + +## 返回值 + +1 - 函数执行成功,颜色已修改 + +0 - 函数执行失败(车辆不存在) + +## 示例代码 + +```c +public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) +{ + // 将主色改为黑色(0),副色改为白色(1) + ChangeVehicleColor(vehicleid, 0, 1); + return 1; +} +``` + +## 颜色表 + +```c +new VehicleColoursTableRGBA[256] = { +// 原始圣安地列斯颜色 +0x000000FF, 0xF5F5F5FF, 0x2A77A1FF, 0x840410FF, 0x263739FF, 0x86446EFF, 0xD78E10FF, 0x4C75B7FF, 0xBDBEC6FF, 0x5E7072FF, +// ...(此处保留原始颜色数据不变) +0x561A28FF, 0x4E0E27FF, 0x706C67FF, 0x3B3E42FF, 0x2E2D33FF, 0x7B7E7DFF, 0x4A4442FF, 0x28344EFF +}; +``` + +## 注意事项 + +:::tip + +部分车辆仅支持修改主色,少数特殊车辆(如水泥车、快艇)支持四色但 SA-MP 只能修改其中两种 + +::: + +## 相关函数 + +- [GetVehicleColours](GetVehicleColours): 获取车辆颜色配置 +- [ChangeVehiclePaintjob](ChangeVehiclePaintjob): 修改车辆涂装样式 + +## 相关回调 + +- [OnVehicleRespray](../callbacks/OnVehicleRespray): 当车辆重新涂装时触发 + +## 扩展资源 + +- [车辆颜色 ID 对照表](../resources/vehiclecolorid) +- [原版车辆颜色配置](../resources/original-car-colors) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColours.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColours.md new file mode 100644 index 00000000000..da52424c60d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehicleColours.md @@ -0,0 +1,93 @@ +--- +title: ChangeVehicleColours +sidebar_label: ChangeVehicleColours +description: 修改车辆的主色和副色 +tags: ["车辆"] +--- + + + +## 描述 + +修改指定车辆的主色和副色 + +| 参数名 | 说明 | +| --------- | ------------- | +| vehicleid | 目标车辆 ID | +| colour1 | 新的主颜色 ID | +| colour2 | 新的副颜色 ID | + +## 返回值 + +**true** - 函数执行成功,颜色已修改 + +**false** - 函数执行失败(车辆不存在) + +## 示例代码 + +```c +public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) +{ + // 将主色改为黑色(0),副色改为白色(1) + ChangeVehicleColours(vehicleid, 0, 1); + return 1; +} +``` + +## 颜色表片段 + +```c +new VehicleColoursTableRGBA[256] = +{ + // 原始圣安地列斯颜色 + 0x000000FF, 0xF5F5F5FF, 0x2A77A1FF, 0x840410FF, 0x263739FF, 0x86446EFF, 0xD78E10FF, 0x4C75B7FF, 0xBDBEC6FF, 0x5E7072FF, + 0x46597AFF, 0x656A79FF, 0x5D7E8DFF, 0x58595AFF, 0xD6DAD6FF, 0x9CA1A3FF, 0x335F3FFF, 0x730E1AFF, 0x7B0A2AFF, 0x9F9D94FF, + 0x3B4E78FF, 0x732E3EFF, 0x691E3BFF, 0x96918CFF, 0x515459FF, 0x3F3E45FF, 0xA5A9A7FF, 0x635C5AFF, 0x3D4A68FF, 0x979592FF, + 0x421F21FF, 0x5F272BFF, 0x8494ABFF, 0x767B7CFF, 0x646464FF, 0x5A5752FF, 0x252527FF, 0x2D3A35FF, 0x93A396FF, 0x6D7A88FF, + 0x221918FF, 0x6F675FFF, 0x7C1C2AFF, 0x5F0A15FF, 0x193826FF, 0x5D1B20FF, 0x9D9872FF, 0x7A7560FF, 0x989586FF, 0xADB0B0FF, + 0x848988FF, 0x304F45FF, 0x4D6268FF, 0x162248FF, 0x272F4BFF, 0x7D6256FF, 0x9EA4ABFF, 0x9C8D71FF, 0x6D1822FF, 0x4E6881FF, + 0x9C9C98FF, 0x917347FF, 0x661C26FF, 0x949D9FFF, 0xA4A7A5FF, 0x8E8C46FF, 0x341A1EFF, 0x6A7A8CFF, 0xAAAD8EFF, 0xAB988FFF, + 0x851F2EFF, 0x6F8297FF, 0x585853FF, 0x9AA790FF, 0x601A23FF, 0x20202CFF, 0xA4A096FF, 0xAA9D84FF, 0x78222BFF, 0x0E316DFF, + 0x722A3FFF, 0x7B715EFF, 0x741D28FF, 0x1E2E32FF, 0x4D322FFF, 0x7C1B44FF, 0x2E5B20FF, 0x395A83FF, 0x6D2837FF, 0xA7A28FFF, + 0xAFB1B1FF, 0x364155FF, 0x6D6C6EFF, 0x0F6A89FF, 0x204B6BFF, 0x2B3E57FF, 0x9B9F9DFF, 0x6C8495FF, 0x4D8495FF, 0xAE9B7FFF, + 0x406C8FFF, 0x1F253BFF, 0xAB9276FF, 0x134573FF, 0x96816CFF, 0x64686AFF, 0x105082FF, 0xA19983FF, 0x385694FF, 0x525661FF, + 0x7F6956FF, 0x8C929AFF, 0x596E87FF, 0x473532FF, 0x44624FFF, 0x730A27FF, 0x223457FF, 0x640D1BFF, 0xA3ADC6FF, 0x695853FF, + 0x9B8B80FF, 0x620B1CFF, 0x5B5D5EFF, 0x624428FF, 0x731827FF, 0x1B376DFF, 0xEC6AAEFF, 0x000000FF, + // SA-MP扩展颜色(0.3x) + 0x177517FF, 0x210606FF, 0x125478FF, 0x452A0DFF, 0x571E1EFF, 0x010701FF, 0x25225AFF, 0x2C89AAFF, 0x8A4DBDFF, 0x35963AFF, + 0xB7B7B7FF, 0x464C8DFF, 0x84888CFF, 0x817867FF, 0x817A26FF, 0x6A506FFF, 0x583E6FFF, 0x8CB972FF, 0x824F78FF, 0x6D276AFF, + 0x1E1D13FF, 0x1E1306FF, 0x1F2518FF, 0x2C4531FF, 0x1E4C99FF, 0x2E5F43FF, 0x1E9948FF, 0x1E9999FF, 0x999976FF, 0x7C8499FF, + 0x992E1EFF, 0x2C1E08FF, 0x142407FF, 0x993E4DFF, 0x1E4C99FF, 0x198181FF, 0x1A292AFF, 0x16616FFF, 0x1B6687FF, 0x6C3F99FF, + 0x481A0EFF, 0x7A7399FF, 0x746D99FF, 0x53387EFF, 0x222407FF, 0x3E190CFF, 0x46210EFF, 0x991E1EFF, 0x8D4C8DFF, 0x805B80FF, + 0x7B3E7EFF, 0x3C1737FF, 0x733517FF, 0x781818FF, 0x83341AFF, 0x8E2F1CFF, 0x7E3E53FF, 0x7C6D7CFF, 0x020C02FF, 0x072407FF, + 0x163012FF, 0x16301BFF, 0x642B4FFF, 0x368452FF, 0x999590FF, 0x818D96FF, 0x99991EFF, 0x7F994CFF, 0x839292FF, 0x788222FF, + 0x2B3C99FF, 0x3A3A0BFF, 0x8A794EFF, 0x0E1F49FF, 0x15371CFF, 0x15273AFF, 0x375775FF, 0x060820FF, 0x071326FF, 0x20394BFF, + 0x2C5089FF, 0x15426CFF, 0x103250FF, 0x241663FF, 0x692015FF, 0x8C8D94FF, 0x516013FF, 0x090F02FF, 0x8C573AFF, 0x52888EFF, + 0x995C52FF, 0x99581EFF, 0x993A63FF, 0x998F4EFF, 0x99311EFF, 0x0D1842FF, 0x521E1EFF, 0x42420DFF, 0x4C991EFF, 0x082A1DFF, + 0x96821DFF, 0x197F19FF, 0x3B141FFF, 0x745217FF, 0x893F8DFF, 0x7E1A6CFF, 0x0B370BFF, 0x27450DFF, 0x071F24FF, 0x784573FF, + 0x8A653AFF, 0x732617FF, 0x319490FF, 0x56941DFF, 0x59163DFF, 0x1B8A2FFF, 0x38160BFF, 0x041804FF, 0x355D8EFF, 0x2E3F5BFF, + 0x561A28FF, 0x4E0E27FF, 0x706C67FF, 0x3B3E42FF, 0x2E2D33FF, 0x7B7E7DFF, 0x4A4442FF, 0x28344EFF +}; +``` + +## 注意事项 + +:::tip + +部分车辆仅支持修改主色,少数特殊车辆(如水泥车、快艇)支持四色但 SA-MP 只能修改其中两种 + +::: + +## 相关函数 + +- [GetVehicleColours](GetVehicleColours): 获取车辆颜色配置 +- [ChangeVehiclePaintjob](ChangeVehiclePaintjob): 修改车辆涂装样式 + +## 相关回调 + +- [OnVehicleRespray](../callbacks/OnVehicleRespray): 当车辆重新涂装时触发 + +## 扩展资源 + +- [车辆颜色 ID 对照表](../resources/vehiclecolorid) +- [原版车辆颜色配置](../resources/original-car-colors) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehiclePaintjob.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehiclePaintjob.md new file mode 100644 index 00000000000..ae823af395d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChangeVehiclePaintjob.md @@ -0,0 +1,54 @@ +--- +title: ChangeVehiclePaintjob +sidebar_label: ChangeVehiclePaintjob +description: 修改车辆的涂装样式 +tags: ["车辆"] +--- + +## 描述 + +修改车辆的涂装样式(纯色修改请参考[ChangeVehicleColor](ChangeVehicleColor)) + +| 参数名 | 说明 | +| --------- | ------------------------------------------------------------------------ | +| vehicleid | 目标车辆 ID | +| paintjob | 要应用的[涂装样式 ID](../resources/paintjobs)。使用 3 可移除当前涂装样式 | + +## 返回值 + +本函数始终返回 **true**(执行成功),即使指定车辆不存在 + +## 示例代码 + +```c +new rand = random(3); // 随机生成0、1或2(均为有效值) +new vehicleid = GetPlayerVehicleID(playerid); + +ChangeVehicleColor(vehicleid, 1, 1); // 确保车辆为白色以获得更好效果 +ChangeVehiclePaintjob(vehicleid, rand); // 将玩家当前车辆的涂装样式改为随机样式 +``` + +## 注意事项 + +:::warning + +若车辆颜色为黑色,涂装样式可能无法显示。建议应用涂装前先将车辆改为白色: + +```c +ChangeVehicleColor(vehicleid, 1, 1); +``` + +::: + +## 相关函数 + +- [GetVehiclePaintjob](GetVehiclePaintjob): 获取车辆当前涂装样式 ID +- [ChangeVehicleColor](ChangeVehicleColor): 设置车辆颜色 + +## 相关回调 + +- [OnVehiclePaintjob](../callbacks/OnVehiclePaintjob): 当车辆涂装样式改变时触发 + +## 扩展资源 + +- [车辆涂装样式 ID 对照表](../resources/paintjobs) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChatTextReplacementToggled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChatTextReplacementToggled.md new file mode 100644 index 00000000000..834545b830f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ChatTextReplacementToggled.md @@ -0,0 +1,28 @@ +--- +title: ChatTextReplacementToggled +sidebar_label: ChatTextReplacementToggled +description: 检查聊天输入过滤功能是否启用 +tags: [] +--- + + + +## 描述 + +检测当前聊天文本过滤功能是否处于激活状态 + +## 返回值 + +true: 过滤功能已启用 + +false: 过滤功能已禁用 + +## 示例代码 + +```c +printf("聊天输入过滤器状态:%s", ChatTextReplacementToggled() ? "启用" : "禁用"); +``` + +## 相关函数 + +- [ToggleChatTextReplacement](ToggleChatTextReplacement): 切换聊天文本过滤功能开关 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearActorAnimations.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearActorAnimations.md new file mode 100644 index 00000000000..21020a3cc9c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearActorAnimations.md @@ -0,0 +1,44 @@ +--- +title: ClearActorAnimations +sidebar_label: ClearActorAnimations +description: 清除角色当前应用的所有动画效果 +tags: ["角色"] +--- + + + +## 描述 + +终止指定角色当前正在播放的动画序列 + +| 参数名 | 说明 | +| ------- | ----------------------------------------------------- | +| actorid | 目标角色 ID(通过[CreateActor](CreateActor)函数创建) | + +## 返回值 + +**1** - 函数执行成功,动画已清除 + +**0** - 函数执行失败(指定角色不存在) + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + // 在武器店创建售货员角色 + gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); + // 应用付款动画 + ApplyActorAnimation(gMyActor, "DEALER", "shop_pay", 4.1, false, false, false, false, 0); + return 1; +} + +// 在其他代码段中终止动画 +ClearActorAnimations(gMyActor); +``` + +## 相关函数 + +- [ApplyActorAnimation](ApplyActorAnimation): 为角色应用动画 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearAnimations.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearAnimations.md new file mode 100644 index 00000000000..adccc137a92 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearAnimations.md @@ -0,0 +1,51 @@ +--- +title: ClearAnimations +sidebar_label: ClearAnimations +description: 清除指定玩家的所有动画效果(同时取消当前所有任务,如使用喷气背包、跳伞、进入车辆、驾驶(将玩家移出车辆)、游泳等) +tags: ["玩家", "动画"] +--- + +## 描述 + +终止指定玩家当前所有动画效果,并取消其正在进行的行为任务(包括但不限于喷气背包飞行、跳伞、进入车辆过程、驾驶状态(强制移出车辆)、游泳等) + +| 参数名 | 说明 | +| -------------------- | ------------------------------------------------------------------------------------ | +| playerid | 目标玩家 ID | +| FORCE_SYNC:forceSync | 设置为`SYNC_ALL`将强制玩家在流式传输范围内同步动画状态(默认=SYNC_NONE,不强制同步) | + +## 返回值 + +本函数始终返回 **true**,即使指定玩家未连接 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/清除动画", true)) + { + ClearAnimations(playerid); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +当在 ApplyAnimation 函数中使用'freeze'参数冻结动画时,ClearAnimations 在动画结束后不会生效 + +::: + +:::tip + +与其他移出车辆方式不同,本函数会将车辆速度立即归零。玩家将出现在车辆顶部,位置与其在座位上的坐标一致 + +::: + +## 相关函数 + +- [ApplyAnimation](ApplyAnimation): 为玩家应用动画效果 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearBanList.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearBanList.md new file mode 100644 index 00000000000..bed32d97788 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearBanList.md @@ -0,0 +1,55 @@ +--- +title: ClearBanList +sidebar_label: ClearBanList +description: 清空服务器封禁列表 +tags: [] +--- + + + +## 描述 + +清除服务器当前所有 IP 封禁记录 + +## 返回值 + +**true** - 操作执行成功 + +**false** - 操作执行失败 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/clearbanlist", true)) + { + if (!IsPlayerAdmin(playerid)) // 检查管理员权限 + { + return 1; + } + + ClearBanList(); + SendClientMessage(playerid, -1, "[服务器]: 封禁列表已清空"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +封禁记录可通过查看 **bans.json** 配置文件获取 + +::: + +## 相关函数 + +- [BlockIpAddress](BlockIpAddress): 临时封锁 IP 地址 +- [UnBlockIpAddress](UnBlockIpAddress): 解除 IP 封锁 +- [Ban](Ban): 封禁指定玩家 +- [BanEx](BanEx): 自定义理由封禁玩家 +- [Kick](Kick): 踢出玩家 +- [IsBanned](IsBanned): 检测 IP 是否被封禁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearPlayerWorldBounds.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearPlayerWorldBounds.md new file mode 100644 index 00000000000..f18b75297b5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ClearPlayerWorldBounds.md @@ -0,0 +1,51 @@ +--- +title: ClearPlayerWorldBounds +sidebar_label: ClearPlayerWorldBounds +description: 重置玩家的世界边界至默认状态 +tags: ["玩家"] +--- + + + +## 描述 + +将指定玩家的自定义世界边界恢复为系统默认设置 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要重置世界边界的玩家 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败 + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0); + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + ClearPlayerWorldBounds(playerid); + return 1; +} +``` + +## 注意事项 + +:::tip + +系统默认边界值为 20000.0000, -20000.0000, 20000.0000, -20000.0000。建议使用本函数进行重置以确保代码可读性 + +::: + +## 相关函数 + +- [SetPlayerWorldBounds](SetPlayerWorldBounds): 设置玩家活动范围边界(越界会被自动推回) +- [GetPlayerWorldBounds](GetPlayerWorldBounds): 获取玩家当前世界边界配置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ConnectNPC.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ConnectNPC.md new file mode 100644 index 00000000000..99772755c92 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ConnectNPC.md @@ -0,0 +1,45 @@ +--- +title: ConnectNPC +sidebar_label: ConnectNPC +description: 连接一个NPC到服务器 +tags: ["NPC"] +--- + +## 描述 + +在服务器中创建一个 NPC 角色 + +| 参数名 | 说明 | +| -------------- | ------------------------------------------------------------ | +| const name[] | NPC 连接时使用的名称,必须符合普通玩家命名规则 | +| const script[] | 位于 npcmodes 文件夹中的 NPC 脚本名称(无需添加.amx 扩展名) | + +## 返回值 + +本函数始终返回 1 + +## 示例代码 + +```c +public OnGameModeInit() +{ + ConnectNPC("[BOT]Pilot", "pilot"); // 连接名为[BOT]Pilot的NPC,使用pilot脚本 + return 1; +} +``` + +## 注意事项 + +:::tip + +NPC 默认没有名牌,可通过[Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer)函数添加自定义 3D 文本标签 + +::: + +## 相关函数 + +- [IsPlayerNPC](IsPlayerNPC): 检测玩家是否为 NPC 角色 + +## 相关回调 + +- [OnPlayerConnect](../callbacks/OnPlayerConnect): 当玩家连接服务器时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CountRunningTimers.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CountRunningTimers.md new file mode 100644 index 00000000000..e0c36a9ad4f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CountRunningTimers.md @@ -0,0 +1,28 @@ +--- +title: CountRunningTimers +sidebar_label: CountRunningTimers +description: 获取当前运行的定时器数量。 +tags: ["定时器"] +--- + + + +## 描述 + +获取通过[SetTimer](SetTimer)和[SetTimerEx](SetTimerEx)创建的正在运行的定时器数量。 + +## 返回值 + +返回当前运行的定时器数量。 + +## 应用示例 + +```c +printf("运行中的定时器数量: %d", CountRunningTimers()); +``` + +## 关联函数 + +- [SetTimer](SetTimer): 创建基础定时器 +- [SetTimerEx](SetTimerEx): 创建带参数的定时器 +- [KillTimer](KillTimer): 终止正在运行的定时器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Create3DTextLabel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Create3DTextLabel.md new file mode 100644 index 00000000000..233c6b0b563 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Create3DTextLabel.md @@ -0,0 +1,93 @@ +--- +title: Create3DTextLabel +sidebar_label: Create3DTextLabel +description: 在游戏世界中指定坐标位置创建3D文本标签。 +tags: ["3D文本标签"] +--- + +## 描述 + +在三维空间中创建带有文字内容的可视化标签。 + +| 参数名 | 说明 | +| ------------------ | --------------------------------------------------------- | +| const text[] | 初始显示的文本字符串 | +| colour | 颜色值(使用整数或 RGBA 十六进制格式) | +| Float:x | X 轴坐标 | +| Float:y | Y 轴坐标 | +| Float:z | Z 轴坐标 | +| Float:drawDistance | 可视距离(单位:游戏单位) | +| virtualWorld | 所属虚拟世界 ID | +| bool:testLOS | 是否启用视线检测(true=穿透物体不可见,false=可穿透显示) | +| OPEN_MP_TAGS:... | 扩展参数(支持任意类型参数) | + +## 返回值 + +成功返回新建 3D 文本标签的 ID,当达到全局 3D 文本标签数量上限(MAX_3DTEXT_GLOBAL)时返回 INVALID_3DTEXT_ID。 + +## 应用示例 + +```c +public OnGameModeInit() +{ + // 在坐标(30.0,40.0,50.0)处创建蓝绿色提示标签 + Create3DTextLabel("当前位置坐标:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/mark", true)) + { + new name[MAX_PLAYER_NAME]; + new Float:x, Float:y, Float:z; + new worldid; + + GetPlayerName(playerid, name, sizeof(name)); + GetPlayerPos(playerid, x, y, z); + worldid = GetPlayerVirtualWorld(playerid); + + // 在玩家当前位置创建红色标记标签 + Create3DTextLabel("%s 标记了这个位置", 0xFF0000FF, x, y, z, 15.0, worldid, false, name); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +- 在观察模式下有效显示距离会明显缩小 +- 使用~r~~g~等颜色代码实现多色文本效果 + +::: + +:::warning + +- 空文本内容可能导致客户端崩溃(open.mp 版本已修复此问题) +- virtualworld 参数设置为-1 时标签不可见 + +::: + +## 关联函数 + +- [Delete3DTextLabel](Delete3DTextLabel): 删除 3D 文本标签 +- [IsValid3DTextLabel](IsValid3DTextLabel): 验证标签有效性 +- [Is3DTextLabelStreamedIn](Is3DTextLabelStreamedIn): 检测标签是否流加载 +- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): 绑定标签到玩家实体 +- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): 绑定标签到车辆实体 +- [Update3DTextLabelText](Update3DTextLabelText): 更新标签文本内容 +- [Get3DTextLabelText](Get3DTextLabelText): 获取标签文本内容 +- [Get3DTextLabelColour](Get3DTextLabelColour): 获取标签颜色值 +- [Get3DTextLabelPos](Get3DTextLabelPos): 获取标签空间坐标 +- [Get3DTextLabelDrawDistance](Get3DTextLabelDrawDistance): 获取可视距离参数 +- [Set3DTextLabelDrawDistance](Set3DTextLabelDrawDistance): 设置可视距离参数 +- [Get3DTextLabelVirtualWorld](Get3DTextLabelVirtualWorld): 获取所属虚拟世界 +- [Set3DTextLabelVirtualWorld](Set3DTextLabelVirtualWorld): 设置所属虚拟世界 +- [Get3DTextLabelLOS](Get3DTextLabelLOS): 获取视线检测状态 +- [Set3DTextLabelLOS](Set3DTextLabelLOS): 设置视线检测状态 +- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): 创建玩家私有标签 +- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): 删除玩家私有标签 +- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): 更新私有标签文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateActor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateActor.md new file mode 100644 index 00000000000..2264bf564df --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateActor.md @@ -0,0 +1,89 @@ +--- +title: CreateActor +sidebar_label: CreateActor +description: 在游戏世界中创建静态角色实体。 +tags: ["角色"] +--- + + + +## 描述 + +创建具有基础功能的静态角色实体。该实体类似 NPC 但功能受限,不会占用服务器玩家槽位。 + +| 参数名 | 说明 | +| ----------- | ------------------------------------------- | +| skin | 角色使用的[皮肤模型 ID](../resources/skins) | +| Float:x | 生成坐标 X 轴值 | +| Float:y | 生成坐标 Y 轴值 | +| Float:z | 生成坐标 Z 轴值 | +| Float:angle | 角色初始朝向角度(单位:度) | + +## 返回值 + +成功返回角色 ID(从 0 开始计数),当达到角色数量上限(1000)时返回 INVALID_ACTOR_ID(65535)。 + +## 应用示例 + +```c +new gActorCJ; + +public OnGameModeInit() +{ + // 在蓝莓镇(地图中心)创建CJ角色 + gActorCJ = CreateActor(0, 0.0, 0.0, 3.0, 0.0); +} + +public OnGameModeExit() +{ + // 销毁已创建的角色 + DestroyActor(gActorCJ); +} +``` + +## 注意事项 + +:::tip + +角色实体适用于静态场景元素(如收银员、酒保),可通过[ApplyActorAnimation](ApplyActorAnimation)执行单次或循环动画 + +::: + +:::warning + +- 角色系统独立于 NPC 系统,不占用玩家槽位且操作方式不同(最大数量 1000) +- 角色会被车辆推动,建议使用定时器重置位置 +- 默认处于无敌状态 + +::: + +## 关联函数 + +- [DestroyActor](DestroyActor): 销毁角色实体 +- [SetActorPos](SetActorPos): 设置角色坐标 +- [GetActorPos](GetActorPos): 获取角色坐标 +- [GetActorSpawnInfo](GetActorSpawnInfo): 获取初始生成信息 +- [SetActorFacingAngle](SetActorFacingAngle): 设置角色朝向角度 +- [GetActorFacingAngle](GetActorFacingAngle): 获取当前朝向角度 +- [SetActorVirtualWorld](SetActorVirtualWorld): 设置所属虚拟世界 +- [GetActorVirtualWorld](GetActorVirtualWorld): 获取所属虚拟世界 +- [ApplyActorAnimation](ApplyActorAnimation): 应用角色动画 +- [ClearActorAnimations](ClearActorAnimations): 清除所有动画 +- [GetActorAnimation](GetActorAnimation): 获取当前播放动画 +- [GetPlayerCameraTargetActor](GetPlayerCameraTargetActor): 检测玩家视角对准的角色 +- [IsActorStreamedIn](IsActorStreamedIn): 检测是否流加载 +- [SetActorSkin](SetActorSkin): 更换角色皮肤 +- [GetActorSkin](GetActorSkin): 获取当前皮肤 +- [SetActorHealth](SetActorHealth): 设置生命值 +- [GetActorHealth](GetActorHealth): 获取生命值 +- [SetActorInvulnerable](SetActorInvulnerable): 设置无敌状态 +- [IsActorInvulnerable](IsActorInvulnerable): 检测无敌状态 +- [IsValidActor](IsValidActor): 验证 ID 有效性 +- [GetActorPoolSize](GetActorPoolSize): 获取最大有效 ID +- [GetPlayerTargetActor](GetPlayerTargetActor): 获取玩家瞄准的角色 + +## 关联回调 + +- [OnActorStreamIn](../callbacks/OnActorStreamIn): 角色流加载时触发 +- [OnActorStreamOut](../callbacks/OnActorStreamOut): 角色流卸载时触发 +- [OnPlayerGiveDamageActor](../callbacks/OnPlayerGiveDamageActor): 玩家攻击角色时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosion.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosion.md new file mode 100644 index 00000000000..68ab362ade2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosion.md @@ -0,0 +1,54 @@ +--- +title: CreateExplosion +sidebar_label: CreateExplosion +description: 在指定坐标位置创建爆炸效果。 +tags: [] +--- + +## 描述 + +在三维空间指定坐标生成爆炸特效。 + +| 参数名 | 说明 | +| ------------ | ------------------------------------------ | +| Float:x | 爆炸效果的 X 轴坐标 | +| Float:y | 爆炸效果的 Y 轴坐标 | +| Float:z | 爆炸效果的 Z 轴坐标 | +| type | 爆炸[类型编号](../resources/explosionlist) | +| Float:radius | 爆炸影响半径(单位:游戏单位) | + +## 返回值 + +本函数始终返回 1,即使爆炸类型或半径参数值无效。 + +## 应用示例 + +```c +public OnPlayerEnterCheckpoint(playerid) +{ + // 获取玩家当前位置坐标 + new Float:x, Float:y, Float:z; + GetPlayerPos(playerid, x, y, z); + + // 在玩家位置创建中型爆炸 + CreateExplosion(x, y, z, 12, 10.0); + + return 1; +} +``` + +## 注意事项 + +:::tip + +单个玩家同时可见的爆炸效果存在数量限制(约 10 个) + +::: + +## 关联函数 + +- [CreateExplosionForPlayer](CreateExplosionForPlayer): 为指定玩家单独创建爆炸效果 + +## 扩展阅读 + +- [爆炸类型列表](../resources/explosionlist): 所有可用爆炸效果类型对照表 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosionForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosionForPlayer.md new file mode 100644 index 00000000000..82c9016fc95 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateExplosionForPlayer.md @@ -0,0 +1,55 @@ +--- +title: CreateExplosionForPlayer +sidebar_label: CreateExplosionForPlayer +description: 为指定玩家创建仅其可见的爆炸效果。 +tags: ["玩家"] +--- + +## 描述 + +创建仅对特定玩家可见的爆炸特效。适用于隔离爆炸效果或指定虚拟世界显示。 + +| 参数名 | 说明 | +| ------------ | ------------------------------------------ | +| playerid | 目标玩家 ID | +| Float:x | 爆炸 X 轴坐标 | +| Float:y | 爆炸 Y 轴坐标 | +| Float:z | 爆炸 Z 轴坐标 | +| type | 爆炸[类型编号](../resources/explosionlist) | +| Float:radius | 爆炸影响半径(单位:游戏单位) | + +## 返回值 + +始终返回 1(即使玩家不存在/参数无效时仍返回成功状态)。 + +## 应用示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/burnme", true) == 0) + { + new Float:x, Float:y, Float:z; + GetPlayerPos(playerid, x, y, z); + CreateExplosionForPlayer(playerid, x, y, z, 1, 10.0); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +单个玩家同时可见的爆炸效果存在数量限制(约 10 个) + +::: + +## 关联函数 + +- [CreateExplosion](CreateExplosion): 创建全局可见的爆炸效果 + +## 扩展阅读 + +- [爆炸类型列表](../resources/explosionlist): 所有可用爆炸效果类型对照表 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateMenu.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateMenu.md new file mode 100644 index 00000000000..d1d20174fc7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateMenu.md @@ -0,0 +1,67 @@ +--- +title: CreateMenu +sidebar_label: CreateMenu +description: 创建可交互的菜单界面。 +tags: ["菜单"] +--- + +## 描述 + +创建基础菜单容器,用于构建玩家交互界面。 + +| 参数名 | 说明 | +| ------------------ | --------------------------------------------- | +| const title[] | 菜单标题(最大 31 字符,超长自动截断) | +| columns | 列数(仅支持 0 和 1 两列) | +| Float:x | X 轴位置(基于 640x460 画布坐标系,0=最左侧) | +| Float:y | Y 轴位置(基于 640x460 画布坐标系,0=最顶部) | +| Float:column1width | 首列宽度 | +| Float:column2width | 次列宽度 | +| OPEN_MP_TAGS:... | 扩展参数(支持任意类型参数) | + +## 返回值 + +成功返回菜单 ID,创建失败返回-1。 + +## 应用示例 + +```c +new Menu:exampleMenu; + +public OnGameModeInit() +{ + // 创建双列菜单(位置200,100 列宽150) + exampleMenu = CreateMenu("示例菜单", 2, 200.0, 100.0, 150.0, 150.0); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 本函数仅创建菜单容器,需调用[ShowMenuForPlayer](ShowMenuForPlayer)显示 +- 实际仅支持 0 和 1 两列配置 +- 标题超过 32 字符将自动截断为 30 字符 + +::: + +:::warning + +- 单个菜单最多容纳 12 个选项项 +- 服务器最多同时存在 128 个菜单 + +::: + +## 关联函数 + +- [AddMenuItem](AddMenuItem): 添加菜单选项项 +- [SetMenuColumnHeader](SetMenuColumnHeader): 设置列标题 +- [DestroyMenu](DestroyMenu): 销毁菜单实例 +- [ShowMenuForPlayer](ShowMenuForPlayer): 向玩家展示菜单 +- [HideMenuForPlayer](HideMenuForPlayer): 隐藏玩家可见菜单 + +## 关联回调 + +- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): 玩家选择菜单项时触发 +- [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu): 玩家退出菜单时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md new file mode 100644 index 00000000000..b667574b6fe --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md @@ -0,0 +1,68 @@ +--- +title: CreateObject +sidebar_label: CreateObject +description: 在游戏世界指定坐标处创建物体。 +tags: ["物体"] +--- + +## 描述 + +在三维空间指定位置生成静态/动态物体模型。 + +| 参数名 | 说明 | +| ------------------ | -------------------------------------------- | +| modelid | 模型 ID | +| Float:x | X 轴坐标 | +| Float:y | Y 轴坐标 | +| Float:z | Z 轴坐标 | +| Float:rotationX | X 轴旋转角度 | +| Float:rotationY | Y 轴旋转角度 | +| Float:rotationZ | Z 轴旋转角度 | +| Float:drawDistance | (可选参数)自定义渲染距离(0.0=使用默认值) | + +## 应用示例 + +```c +public OnGameModeInit() +{ + // 默认渲染距离的物体 + CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + // 自定义300单位渲染距离的物体 + CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0, 300.0); + return 1; +} +``` + +## 注意事项 + +:::tip + +全局物体数量上限为 1000(MAX_OBJECTS),建议使用[流加载插件](https://github.com/samp-incognito/samp-streamer-plugin)突破限制 + +::: + +## 关联函数 + +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 绑定物体到玩家 +- [SetObjectMaterialText](SetObjectMaterialText): 设置物体材质文字 +- [SetObjectMaterial](SetObjectMaterial): 替换物体材质 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家私有物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁私有物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证私有物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动私有物体 +- [StopPlayerObject](StopPlayerObject): 停止私有物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置私有物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置私有物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取私有物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取私有物体旋转 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 绑定私有物体到玩家 +- [SetPlayerObjectMaterialText](SetPlayerObjectMaterialText): 设置私有物体材质文字 +- [SetPlayerObjectMaterial](SetPlayerObjectMaterial): 替换私有物体材质 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePickup.md new file mode 100644 index 00000000000..0b0a2d3b9e5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePickup.md @@ -0,0 +1,92 @@ +--- +title: CreatePickup +sidebar_label: CreatePickup +description: 创建可追踪的拾取物,功能类似AddStaticPickup但支持后续销毁和拾取检测。 +tags: ["拾取物"] +--- + +## 描述 + +本函数功能与 AddStaticPickup 相同,但会返回可用于后续销毁操作的拾取物 ID,并能通过 OnPlayerPickUpPickup 回调追踪拾取事件。 + +| 参数名 | 说明 | +| -------------------------------- | ------------------------------------------ | +| [model](../resources/pickupids) | 拾取物[模型 ID](../resources/pickupids) | +| [type](../resources/pickuptypes) | 拾取物[行为类型](../resources/pickuptypes) | +| Float:x | X 轴坐标 | +| Float:y | Y 轴坐标 | +| Float:z | Z 轴坐标 | +| virtualWorld | 所属虚拟世界 ID(-1 表示全可见) | + +## 返回值 + +成功返回拾取物 ID,达到数量上限时返回-1。 + +## 应用示例 + +```c +new pickup_Armour; // 创建变量存储拾取物ID + +public OnGameModeInit() +{ + // 在坐标(1503.3359,1432.3585,10.1191)创建护甲拾取物 + pickup_Armour = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1); + return 1; +} + +// 后续操作示例 +DestroyPickup(pickup_Armour); // 使用ID销毁拾取物 +pickup_Armour = 0; // 重置变量避免冲突 +``` + +## 注意事项 + +:::tip + +- 仅类型 14 的拾取物支持车辆内拾取(特殊类型如贿赂物品例外) +- 所有玩家可见且可拾取 +- 使用 DestroyPickup 时可能出现多人同时拾取(需通过变量控制) +- 特定模型会触发自动响应(如 M4 模型自动给予武器) +- 完全脚本控制的拾取物建议使用类型 1 + +::: + +:::warning + +已知问题: + +- 当 X/Y 坐标超出 ±4096 范围时,拾取物不可见且不会触发拾取回调 + +::: + +## 关联函数 + +- [AddStaticPickup](AddStaticPickup): 创建静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测流加载状态 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测玩家可见性 +- [SetPickupPos](SetPickupPos): 设置坐标 +- [GetPickupPos](GetPickupPos): 获取坐标 +- [SetPickupModel](SetPickupModel): 更换模型 +- [GetPickupModel](GetPickupModel): 获取当前模型 +- [SetPickupType](SetPickupType): 修改行为类型 +- [GetPickupType](GetPickupType): 获取当前类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取虚拟世界 +- [ShowPickupForPlayer](ShowPickupForPlayer): 对玩家显示 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏 +- [SetPickupForPlayer](SetPickupForPlayer): 自定义玩家专属属性 +- [CreatePlayerPickup](CreatePlayerPickup): 创建玩家私有拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁私有拾取物 + +## 关联回调 + +- [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup): 玩家拾取时触发 +- [OnPickupStreamIn](../callbacks/OnPickupStreamIn): 流加载时触发 +- [OnPickupStreamOut](../callbacks/OnPickupStreamOut): 流卸载时触发 + +## 扩展阅读 + +- [拾取物模型列表](../resources/pickupids) +- [拾取物类型说明](../resources/pickuptypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayer3DTextLabel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayer3DTextLabel.md new file mode 100644 index 00000000000..b14dd759565 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayer3DTextLabel.md @@ -0,0 +1,83 @@ +--- +title: CreatePlayer3DTextLabel +sidebar_label: CreatePlayer3DTextLabel +description: 为指定玩家创建专属的3D文本标签。 +tags: ["玩家", "3D文本标签"] +--- + +## 描述 + +创建仅对特定玩家可见的 3D 文本标签,支持实体绑定和视线检测功能。 + +| 参数名 | 说明 | +| ------------------ | ----------------------------------------------------- | +| playerid | 可见该标签的目标玩家 ID | +| const text[] | 显示文本内容(支持格式符) | +| colour | 颜色值(使用整数或 RGBA 十六进制格式) | +| Float:x | X 轴坐标(若绑定实体则为偏移量) | +| Float:y | Y 轴坐标(若绑定实体则为偏移量) | +| Float:z | Z 轴坐标(若绑定实体则为偏移量) | +| Float:drawDistance | 可视距离(单位:游戏单位) | +| attachedplayer | 绑定玩家实体 ID(不绑定填 INVALID_PLAYER_ID) | +| attachedvehicle | 绑定车辆实体 ID(不绑定填 INVALID_VEHICLE_ID) | +| bool:testLOS | 视线检测开关(true=穿透物体不可见,false=可穿透显示) | +| OPEN_MP_TAGS:... | 扩展参数(支持任意类型参数) | + +## 返回值 + +成功返回私有 3D 文本标签 ID,达到玩家标签上限(MAX_3DTEXT_PLAYER)时返回 INVALID_3DTEXT_ID。 + +## 应用示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/playerlabel", true)) + { + new + PlayerText3D:playerTextId, + name[MAX_PLAYER_NAME], + Float:x, Float:y, Float:z, + string[64]; + + GetPlayerName(playerid, name, sizeof(name)); + GetPlayerPos(playerid, x, y, z); + + // 创建带玩家名的动态标签 + format(string, sizeof(string), "你好 %s!\n我在你的当前位置", name); + playerTextId = CreatePlayer3DTextLabel(playerid, string, 0x008080FF, x, y, z, 40.0); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +观察模式下有效显示距离会显著缩短 + +::: + +:::warning + +空文本可能导致客户端崩溃(open.mp 版本已修复此问题) + +::: + +## 关联函数 + +- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): 删除私有标签 +- [IsValidPlayer3DTextLabel](IsValidPlayer3DTextLabel): 验证有效性 +- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): 更新标签文本 +- [GetPlayer3DTextLabelText](GetPlayer3DTextLabelText): 获取当前文本 +- [GetPlayer3DTextLabelColour](GetPlayer3DTextLabelColour): 获取颜色值 +- [GetPlayer3DTextLabelPos](GetPlayer3DTextLabelPos): 获取坐标位置 +- [GetPlayer3DTextLabelDrawDistance](GetPlayer3DTextLabelDrawDistance): 获取可视距离 +- [SetPlayer3DTextLabelDrawDistance](SetPlayer3DTextLabelDrawDistance): 设置可视距离 +- [GetPlayer3DTextLabelVirtualWorld](GetPlayer3DTextLabelVirtualWorld): 获取虚拟世界 +- [SetPlayer3DTextLabelVirtualWorld](SetPlayer3DTextLabelVirtualWorld): 设置虚拟世界 +- [GetPlayer3DTextLabelLOS](GetPlayer3DTextLabelLOS): 获取视线检测状态 +- [SetPlayer3DTextLabelLOS](SetPlayer3DTextLabelLOS): 设置视线检测状态 +- [Create3DTextLabel](Create3DTextLabel): 创建全局可见标签 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerGangZone.md new file mode 100644 index 00000000000..10cdf59a85a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerGangZone.md @@ -0,0 +1,85 @@ +--- +title: CreatePlayerGangZone +sidebar_label: CreatePlayerGangZone +description: 创建玩家专属帮派区域 +tags: ["玩家", "帮派区域", "玩家帮派区域"] +--- + + + +## 描述 + +创建玩家独立可见的帮派区域,用于突破全局帮派区域的数量限制。 + +| 参数名 | 说明 | +| ---------- | ----------------------------------- | +| playerid | 目标玩家 ID | +| Float:minX | 区域西侧边界 X 坐标(最小水平坐标) | +| Float:minY | 区域南侧边界 Y 坐标(最小垂直坐标) | +| Float:maxX | 区域东侧边界 X 坐标(最大水平坐标) | +| Float:maxY | 区域北侧边界 Y 坐标(最大垂直坐标) | + +## 返回值 + +成功返回帮派区域 ID,创建失败返回-1。 + +## 应用示例 + +```c +// 使用变量存储玩家帮派区域ID +new gGangZoneID[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建矩形帮派区域(坐标范围2236.1475,2424.7266至2319.1636,2502.4348) + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); +} +``` + +``` + MaxY + ↓ + -------------* < MaxX + | | + | 帮派区域 | + | 中心点 | + | | + MinX > *------------- + ↑ + MinY +``` + +## 注意事项 + +:::warning + +- 单个玩家最大支持 1024 个帮派区域 +- 参数顺序错误会导致区域显示异常 + +::: + +:::tip + +本函数仅创建区域,需调用[PlayerGangZoneShow](PlayerGangZoneShow)显示可视化效果 + +::: + +## 关联函数 + +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁玩家帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示指定颜色的帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动区域闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止区域闪烁 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取区域颜色值 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围 +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 + +## 辅助工具 + +- [Prineside 帮派区域编辑器](https://dev.prineside.com/en/gtasa_gangzone_editor/) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerObject.md new file mode 100644 index 00000000000..a30c6473b7b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerObject.md @@ -0,0 +1,69 @@ +--- +title: CreatePlayerObject +sidebar_label: CreatePlayerObject +description: 创建一个仅对单个玩家可见的物体。 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +创建一个仅对单个玩家可见的物体。 + +| 参数名 | 说明 | +| ------------------ | -------------------------------------------------------------------------------------- | +| playerid | 要为其创建物体的玩家 ID | +| modelid | 要创建的模型 ID | +| Float:x | 物体创建的 X 坐标 | +| Float:y | 物体创建的 Y 坐标 | +| Float:z | 物体创建的 Z 坐标 | +| Float:rotationX | 物体的 X 轴旋转角度 | +| Float:rotationY | 物体的 Y 轴旋转角度 | +| Float:rotationZ | 物体的 Z 轴旋转角度 | +| Float:drawDistance | 物体对玩家可见的渲染距离。0.0 将使物体在其默认距离渲染。省略此参数将使用默认渲染距离。 | + +## 返回值 + +返回创建物体的 ID,若达到物体数量上限(MAX_OBJECTS)则返回 INVALID_OBJECT_ID。 + +## 示例 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + // 或者使用DrawDistance参数使其在尽可能远的距离可见: + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0, 300.0); + return 1; +} + +public OnPlayerDisconnect(playerid, reason) +{ + DestroyPlayerObject(playerid, gPlayerObject[playerid]); + return 1; +} +``` + +## 相关函数 + +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体是否有效 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体位置 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家身上 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体是否有效 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体位置 +- [SetObjectRot](SetObjectRot): 设置物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取物体位置 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家身上 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerPickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerPickup.md new file mode 100644 index 00000000000..84d0739ea32 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerPickup.md @@ -0,0 +1,87 @@ +--- +title: CreatePlayerPickup +sidebar_label: CreatePlayerPickup +description: 创建一个仅对单个玩家可见的拾取物。 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +创建一个仅对单个玩家可见的拾取物。 + +| 参数名 | 说明 | +| -------------------------------- | ------------------------------------------------------ | +| playerid | 要为其创建拾取物的玩家 ID | +| [model](../resources/pickupids) | 拾取物的模型 ID | +| [type](../resources/pickuptypes) | 拾取物类型。决定拾取物被拾取时的响应方式 | +| Float:x | 拾取物创建的 X 坐标 | +| Float:y | 拾取物创建的 Y 坐标 | +| Float:z | 拾取物创建的 Z 坐标 | +| virtualWorld | 拾取物所在的虚拟世界 ID。使用-1 表示在所有虚拟世界可见 | + +## 返回值 + +返回创建的玩家拾取物 ID,失败时返回 **-1**(达到拾取物数量上限)。 + +## 示例 + +```c +new PlayerPickupArmour[MAX_PLAYERS]; // 创建用于存储玩家拾取物ID的变量 + +public OnPlayerConnect(playerid) +{ + PlayerPickupArmour[playerid] = CreatePlayerPickup(playerid, 1242, 2, 2010.0979, 1222.0642, 10.8206, -1); + // 创建护甲拾取物并将ID存储在'PlayerPickupArmour[playerid]'中 + return 1; +} +``` + +## 注意事项 + +:::tip + +- 唯一可以在车辆内拾取的类型是 14(特殊拾取物如贿赂物品除外) +- 拾取物对所有玩家可见,并且所有玩家都可以拾取 +- 如果在拾取时使用 DestroyPlayerPickup(),由于网络延迟可能导致多个玩家同时拾取。可通过变量机制规避此问题 +- 某些拾取类型自带「自动响应」机制,例如使用 M4 模型会自动给予玩家该武器和弹药 +- 需要完全脚本控制的拾取物应使用类型 1 + +::: + +:::warning + +已知缺陷: + +- 当 X 或 Y 坐标小于-4096.0 或大于 4096.0 时,拾取物将不可见且不会触发 OnPlayerPickUpPlayerPickup 回调 + +::: + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建仅对单个玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家拾取物是否有效 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检查玩家拾取物是否已流加载给玩家 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家拾取物坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家拾取物坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家拾取物模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家拾取物模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家拾取物类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家拾取物类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家拾取物虚拟世界 +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家拾取物虚拟世界 ID + +## 相关回调 + +以下回调函数可能与此函数相关: + +- [OnPlayerPickUpPlayerPickup](../callbacks/OnPlayerPickUpPlayerPickup): 当玩家拾取玩家拾取物时触发 +- [OnPlayerPickupStreamIn](../callbacks/OnPlayerPickupStreamIn): 当玩家拾取物进入玩家可视范围时触发 +- [OnPlayerPickupStreamOut](../callbacks/OnPlayerPickupStreamOut): 当玩家拾取物离开玩家可视范围时触发 + +## 相关资源 + +- [拾取物 ID 列表](../resources/pickupids) +- [拾取物类型列表](../resources/pickuptypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md new file mode 100644 index 00000000000..ae03a1f6793 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md @@ -0,0 +1,101 @@ +--- +title: CreatePlayerTextDraw +sidebar_label: CreatePlayerTextDraw +description: 为单个玩家创建文本绘图,用于规避全局文本绘图数量限制。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +为单个玩家创建文本绘图,用于规避全局文本绘图数量限制。 + +| 参数名 | 说明 | +| ---------------- | --------------------------- | +| playerid | 要为其创建文本绘图的玩家 ID | +| Float:x | X 轴坐标 | +| Float:y | Y 轴坐标 | +| const format[] | 文本绘图中的格式化文本内容 | +| OPEN_MP_TAGS:... | 不定数量的任意类型参数 | + +## 返回值 + +返回创建的文本绘图的 ID + +## 示例 + +```c +// 此变量用于存储文本绘图的ID以便脚本全局调用 +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 首先创建文本绘图 + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的OPEN.MP服务器"); + + // 立即显示文本绘图 + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 玩家文本绘图会在玩家断开连接时自动销毁 + +::: + +:::warning + +已知限制: + +- 键盘按键映射代码(如 ~k~~VEHICLE_ENTER_EXIT~)在超过 255 个字符后将失效 + +::: + +## 相关函数 + +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图的方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图的对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图的方框尺寸(或可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用玩家文本绘图的比例间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 更新玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检测玩家文本绘图是否可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 验证玩家文本绘图是否有效 +- [PlayerTextDrawBackgroundColour](PlayerTextDrawBackgroundColour): 调整玩家文本绘图的背景色彩 +- [PlayerTextDrawBoxColour](PlayerTextDrawBoxColour): 设置玩家文本绘图的方框色彩 +- [PlayerTextDrawColour](PlayerTextDrawColour): 设置玩家文本绘图的文本色彩 +- [PlayerTextDrawGetAlignment](PlayerTextDrawGetAlignment): 获取玩家文本绘图的对齐方式 +- [PlayerTextDrawGetBackgroundColour](PlayerTextDrawGetBackgroundColour): 获取玩家文本绘图的背景色彩 +- [PlayerTextDrawGetBoxColour](PlayerTextDrawGetBoxColour): 获取玩家文本绘图的方框色彩 +- [PlayerTextDrawGetColour](PlayerTextDrawGetColour): 获取玩家文本绘图的文本色彩 +- [PlayerTextDrawGetFont](PlayerTextDrawGetFont): 获取玩家文本绘图的字体样式 +- [PlayerTextDrawGetLetterSize](PlayerTextDrawGetLetterSize): 获取玩家文本绘图的字符尺寸 +- [PlayerTextDrawGetOutline](PlayerTextDrawGetOutline): 获取玩家文本绘图的轮廓尺寸 +- [PlayerTextDrawGetPos](PlayerTextDrawGetPos): 获取玩家文本绘图的坐标位置 +- [PlayerTextDrawGetPreviewModel](PlayerTextDrawGetPreviewModel): 获取 3D 预览玩家文本绘图的模型 ID +- [PlayerTextDrawGetPreviewRot](PlayerTextDrawGetPreviewRot): 获取 3D 模型预览玩家文本绘图的旋转角度 +- [PlayerTextDrawGetPreviewVehicleColours](PlayerTextDrawGetPreviewVehicleColours): 获取 3D 预览玩家文本绘图的车辆颜色 +- [PlayerTextDrawGetShadow](PlayerTextDrawGetShadow): 获取玩家文本绘图的阴影尺寸 +- [PlayerTextDrawGetString](PlayerTextDrawGetString): 获取玩家文本绘图的文本内容 +- [PlayerTextDrawGetTextSize](PlayerTextDrawGetTextSize): 获取玩家文本绘图的文本尺寸 +- [PlayerTextDrawIsBox](PlayerTextDrawIsBox): 检测玩家文本绘图是否包含方框 +- [PlayerTextDrawIsProportional](PlayerTextDrawIsProportional): 检测玩家文本绘图是否启用比例间距 +- [PlayerTextDrawIsSelectable](PlayerTextDrawIsSelectable): 检测玩家文本绘图是否可交互 +- [PlayerTextDrawSetPos](PlayerTextDrawSetPos): 设置玩家文本绘图的位置坐标 +- [PlayerTextDrawSetPreviewVehicleColours](PlayerTextDrawSetPreviewVehicleColours): 设置玩家文本绘图车辆模型预览的颜色 + +## 相关资源 + +- [文本绘图精灵列表](../resources/textdrawsprites) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateVehicle.md new file mode 100644 index 00000000000..703451b898d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CreateVehicle.md @@ -0,0 +1,72 @@ +--- +title: CreateVehicle +sidebar_label: CreateVehicle +description: 在游戏世界中创建车辆。 +tags: ["车辆"] +--- + +## 描述 + +在游戏世界中动态创建车辆,可在脚本任意时刻替代 AddStaticVehicleEx 使用。 + +| 参数名 | 说明 | +| -------------------------------------- | --------------------------------------------------- | +| [modelid](../resources/vehicleid) | 车辆模型 ID | +| Float:spawnX | 车辆生成的 X 轴坐标 | +| Float:spawnY | 车辆生成的 Y 轴坐标 | +| Float:spawnZ | 车辆生成的 Z 轴坐标 | +| Float:angle | 车辆初始朝向角度 | +| [colour1](../resources/vehiclecolorid) | 主颜色 ID | +| [colour2](../resources/vehiclecolorid) | 副颜色 ID | +| respawnDelay | 无驾驶员时车辆重生延迟(秒)。使用-1 将禁用自动重生 | +| bool:addSiren | 默认值'false'。为车辆启用警笛功能(需车辆自带喇叭) | + +## 返回值 + +返回创建的车辆 ID(范围 1 至 MAX_VEHICLES)。 + +若达到车辆数量上限或模型 ID 无效,返回 INVALID_VEHICLE_ID (65535)。 + +若使用火车模型 ID(538 或 537),返回 0(不可用)。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 在游戏中添加一架九头蛇直升机(520),重生时间为60秒 + CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, -1, -1, 60); + return 1; +} +``` + +## 注意事项 + +:::warning + +火车车辆仅能通过[AddStaticVehicle](AddStaticVehicle)和[AddStaticVehicleEx](AddStaticVehicleEx)添加 + +::: + +## 相关函数 + +- [DestroyVehicle](DestroyVehicle): 销毁车辆 +- [AddStaticVehicle](AddStaticVehicle): 添加静态车辆 +- [AddStaticVehicleEx](AddStaticVehicleEx): 添加带自定义重生时间的静态车辆 +- [GetVehicleParamsSirenState](GetVehicleParamsSirenState): 检测车辆警笛状态 +- [SetVehicleSpawnInfo](SetVehicleSpawnInfo): 配置车辆生成参数 +- [GetVehicleSpawnInfo](GetVehicleSpawnInfo): 获取车辆生成信息 +- [ChangeVehicleColours](ChangeVehicleColours): 修改车辆颜色配置 +- [GetVehicleColours](GetVehicleColours): 获取车辆颜色配置 +- [SetVehicleRespawnDelay](SetVehicleRespawnDelay): 设置车辆重生延迟 +- [GetVehicleRespawnDelay](GetVehicleRespawnDelay): 获取车辆重生延迟 + +## 相关回调 + +- [OnVehicleSpawn](../callbacks/OnVehicleSpawn): 车辆重生时触发 +- [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): 警笛状态变化时触发 + +## 相关资源 + +- [车辆模型列表](../resources/vehicleid): 游戏中所有可用车辆模型的完整清单 +- [车辆颜色 ID 列表](../resources/vehiclecolorid): 所有车辆颜色 ID 对照表 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_ExecuteQuery.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_ExecuteQuery.md new file mode 100644 index 00000000000..56f0df8c348 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_ExecuteQuery.md @@ -0,0 +1,119 @@ +--- +title: DB_ExecuteQuery +sidebar_label: DB_ExecuteQuery +description: 该函数用于在已打开的SQLite数据库上执行SQL查询语句。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于在已打开的 SQLite 数据库上执行 SQL 查询语句。 + +| 参数名 | 说明 | +| ---------------- | -------------------------- | +| DB:db | 要执行查询的数据库连接句柄 | +| const query[] | 需要执行的 SQL 查询语句 | +| OPEN_MP_TAGS:... | 不定数量的任意类型参数 | + +## 返回值 + +执行成功时返回查询结果索引(从 1 开始),失败返回 0。 + +## 示例 + +```c +// 实体存储模块 + +EntityStorage_SpawnAll(DB:connectionHandle) +{ + // 从"entities"表中选择所有条目 + new DBResult:db_result_set = DB_ExecuteQuery(connectionHandle, "SELECT * FROM `entities`"); + + // 验证数据库结果集句柄有效性 + if (db_result_set) + { + // 执行相关操作... + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } +} +``` + +```c +// 游戏模式主文件 + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 创建数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + // 验证数据库连接状态 + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + EntityStorage_SpawnAll(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + // ... + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + // 清理句柄 + gDBConnectionHandle = DB:0; + } + + // ... + + return 1; +} +``` + +## 注意事项 + +:::warning + +务必使用[DB_FreeResultSet](DB_FreeResultSet)释放查询结果! + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果集内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过字段索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过字段名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过字段索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过字段名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过字段索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过字段名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库连接内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果内存句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数量 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_FreeResultSet.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_FreeResultSet.md new file mode 100644 index 00000000000..f5f590efe56 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_FreeResultSet.md @@ -0,0 +1,110 @@ +--- +title: DB_FreeResultSet +sidebar_label: DB_FreeResultSet +description: 释放由DB_ExecuteQuery分配的查询结果内存。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +释放由[DB_ExecuteQuery](DB_ExecuteQuery)分配的查询结果内存。 + +| 参数名 | 说明 | +| ----------------- | ---------------------------------------------------------------- | +| DBResult:dbresult | 要释放的查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)分配) | + +## 返回值 + +- 若结果集句柄有效返回**true** +- 若结果集句柄无效返回**false** + +## 示例 + +```c +// 实体存储模块 + +EntityStorage_SpawnAll(DB:connectionHandle) +{ + // 从"entities"表中选择所有条目 + new DBResult:db_result_set = DB_ExecuteQuery(connectionHandle, "SELECT * FROM `entities`"); + + // 验证结果集有效性 + if (db_result_set) + { + // 执行相关操作... + + // 释放结果集内存 + DB_FreeResultSet(db_result_set); + } +} +``` + +```c +// 游戏模式主文件 + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + EntityStorage_SpawnAll(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +务必使用[DB_FreeResultSet](DB_FreeResultSet)释放查询结果! + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过字段索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过字段名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过字段索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过字段名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过字段索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过字段名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果内存句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseConnectionCount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseConnectionCount.md new file mode 100644 index 00000000000..e9dc514509f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseConnectionCount.md @@ -0,0 +1,46 @@ +--- +title: DB_GetDatabaseConnectionCount +sidebar_label: DB_GetDatabaseConnectionCount +description: 用于调试目的获取已打开的数据库连接数量。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于调试目的获取已打开的数据库连接数量。 + +| 参数 | 说明 | +| ---- | ---------------- | +| 无 | 此函数不需要参数 | + +## 返回值 + +返回当前已打开的 SQLite 数据库连接数量(整数类型)。 + +## 示例 + +```c +printf("当前数据库连接数: %d", DB_GetDatabaseConnectionCount()); +``` + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果集内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过字段索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过字段名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过字段索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过字段名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过字段索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过字段名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库连接内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果内存句柄 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取已打开的查询结果数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseResultSetCount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseResultSetCount.md new file mode 100644 index 00000000000..755f8922e23 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetDatabaseResultSetCount.md @@ -0,0 +1,47 @@ +--- +title: DB_GetDatabaseResultSetCount +sidebar_label: DB_GetDatabaseResultSetCount +description: 获取当前已打开的数据库查询结果集数量 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于获取当前已打开的数据库查询结果集数量。 + +| 参数 | 说明 | +| ---- | ---------------- | +| 无 | 此函数不需要参数 | + +## 返回值 + +返回当前已打开的 SQLite 数据库查询结果集数量(整数类型)。 + +## 示例 + +```c +printf("当前数据库结果集数量: %d", DB_GetDatabaseResultSetCount()); +``` + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果集内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过字段索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过字段名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过字段索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过字段名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过字段索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过字段名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库连接内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果内存句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldCount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldCount.md new file mode 100644 index 00000000000..20fef747e34 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldCount.md @@ -0,0 +1,157 @@ +--- +title: DB_GetFieldCount +sidebar_label: DB_GetFieldCount +description: 获取通过DB_ExecuteQuery分配的结果集中的字段总数。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于获取通过[DB_ExecuteQuery](DB_ExecuteQuery)分配的结果集中的字段总数。 + +| 参数名 | 说明 | +| ----------------- | -------------------------------------------------------- | +| DBResult:dbresult | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | + +## 返回值 + +返回结果集中的字段数量(整型)。 + +## 示例 + +```c +// 示例模块 + +// ... + +static FindFieldIndexByName(DBResult:dbResultSet, const fieldName[]) +{ + // 默认返回-1表示未找到 + new ret = -1; + + // 获取字段总数 + new field_count = DB_GetFieldCount(dbResultSet); + + // 当前字段名称缓存 + new current_field_name[32]; + + // 遍历所有字段索引 + for (new field_index; field_index < field_count; field_index++) + { + // 获取字段名称 + if (DB_GetFieldName(dbResultSet, field_index, current_field_name, sizeof current_field_name)) + { + // 匹配目标字段名称 + if (!strcmp(fieldName, current_field_name)) + { + ret = field_index; // 记录匹配的索引 + break; // 提前退出循环 + } + } + } + + return ret; +} + +Float:Examples_CalculateSum(DB:dbConnectionHandle) +{ + new Float:ret; + + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 获取目标字段索引 + new target_field_index = FindFieldIndexByName(db_result_set, "value"); + + if (target_field_index >= 0) + { + // 遍历结果集 + do + { + // 累加浮点数值 + ret += DB_GetFieldFloat(db_result_set, target_field_index); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + } + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %f", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果集内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过字段索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过字段名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过字段索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过字段名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过字段索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过字段名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果内存句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloat.md new file mode 100644 index 00000000000..9c0a5e35e2d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloat.md @@ -0,0 +1,157 @@ +--- +title: DB_GetFieldFloat +sidebar_label: DB_GetFieldFloat +description: 通过字段索引从查询结果中获取浮点数值。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于通过字段索引从[DB_ExecuteQuery](DB_ExecuteQuery)分配的查询结果中获取浮点数值。 + +| 参数名 | 说明 | +| --------------- | -------------------------------------------------------- | +| DBResult:result | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | +| field = 0 | 目标字段索引(默认从 0 开始) | + +## 返回值 + +以浮点数形式返回获取的字段值。 + +## 示例 + +```c +// 示例模块 + +// ... + +static FindFieldIndexByName(DBResult:dbResultSet, const fieldName[]) +{ + // 默认返回-1表示未找到 + new ret = -1; + + // 获取字段总数 + new field_count = DB_GetFieldCount(dbResultSet); + + // 当前字段名称缓存 + new current_field_name[32]; + + // 遍历所有字段 + for (new field_index; field_index < field_count; field_index++) + { + // 获取字段名称 + if (DB_GetFieldName(dbResultSet, field_index, current_field_name, sizeof current_field_name)) + { + // 匹配目标字段名称 + if (!strcmp(fieldName, current_field_name)) + { + ret = field_index; // 记录匹配的索引 + break; // 提前退出循环 + } + } + } + return ret; +} + +Float:Examples_CalculateSum(DB:dbConnectionHandle) +{ + // 返回值变量 + new Float:ret; + + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 获取目标字段索引 + new target_field_index = FindFieldIndexByName(db_result_set, "value"); + + if (target_field_index >= 0) + { + // 遍历结果集 + do + { + // 累加浮点数值 + ret += DB_GetFieldFloat(db_result_set, target_field_index); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + } + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %f", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取字段总数 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloatByName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloatByName.md new file mode 100644 index 00000000000..06a57051ba0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldFloatByName.md @@ -0,0 +1,124 @@ +--- +title: DB_GetFieldFloatByName +sidebar_label: DB_GetFieldFloatByName +description: 通过字段名称从查询结果中获取浮点数值。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数通过字段名称从[DB_ExecuteQuery](DB_ExecuteQuery)分配的查询结果中获取浮点数值。 + +| 参数名 | 说明 | +| --------------- | -------------------------------------------------------- | +| DBResult:result | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | +| const field[] | 目标字段名称 | + +## 返回值 + +以浮点数形式返回获取的字段值。 + +## 示例 + +```c +// 示例模块 + +// ... + +Float:Examples_CalculateSum(DB:dbConnectionHandle) +{ + // 返回值变量 + new Float:ret; + + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 遍历结果集 + do + { + // 将'value'字段的浮点数值累加到返回值 + ret += DB_GetFieldFloatByName(db_result_set, "value"); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %f", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取字段总数 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldInt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldInt.md new file mode 100644 index 00000000000..f1e2b25811d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldInt.md @@ -0,0 +1,158 @@ +--- +title: DB_GetFieldInt +sidebar_label: DB_GetFieldInt +description: 通过字段索引从DB_ExecuteQuery结果中获取整数值。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于通过字段索引从[DB_ExecuteQuery](DB_ExecuteQuery)分配的查询结果中获取整数值。 + +| 参数名 | 说明 | +| --------------- | -------------------------------------------------------- | +| DBResult:result | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | +| field = 0 | 目标字段索引(默认从 0 开始) | + +## 返回值 + +以整数形式返回获取的字段值。 + +## 示例 + +```c +// 示例模块 + +// ... + +static FindFieldIndexByName(DBResult:dbResultSet, const fieldName[]) +{ + // 默认返回-1表示未找到 + new ret = -1; + + // 获取字段总数 + new field_count = DB_GetFieldCount(dbResultSet); + + // 当前字段名称缓存 + new current_field_name[32]; + + // 遍历所有字段 + for (new field_index; field_index < field_count; field_index++) + { + // 获取字段名称 + if (DB_GetFieldName(dbResultSet, field_index, current_field_name, sizeof current_field_name)) + { + // 匹配目标字段名称 + if (!strcmp(fieldName, current_field_name)) + { + ret = field_index; // 记录匹配的索引 + break; // 提前退出循环 + } + } + } + return ret; +} + +Examples_CalculateSum(DB:dbConnectionHandle) +{ + // 返回值变量 + new ret; + + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 获取目标字段索引 + new target_field_index = FindFieldIndexByName(db_result_set, "value"); + + if (target_field_index >= 0) + { + // 遍历结果集 + do + { + // 累加整数值 + ret += DB_GetFieldInt(db_result_set, target_field_index); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + } + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %d", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取字段总数 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldIntByName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldIntByName.md new file mode 100644 index 00000000000..11ad6a8a047 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldIntByName.md @@ -0,0 +1,124 @@ +--- +title: DB_GetFieldIntByName +sidebar_label: DB_GetFieldIntByName +description: 通过字段名称从查询结果中获取整数值。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数通过字段名称从[DB_ExecuteQuery](DB_ExecuteQuery)分配的查询结果中获取整数值。 + +| 参数名 | 说明 | +| --------------- | -------------------------------------------------------- | +| DBResult:result | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | +| const field[] | 目标字段名称 | + +## 返回值 + +以整数形式返回获取的字段值。 + +## 示例 + +```c +// 示例模块 + +// ... + +Examples_CalculateSum(DB:dbConnectionHandle) +{ + // 返回值变量 + new ret; + + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 遍历结果集 + do + { + // 将'value'字段的整数值累加到返回值 + ret += DB_GetFieldIntByName(db_result_set, "value"); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %d", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取字段总数 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldName.md new file mode 100644 index 00000000000..0166c9df263 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldName.md @@ -0,0 +1,108 @@ +--- +title: DB_GetFieldName +sidebar_label: DB_GetFieldName +description: 返回指定索引处的字段名称。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数返回指定索引处的字段名称。 + +| 参数名 | 说明 | +| ---------------------- | -------------------------------------------------------- | +| DBResult:result | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | +| field | 要获取的字段索引(从 0 开始) | +| output[] | 存储字段名称的字符数组 | +| size = sizeof (output) | 字符数组的最大存储长度 | + +## 返回值 + +- **true** - 结果集句柄有效且操作成功 +- **false** - 结果集句柄无效或操作失败 + +## 示例 + +```c +static DB:gDBConnectionHandle; + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + // 从'join_log'表中选择第一条记录 + new DBResult:db_result_set = DB_ExecuteQuery(gDBConnectionHandle, "SELECT * FROM `join_log` LIMIT 1"); + + if (db_result_set) + { + // 获取结果集字段总数 + new columns = DB_GetFieldCount(db_result_set); + + // 预分配字段名称存储空间 + new field_name[32]; + + // 遍历所有字段索引 + for (new index; index < columns; index++) + { + // 将第index个字段名称存入field_name + DB_GetFieldName(db_result_set, index, field_name, sizeof(field_name)); + + // 输出字段信息 + printf("字段索引 %d 名称: \"%s\"", index, field_name); + } + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } + } + else + { + print("无法连接数据库 \"example.db\""); + } +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldString](DB_GetFieldString): 通过字段索引获取当前行数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过字段名称获取当前行数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过字段索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过字段名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过字段索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过字段名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果内存句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldString.md new file mode 100644 index 00000000000..b8c73a15353 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldString.md @@ -0,0 +1,159 @@ +--- +title: DB_GetFieldString +sidebar_label: DB_GetFieldString +description: 通过字段索引从DB_ExecuteQuery结果中获取字符串数据。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于通过字段索引从[DB_ExecuteQuery](DB_ExecuteQuery)分配的查询结果中获取字符串数据。 + +| 参数名 | 说明 | +| ---------------------- | -------------------------------------------------------- | +| DBResult:result | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | +| field | 目标字段索引 | +| output[] | 存储结果的字符数组 | +| size = sizeof (output) | 结果的最大存储长度 | + +## 返回值 + +- **true** - 结果集句柄有效且字段存在 +- **false** - 结果集句柄无效或字段不存在 + +## 示例 + +```c +// 示例模块 + +// ... + +static FindFieldIndexByName(DBResult:dbResultSet, const fieldName[]) +{ + // 默认返回-1表示未找到 + new ret = -1; + + // 获取字段总数 + new field_count = DB_GetFieldCount(dbResultSet); + + // 当前字段名称缓存 + new current_field_name[32]; + + // 遍历所有字段 + for (new field_index; field_index < field_count; field_index++) + { + // 获取字段名称 + if (DB_GetFieldName(dbResultSet, field_index, current_field_name, sizeof current_field_name)) + { + // 匹配目标字段名称 + if (!strcmp(fieldName, current_field_name)) + { + ret = field_index; // 记录匹配的索引 + break; // 提前退出循环 + } + } + } + return ret; +} + +Examples_ListNames(DB:dbConnectionHandle) +{ + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `name` FROM `examples`"); + + if (db_result_set) + { + // 获取"name"字段的索引 + new target_field_index = FindFieldIndexByName(db_result_set, "name"); + + if (target_field_index >= 0) + { + // 预分配结果存储空间 + new result[256]; + + // 遍历结果集 + do + { + // 获取目标字段内容 + DB_GetFieldString(db_result_set, target_field_index, result, sizeof(result)); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + } + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + Examples_ListNames(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取字段总数 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldStringByName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldStringByName.md new file mode 100644 index 00000000000..96baa7ca482 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetFieldStringByName.md @@ -0,0 +1,125 @@ +--- +title: DB_GetFieldStringByName +sidebar_label: DB_GetFieldStringByName +description: 通过字段名称从查询结果中获取字符串内容。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +通过字段名称从[DB_ExecuteQuery](DB_ExecuteQuery)分配的查询结果中获取字符串数据。 + +| 参数名 | 说明 | +| ---------------------- | -------------------------------------------------------- | +| DBResult:result | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | +| const field[] | 目标字段名称 | +| output[] | 存储结果的字符数组 | +| size = sizeof (output) | 结果的最大存储长度 | + +## 返回值 + +- ​**true**​ - 结果集句柄有效且字段存在 +- ​**false**​ - 结果集句柄无效或字段不存在 + +## 示例 + +```c +// 示例模块 + +// ... + +Examples_ListNames(DB:dbConnectionHandle) +{ + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `name` FROM `examples`"); + + if (db_result_set) + { + // 预分配结果存储空间 + new result[256]; + + // 遍历结果集 + do + { + // 通过字段名称获取数据 + DB_GetFieldStringByName(db_result_set, "name", result, sizeof(result)); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + Examples_ListNames(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过字段索引获取当前行数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过字段索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过字段名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过字段索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过字段名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果内存句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetLegacyDBResult.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetLegacyDBResult.md new file mode 100644 index 00000000000..58c24c3cbc5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetLegacyDBResult.md @@ -0,0 +1,94 @@ +--- +title: DB_GetLegacyDBResult +sidebar_label: DB_GetLegacyDBResult +description: 获取通过DB_ExecuteQuery分配的SQLite查询结果内存句柄 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于获取通过[DB_ExecuteQuery](DB_ExecuteQuery)执行的 SQLite 数据库查询结果的内存句柄。 + +| 参数名 | 说明 | +| --------------- | ---------------------------------------------------------- | +| DBResult:result | 数据库查询句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | + +## 返回值 + +返回数据库查询结果集句柄的内存地址(十六进制格式)。 + +## 示例 + +```c +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + // 执行数据库查询 + new DBResult:result_set = DB_ExecuteQuery(gDBConnectionHandle, "SELECT * FROM `examples`"); + print("成功连接数据库 \"example.db\""); + + if (result_set) + { + // 输出传统查询结果内存句柄 + printf("传统查询结果内存句柄: 0x%x", DB_GetLegacyDBResult(result_set)); + DB_FreeResultSet(result_set); // 释放结果集 + } + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取字段总数 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库连接内存句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetMemHandle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetMemHandle.md new file mode 100644 index 00000000000..71a0dc1d7b8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetMemHandle.md @@ -0,0 +1,86 @@ +--- +title: DB_GetMemHandle +sidebar_label: DB_GetMemHandle +description: 获取通过DB_Open建立的SQLite数据库连接的内存句柄。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于获取通过[DB_Open](DB_Open)建立的 SQLite 数据库连接的内存句柄。 + +| 参数名 | 说明 | +| ------ | ------------------------------------------ | +| DB:db | 数据库连接句柄(由[DB_Open](DB_Open)返回) | + +## 返回值 + +返回数据库连接句柄的内存地址(十六进制格式)。 + +## 示例 + +```c +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("数据库连接内存句柄: 0x%x", DB_GetMemHandle(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的数据库连接句柄将导致服务器崩溃!请始终通过[DB_Open](DB_Open)获取有效句柄 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetRowCount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetRowCount.md new file mode 100644 index 00000000000..f772b28d2fc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_GetRowCount.md @@ -0,0 +1,125 @@ +--- +title: DB_GetRowCount +sidebar_label: DB_GetRowCount +description: 返回通过DB_ExecuteQuery执行的查询结果中的行数。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于获取通过[DB_ExecuteQuery](DB_ExecuteQuery)执行的查询结果中的行数。 + +| 参数名 | 说明 | +| ----------------- | -------------------------------------------------------- | +| DBResult:dbresult | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | + +## 返回值 + +返回结果集中的行数(整数类型)。 + +## 示例 + +```c +// 示例模块 + +// ... + +Examples_ListNames(DB:dbConnectionHandle) +{ + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `name` FROM `examples`"); + + if (db_result_set) + { + // 预分配结果存储空间 + new result[256]; + + // 获取总行数 + new row_count = DB_GetRowCount(db_result_set); + printf("查询结果包含 %d 行数据", row_count); + + // 遍历结果集 + do + { + // 通过字段名称获取数据 + DB_GetFieldStringByName(db_result_set, "name", result, sizeof(result)); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + Examples_ListNames(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果 + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_SelectNextRow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_SelectNextRow.md new file mode 100644 index 00000000000..86ffbcecebb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DB_SelectNextRow.md @@ -0,0 +1,122 @@ +--- +title: DB_SelectNextRow +sidebar_label: DB_SelectNextRow +description: 在DB_ExecuteQuery分配的结果集中移动到下一行。 +keywords: + - sqlite +tags: ["sqlite"] +--- + +## 描述 + +该函数用于在通过[DB_ExecuteQuery](DB_ExecuteQuery)分配的结果集中移动到下一行。 + +| 参数名 | 说明 | +| ----------------- | -------------------------------------------------------- | +| DBResult:dbresult | 查询结果句柄(由[DB_ExecuteQuery](DB_ExecuteQuery)返回) | + +## 返回值 + +- ​**true**​ - 结果集句柄有效且未到达最后一行 +- ​**false**​ - 结果集句柄无效或已遍历所有行 + +## 示例 + +```c +// 示例模块 + +// ... + +Examples_ListNames(DB:dbConnectionHandle) +{ + // 执行数据库查询 + new DBResult:db_result_set = DB_ExecuteQuery(dbConnectionHandle, "SELECT `name` FROM `examples`"); + + if (db_result_set) + { + // 预分配结果存储空间 + new result[256]; + + // 遍历结果集 + do + { + // 通过字段名称获取数据 + DB_GetFieldStringByName(db_result_set, "name", result, sizeof(result)); + } + while (DB_SelectNextRow(db_result_set)); // 跳转至下一行 + + // 释放结果集 + DB_FreeResultSet(db_result_set); + } +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = DB_Open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + Examples_ListNames(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (DB_Close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::danger + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[DB_ExecuteQuery](DB_ExecuteQuery)获取有效的查询结果! + +::: + +## 相关函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Delete3DTextLabel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Delete3DTextLabel.md new file mode 100644 index 00000000000..7d6665cb708 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Delete3DTextLabel.md @@ -0,0 +1,47 @@ +--- +title: Delete3DTextLabel +sidebar_label: Delete3DTextLabel +description: 删除通过Create3DTextLabel创建的3D文本标签。 +tags: ["3d文本标签"] +--- + +## 描述 + +该函数用于删除通过[Create3DTextLabel](Create3DTextLabel)创建的 3D 文本标签。 + +| 参数名 | 描述 | +| ------------- | ----------------------- | +| Text3D:textid | 要删除的 3D 文本标签 ID | + +## 返回值 + +- ​**true**​ - 3D 文本标签删除成功 +- ​**false**​ - 3D 文本标签删除失败 + +## 示例 + +```c +new Text3D:gMyLabel; + +public OnGameModeInit() +{ + // 创建3D文本标签 + gMyLabel = Create3DTextLabel("当前坐标:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); + return 1; +} + +// 稍后使用时删除标签 +Delete3DTextLabel(gMyLabel); +``` + +## 相关函数 + +- [Create3DTextLabel](Create3DTextLabel): 创建 3D 文本标签 +- [IsValid3DTextLabel](IsValid3DTextLabel): 验证 3D 文本标签是否有效 +- [Is3DTextLabelStreamedIn](Is3DTextLabelStreamedIn): 检查 3D 文本标签是否对玩家可见 +- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): 将标签附加到玩家身上 +- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): 将标签附加到车辆上 +- [Update3DTextLabelText](Update3DTextLabelText): 更新标签文本内容 +- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): 为单个玩家创建标签 +- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): 删除玩家的私有标签 +- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): 更新玩家私有标签文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeletePVar.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeletePVar.md new file mode 100644 index 00000000000..d8be2879e48 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeletePVar.md @@ -0,0 +1,48 @@ +--- +title: DeletePVar +sidebar_label: DeletePVar +description: 删除先前设置的玩家变量。 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +删除先前设置的玩家变量。 + +| 参数名 | 说明 | +| ------------ | ---------------------- | +| playerid | 要删除变量的玩家 ID。 | +| const pvar[] | 要删除的玩家变量名称。 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败。可能原因:玩家未连接或不存在指定名称的变量。 + +## 示例 + +```c +SetPVarInt(playerid, "SomeVarName", 69); + +// 后续操作,当不再需要该变量时... + +DeletePVar(playerid, "SomeVarName"); +``` + +## 注意事项 + +:::tip + +变量被删除后,尝试获取其值将返回:整型返回 0,浮点数返回 0.0,字符串返回空值。 + +::: + +## 相关函数 + +- [SetPVarInt](SetPVarInt): 为玩家变量设置整型值 +- [GetPVarInt](GetPVarInt): 从玩家变量获取整型值 +- [SetPVarString](SetPVarString): 为玩家变量设置字符串值 +- [GetPVarString](GetPVarString): 从玩家变量获取字符串值 +- [SetPVarFloat](SetPVarFloat): 为玩家变量设置浮点数值 +- [GetPVarFloat](GetPVarFloat): 从玩家变量获取浮点数值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeletePlayer3DTextLabel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeletePlayer3DTextLabel.md new file mode 100644 index 00000000000..e678f807ee6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeletePlayer3DTextLabel.md @@ -0,0 +1,58 @@ +--- +title: DeletePlayer3DTextLabel +sidebar_label: DeletePlayer3DTextLabel +description: 销毁通过CreatePlayer3DTextLabel创建的3D文本标签。 +tags: ["玩家", "3D文本标签"] +--- + +## 描述 + +销毁通过 CreatePlayer3DTextLabel 创建的 3D 文本标签。 + +| 参数名 | 说明 | +| ------------------- | ------------------------------- | +| playerid | 要删除其 3D 文本标签的玩家 ID。 | +| PlayerText3D:textid | 要删除的玩家 3D 文本标签 ID。 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败。这意味着指定的标签不存在。 + +## 示例 + +```c +new PlayerText3D:playerTextId[MAX_PLAYERS]; + +public OnPlayerSpawn(playerid) +{ + new + name[MAX_PLAYER_NAME], + Float:x, Float:y, Float:z, + string[64]; + + GetPlayerName(playerid, name, sizeof(name)); + GetPlayerPos(playerid, x, y, z); + + format(string, sizeof(string), "Hello %s!\nI'm at your position", name); + playerTextId[playerid] = CreatePlayer3DTextLabel(playerid, string, 0x008080FF, x, y, z, 40.0); + return 1; +} + +public OnPlayerDisconnect(playerid, reason) +{ + DeletePlayer3DTextLabel(playerid, playerTextId[playerid]); + return 1; +} +``` + +## 相关函数 + +- [创建 3D 文本标签](Create3DTextLabel): 创建 3D 文本标签 +- [将 3D 文本标签附加到玩家](Attach3DTextLabelToPlayer): 将 3D 文本标签附加到玩家身上 +- [将 3D 文本标签附加到车辆](Attach3DTextLabelToVehicle): 将 3D 文本标签附加到车辆上 +- [更新 3D 文本标签内容](Update3DTextLabelText): 修改 3D 文本标签的文本内容 +- [为玩家创建 3D 文本标签](CreatePlayer3DTextLabel): 为单个玩家创建 3D 文本标签 +- [更新玩家 3D 文本标签内容](UpdatePlayer3DTextLabelText): 修改玩家的 3D 文本标签内容 +- [验证玩家 3D 文本标签有效性](IsValidPlayer3DTextLabel): 检查玩家的 3D 文本标签是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeleteSVar.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeleteSVar.md new file mode 100644 index 00000000000..81f42b39f84 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DeleteSVar.md @@ -0,0 +1,47 @@ +--- +title: DeleteSVar +sidebar_label: DeleteSVar +description: 删除先前设置的服务器变量。 +tags: ["服务器变量", "svar"] +--- + +## 描述 + +删除先前设置的服务器变量。 + +| 参数名 | 说明 | +| ------------ | ------------------------ | +| const svar[] | 要删除的服务器变量名称。 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败。可能原因:不存在指定名称的变量。 + +## 示例 + +```c +SetSVarInt("SomeVarName", 69); + +// 后续操作,当不再需要该变量时... + +DeleteSVar("SomeVarName"); +``` + +## 注意事项 + +:::tip + +变量被删除后,尝试获取其值将返回:整型返回 0,浮点数返回 0.0,字符串返回空值。 + +::: + +## 相关函数 + +- [SetSVarInt](SetSVarInt): 为服务器变量设置整型值 +- [GetSVarInt](GetSVarInt): 获取服务器变量的整数值 +- [SetSVarString](SetSVarString): 为服务器变量设置字符串值 +- [GetSVarString](GetSVarString): 从服务器变量获取字符串值 +- [SetSVarFloat](SetSVarFloat): 为服务器变量设置浮点数值 +- [GetSVarFloat](GetSVarFloat): 从服务器变量获取浮点数值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyActor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyActor.md new file mode 100644 index 00000000000..1cd2080b728 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyActor.md @@ -0,0 +1,44 @@ +--- +title: DestroyActor +sidebar_label: DestroyActor +description: 销毁通过CreateActor创建的角色。 +tags: ["角色"] +--- + + + +## 描述 + +销毁通过 CreateActor 创建的角色。 + +| 参数名 | 说明 | +| ------- | -------------------------------------------- | +| actorid | 要销毁的角色 ID。该 ID 由 CreateActor 返回。 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败。指定的角色 ID 不存在。 + +## 示例 + +```c +new MyActor; + +public OnFilterScriptInit() +{ + MyActor = CreateActor(0, 0.0, 0.0, 3.0, 0.0); + return 1; +} + +public OnFilterScriptExit() +{ + DestroyActor(MyActor); + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor): 创建角色(静态 NPC) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyMenu.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyMenu.md new file mode 100644 index 00000000000..80b855fb64d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyMenu.md @@ -0,0 +1,39 @@ +--- +title: DestroyMenu +sidebar_label: DestroyMenu +description: 销毁指定的菜单。 +tags: ["菜单"] +--- + +## 描述 + +销毁指定的菜单。 + +| 参数名 | 说明 | +| ----------- | --------------- | +| Menu:menuid | 要销毁的菜单 ID | + +## 返回值 + +**true** 销毁成功返回 true,否则返回 false + +## 示例 + +```c +new Menu:exampleMenu; +exampleMenu = CreateMenu("Your Menu", 2, 200.0, 100.0, 150.0, 150.0); + +// 后续操作... +DestroyMenu(exampleMenu); +``` + +## 相关函数 + +- [CreateMenu](CreateMenu): 创建菜单 +- [SetMenuColumnHeader](SetMenuColumnHeader): 设置菜单列的标题 +- [AddMenuItem](AddMenuItem): 向菜单添加项目 + +## 相关回调 + +- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): 当玩家选择菜单中的某一行时触发 +- [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu): 当玩家退出菜单时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyObject.md new file mode 100644 index 00000000000..8d3a5027631 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyObject.md @@ -0,0 +1,50 @@ +--- +title: DestroyObject +sidebar_label: DestroyObject +description: 销毁通过 CreateObject 创建的物体。 +tags: ["物体"] +--- + +## 描述 + +销毁通过 CreateObject 创建的物体。 + +| 名称 | 描述 | +| -------- | ------------------------------------- | +| objectid | 要销毁的物体 ID,由 CreateObject 返回 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnObjectMoved(objectid) +{ + DestroyObject(objectid); + return 1; +} +``` + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [IsValidObject](IsValidObject): 检查物体是否有效 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体位置 +- [SetObjectRot](SetObjectRot): 设置物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取物体位置 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家专属物体 +- [IsValidPlayerObject](IsValidPlayerObject): 检查玩家专属物体是否有效 +- [MovePlayerObject](MovePlayerObject): 移动玩家专属物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家专属物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家专属物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家专属物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家专属物体位置 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家专属物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家专属物体附加到玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPickup.md new file mode 100644 index 00000000000..dc4530906ba --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPickup.md @@ -0,0 +1,41 @@ +--- +title: DestroyPickup +sidebar_label: DestroyPickup +description: 销毁通过 CreatePickup 创建的拾取物。 +tags: ["拾取物"] +--- + +## 描述 + +销毁通过 CreatePickup 创建的拾取物。 + +| 名称 | 描述 | +| ------ | ----------------------------------------- | +| pickup | 要销毁的拾取物 ID(由 CreatePickup 返回) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定拾取物不存在) + +## 示例 + +```c +new g_PickupArmour; + +// 创建护甲拾取物 +g_PickupArmour = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191); + +// 一段时间后... +DestroyPickup(g_PickupArmour); +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [IsValidPickup](IsValidPickup): 检查拾取物是否有效 + +## 相关回调 + +- [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup): 当玩家拾取拾取物时调用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerObject.md new file mode 100644 index 00000000000..80459dc8fc3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerObject.md @@ -0,0 +1,51 @@ +--- +title: DestroyPlayerObject +sidebar_label: DestroyPlayerObject +description: 销毁通过 CreatePlayerObject 创建的玩家专属物体。 +tags: ["玩家", "物体", "玩家专属物体"] +--- + +## 描述 + +销毁通过 [CreatePlayerObject](CreatePlayerObject) 创建的玩家专属物体。 + +| 名称 | 描述 | +| -------- | ----------------------------------------------------- | +| playerid | 要销毁其玩家专属物体的玩家 ID | +| objectid | 要销毁的玩家专属物体 ID(由 CreatePlayerObject 返回) | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnPlayerObjectMoved(playerid, objectid) +{ + DestroyPlayerObject(playerid, objectid); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [IsValidPlayerObject](IsValidPlayerObject): 检查指定玩家专属物体是否有效 +- [MovePlayerObject](MovePlayerObject): 移动玩家专属物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家专属物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家专属物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家专属物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家专属物体位置 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家专属物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家专属物体附加到指定玩家 +- [CreateObject](CreateObject): 创建全局物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [IsValidObject](IsValidObject): 检查指定全局物体是否有效 +- [MoveObject](MoveObject): 移动全局物体 +- [StopObject](StopObject): 停止全局物体移动 +- [SetObjectPos](SetObjectPos): 设置全局物体位置 +- [SetObjectRot](SetObjectRot): 设置全局物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取全局物体位置 +- [GetObjectRot](GetObjectRot): 获取全局物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将全局物体附加到玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerPickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerPickup.md new file mode 100644 index 00000000000..d7e44439745 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyPlayerPickup.md @@ -0,0 +1,46 @@ +--- +title: DestroyPlayerPickup +sidebar_label: DestroyPlayerPickup +description: 销毁通过 CreatePlayerPickup 创建的玩家专属拾取物。 +tags: ["玩家", "拾取物", "玩家专属拾取物"] +--- + + + +## 描述 + +销毁通过 [CreatePlayerPickup](CreatePlayerPickup) 创建的玩家专属拾取物。 + +| 名称 | 描述 | +| -------- | ------------------------------------------------------- | +| playerid | 目标玩家 ID | +| pickupid | 要销毁的玩家专属拾取物 ID(由 CreatePlayerPickup 返回) | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerPickupArmour[MAX_PLAYERS]; // 创建存储玩家专属拾取物ID的数组 + +public OnPlayerConnect(playerid) +{ + PlayerPickupArmour[playerid] = CreatePlayerPickup(playerid, 1242, 2, 2010.0979, 1222.0642, 10.8206, -1); + // 创建护甲拾取物并将ID存储到 PlayerPickupArmour[playerid] + return 1; +} + +// 一段时间后... +DestroyPlayerPickup(playerid, PlayerPickupArmour[playerid]); +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建仅对单个玩家可见的拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 检查玩家专属拾取物是否有效 + +## 相关回调 + +- [OnPlayerPickUpPlayerPickup](../callbacks/OnPlayerPickUpPlayerPickup): 当玩家拾取专属拾取物时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyVehicle.md new file mode 100644 index 00000000000..738231563da --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DestroyVehicle.md @@ -0,0 +1,44 @@ +--- +title: DestroyVehicle +sidebar_label: DestroyVehicle +description: 销毁一辆车辆。 +tags: ["车辆"] +--- + +## 描述 + +销毁一辆车辆。该车辆将立即消失。 + +| 名称 | 描述 | +| --------- | --------------- | +| vehicleid | 要销毁的车辆 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(车辆不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/destroyveh", true) == 0) + { + if (IsPlayerInAnyVehicle(playerid)) + { + new vehicleid = GetPlayerVehicleID(playerid); + DestroyVehicle(vehicleid); + } + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [CreateVehicle](CreateVehicle): 创建一辆车辆 +- [RemovePlayerFromVehicle](RemovePlayerFromVehicle): 将玩家从其车辆中移出 +- [SetVehicleToRespawn](SetVehicleToRespawn): 重置一辆车辆 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DetachTrailerFromVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DetachTrailerFromVehicle.md new file mode 100644 index 00000000000..3f075b2e780 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DetachTrailerFromVehicle.md @@ -0,0 +1,30 @@ +--- +title: DetachTrailerFromVehicle +sidebar_label: DetachTrailerFromVehicle +description: 断开车辆与其拖车之间的连接(如果存在)。 +tags: ["车辆"] +--- + +## 描述 + +断开车辆与其拖车之间的连接(如果存在)。 + +| 名称 | 描述 | +| --------- | ------------- | +| vehicleid | 牵引车辆的 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +DetachTrailerFromVehicle(vehicleid); +``` + +## 相关函数 + +- [AttachTrailerToVehicle](AttachTrailerToVehicle): 将拖车连接到车辆 +- [IsTrailerAttachedToVehicle](IsTrailerAttachedToVehicle): 检查车辆是否连接拖车 +- [GetVehicleTrailer](GetVehicleTrailer): 获取车辆牵引的拖车 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableInteriorEnterExits.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableInteriorEnterExits.md new file mode 100644 index 00000000000..c167640f6d2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableInteriorEnterExits.md @@ -0,0 +1,44 @@ +--- +title: DisableInteriorEnterExits +sidebar_label: DisableInteriorEnterExits +description: 禁用游戏内所有室内出入口(门前的黄色箭头)。 +tags: ["室内"] +--- + +## 描述 + +禁用游戏内所有室内出入口(门前的黄色箭头)。 + +## 示例 + +```c +public OnGameModeInit() +{ + DisableInteriorEnterExits(); + return 1; +} +``` + +## 注意事项 + +:::warning + +该函数仅在玩家连接前调用有效(建议在 [OnGameModeInit](../callbacks/OnGameModeInit) 中使用)。已连接玩家的标记不会被移除。 + +若在调用此函数后切换游戏模式,且新游戏模式未禁用标记,已连接玩家不会重新显示标记(但新连接玩家会显示)。 + +::: + +:::tip + +您也可以通过 [config.json](../../server/config.json) 禁用室内入口标记: + +```json +"use_entry_exit_markers": false, +``` + +::: + +## 相关函数 + +- [AllowInteriorWeapons](AllowInteriorWeapons): 决定是否允许在室内使用武器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenu.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenu.md new file mode 100644 index 00000000000..007f6b0c5dc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenu.md @@ -0,0 +1,59 @@ +--- +title: DisableMenu +sidebar_label: DisableMenu +description: 禁用一个菜单。 +tags: ["菜单"] +--- + +## 描述 + +禁用一个菜单。 + +| 名称 | 描述 | +| ----------- | --------------- | +| Menu:menuid | 要禁用的菜单 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new WeaponMenu; + +public OnGameModeInit() +{ + WeaponMenu = CreateMenu("Weapons", 1, 50.0, 180.0, 200.0, 200.0); + AddMenuItem(WeaponMenu, 0, "Rocket Launcher"); + AddMenuItem(WeaponMenu, 0, "Flamethrower"); + AddMenuItem(WeaponMenu, 0, "Minigun"); + AddMenuItem(WeaponMenu, 0, "Grenades"); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/disableguns", true)) + { + DisableMenu(WeaponMenu); // 禁用武器菜单 + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +传入无效菜单 ID 会导致崩溃。 + +::: + +## 相关函数 + +- [CreateMenu](CreateMenu): 创建一个菜单 +- [DestroyMenu](DestroyMenu): 销毁一个菜单 +- [AddMenuItem](AddMenuItem): 为菜单添加项目 +- [IsMenuDisabled](IsMenuDisabled): 检查菜单是否被禁用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md new file mode 100644 index 00000000000..805c2e8df82 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md @@ -0,0 +1,67 @@ +--- +title: DisableMenuRow +sidebar_label: DisableMenuRow +description: 为所有玩家禁用菜单中的特定行。 +tags: ["菜单"] +--- + +## 描述 + +为所有玩家禁用菜单中的特定行。该行将显示为灰色且不可选择。 + +| 名称 | 描述 | +| ----------- | --------------------------------------------- | +| Menu:menuid | 目标菜单 ID(无效的菜单 ID 会导致服务器崩溃) | +| row | 要禁用的行序号(从 0 开始计数) | + +## 返回值 + +该函数始终返回 **1**(即使操作失败)。 + +如果指定无效行序号,不会有任何效果。 + +如果指定无效菜单 ID,服务器将崩溃。 + +## 示例 + +```c +new Menu:WeaponMenu; + +public OnGameModeInit() +{ + WeaponMenu = CreateMenu("Weapons", 1, 50.0, 180.0, 200.0, 200.0); + AddMenuItem(WeaponMenu, 0, "Rocket Launcher"); + AddMenuItem(WeaponMenu, 0, "Flamethrower"); + AddMenuItem(WeaponMenu, 0, "Minigun"); + AddMenuItem(WeaponMenu, 0, "Grenades"); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/disablemenu", true)) + { + DisableMenuRow(WeaponMenu, 2); // 禁用「Minigun」行 + return 1; + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 传入无效菜单 ID 会导致服务器崩溃 +- 本函数会对所有玩家生效 +- 没有针对单个玩家的行禁用功能 +- 可通过创建多个菜单实现差异化效果(如:包含禁用行的菜单和普通菜单) + +::: + +## 相关函数 + +- [CreateMenu](CreateMenu): 创建一个菜单 +- [DestroyMenu](DestroyMenu): 销毁一个菜单 +- [AddMenuItem](AddMenuItem): 为菜单添加项目 +- [IsMenuRowDisabled](IsMenuRowDisabled): 检查指定菜单行是否被禁用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableNameTagLOS.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableNameTagLOS.md new file mode 100644 index 00000000000..c75374e7d6b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableNameTagLOS.md @@ -0,0 +1,43 @@ +--- +title: DisableNameTagLOS +sidebar_label: DisableNameTagLOS +description: 禁用名牌的视线检测,使玩家可以透过物体查看名牌。 +tags: [] +--- + +## 描述 + +禁用名牌的视线检测机制,玩家名牌将无视物体遮挡显示。 + +## 示例 + +```c +public OnGameModeInit() +{ + DisableNameTagLOS(); + return 1; +} +``` + +## 注意事项 + +:::warning + +该功能在服务器重启前不可逆。 + +::: + +:::tip + +可通过 [config.json](../../server/config.json) 配置文件禁用名牌视线检测: + +```json +"use_nametag_los": false, +``` + +::: + +## 相关函数 + +- [ShowNameTags](ShowNameTags): 全局控制名牌显示状态 +- [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): 按玩家控制名牌可见性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerCheckpoint.md new file mode 100644 index 00000000000..9bec025fa84 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerCheckpoint.md @@ -0,0 +1,46 @@ +--- +title: DisablePlayerCheckpoint +sidebar_label: DisablePlayerCheckpoint +description: 禁用(隐藏/销毁)玩家设置的检查点。 +tags: ["玩家", "检查点"] +--- + +## 描述 + +禁用(隐藏/销毁)玩家设置的检查点。每个玩家同时只能拥有一个检查点,设置新检查点时会自动覆盖旧检查点。 + +| 名称 | 描述 | +| -------- | --------------------- | +| playerid | 要禁用检查点的玩家 ID | + +## 返回值 + +**true** - 函数执行成功(当玩家未设置检查点时也会返回成功) + +**false** - 函数执行失败(玩家未连接) + +## 示例 + +```c +public OnPlayerEnterCheckpoint(playerid) +{ + DisablePlayerCheckpoint(playerid); + return 1; +} +``` + +## 相关函数 + +- [SetPlayerCheckpoint](SetPlayerCheckpoint): 为玩家创建检查点 +- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): 检查玩家是否处于检查点范围内 +- [IsPlayerCheckpointActive](IsPlayerCheckpointActive): 检查玩家当前是否有可见检查点 +- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): 为玩家创建竞速检查点 +- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): 禁用玩家的竞速检查点 +- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): 检查玩家是否处于竞速检查点范围内 + +## 相关回调 + +- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): 当玩家进入检查点时调用 +- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): 当玩家离开检查点时调用 +- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): 当玩家离开竞速检查点时调用 +- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): 当玩家进入竞速检查点时调用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerRaceCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerRaceCheckpoint.md new file mode 100644 index 00000000000..ac5576526a7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisablePlayerRaceCheckpoint.md @@ -0,0 +1,44 @@ +--- +title: DisablePlayerRaceCheckpoint +sidebar_label: DisablePlayerRaceCheckpoint +description: 禁用指定玩家已初始化的所有竞速检查点(同一时间只能存在一个)。 +tags: ["玩家", "检查点", "竞速检查点"] +--- + +## 描述 + +禁用指定玩家已初始化的所有竞速检查点,因为同一时间只能存在一个。 + +| 名称 | 描述 | +| -------- | ------------------------- | +| playerid | 要禁用竞速检查点的玩家 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnPlayerLeaveRaceCheckpoint(playerid) +{ + DisablePlayerRaceCheckpoint(playerid); // 当玩家离开竞速检查点时禁用 + return 1; +} +``` + +## 相关函数 + +- [SetPlayerCheckpoint](SetPlayerCheckpoint): 为玩家创建检查点 +- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): 禁用玩家的常规检查点 +- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): 检查玩家是否处于检查点范围内 +- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): 为玩家创建竞速检查点 +- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): 检查玩家是否处于竞速检查点范围内 +- [IsPlayerRaceCheckpointActive](IsPlayerRaceCheckpointActive): 检查玩家当前是否有可见竞速检查点 + +## 相关回调 + +- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): 当玩家进入检查点时触发 +- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): 当玩家离开检查点时触发 +- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): 当玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): 当玩家离开竞速检查点时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableRemoteVehicleCollisions.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableRemoteVehicleCollisions.md new file mode 100644 index 00000000000..f429ee4f866 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableRemoteVehicleCollisions.md @@ -0,0 +1,46 @@ +--- +title: DisableRemoteVehicleCollisions +sidebar_label: DisableRemoteVehicleCollisions +description: 禁用玩家已占用车辆之间的碰撞。 +tags: ["车辆"] +--- + + + +## 描述 + +禁用玩家已占用车辆之间的碰撞检测。 + +| 名称 | 描述 | +| ------------ | ------------------------------ | +| playerid | 要设置碰撞状态的玩家 ID | +| bool:disable | true 禁用碰撞 / false 启用碰撞 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例 + +```c +new bool:gPlayerVehicleCollision[MAX_PLAYERS]; + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/collision", true)) + { + new string[64]; + + format(string, sizeof(string), "您的车辆碰撞状态已设置为「%s」", (gPlayerVehicleCollision[playerid] == false) ? ("禁用") : ("启用")); + SendClientMessage(playerid, 0xFFFFFFFF, string); + + gPlayerVehicleCollision[playerid] = !gPlayerVehicleCollision[playerid]; + + DisableRemoteVehicleCollisions(playerid, gPlayerVehicleCollision[playerid]); + return 1; + } + return 0; +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditAttachedObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditAttachedObject.md new file mode 100644 index 00000000000..0ef8e105b12 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditAttachedObject.md @@ -0,0 +1,69 @@ +--- +title: EditAttachedObject +sidebar_label: EditAttachedObject +description: 进入附加物体的编辑模式。 +tags: ["玩家", "物体", "附加"] +--- + +## 描述 + +进入附加物体的编辑模式。 + +| 名称 | 描述 | +| -------- | ---------------------------- | +| playerid | 要进入编辑模式的玩家 ID | +| index | 要编辑的附加物体索引(槽位) | + +## 返回值 + +**1** - 操作成功 + +**0** - 操作失败 + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + SetPlayerAttachedObject(playerid, 0, 1337, 2); +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/edit", true)) + { + EditAttachedObject(playerid, 0); + SendClientMessage(playerid, 0xFFFFFFFF, "服务器:您正在编辑槽位0的附加物体!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +编辑过程中按住空格键(车内按 W 键)并移动鼠标可调整视角 + +::: + +:::warning + +玩家可缩放物体至极大或负值尺寸,应通过 [OnPlayerEditAttachedObject](../callbacks/OnPlayerEditAttachedObject) 回调设置缩放值限制或中止非法操作 + +::: + +## 相关函数 + +- [SetPlayerAttachedObject](SetPlayerAttachedObject): 为玩家附加物体 +- [RemovePlayerAttachedObject](RemovePlayerAttachedObject): 移除玩家附加物体 +- [IsPlayerAttachedObjectSlotUsed](IsPlayerAttachedObjectSlotUsed): 检查指定槽位是否已被占用 +- [EditObject](EditObject): 编辑全局物体 +- [EditPlayerObject](EditPlayerObject): 编辑玩家专属物体 +- [SelectObject](SelectObject): 选择物体 +- [CancelEdit](CancelEdit): 取消编辑操作 + +## 相关回调 + +- [OnPlayerEditAttachedObject](../callbacks/OnPlayerEditAttachedObject): 当玩家完成附加物体编辑时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditObject.md new file mode 100644 index 00000000000..446ba02333a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditObject.md @@ -0,0 +1,61 @@ +--- +title: EditObject +sidebar_label: EditObject +description: 允许玩家通过图形界面(GUI)编辑物体的位置和旋转。 +tags: [] +--- + +## 描述 + +允许玩家通过图形用户界面(GUI)使用鼠标编辑物体的位置和旋转。 + +| 名称 | 描述 | +| -------- | --------------------- | +| playerid | 执行编辑操作的玩家 ID | +| objectid | 待编辑的物体 ID | + +## 返回值 + +**1** - 函数执行成功(即使指定了不存在的物体也会返回成功,但无实际效果) + +**0** - 函数执行失败(玩家未连接) + +## 示例 + +```c +new object; +public OnGameModeInit() +{ + object = CreateObject(1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/oedit", true)) + { + EditObject(playerid, object); + SendClientMessage(playerid, 0xFFFFFFFF, "服务器:您现在可以编辑该物体!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +编辑过程中按住空格键(车内按 W 键)并移动鼠标可调整视角 + +::: + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [MoveObject](MoveObject): 移动物体 +- [EditPlayerObject](EditPlayerObject): 编辑玩家专属物体 +- [EditAttachedObject](EditAttachedObject): 编辑附加物体 +- [SelectObject](SelectObject): 选择物体 +- [CancelEdit](CancelEdit): 取消编辑操作 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerClass.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerClass.md new file mode 100644 index 00000000000..6200dd8ce58 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerClass.md @@ -0,0 +1,46 @@ +--- +title: EditPlayerClass +sidebar_label: EditPlayerClass +description: 编辑一个职业数据。 +tags: ["职业"] +--- + + + +## 描述 + +编辑已定义的玩家职业数据。 + +| 名称 | 描述 | +| -------------- | -------------------------------------- | +| classid | 要编辑的职业 ID | +| team | 玩家生成时所属队伍 | +| skin | 生成时使用的[皮肤](../resources/skins) | +| Float:spawnX | 生成点 X 坐标 | +| Float:spawnY | 生成点 Y 坐标 | +| Float:spawnZ | 生成点 Z 坐标 | +| Float:angle | 生成时面朝方向(角度) | +| WEAPON:weapon1 | 首把生成武器 | +| ammo1 | 首把武器弹药量 | +| WEAPON:weapon2 | 第二把生成武器 | +| ammo2 | 第二把武器弹药量 | +| WEAPON:weapon3 | 第三把生成武器 | +| ammo3 | 第三把武器弹药量 | + +## 示例 + +```c +// 编辑职业ID 10 +EditPlayerClass(10, TEAM_NONE, 299, -253.8291, 2602.9312, 62.8527, -90.0000, WEAPON_KNIFE, 1, WEAPON_MP5, 100, WEAPON_COLT45, 20); +``` + +## 相关函数 + +- [AddPlayerClass](AddPlayerClass): 添加职业 +- [AddPlayerClassEx](AddPlayerClassEx): 添加带默认队伍的职业 +- [GetAvailableClasses](GetAvailableClasses): 获取已定义职业数量 + +## 相关资源 + +- [皮肤 ID](../resources/skins) +- [武器 ID](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerObject.md new file mode 100644 index 00000000000..310a5efc24d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EditPlayerObject.md @@ -0,0 +1,59 @@ +--- +title: EditPlayerObject +sidebar_label: EditPlayerObject +description: 允许玩家通过图形界面编辑其专属物体的位置和旋转。 +tags: ["玩家"] +--- + +## 描述 + +允许玩家通过图形用户界面(GUI)使用鼠标编辑其专属物体的位置和旋转。 + +| 名称 | 描述 | +| -------- | ----------------------- | +| playerid | 执行编辑操作的玩家 ID | +| objectid | 待编辑的玩家专属物体 ID | + +## 返回值 + +**1** - 函数执行成功 + +**0** - 函数执行失败(玩家或物体无效) + +## 示例 + +```c +new object[MAX_PLAYERS]; +public OnPlayerSpawn(playerid) +{ + object[playerid] = CreatePlayerObject(playerid, 1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/edit", true)) + { + EditPlayerObject(playerid, object[playerid]); + SendClientMessage(playerid, 0xFFFFFFFF, "服务器:您现在可以编辑您的专属物体!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +编辑过程中按住空格键(车内按 W 键)并移动鼠标可调整视角 + +::: + +## 相关函数 + +- [CreateObject](CreateObject): 创建全局物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [MoveObject](MoveObject): 移动全局物体 +- [EditAttachedObject](EditAttachedObject): 编辑附加物体 +- [SelectObject](SelectObject): 选择物体 +- [CancelEdit](CancelEdit): 取消编辑操作 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableAllAnimations.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableAllAnimations.md new file mode 100644 index 00000000000..8ad4c1dc89b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableAllAnimations.md @@ -0,0 +1,52 @@ +--- +title: EnableAllAnimations +sidebar_label: EnableAllAnimations +description: 允许使用某些版本中缺失的动画。 +tags: ["动画"] +--- + + + +## 描述 + +启用部分版本中缺失的动画资源。 + +| 名称 | 描述 | +| ----------- | -------------------------------------- | +| bool:enable | true 启用缺失动画 / false 禁用缺失动画 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnGameModeInit() +{ + EnableAllAnimations(true); // 启用缺失动画资源 + return 1; +} +``` + +## 注意事项 + +:::tip + +可通过 [config.json](../../server/config.json) 配置文件全局控制动画资源加载: + +```json +"use_all_animations": false, +``` + +::: + +## 相关函数 + +- [AreAllAnimationsEnabled](AreAllAnimationsEnabled): 检测是否启用了所有动画资源 +- [ApplyAnimation](ApplyAnimation): 对玩家应用动画 +- [ClearAnimations](ClearAnimations): 清除玩家当前动画 + +## 相关资源 + +- [动画列表](../resources/animations) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnablePlayerCameraTarget.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnablePlayerCameraTarget.md new file mode 100644 index 00000000000..7d77c519d71 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnablePlayerCameraTarget.md @@ -0,0 +1,40 @@ +--- +title: EnablePlayerCameraTarget +sidebar_label: EnablePlayerCameraTarget +description: 切换玩家的视角目标功能(默认禁用以节省带宽)。 +tags: ["玩家"] +--- + + + +## 描述 + +切换玩家的视角目标检测功能。该功能默认禁用以节省网络带宽。 + +| 名称 | 描述 | +| ----------- | ----------------------------- | +| playerid | 要设置视角目标功能的玩家 ID | +| bool:enable | true 启用 / false 禁用 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + EnablePlayerCameraTarget(playerid, true); // 玩家连接时启用视角目标功能 + return 1; +} +``` + +## 相关函数 + +- [IsPlayerCameraTargetEnabled](IsPlayerCameraTargetEnabled): 检查玩家视角目标是否启用 +- [GetPlayerCameraTargetVehicle](GetPlayerCameraTargetVehicle): 获取玩家正在观察的车辆 ID +- [GetPlayerCameraTargetPlayer](GetPlayerCameraTargetPlayer): 获取玩家正在观察的其他玩家 ID +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForAll.md new file mode 100644 index 00000000000..65990937164 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForAll.md @@ -0,0 +1,44 @@ +--- +title: EnableStuntBonusForAll +sidebar_label: EnableStuntBonusForAll +description: 为所有玩家启用或禁用特技奖励。 +tags: [] +--- + +## 描述 + +为所有玩家启用或禁用车辆特技奖励。启用时,玩家执行车辆特技(例如翘轮动作)将获得金钱奖励。 + +| 名称 | 描述 | +| ----------- | -------------------------------------- | +| bool:enable | true 启用特技奖励 / false 禁用特技奖励 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnGameModeInit() +{ + EnableStuntBonusForAll(false); // 禁用全局特技奖励 + return 1; +} +``` + +## 注意事项 + +:::tip + +可通过 [config.json](../../server/config.json) 配置文件全局控制特技奖励: + +```json +"use_stunt_bonuses": false, +``` + +::: + +## 相关函数 + +- [EnableStuntBonusForPlayer](EnableStuntBonusForPlayer): 为单个玩家切换特技奖励功能 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForPlayer.md new file mode 100644 index 00000000000..706d3bebcb7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableStuntBonusForPlayer.md @@ -0,0 +1,35 @@ +--- +title: EnableStuntBonusForPlayer +sidebar_label: EnableStuntBonusForPlayer +description: 切换玩家的特技奖励功能。 +tags: ["玩家"] +--- + +## 描述 + +切换指定玩家的车辆特技奖励(默认启用)。 + +| 名称 | 描述 | +| ----------- | ----------------------- | +| playerid | 要设置特技奖励的玩家 ID | +| bool:enable | true 启用 / false 禁用 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + EnableStuntBonusForPlayer(playerid, false); // 玩家连接时禁用其特技奖励 + return 1; +} +``` + +## 相关函数 + +- [EnableStuntBonusForAll](EnableStuntBonusForAll): 为所有玩家切换特技奖励功能 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableTirePopping.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableTirePopping.md new file mode 100644 index 00000000000..d38282fa7b0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableTirePopping.md @@ -0,0 +1,43 @@ +--- +title: EnableTirePopping +sidebar_label: EnableTirePopping +description: 通过此函数可以启用或禁用轮胎爆胎效果。 +tags: [] +--- + +## 描述 + +通过此函数可以启用或禁用车辆轮胎爆胎机制。 + +| 名称 | 描述 | +| ----------- | -------------------------------------- | +| bool:enable | true 启用轮胎爆胎 / false 禁用轮胎爆胎 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 这将禁用游戏模式中的轮胎爆胎机制 + EnableTirePopping(false); + return 1; +} +``` + +## 注意事项 + +:::warning + +- 该函数已在 SA-MP 0.3 版本移除 +- 轮胎爆胎机制默认启用 +- 若需禁用该功能,需通过 [OnVehicleDamageStatusUpdate](../callbacks/OnVehicleDamageStatusUpdate) 回调手动实现 + +::: + +## 相关函数 + +- [SetPlayerTeam](SetPlayerTeam): 设置玩家队伍 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableVehicleFriendlyFire.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableVehicleFriendlyFire.md new file mode 100644 index 00000000000..aa4b2f8e7dd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableVehicleFriendlyFire.md @@ -0,0 +1,28 @@ +--- +title: EnableVehicleFriendlyFire +sidebar_label: EnableVehicleFriendlyFire +description: 启用队伍车辆的友军伤害机制。 +tags: ["车辆"] +--- + +## 描述 + +启用队伍车辆的友军伤害机制。玩家将能够攻击同队成员的车辆(必须使用 [SetPlayerTeam](SetPlayerTeam) 设置队伍)。 + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnGameModeInit() +{ + EnableVehicleFriendlyFire(); // 启用友军伤害 + return 1; +} +``` + +## 相关函数 + +- [SetPlayerTeam](SetPlayerTeam): 设置玩家队伍 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableZoneNames.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableZoneNames.md new file mode 100644 index 00000000000..c4de762f4d8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EnableZoneNames.md @@ -0,0 +1,46 @@ +--- +title: EnableZoneNames +sidebar_label: EnableZoneNames +description: 启用或禁用进入区域时屏幕右下角显示的区域名称(例如"Vinewood"或"Doherty")。 +tags: ["游戏界面"] +--- + +## 描述 + +此函数用于控制玩家进入新区域时是否在屏幕右下角显示区域名称(例如"Vinewood"或"Doherty")。此设置属于游戏模式选项,应在 [OnGameModeInit](../callbacks/OnGameModeInit) 回调中设置。 + +| 名称 | 描述 | +| ----------- | -------------------------------------- | +| bool:enable | true 启用区域名称显示 / false 禁用显示 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnGameModeInit() +{ + EnableZoneNames(true); // 启用区域名称显示 + return 1; +} +``` + +## 注意事项 + +:::warning + +该函数已在 SA-MP 0.3 版本移除(因其导致的崩溃问题) + +::: + +:::tip + +可通过 [config.json](../../server/config.json) 配置文件全局控制区域名称显示: + +```json +"use_zone_names": true, +``` + +::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EndObjectEditing.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EndObjectEditing.md new file mode 100644 index 00000000000..e14891761e5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/EndObjectEditing.md @@ -0,0 +1,45 @@ +--- +title: EndObjectEditing +sidebar_label: EndObjectEditing +description: 取消玩家的物体编辑模式。 +tags: ["物体"] +--- + + + +## 描述 + +强制终止指定玩家的物体编辑状态。 + +| 名称 | 描述 | +| -------- | ------------------- | +| playerid | 要终止编辑的玩家 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/stopedit", true)) + { + EndObjectEditing(playerid); + SendClientMessage(playerid, 0xFFFFFFFF, "服务器:物体编辑已终止!"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [BeginObjectSelecting](BeginObjectSelecting): 进入物体选择模式 +- [BeginObjectEditing](BeginObjectEditing): 开始编辑全局物体 +- [BeginPlayerObjectEditing](BeginPlayerObjectEditing): 开始编辑玩家专属物体 +- [EditAttachedObject](EditAttachedObject): 编辑附加物体 +- [CreateObject](CreateObject): 创建全局物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [MoveObject](MoveObject): 移动全局物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/FindModelFileNameFromCRC.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/FindModelFileNameFromCRC.md new file mode 100644 index 00000000000..13b2446c89c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/FindModelFileNameFromCRC.md @@ -0,0 +1,28 @@ +--- +title: FindModelFileNameFromCRC +sidebar_label: FindModelFileNameFromCRC +description: 查找现有的自定义皮肤或简单物体模型文件。 +tags: ["自定义模型", "自定义皮肤", "简单模型"] +--- + + + +## 描述 + +根据 CRC 校验和查找已存在的自定义皮肤或简单物体模型文件。模型文件默认存储在服务器的 models 目录下(通过 artpath 配置指定)。 + +| 名称 | 描述 | +| ---------------------- | ------------------------------------------- | +| crc | 自定义模型文件的 CRC 校验和 | +| output[] | 用于存储.dff 文件名的数组(通过引用传递) | +| size = sizeof (output) | 需存储的字符串长度,默认值为 sizeof(output) | + +## 返回值 + +**1:** 函数执行成功。 + +**0:** 函数执行失败。 + +## 相关函数 + +- [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading): 当玩家完成自定义模型下载时触发该回调 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/FindTextureFileNameFromCRC.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/FindTextureFileNameFromCRC.md new file mode 100644 index 00000000000..bcbeba1eb76 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/FindTextureFileNameFromCRC.md @@ -0,0 +1,28 @@ +--- +title: FindTextureFileNameFromCRC +sidebar_label: FindTextureFileNameFromCRC +description: 查找现有的自定义皮肤或简单物体纹理文件。 +tags: ["自定义模型", "自定义皮肤", "简单模型"] +--- + + + +## 描述 + +根据 CRC 校验和查找已存在的自定义皮肤或简单物体纹理文件。模型文件默认存储在服务器的 models 目录下(通过 artpath 配置指定)。 + +| 名称 | 描述 | +| ---------------------- | ------------------------------------------- | +| crc | 自定义模型文件的 CRC 校验和 | +| output[] | 用于存储.txd 文件名的数组(通过引用传递) | +| size = sizeof (output) | 需存储的字符串长度,默认值为 sizeof(output) | + +## 返回值 + +**1:** 函数执行成功。 + +**0:** 函数执行失败。 + +## 相关函数 + +- [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading): 当玩家完成自定义模型下载时触发该回调 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ForceClassSelection.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ForceClassSelection.md new file mode 100644 index 00000000000..7fdb9c5ef13 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ForceClassSelection.md @@ -0,0 +1,52 @@ +--- +title: ForceClassSelection +sidebar_label: ForceClassSelection +description: 强制玩家返回职业选择界面。 +tags: ["职业系统"] +--- + +## 描述 + +该函数强制指定玩家返回职业选择界面。 + +| 参数名 | 描述 | +| -------- | ----------------- | +| playerid | 需要操作的玩家 ID | + +## 返回值 + +此函数不返回特定值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/class", true)) + { + ForceClassSelection(playerid); // 强制玩家返回职业选择界面 + TogglePlayerSpectating(playerid, true); + TogglePlayerSpectating(playerid, false); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +当结合使用 TogglePlayerSpectating 函数时(如上例所示),本函数不会将玩家状态切换为 PLAYER_STATE_WASTED(濒死状态)。 + +::: + +## 相关函数 + +- [AddPlayerClass](AddPlayerClass): 添加新职业配置 +- [SetPlayerSkin](SetPlayerSkin): 设置玩家皮肤外观 +- [GetPlayerSkin](GetPlayerSkin): 获取玩家当前皮肤 ID + +## 相关回调 + +- [OnPlayerRequestClass](../callbacks/OnPlayerRequestClass): 当玩家在职业选择界面切换职业时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameModeExit.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameModeExit.md new file mode 100644 index 00000000000..451b4b4c12e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameModeExit.md @@ -0,0 +1,23 @@ +--- +title: GameModeExit +sidebar_label: GameModeExit +description: 结束当前游戏模式。 +tags: [] +--- + +## 描述 + +结束当前游戏模式。 + +## 示例 + +```c +if (OneTeamHasWon) +{ + GameModeExit(); +} +``` + +## 相关函数 + +- [SetModeRestartTime](SetModeRestartTime): 设置加载主脚本之间的延迟时间(以秒为单位)。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForAll.md new file mode 100644 index 00000000000..d8227413cf1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForAll.md @@ -0,0 +1,61 @@ +--- +title: GameTextForAll +sidebar_label: GameTextForAll +description: 为所有玩家显示指定持续时间的'游戏文本'(屏幕文本)。 +tags: ["游戏文本"] +--- + +## 描述 + +为所有玩家显示指定持续时间的'游戏文本'(屏幕文本)。 + +| 参数名 | 说明 | +| ---------------- | --------------------------------------------- | +| const format[] | 要显示的文本内容 | +| time | 文本显示持续时间(以毫秒为单位) | +| style | 文本显示的[样式](../resources/gametextstyles) | +| OPEN_MP_TAGS:... | 任意数量的不限类型的参数 | + +## 返回值 + +该函数总是返回 1。 + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 此示例在玩家死亡后,为所有玩家显示白色大字体的"[玩家昵称] 已死亡" + // 使用3号文本类型,持续5秒(5000毫秒) + new name[MAX_PLAYER_NAME]; + GetPlayerName(playerid, name, sizeof(name)); + + // 正确格式化死亡消息并显示给所有玩家: + new string[64]; + format(string, sizeof(string), "~w~%s has passed away", name); + GameTextForAll(string, 5000, 3); + + // 专业提示:在open.mp中无需使用`format` + GameTextForAll("~w~%s has passed away", 5000, 3, name); + return 1; +} +``` + +## 注意事项 + +:::warning + +注意:如果游戏文本中使用的波浪号(`~`)符号数量为奇数,可能导致玩家客户端崩溃。在超过 255 个字符后使用颜色代码(例如~r~)会导致客户端崩溃。 + +::: + +## 相关函数 + +- [HideGameTextForAll](HideGameTextForAll): 停止为所有玩家显示游戏文本样式 +- [GameTextForPlayer](GameTextForPlayer): 为单个玩家显示游戏文本 +- [HideGameTextForPlayer](HideGameTextForPlayer): 停止为单个玩家显示游戏文本样式 +- [TextDrawShowForAll](TextDrawShowForAll): 为所有玩家显示文本绘图 + +## 相关资源 + +- [游戏文本样式](../resources/gametextstyles) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForPlayer.md new file mode 100644 index 00000000000..83e7ce87047 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GameTextForPlayer.md @@ -0,0 +1,65 @@ +--- +title: GameTextForPlayer +sidebar_label: GameTextForPlayer +description: 为指定玩家显示持续特定时间的'游戏文本'(屏幕文本)。 +tags: ["玩家", "游戏文本"] +--- + +## 描述 + +为指定玩家显示持续特定时间的'游戏文本'(屏幕文本)。 + +| 参数名 | 说明 | +| ---------------- | --------------------------------------------- | +| playerid | 目标玩家的 ID | +| const format[] | 要显示的文本内容 | +| time | 文本显示持续时间(以毫秒为单位) | +| style | 文本显示的[样式](../resources/gametextstyles) | +| OPEN_MP_TAGS:... | 任意数量的不限类型的参数 | + +## 返回值 + +**true** - 函数执行成功(即使样式/时间参数无效也会返回成功,但不会显示文本,可能引发崩溃) + +**false** - 函数执行失败(字符串为空或玩家未连接) + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + GameTextForPlayer(playerid, "Wasted", 5000, 2); + + if (killerid != INVALID_PLAYER_ID) + { + new name[MAX_PLAYER_NAME]; + GetPlayerName(playerid, name, sizeof(name)); + + GameTextForPlayer(killerid, "~w~You killed ~r~%s", 3000, 3, name); + } + return 1; +} +``` + +## 注意事项 + +:::warning + +注意:游戏文本中波浪号(`~`)的数量为奇数可能导致客户端崩溃。颜色代码(如~r~)在超过 255 字符后使用会引发崩溃。 + +字符串末尾的空格会导致失效。例如:`"爆头 "` 会失败,应改为 `"爆头"` 或 `"爆头_"`(使用下划线替代空格)。 + +::: + +## 相关函数 + +- [HideGameTextForPlayer](HideGameTextForPlayer): 停止为玩家显示游戏文本样式 +- [GameTextForAll](GameTextForAll): 为所有玩家显示游戏文本 +- [HideGameTextForAll](HideGameTextForAll): 停止为所有玩家显示游戏文本样式 +- [GetGameText](GetGameText): 获取指定游戏文本样式的信息 +- [HasGameText](HasGameText): 检查玩家当前是否显示指定样式的游戏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 为所有玩家显示文本绘图 + +## 相关资源 + +- [游戏文本样式](../resources/gametextstyles) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneCreate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneCreate.md new file mode 100644 index 00000000000..5ce430eeb7e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneCreate.md @@ -0,0 +1,77 @@ +--- +title: GangZoneCreate +sidebar_label: GangZoneCreate +description: 创建帮派区域(彩色雷达区域)。 +tags: ["帮派区域"] +--- + +## 描述 + +创建帮派区域(彩色雷达区域)。 + +| 参数名 | 说明 | +| ---------- | ------------------------- | +| Float:minX | 帮派区域西侧边界的 X 坐标 | +| Float:minY | 帮派区域南侧边界的 Y 坐标 | +| Float:maxX | 帮派区域东侧边界的 X 坐标 | +| Float:maxY | 帮派区域北侧边界的 Y 坐标 | + +## 返回值 + +返回创建区域的 ID,创建失败返回 **-1** + +## 示例 + +```c +new gangZone; + +public OnGameModeInit() +{ + gangZone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} +``` + +``` + 最大Y坐标 + v + -------------* < 最大X坐标 + | | + | 帮派区域 | + | 中心点 | + | | + 最小X坐标 > *------------- + ^ + 最小Y坐标 +``` + +## 注意事项 + +:::warning + +- 最多支持创建 1024 个帮派区域 +- 参数顺序错误会导致区域显示异常 + +::: + +:::tip + +本函数仅创建帮派区域,需使用[GangZoneShowForPlayer](GangZoneShowForPlayer)或[GangZoneShowForAll](GangZoneShowForAll)进行显示 + +::: + +## 相关函数 + +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 + +## 帮派区域编辑器 + +- [Prineside 开发工具-帮派区域编辑器](https://dev.prineside.com/en/gtasa_gangzone_editor/) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneDestroy.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneDestroy.md new file mode 100644 index 00000000000..d883582f7bd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneDestroy.md @@ -0,0 +1,50 @@ +--- +title: GangZoneDestroy +sidebar_label: GangZoneDestroy +description: 销毁帮派区域。 +tags: ["帮派区域"] +--- + +## 描述 + +销毁帮派区域。 + +| 参数名 | 说明 | +| ------ | --------------- | +| zoneid | 要销毁的区域 ID | + +## 返回值 + +1:函数执行成功。 + +0:函数执行失败。指定的帮派区域 ID 不存在。 + +## 示例 + +```c +new gangZone; + +public OnGameModeInit() +{ + gangZone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} + +public OnGameModeExit() +{ + GangZoneDestroy(gangZone); + return 1; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForAll.md new file mode 100644 index 00000000000..2102d527f34 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForAll.md @@ -0,0 +1,49 @@ +--- +title: GangZoneFlashForAll +sidebar_label: GangZoneFlashForAll +description: 为所有玩家闪烁显示帮派区域。 +tags: ["帮派区域"] +--- + +## 描述 + +为所有玩家闪烁显示帮派区域。 + +| 参数名 | 说明 | +| ----------- | ------------------------------------------------------- | +| zoneid | 要闪烁的区域 ID | +| flashColour | 闪烁颜色(RGBA 格式的整型或十六进制值,支持透明度通道) | + +## 返回值 + +该函数没有返回值。 + +## 示例 + +```c +new gGangZoneId; + +public OnGameModeInit() +{ + gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + GangZoneFlashForAll(gGangZoneId, 0xFF0000FF); // 红色 + return 1; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 为单个玩家闪烁帮派区域 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止为玩家闪烁帮派区域 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止为所有玩家闪烁帮派区域 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForPlayer.md new file mode 100644 index 00000000000..8770469c308 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneFlashForPlayer.md @@ -0,0 +1,50 @@ +--- +title: GangZoneFlashForPlayer +sidebar_label: GangZoneFlashForPlayer +description: 使帮派区域对指定玩家闪烁显示。 +tags: ["玩家", "帮派区域"] +--- + +## 描述 + +使指定玩家的帮派区域闪烁显示。 + +| 参数名 | 说明 | +| ----------- | ------------------------------------------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要闪烁的区域 ID | +| flashColour | 闪烁颜色(RGBA 格式的整型或十六进制值,支持透明度通道) | + +## 返回值 + +该函数没有返回值。 + +## 示例 + +```c +new gGangZoneId; + +public OnGameModeInit() +{ + gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + GangZoneFlashForPlayer(playerid, gGangZoneId, 0xFF0000FF); + return 1; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForAll](GangZoneFlashForAll): 为所有玩家闪烁帮派区域 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止为玩家闪烁帮派区域 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止为所有玩家闪烁帮派区域 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetColourForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetColourForPlayer.md new file mode 100644 index 00000000000..eafbdeb026a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetColourForPlayer.md @@ -0,0 +1,38 @@ +--- +title: GangZoneGetColourForPlayer +sidebar_label: GangZoneGetColourForPlayer +description: 获取玩家帮派区域的颜色 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +获取指定玩家帮派区域的当前颜色。 + +| 参数名 | 说明 | +| -------- | ----------- | +| playerid | 目标玩家 ID | +| zoneid | 帮派区域 ID | + +## 返回值 + +返回玩家帮派区域的 RGBA 颜色值。 + +**0:** 函数执行失败。该帮派区域未对玩家显示。 + +## 相关函数 + +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 +- [IsValidGangZone](IsValidGangZone): 检查帮派区域是否有效 +- [IsPlayerInGangZone](IsPlayerInGangZone): 检查玩家是否在帮派区域内 +- [IsGangZoneVisibleForPlayer](IsGangZoneVisibleForPlayer): 检查帮派区域对玩家是否可见 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetFlashColourForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetFlashColourForPlayer.md new file mode 100644 index 00000000000..c106545a221 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetFlashColourForPlayer.md @@ -0,0 +1,38 @@ +--- +title: GangZoneGetFlashColourForPlayer +sidebar_label: GangZoneGetFlashColourForPlayer +description: 获取玩家帮派区域的闪烁颜色 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +获取指定玩家帮派区域的当前闪烁颜色。 + +| 参数名 | 说明 | +| -------- | ----------- | +| playerid | 目标玩家 ID | +| zoneid | 帮派区域 ID | + +## 返回值 + +返回玩家帮派区域的 RGBA 闪烁颜色值。 + +**0:** 函数执行失败。该帮派区域未对玩家显示或未设置闪烁。 + +## 相关函数 + +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 +- [IsValidGangZone](IsValidGangZone): 检查帮派区域是否有效 +- [IsPlayerInGangZone](IsPlayerInGangZone): 检查玩家是否在帮派区域内 +- [IsGangZoneVisibleForPlayer](IsGangZoneVisibleForPlayer): 检查帮派区域对玩家是否可见 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetPos.md new file mode 100644 index 00000000000..77e39d23521 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneGetPos.md @@ -0,0 +1,61 @@ +--- +title: GangZoneGetPos +sidebar_label: GangZoneGetPos +description: 获取帮派区域的坐标位置 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +获取帮派区域的坐标位置,包括最小 X、最小 Y、最大 X、最大 Y 坐标。 + +| 参数名 | 说明 | +| ----------- | ------------------------------------------------------- | +| zoneid | 需要获取坐标的帮派区域 ID | +| &Float:minX | 用于存储帮派区域西侧边界 X 坐标的浮点变量(按引用传递) | +| &Float:minY | 用于存储帮派区域南侧边界 Y 坐标的浮点变量(按引用传递) | +| &Float:maxX | 用于存储帮派区域东侧边界 X 坐标的浮点变量(按引用传递) | +| &Float:maxY | 用于存储帮派区域北侧边界 Y 坐标的浮点变量(按引用传递) | + +## 返回值 + +该函数总是返回 **true**。 + +## 示例 + +```c +new gangZone; + +public OnGameModeInit() +{ + gangZone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + + new + Float:minX, + Float:minY, + Float:maxX, + Float:maxY; + + GangZoneGetPos(gangZone, minX, minY, maxX, maxY); + return 1; +} +``` + +## 相关函数 + +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 +- [IsValidGangZone](IsValidGangZone): 检查帮派区域是否有效 +- [IsPlayerInGangZone](IsPlayerInGangZone): 检查玩家是否在帮派区域内 +- [IsGangZoneVisibleForPlayer](IsGangZoneVisibleForPlayer): 检查帮派区域对玩家是否可见 +- [GangZoneGetFlashColourForPlayer](GangZoneGetFlashColourForPlayer): 获取玩家帮派区域的闪烁颜色 +- [IsGangZoneFlashingForPlayer](IsGangZoneFlashingForPlayer): 检查帮派区域是否对玩家闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForAll.md new file mode 100644 index 00000000000..5709d249a43 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForAll.md @@ -0,0 +1,52 @@ +--- +title: GangZoneHideForAll +sidebar_label: GangZoneHideForAll +description: 为所有玩家隐藏帮派区域。 +tags: ["帮派区域"] +--- + +## 描述 + +为所有玩家隐藏指定的帮派区域。 + +| 参数名 | 说明 | +| ------ | --------------- | +| zoneid | 要隐藏的区域 ID | + +## 返回值 + +该函数没有返回值。 + +## 示例 + +```c +new gGangZoneId; + +public OnGameModeInit() +{ + gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/hidezone", true)) + { + GangZoneHideForAll(gGangZoneId); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForPlayer.md new file mode 100644 index 00000000000..e25fe7769f6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneHideForPlayer.md @@ -0,0 +1,55 @@ +--- +title: GangZoneHideForPlayer +sidebar_label: GangZoneHideForPlayer +description: 为指定玩家隐藏帮派区域。 +tags: ["玩家", "帮派区域"] +--- + +## 描述 + +为指定玩家隐藏帮派区域。 + +| 参数名 | 说明 | +| -------- | --------------- | +| playerid | 目标玩家 ID | +| zoneid | 要隐藏的区域 ID | + +## 返回值 + +该函数没有返回值。 + +## 示例 + +```c +new gGangZoneId; + +public OnGameModeInit() +{ + gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + GangZoneShowForPlayer(playerid, gGangZoneId, 0xFF0000FF); + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + GangZoneHideForPlayer(playerid, gGangZoneId); + return 1; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForAll.md new file mode 100644 index 00000000000..d114aa6ec91 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForAll.md @@ -0,0 +1,54 @@ +--- +title: GangZoneShowForAll +sidebar_label: GangZoneShowForAll +description: 为所有玩家显示指定颜色的帮派区域。 +tags: ["帮派区域"] +--- + +## 描述 + +为所有玩家显示指定颜色的帮派区域。 + +| 参数名 | 说明 | +| ------ | ----------------------------------------------------------------- | +| zoneid | 要显示的帮派区域 ID(由[GangZoneCreate](GangZoneCreate)创建返回) | +| colour | 显示颜色(RGBA 格式的整型或十六进制值,支持透明度通道) | + +## 返回值 + +1:函数执行成功。帮派区域已对所有玩家显示。 + +0:函数执行失败。指定的帮派区域不存在。 + +## 示例 + +```c +new gGangZoneId; + +public OnGameModeInit() +{ + gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + if (IsPlayerAdmin(playerid)) + { + GangZoneShowForAll(gGangZoneId, 0xFF0000FF); + } + return 1; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为单个玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForPlayer.md new file mode 100644 index 00000000000..81d675c8be4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneShowForPlayer.md @@ -0,0 +1,50 @@ +--- +title: GangZoneShowForPlayer +sidebar_label: GangZoneShowForPlayer +description: 为指定玩家显示帮派区域。 +tags: ["玩家", "帮派区域"] +--- + +## 描述 + +为指定玩家显示帮派区域。需预先使用[GangZoneCreate](GangZoneCreate)创建。 + +| 参数名 | 说明 | +| -------- | ----------------------------------------------------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要显示的帮派区域 ID(由[GangZoneCreate](GangZoneCreate)创建返回) | +| colour | 显示颜色(RGBA 格式的整型或十六进制值,支持透明度通道) | + +## 返回值 + +显示成功返回**1**,否则返回**0**(帮派区域不存在) + +## 示例 + +```c +new gGangZoneId; + +public OnGameModeInit() +{ + gGangZoneId = GangZoneCreate(1082.962, -2787.229, 2942.549, -1859.51); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + GangZoneShowForPlayer(playerid, gGangZoneId, 0xFFFF0096); + return 1; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForAll.md new file mode 100644 index 00000000000..df7e100b47c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForAll.md @@ -0,0 +1,56 @@ +--- +title: GangZoneStopFlashForAll +sidebar_label: GangZoneStopFlashForAll +description: 停止所有玩家的帮派区域闪烁。 +tags: ["帮派区域"] +--- + +## 描述 + +停止指定帮派区域对所有玩家的闪烁效果。 + +| 参数名 | 说明 | +| ------ | ------------------------------------------------- | +| zoneid | 要停止闪烁的区域 ID(由 GangZoneCreate 创建返回) | + +## 返回值 + +**1**: 函数执行成功(即使该区域原本未处于闪烁状态也会返回成功) + +**0**: 函数执行失败(指定的帮派区域不存在) + +## 示例 + +```c +new gGangZoneId; + +public OnGameModeInit() +{ + gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + GangZoneFlashForAll(gGangZoneId, COLOR_RED); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + GangZoneStopFlashForAll(gGangZoneId); + return 1; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForPlayer.md new file mode 100644 index 00000000000..6189e1c7d69 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GangZoneStopFlashForPlayer.md @@ -0,0 +1,55 @@ +--- +title: GangZoneStopFlashForPlayer +sidebar_label: GangZoneStopFlashForPlayer +description: 停止指定玩家的帮派区域闪烁效果。 +tags: ["玩家", "帮派区域"] +--- + +## 描述 + +停止对指定玩家的帮派区域闪烁效果。 + +| 参数名 | 说明 | +| -------- | ----------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要停止闪烁的帮派区域 ID | + +## 返回值 + +该函数没有返回值。 + +## 示例 + +```c +new gGangZoneId; + +public OnGameModeInit() +{ + gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + GangZoneFlashForPlayer(playerid, gGangZoneId, 0xFF0000FF); + return 1; +} + +public OnPlayerEnterVehicle(playerid, vehicleid) +{ + GangZoneStopFlashForPlayer(playerid, gGangZoneId); + return 1; +} +``` + +## 相关函数 + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止所有玩家的帮派区域闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelAttachedData.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelAttachedData.md new file mode 100644 index 00000000000..b404077b542 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelAttachedData.md @@ -0,0 +1,56 @@ +--- +title: Get3DTextLabelAttachedData +sidebar_label: Get3DTextLabelAttachedData +description: 获取3D文本标签的附加数据 +tags: ["3D文本标签"] +--- + + + +## 描述 + +获取 3D 文本标签的附加数据。 + +| 参数名 | 说明 | +| ---------------- | ---------------------------------------- | +| Text3D:textid | 要获取附加数据的 3D 文本标签 ID | +| &parentPlayerid | 用于存储父级玩家 ID 的变量(按引用传递) | +| &parentVehicleid | 用于存储父级车辆 ID 的变量(按引用传递) | + +## 示例 + +**父级玩家 ID** 示例: + +```c +new Text3D:gMyLabel; +new parentPlayerid; +new parentVehicleid; + +gMyLabel = Create3DTextLabel("你好,我是新来的!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, false); +Attach3DTextLabelToPlayer(gMyLabel, playerid, 0.0, 0.0, 0.7); + +Get3DTextLabelAttachedData(gMyLabel, parentPlayerid, parentVehicleid); +``` + +**父级车辆 ID** 示例: + +```c +new Text3D:gVehicle3dText[MAX_VEHICLES]; +new gVehicleId; + +new parentPlayerid; +new parentVehicleid; + +gVehicleId = CreateVehicle(510, 0.0, 0.0, 15.0, 5, 0, 120); +gVehicle3dText[gVehicleId] = Create3DTextLabel("示例文本", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, false); +Attach3DTextLabelToVehicle(gVehicle3dText[gVehicleId], gVehicleId, 0.0, 0.0, 2.0); + +Get3DTextLabelAttachedData(gVehicle3dText[gVehicleId], parentPlayerid, parentVehicleid); +// 此时parentVehicleid将等于gVehicleId的值 +``` + +## 相关函数 + +- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): 将 3D 文本标签附加到玩家身上 +- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): 将 3D 文本标签附加到车辆 +- [GetPlayer3DTextLabelAttachedData](GetPlayer3DTextLabelAttachedData): 获取玩家 3D 文本标签的附加数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColor.md new file mode 100644 index 00000000000..bac1c72a48c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColor.md @@ -0,0 +1,39 @@ +--- +title: Get3DTextLabelColor +sidebar_label: Get3DTextLabelColor +description: 获取3D文本标签颜色 +tags: ["3D文本标签"] +--- + +:::warning + +该函数已弃用,请使用[Get3DTextLabelColour](Get3DTextLabelColour)。 + +::: + +## 描述 + +获取 3D 文本标签的颜色值。 + +| 参数名 | 说明 | +| ------------- | --------------------------- | +| Text3D:textid | 要获取颜色的 3D 文本标签 ID | + +## 返回值 + +返回 3D 文本标签的 RGBA 颜色值。 + +## 示例 + +```c +new Text3D:gMyLabel; + +gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); + +new color = Get3DTextLabelColor(gMyLabel); +// color = 0x008080FF +``` + +## 相关函数 + +- [GetPlayer3DTextLabelColor](GetPlayer3DTextLabelColor): 获取玩家 3D 文本标签颜色 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColour.md new file mode 100644 index 00000000000..bee5c02272f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelColour.md @@ -0,0 +1,35 @@ +--- +title: Get3DTextLabelColour +sidebar_label: Get3DTextLabelColour +description: 获取3D文本标签颜色 +tags: ["3D文本标签"] +--- + + + +## 描述 + +获取 3D 文本标签的颜色值。 + +| 参数名 | 说明 | +| ------------- | --------------------------- | +| Text3D:textid | 要获取颜色的 3D 文本标签 ID | + +## 返回值 + +返回 3D 文本标签的 RGBA 颜色值(十六进制格式)。 + +## 示例 + +```c +new Text3D:gMyLabel; + +gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); + +new colour = Get3DTextLabelColour(gMyLabel); +// colour = 0x008080FF +``` + +## 相关函数 + +- [GetPlayer3DTextLabelColour](GetPlayer3DTextLabelColour): 获取玩家专属 3D 文本标签颜色 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelDrawDistance.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelDrawDistance.md new file mode 100644 index 00000000000..3dbc8244954 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelDrawDistance.md @@ -0,0 +1,37 @@ +--- +title: Get3DTextLabelDrawDistance +sidebar_label: Get3DTextLabelDrawDistance +description: 获取3D文本标签的可见绘制距离 +tags: ["3D文本标签"] +--- + + + +## 描述 + +获取 3D 文本标签的可见绘制距离。 + +| 参数名 | 说明 | +| ------------- | ------------------------------- | +| Text3D:textid | 要获取绘制距离的 3D 文本标签 ID | + +## 返回值 + +以浮点数形式返回 3D 文本标签的可见范围(单位:游戏单位) + +## 示例 + +```c +new Text3D:gMyLabel; +new Float:drawDistance; + +gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 0, false); + +drawDistance = Get3DTextLabelDrawDistance(gMyLabel); +// drawDistance = 10.0 +``` + +## 相关函数 + +- [Set3DTextLabelDrawDistance](Set3DTextLabelDrawDistance): 设置 3D 文本标签绘制距离 +- [GetPlayer3DTextLabelDrawDistance](GetPlayer3DTextLabelDrawDistance): 获取玩家专属 3D 文本标签绘制距离 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelLOS.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelLOS.md new file mode 100644 index 00000000000..56f5cc802e5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelLOS.md @@ -0,0 +1,37 @@ +--- +title: Get3DTextLabelLOS +sidebar_label: Get3DTextLabelLOS +description: 获取3D文本标签的视线检测设置 +tags: ["3D文本标签"] +--- + + + +## 描述 + +获取 3D 文本标签的视线检测设置(是否在物体遮挡时隐藏)。 + +| 参数名 | 说明 | +| ------------- | ----------------------------------- | +| Text3D:textid | 要获取视线检测设置的 3D 文本标签 ID | + +## 返回值 + +返回布尔值表示视线检测状态(`false`=禁用/`true`=启用) + +## 示例 + +```c +new Text3D:gMyLabel; +new bool:testLOS; + +gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 0, true); + +testLOS = Get3DTextLabelLOS(gMyLabel); +// testLOS = true +``` + +## 相关函数 + +- [Set3DTextLabelLOS](Set3DTextLabelLOS): 设置 3D 文本标签的视线检测 +- [GetPlayer3DTextLabelLOS](GetPlayer3DTextLabelLOS): 获取玩家专属 3D 文本标签的视线检测设置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelPos.md new file mode 100644 index 00000000000..637f6e54953 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelPos.md @@ -0,0 +1,41 @@ +--- +title: Get3DTextLabelPos +sidebar_label: Get3DTextLabelPos +description: 获取3D文本标签的位置坐标 +tags: ["3D文本标签"] +--- + + + +## 描述 + +获取 3D 文本标签的当前位置坐标。 + +| 参数名 | 说明 | +| ------------- | --------------------------------------- | +| Text3D:textid | 要获取位置的 3D 文本标签 ID | +| &Float:x | 用于存储 X 坐标的浮点变量(按引用传递) | +| &Float:y | 用于存储 Y 坐标的浮点变量(按引用传递) | +| &Float:z | 用于存储 Z 坐标的浮点变量(按引用传递) | + +## 示例 + +```c +new Text3D:gMyLabel; + +public OnGameModeInit() +{ + gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 0, false); + + new Float:x, Float:y, Float:z; + Get3DTextLabelPos(gMyLabel, x, y, z); + // x = 30.0 + // y = 40.0 + // z = 50.0 + return 1; +} +``` + +## 相关函数 + +- [GetPlayer3DTextLabelPos](GetPlayer3DTextLabelPos): 获取玩家专属 3D 文本标签的位置坐标 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelText.md new file mode 100644 index 00000000000..877bd74b643 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelText.md @@ -0,0 +1,40 @@ +--- +title: Get3DTextLabelText +sidebar_label: Get3DTextLabelText +description: 获取3D文本标签的文字内容 +tags: ["3D文本标签"] +--- + + + +## 描述 + +获取 3D 文本标签的显示文字内容。 + +| 参数名 | 说明 | +| ------------- | -------------------------------------------------- | +| Text3D:textid | 要获取文字的 3D 文本标签 ID | +| const text[] | 用于存储文字的字符数组(按引用传递) | +| len | 文字缓冲区最大容量(建议使用 sizeof 获取数组长度) | + +## 示例 + +```c +new Text3D:gMyLabel; + +public OnGameModeInit() +{ + gMyLabel = Create3DTextLabel("你好 世界!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); + + new text[16]; + Get3DTextLabelText(gMyLabel, text, sizeof(text)); + // `文本`将显示为 '你好 世界!' + return 1; +} +``` + +## 相关函数 + +- [Create3DTextLabel](Create3DTextLabel): 创建 3D 文本标签 +- [Update3DTextLabelText](Update3DTextLabelText): 更新 3D 文本标签内容及颜色 +- [GetPlayer3DTextLabelText](GetPlayer3DTextLabelText): 获取玩家专属 3D 文本标签文字 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelVirtualWorld.md new file mode 100644 index 00000000000..499d6c31023 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Get3DTextLabelVirtualWorld.md @@ -0,0 +1,37 @@ +--- +title: Get3DTextLabelVirtualWorld +sidebar_label: Get3DTextLabelVirtualWorld +description: 获取3D文本标签的虚拟世界ID +tags: ["3D文本标签"] +--- + + + +## 描述 + +获取 3D 文本标签所属的虚拟世界 ID。 + +| 参数名 | 说明 | +| ------------- | ----------------------------------- | +| Text3D:textid | 要获取虚拟世界 ID 的 3D 文本标签 ID | + +## 返回值 + +返回 3D 文本标签所在的虚拟世界 ID 数值 + +## 示例 + +```c +new Text3D:gMyLabel; +new worldid; + +gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 20, false); + +worldid = Get3DTextLabelVirtualWorld(gMyLabel); +// worldid = 20 +``` + +## 相关函数 + +- [Set3DTextLabelVirtualWorld](Set3DTextLabelVirtualWorld): 设置 3D 文本标签的虚拟世界 ID +- [GetPlayer3DTextLabelVirtualWorld](GetPlayer3DTextLabelVirtualWorld): 获取玩家专属 3D 文本标签的虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorAnimation.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorAnimation.md new file mode 100644 index 00000000000..513e3c9048d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorAnimation.md @@ -0,0 +1,60 @@ +--- +title: GetActorAnimation +sidebar_label: GetActorAnimation +description: 获取角色当前正在播放的动画信息。 +tags: ["角色"] +--- + + + +## 描述 + +获取角色当前正在播放的动画信息。 + +| 参数名 | 说明 | +| ------------------ | ------------------------------------------- | +| actorid | 要获取动画的角色 ID | +| animationLibrary[] | 用于存储动画库名称的数组(引用传递) | +| librarySize | 动画库名称数组的长度 | +| animationName[] | 用于存储动画名称的数组(引用传递) | +| nameSize | 动画名称数组的长度 | +| &Float:delta | 浮点变量,用于存储动画增量(引用传递) | +| &bool:loop | 布尔变量,用于存储循环状态(引用传递) | +| &bool:lockX | 布尔变量,用于存储 X 轴锁定状态(引用传递) | +| &bool:lockY | 布尔变量,用于存储 Y 轴锁定状态(引用传递) | +| &bool:freeze | 布尔变量,用于存储冻结状态(引用传递) | +| &time | 整型变量,用于存储动画时间(引用传递) | + +## 返回值 + +若角色存在且有效返回 true,否则返回 false。 + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 1153.9640, -1772.3915, 16.5920, 0.0000); + ApplyActorAnimation(gMyActor, "PED", "IDLE_CHAT", 4.1, true, true, true, true, 0); + + new animationLibrary[32], + animationName[32], + Float:delta, + bool:loop, + bool:lockX, + bool:lockY, + bool:freeze, + time; + + GetActorAnimation(gMyActor, animationLibrary, sizeof animationLibrary, animationName, sizeof animationName, delta, loop, lockX, lockY, freeze, time); + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor): 创建角色(静态 NPC) +- [ApplyActorAnimation](ApplyActorAnimation): 对角色应用动画 +- [ClearActorAnimations](ClearActorAnimations): 清除角色的所有动画 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorFacingAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorFacingAngle.md new file mode 100644 index 00000000000..d873117b289 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorFacingAngle.md @@ -0,0 +1,37 @@ +--- +title: GetActorFacingAngle +sidebar_label: GetActorFacingAngle +description: 获取角色的朝向角度。 +tags: ["角色"] +--- + + + +## 描述 + +获取角色的朝向角度。 + +| 参数名 | 说明 | +| ------------ | --------------------------------------------------------------- | +| actorid | 要获取朝向角度的角色 ID(由[CreateActor](CreateActor)创建返回) | +| &Float:angle | 浮点变量(引用传递),用于存储角色的朝向角度 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定角色不存在) + +角色的朝向角度将被存储到指定变量中。 + +## 示例代码 + +```c +new Float:facingAngle; +GetActorFacingAngle(actorid, facingAngle); +``` + +## 相关函数 + +- [SetActorFacingAngle](SetActorFacingAngle): 设置角色的朝向角度 +- [GetActorPos](GetActorPos): 获取角色的坐标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorHealth.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorHealth.md new file mode 100644 index 00000000000..78e3cf1e147 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorHealth.md @@ -0,0 +1,50 @@ +--- +title: GetActorHealth +sidebar_label: GetActorHealth +description: 获取角色的生命值。 +tags: ["角色"] +--- + + + +## 描述 + +获取角色的生命值。 + +| 参数名 | 说明 | +| ------------- | ------------------------------------------ | +| actorid | 要获取生命值的角色 ID | +| &Float:health | 浮点变量(引用传递),用于存储角色的生命值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(角色未创建) + +注意:角色的生命值存储在指定变量中,而非通过返回值获取。 + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // 在武器商店创建销售员角色 + + SetActorHealth(gMyActor, 100.0); + + new Float:actorHealth; + GetActorHealth(gMyActor, actorHealth); + printf("角色ID %d 当前生命值:%.2f", gMyActor, actorHealth); + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor): 创建角色(静态 NPC) +- [SetActorHealth](SetActorHealth): 设置角色的生命值 +- [SetActorInvulnerable](SetActorInvulnerable): 设置角色无敌状态 +- [IsActorInvulnerable](IsActorInvulnerable): 检测角色是否处于无敌状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPoolSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPoolSize.md new file mode 100644 index 00000000000..a0211b492af --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPoolSize.md @@ -0,0 +1,34 @@ +--- +title: GetActorPoolSize +sidebar_label: GetActorPoolSize +description: 获取服务器上已创建的最高角色ID。 +tags: ["角色"] +--- + + + +## 描述 + +获取服务器上已创建的最高角色 ID。注意在 SA-MP 中该函数存在缺陷,即使没有角色时也会返回`0`。fixes.inc 和 open.mp 已修正此问题会返回`-1`,同时已弃用该函数,建议改用`MAX_ACTORS`或`foreach`循环。 + +## 示例代码 + +```c +SetAllActorsHealth(Float:health) +{ + // 遍历所有可能的角色ID + for(new i = 0, j = GetActorPoolSize(); i <= j; i++) + { + if (IsValidActor(i)) + { + SetActorHealth(i, health); // 设置有效角色的生命值 + } + } +} +``` + +## 相关函数 + +- [CreateActor](CreateActor): 创建角色(静态 NPC) +- [IsValidActor](isValidActor): 验证角色 ID 是否有效 +- [SetActorHealth](SetActorHealth): 设置角色的生命值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPos.md new file mode 100644 index 00000000000..5ed0aa2418b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorPos.md @@ -0,0 +1,38 @@ +--- +title: GetActorPos +sidebar_label: GetActorPos +description: 获取角色的坐标位置。 +tags: ["角色"] +--- + + + +## 描述 + +获取角色的坐标位置。 + +| 参数名 | 说明 | +| -------- | ----------------------------------------------------------- | +| actorid | 要获取坐标的角色 ID(由[CreateActor](CreateActor)创建返回) | +| &Float:x | 浮点变量(引用传递),用于存储角色的 X 轴坐标 | +| &Float:y | 浮点变量(引用传递),用于存储角色的 Y 轴坐标 | +| &Float:z | 浮点变量(引用传递),用于存储角色的 Z 轴坐标 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定角色不存在) + +角色的坐标将被存储到指定变量中。 + +## 示例代码 + +```c +new Float:x, Float:y, Float:z; +GetActorPos(actorid, x, y, z); +``` + +## 相关函数 + +- [SetActorPos](SetActorPos.md): 设置角色的坐标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSkin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSkin.md new file mode 100644 index 00000000000..44033ccdce8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSkin.md @@ -0,0 +1,40 @@ +--- +title: GetActorSkin +sidebar_label: GetActorSkin +description: 获取角色当前使用的皮肤ID。 +tags: ["角色"] +--- + + + +## 描述 + +获取角色当前使用的皮肤 ID。 + +| 参数名 | 说明 | +| ------- | ------------------- | +| actorid | 要获取皮肤的角色 ID | + +## 返回值 + +返回角色当前使用的皮肤 ID。 + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 1153.9640, -1772.3915, 16.5920, 0.0000); // 创建皮肤ID为179的角色 + + new actorSkinID = GetActorSkin(gMyActor); + // `actorSkinID`的值现在是179 + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor.md): 创建角色(静态 NPC) +- [SetActorSkin](SetActorSkin.md): 设置角色的皮肤 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSpawnInfo.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSpawnInfo.md new file mode 100644 index 00000000000..d2646eb94f0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorSpawnInfo.md @@ -0,0 +1,53 @@ +--- +title: GetActorSpawnInfo +sidebar_label: GetActorSpawnInfo +description: 获取角色的初始生成点信息。 +tags: ["角色"] +--- + + + +## 描述 + +获取角色的初始生成点信息。 + +| 参数名 | 说明 | +| ----------------- | -------------------------------------------- | +| actorid | 要获取生成信息的角色 ID | +| &skin | 整型变量(引用传递),用于存储角色皮肤 ID | +| &Float:spawnX | 浮点变量(引用传递),用于存储生成点 X 坐标 | +| &Float:spawnY | 浮点变量(引用传递),用于存储生成点 Y 坐标 | +| &Float:spawnZ | 浮点变量(引用传递),用于存储生成点 Z 坐标 | +| &Float:spawnAngle | 浮点变量(引用传递),用于存储生成点朝向角度 | + +## 返回值 + +若角色存在且有效返回 true,否则返回 false。 + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 1153.9640, -1772.3915, 16.5920, 0.0000); // 创建皮肤ID为179的角色 + + new skin, + Float:spawnX, + Float:spawnY, + Float:spawnZ, + Float:spawnAngle; + + GetActorSpawnInfo(gMyActor, skin, spawnX, spawnY, spawnZ, spawnAngle); + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor.md): 创建角色(静态 NPC) +- [GetActorPos](GetActorPos.md): 获取角色的坐标位置 +- [SetActorPos](SetActorPos.md): 设置角色的坐标位置 +- [GetActorSkin](GetActorSkin.md): 获取角色皮肤 ID +- [SetActorSkin](SetActorSkin.md): 设置角色皮肤 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorVirtualWorld.md new file mode 100644 index 00000000000..f52f4e7f00b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActorVirtualWorld.md @@ -0,0 +1,46 @@ +--- +title: GetActorVirtualWorld +sidebar_label: GetActorVirtualWorld +description: 获取角色所在的虚拟世界。 +tags: ["角色"] +--- + + + +## 描述 + +获取角色所在的虚拟世界。 + +| 参数名 | 说明 | +| ------- | ----------------------- | +| actorid | 要获取虚拟世界的角色 ID | + +## 返回值 + +返回角色所在的虚拟世界 ID(默认值为 0)。 + +若指定角色不存在也会返回 0。 + +## 示例代码 + +```c +new MyActor; + +public OnGameModeInit() +{ + MyActor = CreateActor(69, 0.0, 0.0, 3.0, 0.0); // 创建角色(皮肤ID 69) + + SetActorVirtualWorld(MyActor, 20); // 设置角色虚拟世界为20 + return 1; +} + +// 在其他地方检测虚拟世界 +if (GetActorVirtualWorld(MyActor) == 20) +{ + // 执行相关操作(当角色在虚拟世界20时触发) +} +``` + +## 相关函数 + +- [SetActorVirtualWorld](SetActorVirtualWorld.md): 设置角色所在的虚拟世界 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActors.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActors.md new file mode 100644 index 00000000000..1a01a656c56 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetActors.md @@ -0,0 +1,35 @@ +--- +title: GetActors +sidebar_label: GetActors +description: 获取服务器上已创建的角色ID数组。 +tags: ["角色"] +--- + + + +## 描述 + +获取服务器上已创建的角色 ID 数组。 + +| 参数名 | 说明 | +| -------- | ------------------------------------- | +| actors[] | 数组变量(引用传递),用于存储角色 ID | +| size | 数组的容量长度 | + +## 返回值 + +返回数组中存储的角色数量。 + +## 示例代码 + +```pawn +new actors[MAX_ACTORS]; + +GetActors(actors, sizeof(actors)); +// `actors`数组现在包含已创建的角色ID,例如 {0, 1, 2, 3, 4, ...} +``` + +## 相关函数 + +- [GetPlayers](GetPlayers.md): 获取当前在线玩家 ID 数组 +- [GetVehicles](GetVehicles.md): 获取已创建车辆 ID 数组 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetAnimationName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetAnimationName.md new file mode 100644 index 00000000000..7d3d55d28d8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetAnimationName.md @@ -0,0 +1,46 @@ +--- +title: GetAnimationName +sidebar_label: GetAnimationName +description: 根据动画索引获取对应的动画库名称和动画名称。 +tags: [] +--- + +## 描述 + +根据动画索引获取对应的动画库名称和动画名称。 + +| 参数名 | 说明 | +| ------------------ | ------------------------------------------- | +| index | 动画索引(由 GetPlayerAnimationIndex 返回) | +| animationLibrary[] | 字符串变量,用于存储动画库名称 | +| len1(数组长度) | 存储动画库名称的字符串数组长度 | +| animationName[] | 字符串变量,用于存储动画名称 | +| len2(数组长度) | 存储动画名称的字符串数组长度 | + +## 返回值 + +成功返回 1,失败返回 0。 + +## 示例代码 + +```c +public OnPlayerUpdate(playerid) +{ + if (GetPlayerAnimationIndex(playerid)) + { + new + animLib[32], + animName[32], + msgText[128]; + + GetAnimationName(GetPlayerAnimationIndex(playerid), animLib, sizeof animLib, animName, sizeof animName); + format(msgText, sizeof msgText, "正在播放动画:%s %s", animLib, animName); + SendClientMessage(playerid, 0xFFFFFFFF, msgText); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerAnimationIndex](GetPlayerAnimationIndex.md): 获取玩家当前动画的索引 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetAvailableClasses.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetAvailableClasses.md new file mode 100644 index 00000000000..b16310ad1db --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetAvailableClasses.md @@ -0,0 +1,24 @@ +--- +title: GetAvailableClasses +sidebar_label: GetAvailableClasses +description: 获取已定义的职业数量。 +tags: ["职业"] +--- + + + +## 描述 + +获取服务器中已定义的玩家职业数量。 + +## 示例代码 + +```c +printf("可用职业数量: %d", GetAvailableClasses()); // 输出已定义职业总数 +``` + +## 相关函数 + +- [AddPlayerClass](AddPlayerClass.md): 添加基础玩家职业 +- [AddPlayerClassEx](AddPlayerClassEx.md): 添加带默认队伍的玩家职业 +- [EditPlayerClass](EditPlayerClass.md): 编辑职业配置数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsBool.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsBool.md new file mode 100644 index 00000000000..1ae2abe3754 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsBool.md @@ -0,0 +1,45 @@ +--- +title: GetConsoleVarAsBool +sidebar_label: GetConsoleVarAsBool +description: 获取控制台变量的布尔类型值。 +tags: [] +--- + +## 描述 + +获取控制台变量的布尔类型值。 + +| 参数名 | 说明 | +| ------------ | ------------------------------ | +| const cvar[] | 要获取的布尔类型控制台变量名称 | + +## 返回值 + +返回指定控制台变量的布尔值。若变量不存在或类型不符返回 0。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + new queryEnabled = GetConsoleVarAsBool("enable_query"); + if (!queryEnabled) + { + print("警告:查询功能已禁用,服务器将不会显示在服务器列表中。"); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +在服务器控制台输入 `varlist` 可查看所有可用控制台变量及其类型。 + +::: + +## 相关函数 + +- [GetConsoleVarAsString](GetConsoleVarAsString.md): 以字符串形式获取控制台变量 +- [GetConsoleVarAsInt](GetConsoleVarAsInt.md): 以整型形式获取控制台变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsFloat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsFloat.md new file mode 100644 index 00000000000..cac045b340b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsFloat.md @@ -0,0 +1,39 @@ +--- +title: GetConsoleVarAsFloat +sidebar_label: GetConsoleVarAsFloat +description: 获取控制台变量的浮点类型值。 +tags: [] +--- + +## 描述 + +获取控制台变量的浮点类型值。 + +| 参数名 | 说明 | +| ------------ | ------------------------------ | +| const cvar[] | 要获取的浮点类型控制台变量名称 | + +## 返回值 + +返回指定控制台变量的浮点数值。若变量不存在或类型不符返回 0.0。 + +## 示例代码 + +```c +new Float:radius = GetConsoleVarAsFloat("game.nametag_draw_radius"); +printf("玩家名牌绘制半径: %.2f", radius); // 输出浮点数值保留两位小数 +``` + +## 注意事项 + +:::tip + +在服务器控制台输入 `varlist` 可查看所有可用控制台变量及其类型。 + +::: + +## 相关函数 + +- [GetConsoleVarAsInt](GetConsoleVarAsInt.md): 以整型形式获取控制台变量 +- [GetConsoleVarAsString](GetConsoleVarAsString.md): 以字符串形式获取控制台变量 +- [GetConsoleVarAsBool](GetConsoleVarAsBool.md): 以布尔值形式获取控制台变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsInt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsInt.md new file mode 100644 index 00000000000..52e588d5329 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsInt.md @@ -0,0 +1,38 @@ +--- +title: GetConsoleVarAsInt +sidebar_label: GetConsoleVarAsInt +description: 获取控制台变量的整数类型值。 +tags: [] +--- + +## 描述 + +获取控制台变量的整数类型值。 + +| 参数名 | 说明 | +| ------------ | -------------------------- | +| const cvar[] | 要获取的整型控制台变量名称 | + +## 返回值 + +返回指定控制台变量的整数值。若变量不存在或类型不符返回 0。 + +## 示例代码 + +```c +new serverPort = GetConsoleVarAsInt("network.port"); +printf("服务器端口号: %i", serverPort); // 输出整型端口数值 +``` + +## 注意事项 + +:::tip + +在服务器控制台输入 `varlist` 可查看所有可用控制台变量及其类型。 + +::: + +## 相关函数 + +- [GetConsoleVarAsString](GetConsoleVarAsString.md): 以字符串形式获取控制台变量 +- [GetConsoleVarAsBool](GetConsoleVarAsBool.md): 以布尔值形式获取控制台变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsString.md new file mode 100644 index 00000000000..5b87ac364e1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetConsoleVarAsString.md @@ -0,0 +1,57 @@ +--- +title: GetConsoleVarAsString +sidebar_label: GetConsoleVarAsString +description: 获取控制台变量的字符串类型值。 +tags: [] +--- + +## 描述 + +获取控制台变量的字符串类型值。 + +| 参数名 | 说明 | +| --------------- | -------------------------------- | +| const cvar[] | 要获取的字符串类型控制台变量名称 | +| buffer[] | 存储值的数组变量(引用传递) | +| len(数组长度) | 存储字符串的缓冲区长度 | + +## 返回值 + +返回字符串的实际长度。若变量不存在或类型不符返回 0。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + new hostname[64]; + GetConsoleVarAsString("hostname", hostname, sizeof(hostname)); // 获取服务器名称 + printf("服务器名称: %s", hostname); // 输出字符串值 +} +``` + +## 注意事项 + +:::tip + +当变量名为"filterscripts"或"plugins"时,本函数仅返回第一个滤镜脚本/插件的名称。 + +::: + +:::tip + +在服务器控制台输入 `varlist` 可查看所有可用控制台变量及其类型。 + +::: + +:::warning + +- 在旧版本中,对非字符串类型变量(整型/布尔型/浮点型)使用本函数会导致服务器崩溃(open.mp 已修复) +- 在旧版本中,对不存在的变量使用本函数会导致服务器崩溃(open.mp 已修复) + +::: + +## 相关函数 + +- [GetConsoleVarAsInt](GetConsoleVarAsInt.md): 以整型形式获取控制台变量 +- [GetConsoleVarAsBool](GetConsoleVarAsBool.md): 以布尔值形式获取控制台变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetCustomModelPath.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetCustomModelPath.md new file mode 100644 index 00000000000..ff938599908 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetCustomModelPath.md @@ -0,0 +1,42 @@ +--- +title: GetCustomModelPath +sidebar_label: GetCustomModelPath +description: 获取自定义模型的DFF/TXD文件路径。 +tags: ["自定义模型", "自定义皮肤", "简单模型"] +--- + + + +## 描述 + +获取指定自定义模型的资源文件路径信息。 + +| 参数名 | 说明 | +| --------- | ------------------------------------------- | +| modelid | 要查询的自定义模型 ID | +| dffPath[] | 数组变量(引用传递),用于存储 DFF 文件路径 | +| dffSize | DFF 路径存储数组的长度 | +| txdPath[] | 数组变量(引用传递),用于存储 TXD 文件路径 | +| txdSize | TXD 路径存储数组的长度 | + +## 示例代码 + +```c +new + modelid = -2000, // 自定义模型ID + dffPath[64], // DFF路径存储数组 + txdPath[64]; // TXD路径存储数组 + +GetCustomModelPath(modelid, dffPath, sizeof(dffPath), txdPath, sizeof(txdPath)); + +printf("[ID %d 自定义模型路径]\n\ + DFF文件: %s\n\ + TXD文件: %s", + modelid, dffPath, txdPath); // 输出路径信息 +``` + +## 相关函数 + +- [AddSimpleModel](AddSimpleModel.md): 添加新的简单物体模型 +- [AddSimpleModelTimed](AddSimpleModelTimed.md): 添加带时间限制的简单物体模型 +- [IsValidCustomModel](IsValidCustomModel.md): 验证自定义模型 ID 是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetDefaultPlayerColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetDefaultPlayerColour.md new file mode 100644 index 00000000000..270d1b0a849 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetDefaultPlayerColour.md @@ -0,0 +1,30 @@ +--- +title: GetDefaultPlayerColour +sidebar_label: GetDefaultPlayerColour +description: 获取玩家ID的默认颜色。 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家 ID 的默认颜色。 + +| 参数名 | 说明 | +| -------- | ----------------------------------- | +| playerid | 要获取颜色的玩家 ID(无需玩家在线) | + +## 返回值 + +返回玩家的默认颜色值。 + +## 示例代码 + +```c +new colour = GetDefaultPlayerColour(playerid); // 获取玩家的默认颜色 +``` + +## 相关函数 + +- [GetPlayerColor](GetPlayerColor.md): 获取玩家当前使用的颜色 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetGameText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetGameText.md new file mode 100644 index 00000000000..3e744526731 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetGameText.md @@ -0,0 +1,54 @@ +--- +title: GetGameText +sidebar_label: GetGameText +description: 获取指定玩家游戏文本样式的所有相关信息。 +tags: ["玩家"] +--- + + + +## 描述 + +获取指定玩家游戏文本样式的所有相关信息。 + +| 参数名 | 说明 | +| --------------- | --------------------------------------------------- | +| playerid | 要获取信息的玩家 ID | +| style | 要查询的[游戏文本样式](../resources/gametextstyles) | +| message[] | 存储文本内容的数组变量(引用传递) | +| len(数组长度) | 输出数组的容量大小 | +| time | 游戏文本最初显示的持续时间(单位:毫秒) | +| remaining | 当前剩余的显示时间(单位:毫秒) | + +## 返回值 + +true - 函数执行成功 + +false - 函数执行失败(玩家不存在或样式无效) + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + GameTextForPlayer(playerid, "欢迎来到服务器!", 5000, 3); // 显示持续5秒的样式3文本 + + new + message[32], + time, + remaining; + + GetGameText(playerid, 3, message, sizeof(message), time, remaining); + // message = "欢迎来到服务器!" + // time = 5000 + return 1; +} +``` + +## 相关函数 + +- [GameTextForPlayer](GameTextForPlayer.md): 向玩家显示游戏文本 +- [HideGameTextForPlayer](HideGameTextForPlayer.md): 隐藏玩家的指定样式游戏文本 +- [GameTextForAll](GameTextForAll.md): 向所有玩家显示游戏文本 +- [HideGameTextForAll](HideGameTextForAll.md): 全局隐藏指定样式游戏文本 +- [HasGameText](HasGameText.md): 检测玩家是否正在显示指定样式的游戏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetGravity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetGravity.md new file mode 100644 index 00000000000..9b67c3e3692 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetGravity.md @@ -0,0 +1,53 @@ +--- +title: GetGravity +sidebar_label: GetGravity +description: 获取当前服务器的全局重力值。 +tags: [] +--- + +## 描述 + +获取当前服务器的全局重力值。 + +## 示例代码 + +**SA-MP 服务器示例:** + +```c +#include + +#if !defined GetGravity + native Float:GetGravity(); +#endif + +public OnGameModeInit() +{ + printf("当前重力值:%f", GetGravity()); // 输出浮点型重力值 + return 1; +} +``` + +**open.mp 服务器示例:** + +```c +#include + +public OnGameModeInit() +{ + printf("当前重力值:%f", GetGravity()); // 直接调用函数获取重力值 + return 1; +} +``` + +## 注意事项 + +:::warning + +在 SA-MP 服务器中,该函数默认未定义。需在包含 a_samp.inc 后添加 'native Float:GetGravity();' 声明方可使用。 + +::: + +## 相关函数 + +- [SetGravity](SetGravity.md): 设置全局重力值 +- [GetPlayerGravity](GetPlayerGravity.md): 获取玩家个体重力值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md new file mode 100644 index 00000000000..238e80e9dd6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md @@ -0,0 +1,33 @@ +--- +title: GetMaxPlayers +sidebar_label: GetMaxPlayers +description: 返回服务器配置中设置的最大玩家数量(由config.json中的max_players变量决定)。 +tags: ["玩家"] +--- + +## 描述 + +获取服务器配置文件(config.json)中设置的最大玩家容量。 + +## 示例代码 + +```c +new string[128]; +format(string, sizeof(string), "本服务器最大玩家数量: %i 人!", GetMaxPlayers()); +SendClientMessage(playerid, 0xFFFFFFFF, string); // 向玩家发送服务器最大人数信息 +``` + +## 注意事项 + +:::warning + +- 本函数不能替代 MAX_PLAYERS 宏定义 +- 不可用于编译时数组大小定义 +- 应始终将 MAX_PLAYERS 宏定义为与 max_players 配置相同或更大的值 + +::: + +## 相关函数 + +- [GetPlayerPoolSize](GetPlayerPoolSize.md): 获取当前已连接玩家的最高 ID +- [IsPlayerConnected](IsPlayerConnected.md): 检测玩家是否已连接服务器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnHeader.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnHeader.md new file mode 100644 index 00000000000..8cc74e69357 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnHeader.md @@ -0,0 +1,36 @@ +--- +title: GetMenuColumnHeader +sidebar_label: GetMenuColumnHeader +description: 获取指定列标题中的文本内容。 +tags: ["菜单"] +--- + + + +## 描述 + +获取指定列标题中的文本内容。 + +| 参数名 | 说明 | +| --------------------- | ---------------------------------- | +| Menu:menuid | 要查询的菜单 ID | +| column | 列索引(从 0 开始计数) | +| header[] | 存储标题文本的数组变量(引用传递) | +| len = sizeof (header) | 存储文本的数组容量长度 | + +## 返回值 + +本函数始终返回 **true**。 + +## 示例代码 + +```c +new text[32]; + +// 获取菜单第1列的标题文本 +GetMenuColumnHeader(menuid, 1, text, sizeof(text)); +``` + +## 相关函数 + +- [CreateMenu](CreateMenu.md): 创建新菜单 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnWidth.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnWidth.md new file mode 100644 index 00000000000..d05188f2f1c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumnWidth.md @@ -0,0 +1,37 @@ +--- +title: GetMenuColumnWidth +sidebar_label: GetMenuColumnWidth +description: 获取菜单中一列或两列的宽度。 +tags: ["菜单"] +--- + + + +## 描述 + +获取菜单中一列或两列的宽度。 + +| 参数名 | 说明 | +| ------------------- | ---------------------------------------------------- | +| Menu:menuid | 要获取列宽的菜单 ID | +| &Float:column1Width | 浮点变量(引用传递),用于存储第一列宽度 | +| &Float:column2Width | 浮点变量(引用传递),用于存储第二列宽度(可选参数) | + +## 返回值 + +本函数始终返回 **true**。 + +## 示例代码 + +```c +new Float:column1Width, Float:column2Width; +GetMenuColumnWidth(menuid, column1Width, column2Width); // 获取双列宽度 + +// 若只需获取第一列宽度 +new Float:column1Width; +GetMenuColumnWidth(menuid, column1Width); +``` + +## 相关函数 + +- [GetMenuPos](GetMenuPos.md): 获取菜单在屏幕上的 X/Y 坐标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumns.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumns.md new file mode 100644 index 00000000000..7838038e812 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuColumns.md @@ -0,0 +1,31 @@ +--- +title: GetMenuColumns +sidebar_label: GetMenuColumns +description: 获取菜单中当前激活的列数。 +tags: ["菜单"] +--- + + + +## 描述 + +获取菜单中当前激活的列数。 + +| 参数名 | 说明 | +| ----------- | ------------------- | +| Menu:menuid | 要获取列数的菜单 ID | + +## 返回值 + +返回激活的列数。 + +## 示例代码 + +```c +new columns = GetMenuColumns(menuid); // 获取激活的列数 +``` + +## 相关函数 + +- [GetMenuItems](GetMenuItems.md): 获取菜单项列表 +- [GetMenuItem](GetMenuItem.md): 通过行列索引获取单元格文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItem.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItem.md new file mode 100644 index 00000000000..0f6ca7cca8b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItem.md @@ -0,0 +1,38 @@ +--- +title: GetMenuItem +sidebar_label: GetMenuItem +description: 通过列和行索引获取指定单元格中的文本内容。 +tags: ["菜单"] +--- + + + +## 描述 + +通过列和行索引获取指定单元格中的文本内容。 + +| 参数名 | 说明 | +| ----------- | ---------------------------------- | +| Menu:menuid | 要查询的菜单 ID | +| column | 列索引(从 0 开始计数) | +| row | 行索引(从 0 开始计数) | +| cell[] | 存储文本内容的数组变量(引用传递) | +| len | 存储数组的容量长度 | + +## 返回值 + +本函数始终返回 true。 + +## 示例代码 + +```c +new text[32]; + +// 获取第1列第2行的菜单项文本 +GetMenuItem(menuid, 1, 2, text, sizeof(text)); +``` + +## 相关函数 + +- [GetMenuItems](GetMenuItems.md): 获取菜单项列表 +- [GetMenuColumns](GetMenuColumns.md): 获取菜单激活列数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItems.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItems.md new file mode 100644 index 00000000000..1e5ea18f4ba --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuItems.md @@ -0,0 +1,33 @@ +--- +title: GetMenuItems +sidebar_label: GetMenuItems +description: 获取指定列中的行数。 +tags: ["菜单"] +--- + + + +## 描述 + +获取指定列中的行数。 + +| 参数名 | 说明 | +| ----------- | ----------------------- | +| Menu:menuid | 要查询的菜单 ID | +| column | 列索引(从 0 开始计数) | + +## 返回值 + +返回指定列中的行数。 + +## 示例代码 + +```c +// 获取菜单第1列的行数 +new items = GetMenuItems(menuid, 1); +``` + +## 相关函数 + +- [GetMenuColumns](GetMenuColumns.md): 获取菜单激活列数 +- [GetMenuItem](GetMenuItem.md): 通过行列索引获取单元格文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuPos.md new file mode 100644 index 00000000000..b1fd56836b0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMenuPos.md @@ -0,0 +1,33 @@ +--- +title: GetMenuPos +sidebar_label: GetMenuPos +description: 获取菜单在屏幕上的X/Y坐标位置。 +tags: ["菜单"] +--- + + + +## 描述 + +获取菜单在屏幕上的 X/Y 坐标位置。 + +| 参数名 | 说明 | +| ----------- | --------------------------------------- | +| Menu:menuid | 要获取位置的菜单 ID | +| &Float:x | 浮点变量(引用传递),用于存储 X 轴坐标 | +| &Float:y | 浮点变量(引用传递),用于存储 Y 轴坐标 | + +## 返回值 + +本函数始终返回 true。 + +## 示例代码 + +```c +new Float:x, Float:y; +GetMenuPos(menuid, x, y); // 获取菜单位置坐标 +``` + +## 相关函数 + +- [GetMenuColumnWidth](GetMenuColumnWidth.md): 获取菜单列宽 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetModeRestartTime.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetModeRestartTime.md new file mode 100644 index 00000000000..910f5a0d515 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetModeRestartTime.md @@ -0,0 +1,29 @@ +--- +title: GetModeRestartTime +sidebar_label: GetModeRestartTime +description: 获取主脚本加载之间的延迟时间(单位:秒)。 +tags: ["核心", "配置"] +--- + + + +## 描述 + +获取主脚本(游戏模式/滤镜脚本)加载之间的重启延迟时间。 + +## 返回值 + +返回以秒为单位的浮点型延迟时间。 + +## 示例代码 + +```c +SetModeRestartTime(5.0); // 设置重启延迟为5秒 + +new Float:seconds = GetModeRestartTime(); +printf("重启延迟时间: %.1f 秒", seconds); // 输出: 重启延迟时间: 5.0 秒 +``` + +## 相关函数 + +- [SetModeRestartTime](SetModeRestartTime.md): 设置主脚本加载之间的延迟时间 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMyFacingAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMyFacingAngle.md new file mode 100644 index 00000000000..77bcfe777da --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMyFacingAngle.md @@ -0,0 +1,33 @@ +--- +title: GetMyFacingAngle +sidebar_label: GetMyFacingAngle +description: 获取NPC当前的面朝角度 +tags: [] +--- + +## 描述 + +获取 NPC 当前的面朝角度。 + +| 名称 | 描述 | +| ------------ | ---------------------------------------- | +| &Float:Angle | 用于存储角度的浮点数变量,通过引用传递。 | + +## 返回值 + +面朝角度将存储在指定变量中。 + +## 示例代码 + +```c +public OnPlayerText(playerid, text[]) +{ + new Float:Angle; + GetMyFacingAngle(Angle); + printf("我正面对着 %f!", Angle); +} +``` + +## 相关函数 + +- [SetMyFacingAngle](../functions/SetMyFacingAngle): 设置 NPC 的面朝角度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMyPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMyPos.md new file mode 100644 index 00000000000..211e06fea5c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMyPos.md @@ -0,0 +1,32 @@ +--- +title: GetMyPos +sidebar_label: GetMyPos +description: 获取NPC的当前位置 +tags: ["npc"] +--- + +## 描述 + +获取 NPC 的当前位置。 + +| 名称 | 描述 | +| -------- | ------------------------------------------- | +| &Float:x | 用于存储 X 坐标的浮点数变量,通过引用传递。 | +| &Float:y | 用于存储 Y 坐标的浮点数变量,通过引用传递。 | +| &Float:z | 用于存储 Z 坐标的浮点数变量,通过引用传递。 | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new Float:x, Float:y, Float:z; +GetMyPos(x,y,z); +printf("我现在位于 %f, %f, %f!",x,y,z); +``` + +## 相关函数 + +- [SetMyPos](SetMyPos): 设置 NPC 的当前位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetNetworkStats.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetNetworkStats.md new file mode 100644 index 00000000000..c44a3f7ec68 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetNetworkStats.md @@ -0,0 +1,69 @@ +--- +title: GetNetworkStats +sidebar_label: GetNetworkStats +description: 获取服务器的网络统计数据并存储到字符串中 +tags: [] +--- + +## 描述 + +获取服务器的网络统计数据并存储到字符串中。 + +| 名称 | 描述 | +| ---------------------- | -------------------------------------------- | +| output[] | 用于存储网络统计数据的字符串,通过引用传递。 | +| size = sizeof (output) | 待存储字符串的长度 | + +## 返回值 + +本函数固定返回 1。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/netstats")) + { + new stats[400+1]; + GetNetworkStats(stats, sizeof(stats)); // 获取服务器网络统计数据 + ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "服务器网络状态", stats, "关闭", ""); + } + return 1; +} +``` + +**输出结果:** + +``` +(服务器时钟周期) Server Ticks: 200 +(发送缓冲区中的消息) Messages in Send buffer: 0 +(已发送消息) Messages sent: 142 +(已发送字节) Bytes sent: 8203 +(已发送确认) Acks sent: 11 +(发送缓冲区中的确认) Acks in send buffer: 0 +(等待确认的消息) Messages waiting for ack: 0 +(重新发送的消息) Messages resent: 0 +(重新发送的字节) Bytes resent: 0 +(数据包丢失率) Packetloss: 0.0% +(已接收消息) Messages received: 54 +(已接收字节) Bytes received: 2204 +(已接收确认) Acks received: 0 +(重复确认接收) Duplicate acks received: 0 +(瞬时KBits每秒) Inst. KBits per second: 28.8 +(发送KBits每秒) KBits per second sent: 10.0 +(接收KBits每秒) KBits per second received: 2.7 +``` + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存储到字符串中 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器从玩家接收的网络消息数量 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器从玩家接收的数据量(字节) +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送给玩家的网络消息数量 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送给玩家的数据量(字节) +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取服务器每秒从玩家接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家的数据包丢失率 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家的连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家的 IP 地址和端口 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedData.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedData.md new file mode 100644 index 00000000000..112678f705e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedData.md @@ -0,0 +1,41 @@ +--- +title: GetObjectAttachedData +sidebar_label: GetObjectAttachedData +description: 获取物体的附加数据 +tags: ["物体"] +--- + + + +## 描述 + +获取物体的附加数据。 + +| 名称 | 描述 | +| -------------- | ------------------------------------ | +| objectid | 需要获取附加数据的物体 ID | +| &parentVehicle | 存储父车辆 ID 的变量,通过引用传递。 | +| &parentObject | 存储父物体 ID 的变量,通过引用传递。 | +| &parentPlayer | 存储父玩家 ID 的变量,通过引用传递。 | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new + parentVehicle, + parentObject, + parentPlayer; + +GetObjectAttachedData(objectid, parentVehicle, parentObject, parentPlayer); +``` + +## 相关函数 + +- [GetObjectAttachedOffset](GetObjectAttachedOffset): 获取物体的附加偏移和旋转参数 +- [GetPlayerObjectAttachedData](GetPlayerObjectAttachedData): 获取玩家物体的附加数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedOffset.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedOffset.md new file mode 100644 index 00000000000..d3a136c1da8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectAttachedOffset.md @@ -0,0 +1,47 @@ +--- +title: GetObjectAttachedOffset +sidebar_label: GetObjectAttachedOffset +description: 获取物体的附加偏移和旋转参数 +tags: ["物体"] +--- + + + +## 描述 + +获取物体的附加偏移和旋转参数。 + +| 名称 | 描述 | +| ---------------- | ----------------------------------------------- | +| objectid | 需要获取偏移和旋转参数的物体 ID | +| &Float:offsetX | 用于存储 X 轴偏移坐标的浮点变量,通过引用传递。 | +| &Float:offsetY | 用于存储 Y 轴偏移坐标的浮点变量,通过引用传递。 | +| &Float:offsetZ | 用于存储 Z 轴偏移坐标的浮点变量,通过引用传递。 | +| &Float:rotationX | 用于存储 X 轴旋转参数的浮点变量,通过引用传递。 | +| &Float:rotationY | 用于存储 Y 轴旋转参数的浮点变量,通过引用传递。 | +| &Float:rotationZ | 用于存储 Z 轴旋转参数的浮点变量,通过引用传递。 | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new + Float:offsetX, + Float:offsetY, + Float:offsetZ, + Float:rotationX, + Float:rotationY, + Float:rotationZ; + +GetObjectAttachedOffset(objectid, offsetX, offsetY, offsetZ, rotationX, rotationY, rotationZ); +``` + +## 相关函数 + +- [GetObjectAttachedData](GetObjectAttachedData): 获取物体的附加数据 +- [GetPlayerObjectAttachedOffset](GetPlayerObjectAttachedOffset): 获取玩家物体的附加偏移和旋转参数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectDrawDistance.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectDrawDistance.md new file mode 100644 index 00000000000..1f673bdb79c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectDrawDistance.md @@ -0,0 +1,33 @@ +--- +title: GetObjectDrawDistance +sidebar_label: GetObjectDrawDistance +description: 获取物体的绘制距离 +tags: ["物体"] +--- + + + +## 描述 + +获取物体的绘制距离。 + +| 名称 | 描述 | +| -------- | ------------------------- | +| objectid | 需要获取绘制距离的物体 ID | + +## 返回值 + +以浮点数形式返回绘制距离。 + +## 示例代码 + +```c +new objectid = CreateObject(3335, 672.53485, -656.11023, 15.26560, 3.00000, 0.00000, 0.00000, 100.0); + +new Float:drawDistance = GetObjectDrawDistance(objectid); +// drawDistance = 100.0 +``` + +## 相关函数 + +- [GetPlayerObjectDrawDistance](GetPlayerObjectDrawDistance): 获取玩家物体的绘制距离 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterial.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterial.md new file mode 100644 index 00000000000..fa0b5468969 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterial.md @@ -0,0 +1,56 @@ +--- +title: GetObjectMaterial +sidebar_label: GetObjectMaterial +description: 从物体的材质索引获取材质数据 +tags: ["物体"] +--- + + + +## 描述 + +从物体的材质索引获取材质数据。 + +| 名称 | 描述 | +| ------------------ | ---------------------------------- | +| objectid | 物体 ID | +| materialIndex | 物体的材质索引 (0 至 15) | +| &modelid | 存储模型 ID 的变量,通过引用传递 | +| textureLibrary[] | 存储纹理库名称的数组,通过引用传递 | +| textureLibrarySize | 纹理库数组的尺寸 | +| textureName[] | 存储纹理名称的数组,通过引用传递 | +| textureNameSize | 纹理名称数组的尺寸 | +| &materialColour | 存储材质颜色的变量,通过引用传递 | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在或使用无效的材质索引) + +## 示例代码 + +```c +new objectid = CreateObject(19371, 978.71143, -925.25708, 42.63720, 0.00000, 0.00000, 2.00000); +SetObjectMaterial(objectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); + +new + modelid, + textureLibrary[16], + textureName[16], + materialColour; + +GetObjectMaterial(objectid, 0, modelid, textureLibrary, sizeof(textureLibrary), textureName, sizeof(textureName), materialColour); +// modelid = 19341 +// textureLibrary = "egg_texts" +// textureName = "easter_egg01" +// materialColour = 0xFFFFFFFF +``` + +## 相关函数 + +- [SetObjectMaterial](SetObjectMaterial): 用游戏中其他模型的纹理替换物体的材质 +- [SetObjectMaterialText](SetObjectMaterialText): 使用文本替换物体的材质纹理 +- [IsObjectMaterialSlotUsed](IsObjectMaterialSlotUsed): 检查物体材质槽位是否被使用 +- [GetObjectMaterialText](GetObjectMaterialText): 从物体的材质索引获取文本材质数据 +- [GetPlayerObjectMaterial](GetPlayerObjectMaterial): 从玩家物体的材质索引获取材质数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterialText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterialText.md new file mode 100644 index 00000000000..b6491b29653 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMaterialText.md @@ -0,0 +1,68 @@ +--- +title: GetObjectMaterialText +sidebar_label: GetObjectMaterialText +description: 从物体的材质索引获取文本材质数据 +tags: ["物体"] +--- + + + +## 描述 + +从物体的材质索引获取文本材质数据。 + +| 名称 | 描述 | +| ----------------------------------------- | ------------------------------------ | +| objectid | 物体 ID | +| materialIndex | 物体的材质索引 (0 至 15) | +| text[] | 存储文本内容的数组,通过引用传递 | +| textSize | 文本数组的尺寸 | +| &OBJECT_MATERIAL_SIZE:materialSize | 存储材质尺寸的变量,通过引用传递 | +| fontFace[] | 存储字体名称的数组,通过引用传递 | +| fontFaceSize | 字体名称数组的尺寸 | +| &fontSize | 存储字号的变量,通过引用传递 | +| &bool:bold | 存储粗体效果的布尔变量,通过引用传递 | +| &fontColour | 存储字体颜色的变量,通过引用传递 | +| &backgroundColour | 存储背景颜色的变量,通过引用传递 | +| &OBJECT_MATERIAL_TEXT_ALIGN:textAlignment | 存储文本对齐方式的变量,通过引用传递 | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在或使用无效的材质索引) + +## 示例代码 + +```c +new objectid = CreateObject(19174, 986.42767, -983.14850, 40.95220, 0.00000, 0.00000, 186.00000); +SetObjectMaterialText(objectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); + +new + text[16], + OBJECT_MATERIAL_SIZE:materialSize, + fontFace[16], + fontSize, + bool:bold, + fontColour, + backgroundColour, + OBJECT_MATERIAL_TEXT_ALIGN:textAlignment; + +GetObjectMaterialText(objectid, 0, text, sizeof(text), materialSize, fontFace, sizeof(fontFace), fontSize, bold, fontColour, backgroundColour, textAlignment); +// text = "OPEN.MP" +// materialSize = OBJECT_MATERIAL_SIZE_256x128 +// fontFace = "Arial" +// fontSize = 38 +// bold = true +// fontColour = 0xFF0000FF +// backgroundColour = 0x00000000 +// textAlignment = OBJECT_MATERIAL_TEXT_ALIGN_LEFT +``` + +## 相关函数 + +- [SetObjectMaterial](SetObjectMaterial): 用游戏内其他模型的纹理替换物体材质 +- [SetObjectMaterialText](SetObjectMaterialText): 使用文本替换物体的材质纹理 +- [IsObjectMaterialSlotUsed](IsObjectMaterialSlotUsed): 检查物体材质槽位是否被使用 +- [GetObjectMaterial](GetObjectMaterial): 从物体的材质索引获取材质数据 +- [GetPlayerObjectMaterialText](GetPlayerObjectMaterialText): 从玩家物体的材质索引获取文本材质数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectModel.md new file mode 100644 index 00000000000..2b90eb1b638 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectModel.md @@ -0,0 +1,38 @@ +--- +title: GetObjectModel +sidebar_label: GetObjectModel +description: 获取物体的模型ID(通过CreateObject创建) +tags: ["物体"] +--- + + + +## 描述 + +获取通过 [CreateObject](CreateObject) 创建的物体模型 ID。 + +| 名称 | 描述 | +| -------- | ---------------------------- | +| objectid | 需要获取模型 ID 的物体标识符 | + +## 返回值 + +成功返回物体的模型 ID, +当指定物体不存在时返回 **-1**。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + new objectid = CreateObject(19609, 666.57239, 1750.79749, 4.95627, 0.00000, 0.00000, -156.00000); + + new modelid = GetObjectModel(objectid); + printf("Object model: %d", modelid); // 输出: "Object model: 19609" + return 1; +} +``` + +## 相关函数 + +- [GetPlayerObjectModel](GetPlayerObjectModel): 获取玩家物体的模型 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMoveSpeed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMoveSpeed.md new file mode 100644 index 00000000000..73eac45bbfa --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMoveSpeed.md @@ -0,0 +1,36 @@ +--- +title: GetObjectMoveSpeed +sidebar_label: GetObjectMoveSpeed +description: 获取物体的移动速度 +tags: ["物体"] +--- + + + +## 描述 + +获取物体的移动速度。 + +| 名称 | 描述 | +| -------- | ------------------------- | +| objectid | 需要获取移动速度的物体 ID | + +## 返回值 + +以浮点数形式返回移动速度。 + +## 示例代码 + +```c +new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); +MoveObject(objectid, 1003.3915, -643.3342, 114.5122, 0.8); + +new Float:moveSpeed = GetObjectMoveSpeed(objectid); +// moveSpeed = 0.8 +``` + +## 相关函数 + +- [MoveObject](MoveObject): 以指定速度移动物体到新位置 +- [SetObjectMoveSpeed](SetObjectMoveSpeed): 设置物体的移动速度 +- [GetPlayerObjectMoveSpeed](GetPlayerObjectMoveSpeed): 获取玩家物体的移动速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetPos.md new file mode 100644 index 00000000000..07452a01ea3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetPos.md @@ -0,0 +1,47 @@ +--- +title: GetObjectMovingTargetPos +sidebar_label: GetObjectMovingTargetPos +description: 获取物体的移动目标位置 +tags: ["物体"] +--- + + + +## 描述 + +获取物体的移动目标位置。 + +| 名称 | 描述 | +| -------------- | --------------------------------------- | +| objectid | 需要获取移动目标位置的物体 ID | +| &Float:targetX | 存储目标 X 坐标的浮点变量,通过引用传递 | +| &Float:targetY | 存储目标 Y 坐标的浮点变量,通过引用传递 | +| &Float:targetZ | 存储目标 Z 坐标的浮点变量,通过引用传递 | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); +MoveObject(objectid, 1003.3915, -643.3342, 114.5122, 0.8); + +new + Float:targetX, + Float:targetY, + Float:targetZ; + +GetObjectMovingTargetPos(objectid, targetX, targetY, targetZ); +// targetX = 1003.3915 +// targetY = -643.3342 +// targetZ = 114.5122 +``` + +## 相关函数 + +- [GetObjectMovingTargetRot](GetObjectMovingTargetRot): 获取物体的移动目标旋转参数 +- [GetPlayerObjectMovingTargetPos](GetPlayerObjectMovingTargetPos): 获取玩家物体的移动目标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetRot.md new file mode 100644 index 00000000000..06bdd379b05 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectMovingTargetRot.md @@ -0,0 +1,47 @@ +--- +title: GetObjectMovingTargetRot +sidebar_label: GetObjectMovingTargetRot +description: 获取物体的移动目标旋转参数 +tags: ["物体"] +--- + + + +## 描述 + +获取物体的移动目标旋转参数。 + +| 名称 | 描述 | +| ---------------- | --------------------------------------- | +| objectid | 需要获取移动目标旋转的物体 ID | +| &Float:rotationX | 存储旋转 X 坐标的浮点变量,通过引用传递 | +| &Float:rotationY | 存储旋转 Y 坐标的浮点变量,通过引用传递 | +| &Float:rotationZ | 存储旋转 Z 坐标的浮点变量,通过引用传递 | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new objectid = CreateObject(968, 1023.79541, -943.75879, 42.31450, 0.00000, 0.00000, 10.00000); +MoveObject(objectid, 1023.79541, -943.75879, 42.31450, 0.8, 0.00000, -90.00000, 10.00000); + +new + Float:rotationX, + Float:rotationY, + Float:rotationZ; + +GetObjectMovingTargetRot(objectid, rotationX, rotationY, rotationZ); +// rotationX = 0.00000 +// rotationY = -90.00000 +// rotationZ = 10.00000 +``` + +## 相关函数 + +- [GetObjectMovingTargetPos](GetObjectMovingTargetPos): 获取物体的移动目标位置 +- [GetPlayerObjectMovingTargetRot](GetPlayerObjectMovingTargetRot): 获取玩家物体的移动目标旋转参数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectPos.md new file mode 100644 index 00000000000..9b29506b974 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectPos.md @@ -0,0 +1,61 @@ +--- +title: GetObjectPos +sidebar_label: GetObjectPos +description: 获取物体的当前位置 +tags: ["物体"] +--- + +## 描述 + +获取物体的当前位置。 + +| 名称 | 描述 | +| -------- | ----------------------------------- | +| objectid | 需要获取位置的物体 ID | +| &Float:x | 存储 X 坐标的浮点变量,通过引用传递 | +| &Float:y | 存储 Y 坐标的浮点变量,通过引用传递 | +| &Float:z | 存储 Z 坐标的浮点变量,通过引用传递 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +public OnGameModeInit() +{ + new objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + new Float:x, Float:y, Float:z; + GetObjectPos(objectid, x, y, z); + // x = 2001.195679 + // y = 1547.113892 + // z = 14.283400 + return 1; +} +``` + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体是否有效 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体位置 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [GetObjectRot](GetObjectRot): 获取物体旋转参数 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体是否有效 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体位置 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转参数 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到其他玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectRot.md new file mode 100644 index 00000000000..ccdf429e1c8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectRot.md @@ -0,0 +1,59 @@ +--- +title: GetObjectRot +sidebar_label: GetObjectRot +description: 使用此函数获取物体当前的旋转角度 +tags: ["物体"] +--- + +## 描述 + +使用此函数获取物体当前的旋转角度。旋转参数通过引用方式存储在三个变量 rotationX/rotationY/rotationZ 中。 + +| 名称 | 描述 | +| ---------------- | ----------------------------------------- | +| objectid | 需要获取旋转参数的物体 ID | +| &Float:rotationX | 存储 X 轴旋转角度的浮点变量,通过引用传递 | +| &Float:rotationY | 存储 Y 轴旋转角度的浮点变量,通过引用传递 | +| &Float:rotationZ | 存储 Z 轴旋转角度的浮点变量,通过引用传递 | + +## 返回值 + +物体的旋转角度通过引用变量返回,不通过函数返回值。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + new objectid = CreateObject(652, 732.32690, 1940.21289, 4.27340, 357.00000, 0.00000, -76.00000); + + new Float:rotationX, Float:rotationY, Float:rotationZ; + GetObjectRot(objectid, rotationX, rotationY, rotationZ); + // rotationX = 357.00000 + // rotationY = 0.00000 + // rotationZ = -76.00000 + return 1; +} +``` + +## 相关函数 + +- [GetObjectPos](GetObjectPos): 获取物体位置 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体位置 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体位置 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到其他玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectSyncRotation.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectSyncRotation.md new file mode 100644 index 00000000000..bc28c907cfa --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectSyncRotation.md @@ -0,0 +1,36 @@ +--- +title: GetObjectSyncRotation +sidebar_label: GetObjectSyncRotation +description: 获取物体的同步旋转状态 +tags: ["物体"] +--- + + + +## 描述 + +获取物体的同步旋转状态。 + +| 名称 | 描述 | +| -------- | ------------- | +| objectid | 目标物体的 ID | + +## 返回值 + +返回表示是否启用同步旋转的布尔值(`true`/`false`)。 + +## 示例代码 + +```c +new objectid = CreateObject(...); +new parentid = CreateObject(...); +AttachObjectToObject(objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, false); + +new bool:syncRotation = GetObjectSyncRotation(objectid); +// syncRotation = false +``` + +## 相关函数 + +- [AttachObjectToObject](AttachObjectToObject): 将物体附加到其他物体 +- [GetPlayerObjectSyncRotation](GetPlayerObjectSyncRotation): 获取玩家物体的同步旋转状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectType.md new file mode 100644 index 00000000000..edcdc28792e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetObjectType.md @@ -0,0 +1,48 @@ +--- +title: GetObjectType +sidebar_label: GetObjectType +description: 获取物体的类型(全局物体或玩家物体) +tags: ["物体"] +--- + + + +## 描述 + +获取物体的类型(全局物体或玩家物体)。 + +| 名称 | 描述 | +| -------- | --------------------- | +| playerid | 玩家 ID | +| objectid | 需要获取类型的物体 ID | + +## 返回值 + +`0` - 函数执行失败(指定物体或玩家不存在) + +`1` - 全局物体 + +`2` - 玩家物体 + +## 示例代码 + +```c +new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); + +new objectType = GetObjectType(playerid, objectid); +// objectType = 1 +``` + +另一个示例: + +```c +new playerobjectid = CreatePlayerObject(playerid, 19174, 978.88757, -986.34918, 40.95220, 0.00000, 0.00000, 228.00000); + +new objectType = GetObjectType(playerid, playerobjectid); +// objectType = 2 +``` + +## 相关函数 + +- [CreateObject](CreateObject): 创建全局物体 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarFloat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarFloat.md new file mode 100644 index 00000000000..ab95061d1b1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarFloat.md @@ -0,0 +1,55 @@ +--- +title: GetPVarFloat +sidebar_label: GetPVarFloat +description: 获取玩家变量的浮点数值 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +获取指定玩家的浮点型变量值 + +| 名称 | 说明 | +| ------------ | --------------------- | +| playerid | 需要获取变量的玩家 ID | +| const pvar[] | 目标玩家变量名称 | + +## 返回值 + +返回指定玩家变量的浮点数值,若变量不存在返回 0.0 + +## 示例代码 + +```c +// 加载玩家保存的位置数据 +LoadPlayerPos(playerid) +{ + new Float:x, Float:y, Float:z; + + // 从玩家变量读取坐标 + x = GetPVarFloat(playerid, "Xpos"); + y = GetPVarFloat(playerid, "Ypos"); + z = GetPVarFloat(playerid, "Zpos"); + + // 设置玩家位置 + SetPlayerPos(playerid, x, y, z); + return 1; +} +``` + +## 注意事项 + +:::tip + +玩家变量在[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)回调触发后才会重置,因此在断开连接事件中仍可访问 + +::: + +## 相关函数 + +- [SetPVarInt](SetPVarInt): 设置玩家变量的整数值 +- [GetPVarInt](GetPVarInt): 获取玩家变量的整数值 +- [SetPVarString](SetPVarString): 设置玩家变量的字符串值 +- [GetPVarString](GetPVarString): 获取玩家变量的字符串值 +- [SetPVarFloat](SetPVarFloat): 设置玩家变量的浮点数值 +- [DeletePVar](DeletePVar): 删除指定玩家变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarInt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarInt.md new file mode 100644 index 00000000000..f7095f7e6d9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarInt.md @@ -0,0 +1,55 @@ +--- +title: GetPVarInt +sidebar_label: GetPVarInt +description: 获取玩家变量的整数值 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +获取指定玩家变量的整数值 + +| 名称 | 说明 | +| ------------ | ----------------------------------------------------------------------- | +| playerid | 需要获取变量的玩家 ID | +| const pvar[] | 目标变量名称(不区分大小写)
需通过[SetPVarInt](SetPVarInt)预先设置 | + +## 返回值 + +返回指定玩家变量的整数值。若变量未设置或玩家不存在,返回 **0** + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + // 设置玩家等级变量 + SetPVarInt(playerid, "Level", 20); + return 1; +} + +public OnPlayerDisconnect(playerid, reason) +{ + // 获取并打印已保存的等级值 + printf("等级: %d", GetPVarInt(playerid, "Level")); + // 输出"等级: 20" + return 1; +} +``` + +## 注意事项 + +:::tip + +玩家变量在[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)回调触发后才会重置,因此在断开连接事件中仍可访问 + +::: + +## 相关函数 + +- [SetPVarInt](SetPVarInt): 设置玩家变量的整数值 +- [SetPVarString](SetPVarString): 设置玩家变量的字符串值 +- [GetPVarString](GetPVarString): 获取玩家变量的字符串值 +- [SetPVarFloat](SetPVarFloat): 设置玩家变量的浮点数值 +- [GetPVarFloat](GetPVarFloat): 获取玩家变量的浮点数值 +- [DeletePVar](DeletePVar): 删除指定玩家变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarNameAtIndex.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarNameAtIndex.md new file mode 100644 index 00000000000..aa5ea82e4f3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarNameAtIndex.md @@ -0,0 +1,29 @@ +--- +title: GetPVarNameAtIndex +sidebar_label: GetPVarNameAtIndex +description: 通过索引获取玩家变量的名称 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +通过索引值获取玩家变量的名称 + +| 名称 | 说明 | +| ---------------------- | ---------------------------------- | +| playerid | 需要获取变量名称的玩家 ID | +| index | 玩家变量的索引编号(从 0 开始) | +| output[] | 存储变量名称的字符数组(引用传递) | +| size = sizeof (output) | 输出字符串的最大缓冲长度 | + +## 返回值 + +本函数不直接返回值,变量名称将存储于指定字符数组中 + +## 相关函数 + +- [GetPVarType](GetPVarType): 获取玩家变量的数据类型 +- [GetPVarInt](GetPVarInt): 获取玩家变量的整数值 +- [GetPVarFloat](GetPVarFloat): 获取玩家变量的浮点数值 +- [GetPVarString](GetPVarString): 获取玩家变量的字符串值 +- [GetPVarsUpperIndex](GetPVarsUpperIndex): 获取玩家变量的最大索引值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarString.md new file mode 100644 index 00000000000..85b396b6c48 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarString.md @@ -0,0 +1,60 @@ +--- +title: GetPVarString +sidebar_label: GetPVarString +description: 获取玩家变量的字符串值 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +获取指定玩家变量的字符串值 + +| 名称 | 说明 | +| --------------------- | ------------------------------------------------------------ | +| playerid | 需要获取变量的玩家 ID | +| const pvar[] | 目标变量名称(需通过[SetPVarString](SetPVarString)预先设置) | +| output[] | 存储字符串的字符数组(引用传递) | +| len = sizeof (output) | 字符串最大缓冲长度 | + +## 返回值 + +返回字符串的实际长度。若变量未设置或玩家不存在,返回 **0** + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + // 保存玩家昵称到变量 + new playerName[MAX_PLAYER_NAME]; + GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); + SetPVarString(playerid, "PlayerName", playerName); + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 从变量读取玩家昵称 + new playerName[MAX_PLAYER_NAME]; + GetPVarString(playerid, "PlayerName", playerName, sizeof(playerName)); + + printf("%s 已阵亡。", playerName); +} +``` + +## 注意事项 + +:::warning + +当返回值为 0 时(变量未设置),`output` 数组内容不会自动清空,需手动重置数组内容以避免脏数据 + +::: + +## 相关函数 + +- [SetPVarString](SetPVarString): 设置玩家变量的字符串值 +- [SetPVarInt](SetPVarInt): 设置玩家变量的整数值 +- [GetPVarInt](GetPVarInt): 获取玩家变量的整数值 +- [SetPVarFloat](SetPVarFloat): 设置玩家变量的浮点数值 +- [GetPVarFloat](GetPVarFloat): 获取玩家变量的浮点数值 +- [DeletePVar](DeletePVar): 删除指定玩家变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarType.md new file mode 100644 index 00000000000..ad609fd2c3f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarType.md @@ -0,0 +1,79 @@ +--- +title: GetPVarType +sidebar_label: GetPVarType +description: 获取玩家变量的数据类型(整型、浮点型或字符串) +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +获取指定玩家变量的数据类型(整型、浮点型或字符串) + +| 名称 | 说明 | +| ------------ | ------------------------- | +| playerid | 需要获取变量类型的玩家 ID | +| const pvar[] | 目标变量名称(需已设置) | + +## 返回值 + +返回变量类型值,具体类型参见下表: + +| 返回值常量 | 数值 | 说明 | +| --------------------- | ---- | ----------------- | +| PLAYER_VARTYPE_NONE | 0 | 变量不存在/未设置 | +| PLAYER_VARTYPE_INT | 1 | 整型变量 | +| PLAYER_VARTYPE_FLOAT | 2 | 浮点型变量 | +| PLAYER_VARTYPE_STRING | 3 | 字符串型变量 | + +## 示例代码 + +```c +stock PrintPVar(playerid, varname[]) +{ + switch(GetPVarType(playerid, varname)) + { + case PLAYER_VARTYPE_NONE: + { + return 0; // 变量未设置 + } + case PLAYER_VARTYPE_INT: + { + printf("整型变量 '%s': %i", varname, GetPVarInt(playerid, varname)); + } + case PLAYER_VARTYPE_FLOAT: + { + printf("浮点型变量 '%s': %f", varname, GetPVarFloat(playerid, varname)); + } + case PLAYER_VARTYPE_STRING: + { + new varstring[256]; + GetPVarString(playerid, varname, varstring, sizeof(varstring)); + + printf("字符串变量 '%s': %s", varname, varstring); + } + } + return 1; +} + +public OnPlayerConnect(playerid) +{ + SetPVarInt(playerid, "Level", 20); + + PrintPVar(playerid, "Level"); // 输出:"整型变量 'Level': 20" + return 1; +} +``` + +## 相关函数 + +- [SetPVarInt](SetPVarInt): 设置整型玩家变量 +- [GetPVarInt](GetPVarInt): 获取整型玩家变量值 +- [SetPVarString](SetPVarString): 设置字符串型玩家变量 +- [GetPVarString](GetPVarString): 获取字符串型玩家变量值 +- [SetPVarFloat](SetPVarFloat): 设置浮点型玩家变量 +- [GetPVarFloat](GetPVarFloat): 获取浮点型玩家变量值 +- [DeletePVar](DeletePVar): 删除玩家变量 + +## 相关资源 + +- [玩家变量类型说明](../resources/pvartypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarsUpperIndex.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarsUpperIndex.md new file mode 100644 index 00000000000..fd7c62d150c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPVarsUpperIndex.md @@ -0,0 +1,51 @@ +--- +title: GetPVarsUpperIndex +sidebar_label: GetPVarsUpperIndex +description: 获取玩家变量的最大索引值 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +玩家变量(PVar)都有唯一的标识索引,本函数返回玩家已设置的变量最大索引值 + +| 名称 | 说明 | +| -------- | --------------------- | +| playerid | 需要获取索引的玩家 ID | + +## 返回值 + +已设置的最高玩家变量索引值(从 0 开始) + +## 示例代码 + +```c +// 将最大索引值存储在变量中并加1 +new PVarUpperIndex = GetPVarsUpperIndex(playerid) + 1; + +// 此变量用于统计实际设置的变量数量 +new pVarCount; + +new pVarName[128]; + +for(new i = 0; i != PVarUpperIndex; i++) // 遍历所有可能的变量索引 +{ + // 首先获取变量名称 + GetPVarNameAtIndex(playerid, i, pVarName, sizeof(pVarName)); + + // 若变量已设置(类型不为0),增加计数器 + if (GetPVarType(playerid, pVarName) != 0) + { + pVarCount++; + } +} + +new szString[128]; +format(szString, sizeof(szString), "您已设置了 %i 个玩家变量,最大索引值为 %i", pVarCount, PVarUpperIndex-1); +SendClientMessage(playerid, -1, szString); +``` + +## 相关函数 + +- [GetPVarNameAtIndex](GetPVarNameAtIndex): 根据索引获取玩家变量名称 +- [GetPVarType](GetPVarType): 获取玩家变量的数据类型 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupModel.md new file mode 100644 index 00000000000..5767cf64b64 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupModel.md @@ -0,0 +1,54 @@ +--- +title: GetPickupModel +sidebar_label: GetPickupModel +description: 获取拾取物的模型ID +tags: ["拾取物"] +--- + + + +## 描述 + +获取拾取物的模型 ID。 + +| 名称 | 描述 | +| -------- | ------------------------------ | +| pickupid | 需要获取模型 ID 的拾取物标识符 | + +## 返回值 + +返回拾取物的模型 ID。 + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + + new model = GetPickupModel(g_Pickup); + // model = 1239 + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测拾取物是否对玩家流加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物所属虚拟世界 +- [ShowPickupForPlayer](ShowPickupForPlayer): 为玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家自定义拾取物属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupPos.md new file mode 100644 index 00000000000..fd121f42938 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupPos.md @@ -0,0 +1,66 @@ +--- +title: GetPickupPos +sidebar_label: GetPickupPos +description: 获取拾取物的坐标 +tags: ["拾取物"] +--- + + + +## 描述 + +获取拾取物的坐标。 + +| 名称 | 描述 | +| -------- | ----------------------------------- | +| pickupid | 需要获取坐标的拾取物 ID | +| &Float:x | 存储 X 坐标的浮点变量,通过引用传递 | +| &Float:y | 存储 Y 坐标的浮点变量,通过引用传递 | +| &Float:z | 存储 Z 坐标的浮点变量,通过引用传递 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定拾取物不存在) + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + + new + Float:x, + Float:y, + Float:z; + + GetPickupPos(g_Pickup, x, y, z); + // x = 1686.6160 + // y = 1455.4277 + // z = 10.7705 + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测拾取物是否对玩家流加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物所属虚拟世界 +- [ShowPickupForPlayer](ShowPickupForPlayer): 为玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家自定义拾取物属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupType.md new file mode 100644 index 00000000000..bb0a34a8772 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupType.md @@ -0,0 +1,55 @@ +--- +title: GetPickupType +sidebar_label: GetPickupType +description: 获取拾取物的类型 +tags: ["拾取物"] +--- + + + +## 描述 + +获取拾取物的类型。 + +| 名称 | 描述 | +| -------- | ----------------------- | +| pickupid | 需要获取类型的拾取物 ID | + +## 返回值 + +返回拾取物的类型, +当拾取物无效时返回 **-1**。 + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + + new type = GetPickupType(g_Pickup); + // type = 1 + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测拾取物是否对玩家流加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物所属虚拟世界 +- [ShowPickupForPlayer](ShowPickupForPlayer): 为玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家自定义拾取物属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupVirtualWorld.md new file mode 100644 index 00000000000..889c0277258 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPickupVirtualWorld.md @@ -0,0 +1,54 @@ +--- +title: GetPickupVirtualWorld +sidebar_label: GetPickupVirtualWorld +description: 获取拾取物所属的虚拟世界ID +tags: ["拾取物"] +--- + + + +## 描述 + +获取拾取物所属的虚拟世界 ID。 + +| 名称 | 描述 | +| -------- | ---------------------------------- | +| pickupid | 需要获取虚拟世界 ID 的拾取物标识符 | + +## 返回值 + +返回拾取物所属的虚拟世界 ID。 + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, 20); + + new worldid = GetPickupVirtualWorld(g_Pickup); + // worldid = 20 + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测拾取物是否对玩家流加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 +- [ShowPickupForPlayer](ShowPickupForPlayer): 为玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家自定义拾取物属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttached.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttached.md new file mode 100644 index 00000000000..faae8461cdd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttached.md @@ -0,0 +1,70 @@ +--- +title: GetPlayer3DTextLabelAttached +sidebar_label: GetPlayer3DTextLabelAttached +description: 获取玩家3D文本标签的附加数据 +tags: ["玩家", "3D文本标签"] +--- + +:::warning + +该函数已弃用,请使用 [GetPlayer3DTextLabelAttachedData](GetPlayer3DTextLabelAttachedData)。 + +::: + +## 描述 + +获取玩家 3D 文本标签的附加数据。 + +| 名称 | 描述 | +| ------------------- | ------------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取附加数据的玩家 3D 文本标签 ID | +| &parentPlayerid | 存储父玩家 ID 的变量,通过引用传递 | +| &parentVehicleid | 存储父车辆 ID 的变量,通过引用传递 | + +## 示例代码 + +### 父玩家 ID 示例 + +```c +new PlayerText3D:playerTextId; +new Float:X, Float:Y, Float:Z; +new attachedplayer = 37; // 附加到ID为37的玩家 + +new parentPlayerid; +new parentVehicleid; + +GetPlayerPos(playerid, X, Y, Z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, X, Y, Z, 40.0, attachedplayer, INVALID_VEHICLE_ID); + +GetPlayer3DTextLabelAttached(playerid, playerTextId, parentPlayerid, parentVehicleid); +// `parentPlayerid` 将为 '37' +``` + +### 父车辆 ID 示例 + +```c +new PlayerText3D:gVehicle3dText[MAX_VEHICLES]; +new gVehicleId; + +new parentPlayerid; +new parentVehicleid; + +gVehicleId = CreateVehicle(510, 0.0, 0.0, 15.0, 5, 0, 120); +gVehicle3dText[gVehicleId] = CreatePlayer3DTextLabel(playerid, "示例文本", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, INVALID_PLAYER_ID, gVehicleId); + +GetPlayer3DTextLabelAttached(playerid, gVehicle3dText[gVehicleId], parentPlayerid, parentVehicleid); +// `parentVehicleid` 将等于 'gVehicleId' 的值 +``` + +## 注意事项 + +:::tip + +此函数是 [GetPlayer3DTextLabelAttachedData](GetPlayer3DTextLabelAttachedData) 的简写形式 + +::: + +## 相关函数 + +- [Get3DTextLabelAttachedData](Get3DTextLabelAttachedData): 获取 3D 文本标签的附加数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttachedData.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttachedData.md new file mode 100644 index 00000000000..e8bdcaaddd3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelAttachedData.md @@ -0,0 +1,58 @@ +--- +title: GetPlayer3DTextLabelAttachedData +sidebar_label: GetPlayer3DTextLabelAttachedData +description: 获取玩家3D文本标签的附加数据 +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +获取玩家 3D 文本标签的附加数据。 + +| 名称 | 描述 | +| ------------------- | ------------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取附加数据的玩家 3D 文本标签 ID | +| &parentPlayerid | 存储父玩家 ID 的变量,通过引用传递 | +| &parentVehicleid | 存储父车辆 ID 的变量,通过引用传递 | + +## 示例代码 + +### 父玩家 ID 示例 + +```c +new PlayerText3D:playerTextId; +new Float:X, Float:Y, Float:Z; +new attachedplayer = 37; // 附加到ID为37的玩家 + +new parentPlayerid; +new parentVehicleid; + +GetPlayerPos(playerid, X, Y, Z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, X, Y, Z, 40.0, attachedplayer, INVALID_VEHICLE_ID); + +GetPlayer3DTextLabelAttachedData(playerid, playerTextId, parentPlayerid, parentVehicleid); +// `parentPlayerid` 将为 '37' +``` + +### 父车辆 ID 示例 + +```c +new PlayerText3D:gVehicle3dText[MAX_VEHICLES]; +new gVehicleId; + +new parentPlayerid; +new parentVehicleid; + +gVehicleId = CreateVehicle(510, 0.0, 0.0, 15.0, 5, 0, 120); +gVehicle3dText[gVehicleId] = CreatePlayer3DTextLabel(playerid, "示例文本", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, INVALID_PLAYER_ID, gVehicleId); + +GetPlayer3DTextLabelAttachedData(playerid, gVehicle3dText[gVehicleId], parentPlayerid, parentVehicleid); +// `parentVehicleid` 将等于 'gVehicleId' 的值 +``` + +## 相关函数 + +- [Get3DTextLabelAttachedData](Get3DTextLabelAttachedData): 获取 3D 文本标签的附加数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColor.md new file mode 100644 index 00000000000..2895bffc8cc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColor.md @@ -0,0 +1,43 @@ +--- +title: GetPlayer3DTextLabelColor +sidebar_label: GetPlayer3DTextLabelColor +description: 获取玩家3D文本标签的颜色 +tags: ["玩家", "3D文本标签"] +--- + +:::warning + +该函数已弃用,请使用 [GetPlayer3DTextLabelColour](GetPlayer3DTextLabelColour)。 + +::: + +## 描述 + +获取玩家 3D 文本标签的颜色。 + +| 名称 | 描述 | +| ------------------- | --------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取颜色的玩家 3D 文本标签 ID | + +## 返回值 + +返回玩家 3D 文本标签的颜色值(ARGB 格式)。 + +## 示例代码 + +```c +new PlayerText3D:playerTextId; +new Float:X, Float:Y, Float:Z; +new color; + +GetPlayerPos(playerid, X, Y, Z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, X, Y, Z, 40.0); + +color = GetPlayer3DTextLabelColor(playerid, playerTextId); +// color = 0x008080FF +``` + +## 相关函数 + +- [Get3DTextLabelColor](Get3DTextLabelColor): 获取 3D 文本标签颜色 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColour.md new file mode 100644 index 00000000000..7ec0fa1c479 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelColour.md @@ -0,0 +1,39 @@ +--- +title: GetPlayer3DTextLabelColour +sidebar_label: GetPlayer3DTextLabelColour +description: 获取玩家3D文本标签的颜色 +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +获取玩家 3D 文本标签的颜色。 + +| 名称 | 描述 | +| ------------------- | --------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取颜色的玩家 3D 文本标签 ID | + +## 返回值 + +返回玩家 3D 文本标签的颜色值(ARGB 格式)。 + +## 示例代码 + +```c +new PlayerText3D:playerTextId; +new Float:x, Float:y, Float:z; +new colour; + +GetPlayerPos(playerid, x, y, z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, x, y, z, 40.0); + +colour = GetPlayer3DTextLabelColour(playerid, playerTextId); +// colour = 0x008080FF +``` + +## 相关函数 + +- [Get3DTextLabelColour](Get3DTextLabelColour): 获取 3D 文本标签颜色 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDist.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDist.md new file mode 100644 index 00000000000..a76ae3d829a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDist.md @@ -0,0 +1,52 @@ +--- +title: GetPlayer3DTextLabelDrawDist +sidebar_label: GetPlayer3DTextLabelDrawDist +description: 获取玩家3D文本标签的绘制距离 +tags: ["玩家", "3D文本标签"] +--- + +:::warning + +该函数已弃用,请使用 [GetPlayer3DTextLabelDrawDistance](GetPlayer3DTextLabelDrawDistance)。 + +::: + +## 描述 + +获取玩家 3D 文本标签的绘制距离。 + +| 名称 | 描述 | +| ------------------- | ------------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取绘制距离的玩家 3D 文本标签 ID | + +## 返回值 + +以浮点数形式返回玩家 3D 文本标签的绘制距离。 + +## 示例代码 + +```c +new PlayerText3D:playerTextId; +new Float:X, Float:Y, Float:Z; +new Float:drawDistance; + +GetPlayerPos(playerid, X, Y, Z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, X, Y, Z, 40.0); + +drawDistance = GetPlayer3DTextLabelDrawDist(playerid, playerTextId); +// drawDistance = 40.0 +``` + +## 注意事项 + +:::tip + +此函数是 [GetPlayer3DTextLabelDrawDistance](GetPlayer3DTextLabelDrawDistance) 的简写形式 + +::: + +## 相关函数 + +- [SetPlayer3DTextLabelDrawDistance](SetPlayer3DTextLabelDrawDistance): 设置玩家 3D 文本标签的绘制距离 +- [Get3DTextLabelDrawDistance](Get3DTextLabelDrawDistance): 获取 3D 文本标签的绘制距离 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDistance.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDistance.md new file mode 100644 index 00000000000..a93b6787425 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelDrawDistance.md @@ -0,0 +1,40 @@ +--- +title: GetPlayer3DTextLabelDrawDistance +sidebar_label: GetPlayer3DTextLabelDrawDistance +description: 获取玩家3D文本标签的绘制距离 +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +获取玩家 3D 文本标签的绘制距离。 + +| 名称 | 描述 | +| ------------------- | ------------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取绘制距离的玩家 3D 文本标签 ID | + +## 返回值 + +以浮点数形式返回玩家 3D 文本标签的绘制距离。 + +## 示例代码 + +```c +new PlayerText3D:playerTextId; +new Float:x, Float:y, Float:z; +new Float:drawDistance; + +GetPlayerPos(playerid, x, y, z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, x, y, z, 40.0); + +drawDistance = GetPlayer3DTextLabelDrawDistance(playerid, playerTextId); +// drawDistance = 40.0 +``` + +## 相关函数 + +- [SetPlayer3DTextLabelDrawDistance](SetPlayer3DTextLabelDrawDistance): 设置玩家 3D 文本标签的绘制距离 +- [Get3DTextLabelDrawDistance](Get3DTextLabelDrawDistance): 获取 3D 文本标签的绘制距离 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelLOS.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelLOS.md new file mode 100644 index 00000000000..fbf833fa243 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelLOS.md @@ -0,0 +1,40 @@ +--- +title: GetPlayer3DTextLabelLOS +sidebar_label: GetPlayer3DTextLabelLOS +description: 获取玩家3D文本标签的视线检测状态 +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +获取玩家 3D 文本标签的视线检测状态。 + +| 名称 | 描述 | +| ------------------- | ----------------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取视线检测状态的玩家 3D 文本标签 ID | + +## 返回值 + +返回表示玩家 3D 文本标签视线检测状态的布尔值(false/true)。 + +## 示例代码 + +```c +new PlayerText3D:playerTextId; +new Float:X, Float:Y, Float:Z; +new bool:testLOS; + +GetPlayerPos(playerid, X, Y, Z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, X, Y, Z, 40.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, true); + +testLOS = GetPlayer3DTextLabelLOS(playerid, playerTextId); +// testLOS = true(启用视线检测) +``` + +## 相关函数 + +- [SetPlayer3DTextLabelLOS](SetPlayer3DTextLabelLOS): 设置玩家 3D 文本标签的视线检测状态 +- [Get3DTextLabelLOS](Get3DTextLabelLOS): 获取 3D 文本标签的视线检测状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelPos.md new file mode 100644 index 00000000000..6a47c5e9ab0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelPos.md @@ -0,0 +1,37 @@ +--- +title: GetPlayer3DTextLabelPos +sidebar_label: GetPlayer3DTextLabelPos +description: 获取玩家3D文本标签的位置 +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +获取玩家 3D 文本标签的位置。 + +| 名称 | 描述 | +| ------------------- | ----------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取位置的玩家 3D 文本标签 ID | +| &Float:x | 存储 X 坐标的浮点变量,通过引用传递 | +| &Float:y | 存储 Y 坐标的浮点变量,通过引用传递 | +| &Float:z | 存储 Z 坐标的浮点变量,通过引用传递 | + +## 示例代码 + +```c +new PlayerText3D:playerTextId; +new Float:playerX, Float:playerY, Float:playerZ; + +GetPlayerPos(playerid, playerX, playerY, playerZ); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, playerX, playerY, playerZ, 40.0); + +new Float:x, Float:y, Float:z; +GetPlayer3DTextLabelPos(playerid, playerTextId, x, y, z); +``` + +## 相关函数 + +- [Get3DTextLabelPos](Get3DTextLabelPos): 获取 3D 文本标签的位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelText.md new file mode 100644 index 00000000000..23f4098c8d6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelText.md @@ -0,0 +1,39 @@ +--- +title: GetPlayer3DTextLabelText +sidebar_label: GetPlayer3DTextLabelText +description: 获取玩家3D文本标签的文本内容 +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +获取玩家 3D 文本标签的文本内容。 + +| 名称 | 描述 | +| ------------------- | --------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取文本的玩家 3D 文本标签 ID | +| text[] | 存储文本内容的数组,通过引用传递 | +| len | 待存储文本的最大长度 | + +## 示例代码 + +```c +new PlayerText3D:playerTextId; +new Float:X, Float:Y, Float:Z; +new text[16]; + +GetPlayerPos(playerid, X, Y, Z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello World!", 0x008080FF, X, Y, Z, 40.0); + +GetPlayer3DTextLabelText(playerid, playerTextId, text, sizeof(text)); +// text = "Hello World!" +``` + +## 相关函数 + +- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): 为指定玩家创建 3D 文本标签 +- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): 更新玩家 3D 文本标签的内容和颜色 +- [Get3DTextLabelText](Get3DTextLabelText): 获取 3D 文本标签的文本内容 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md new file mode 100644 index 00000000000..ac07bcf0bc2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayer3DTextLabelVirtualWorld.md @@ -0,0 +1,47 @@ +--- +title: GetPlayer3DTextLabelVirtualWorld +sidebar_label: GetPlayer3DTextLabelVirtualWorld +description: 获取玩家3D文本标签的虚拟世界ID +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +获取玩家 3D 文本标签的虚拟世界 ID。 + +| 名称 | 描述 | +| ------------------- | ----------------------------------------- | +| playerid | 玩家的 ID | +| PlayerText3D:textid | 需要获取虚拟世界 ID 的玩家 3D 文本标签 ID | + +## 返回值 + +返回玩家 3D 文本标签的虚拟世界 ID。 + +## 示例代码 + +```c +new PlayerText3D:playerTextId; +new Float:X, Float:Y, Float:Z; +new worldid; + +GetPlayerPos(playerid, X, Y, Z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, X, Y, Z, 40.0); + +worldid = GetPlayer3DTextLabelVirtualWorld(playerid, playerTextId); +``` + +## 注意事项 + +:::warning + +玩家 3D 文本标签本身不支持虚拟世界设置, +本函数实际返回的是玩家当前的虚拟世界 ID! + +::: + +## 相关函数 + +- [Get3DTextLabelVirtualWorld](Get3DTextLabelVirtualWorld): 获取 3D 文本标签的虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAmmo.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAmmo.md new file mode 100644 index 00000000000..f7050ab5025 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAmmo.md @@ -0,0 +1,50 @@ +--- +title: GetPlayerAmmo +sidebar_label: GetPlayerAmmo +description: 获取玩家当前武器的弹药量 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前武器的弹药量。 + +| 名称 | 描述 | +| -------- | ----------------------- | +| playerid | 需要获取弹药量的玩家 ID | + +## 返回值 + +玩家当前武器的弹药数量。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/myammo", true)) + { + new + ammo = GetPlayerAmmo(playerid), + string[32]; + + format(string, sizeof(string), "你的弹药量: %i", ammo); + SendClientMessage(playerid, -1, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +弹药量使用 16 位存储,超过 32767 时返回值会出现错误。 + +::: + +## 相关函数 + +- [SetPlayerAmmo](SetPlayerAmmo): 设置指定玩家武器的弹药量 +- [GetPlayerWeaponData](GetPlayerWeaponData): 获取玩家武器数据信息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimFlags.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimFlags.md new file mode 100644 index 00000000000..2df6097ca85 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimFlags.md @@ -0,0 +1,48 @@ +--- +title: GetPlayerAnimFlags +sidebar_label: GetPlayerAnimFlags +description: 获取玩家动画标志位 +tags: ["玩家", "动画"] +--- + + + +## 描述 + +获取玩家当前的动画标志位信息。 + +| 名称 | 描述 | +| -------- | --------------------------- | +| playerid | 需要获取动画标志位的玩家 ID | + +## 返回值 + +以整型形式返回动画标志位的组合值。 + +## 示例代码 + +```c +new flags = GetPlayerAnimFlags(playerid); +// flags 包含动画系统的状态标志位组合 +``` + +## 注意事项 + +:::tip +标志位采用位掩码(bitmask)形式存储,需使用位运算进行解析: + +```c +// 示例标志位定义 +#define ANIM_LOOP_FLAG 0b00000001 // 循环播放标志 +#define ANIM_LOCK_X_FLAG 0b00000010 // X轴锁定标志 +#define ANIM_LOCK_Y_FLAG 0b00000100 // Y轴锁定标志 + +// 标志位检测 +bool:isLooping = (flags & ANIM_LOOP_FLAG) ? true : false; +``` + +::: + +## 相关函数 + +- [ApplyAnimation](ApplyAnimation): 为玩家应用动画效果 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationFlags.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationFlags.md new file mode 100644 index 00000000000..f7282d3329b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationFlags.md @@ -0,0 +1,62 @@ +--- +title: GetPlayerAnimationFlags +sidebar_label: GetPlayerAnimationFlags +description: 获取玩家动画标志位 +tags: ["玩家", "动画"] +--- + + + +## 描述 + +获取玩家当前动画的标志位信息。 + +| 名称 | 描述 | +| -------- | --------------------------- | +| playerid | 需要获取动画标志位的玩家 ID | + +## 返回值 + +以整型形式返回玩家动画的标志位组合。 + +## 示例代码 + +通过位掩码操作获取各个标志位: + +```c +#define ANIM_FREEZE_FLAG 0b0000000000000100 // 冻结动画标志 +#define ANIM_LOCK_X_FLAG 0b0010000000000 // X轴锁定标志 +#define ANIM_LOCK_Y_FLAG 0b0001000000000 // Y轴锁定标志 +#define ANIM_LOOP_FLAG 0b0000100000000 // 循环播放标志 + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/myanimflags", true)) + { + new messageString[128]; + new flags = GetPlayerAnimationFlags(playerid); + + bool:freeze = (flags & ANIM_FREEZE_FLAG) ? true : false; + bool:lockx = (flags & ANIM_LOCK_X_FLAG) ? true : false; + bool:locky = (flags & ANIM_LOCK_Y_FLAG) ? true : false; + bool:loop = (flags & ANIM_LOOP_FLAG) ? true : false; + + format(messageString, sizeof(messageString), "当前动画标志:[冻结:%d] [X轴锁定:%d] [Y轴锁定:%d] [循环:%d]", freeze, lockx, locky, loop); + SendClientMessage(playerid, 0xFFFFFFFF, messageString); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +当玩家处于非地面状态(如车内/空中)时,返回的标志位始终为 0 + +::: + +## 相关函数 + +- [ApplyAnimation](ApplyAnimation): 为玩家应用动画效果 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationIndex.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationIndex.md new file mode 100644 index 00000000000..59d2f91d666 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAnimationIndex.md @@ -0,0 +1,50 @@ +--- +title: GetPlayerAnimationIndex +sidebar_label: GetPlayerAnimationIndex +description: 获取玩家当前播放的动画索引 +tags: ["玩家", "动画"] +--- + +## 描述 + +获取玩家当前正在应用的动画索引编号。 + +| 名称 | 描述 | +| -------- | ------------------------- | +| playerid | 需要获取动画索引的玩家 ID | + +## 返回值 + +返回动画库中的索引编号,当没有应用动画时返回 0。 + +## 示例代码 + +```c +public OnPlayerUpdate(playerid) +{ + if (GetPlayerAnimationIndex(playerid)) + { + new + animationLibrary[32], + animationName[32], + string[128]; + + GetAnimationName(GetPlayerAnimationIndex(playerid), animationLibrary, sizeof(animationLibrary), animationName, sizeof(animationName)); + + format(string, sizeof(string), "正在播放动画:%s 库中的 %s", animationLibrary, animationName); + SendClientMessage(playerid, 0xFFFFFFFF, string); + } + return 1; +} +``` + +## 注意事项 + +:::tip +动画索引对应 SA-MP 内置动画库的编号,可通过[GetAnimationName](GetAnimationName)获取具体动画名称 +::: + +## 相关函数 + +- [ApplyAnimation](ApplyAnimation): 为玩家应用指定动画 +- [GetAnimationName](GetAnimationName): 通过索引获取动画库及动画名称 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerArmour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerArmour.md new file mode 100644 index 00000000000..2a32be9e202 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerArmour.md @@ -0,0 +1,56 @@ +--- +title: GetPlayerArmour +sidebar_label: GetPlayerArmour +description: 获取玩家当前护甲值 +tags: ["玩家"] +--- + +## 描述 + +此函数用于将玩家的护甲值存储到指定变量中。 + +| 名称 | 描述 | +| ------------- | ---------------------------------- | +| playerid | 需要获取护甲值的玩家 ID | +| &Float:armour | 存储护甲值的浮点变量,通过引用传递 | + +## 返回值 + +**1** - 成功获取 + +**0** - 获取失败(玩家未连接) + +护甲值将被存储在指定的浮点变量中。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/myarmour", true)) + { + new string[40]; + new Float:armour; + GetPlayerArmour(playerid, armour); + + format(string, sizeof(string), "系统: 你的护甲值为 %.2f", armour); + SendClientMessage(playerid, 0xFFFFFFAA, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +尽管服务端可以设置接近无限的护甲值,但客户端最多只能显示 255。超过的值会循环计算:256 变为 0,257 变为 1,依此类推。获取的护甲值会被取整:设置 50.15 将得到 50.0 + +::: + +## 相关函数 + +- [SetPlayerArmour](SetPlayerArmour): 设置玩家护甲值 +- [GetPlayerHealth](GetPlayerHealth): 获取玩家生命值 +- [GetVehicleHealth](GetVehicleHealth): 获取车辆耐久值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAttachedObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAttachedObject.md new file mode 100644 index 00000000000..76a3e22a2d2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerAttachedObject.md @@ -0,0 +1,67 @@ +--- +title: GetPlayerAttachedObject +sidebar_label: GetPlayerAttachedObject +description: 通过索引获取玩家附加物体的数据 +tags: ["玩家", "物体", "附加"] +--- + + + +## 描述 + +通过索引获取玩家附加物体的详细数据。 + +| 名称 | 描述 | +| ---------------- | ------------------------ | +| playerid | 要获取数据的玩家 ID | +| index | 物体附加的索引位置 (0-9) | +| &modelid | 附加物体的模型 ID | +| &bone | 附加的骨骼位置 | +| &Float:offsetX | 物体 X 轴偏移量 | +| &Float:offsetY | 物体 Y 轴偏移量 | +| &Float:offsetZ | 物体 Z 轴偏移量 | +| &Float:rotationX | 物体 X 轴旋转角度 | +| &Float:rotationY | 物体 Y 轴旋转角度 | +| &Float:rotationZ | 物体 Z 轴旋转角度 | +| &Float:scaleX | 物体 X 轴缩放比例 | +| &Float:scaleY | 物体 Y 轴缩放比例 | +| &Float:scaleZ | 物体 Z 轴缩放比例 | +| &materialColour1 | 物体材质颜色 1 | +| &materialColour2 | 物体材质颜色 2 | + +## 返回值 + +总是返回 true。 + +## 示例代码 + +```c +new + modelid, + bone, + Float:offsetX, Float:offsetY, Float:offsetZ, + Float:rotationX, Float:rotationY, Float:rotationZ, + Float:scaleX, Float:scaleY, Float:scaleZ, + materialColour1, materialColour2; + +// 获取索引3的附加物体数据 +GetPlayerAttachedObject(playerid, 3, modelid, bone, offsetX, offsetY, offsetZ, + rotationX, rotationY, rotationZ, scaleX, scaleY, scaleZ, + materialColour1, materialColour2); +``` + +## 注意事项 + +:::tip + +- 索引范围为 0-9,对应玩家可附加物体的 10 个插槽 +- 偏移量和旋转参数使用浮点数存储,精确到小数点后 4 位 +- 材质颜色使用 32 位 ARGB 格式存储 (0xAARRGGBB) + ::: + +## 相关函数 + +- [SetPlayerAttachedObject](SetPlayerAttachedObject): 给玩家附加物体 +- [RemovePlayerAttachedObject](RemovePlayerAttachedObject): 移除玩家的附加物体 +- [IsPlayerAttachedObjectSlotUsed](IsPlayerAttachedObjectSlotUsed): 检测物体附加插槽是否被占用 +- [EditAttachedObject](EditAttachedObject): 编辑已附加的物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerBuildingsRemoved.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerBuildingsRemoved.md new file mode 100644 index 00000000000..dd5f8f62828 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerBuildingsRemoved.md @@ -0,0 +1,39 @@ +--- +title: GetPlayerBuildingsRemoved +sidebar_label: GetPlayerBuildingsRemoved +description: 获取玩家已移除的建筑数量 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家通过 RemoveBuildingForPlayer 函数已移除的建筑数量。 + +| 名称 | 描述 | +| -------- | ----------------- | +| playerid | 需要查询的玩家 ID | + +## 返回值 + +返回玩家已移除的建筑数量(整数)。 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + RemoveBuildingForPlayer(playerid, 700, 1192.1016, -1738.0000, 13.0391, 0.25); + RemoveBuildingForPlayer(playerid, 700, 1204.4844, -1724.8516, 13.0391, 0.25); + RemoveBuildingForPlayer(playerid, 673, 1192.5625, -1723.8828, 12.5234, 0.25); + + printf("已移除建筑数量: %d", GetPlayerBuildingsRemoved(playerid)); // 输出: 已移除建筑数量: 3 + return 1; +} +``` + +## 相关函数 + +- [RemoveBuildingForPlayer](RemoveBuildingForPlayer): 为玩家移除指定范围内的建筑物 +- [RemoveBuildingForPlayerEx](RemoveBuildingForPlayerEx): (扩展功能)增强版建筑移除函数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraAspectRatio.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraAspectRatio.md new file mode 100644 index 00000000000..280f698ea45 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraAspectRatio.md @@ -0,0 +1,42 @@ +--- +title: GetPlayerCameraAspectRatio +sidebar_label: GetPlayerCameraAspectRatio +description: 获取玩家视角的宽高比 +tags: ["玩家", "视角"] +--- + +## 描述 + +获取玩家当前视角的宽高比参数。 + +| 名称 | 描述 | +| -------- | ----------------------------- | +| playerid | 需要获取视角宽高比的玩家 ID | + +## 返回值 + +返回玩家视角宽高比的浮点数值,可能为以下三种预设值: + +- **4:3 标准比例** (1.3333334, Float:0x3FAAAAAB) - 当游戏设置中关闭宽屏模式时 +- **5:4 信箱模式** (1.2470589, Float:0x3F9F9FA0) - 当启用电影黑边效果时 +- **16:9 宽屏比例** (1.7764707, Float:0x3FE36364) - 当开启宽屏模式时(不受黑边设置影响) + +## 示例代码 + +```c +new string[128]; +format(string, sizeof(string), "当前宽高比: %f", GetPlayerCameraAspectRatio(playerid)); +SendClientMessage(playerid, -1, string); +``` + +## 注意事项 + +:::tip +返回值反映的是游戏内"宽屏"设置的选项值,而非玩家显示设备的实际物理宽高比 +::: + +## 相关函数 + +- [GetPlayerCameraZoom](GetPlayerCameraZoom): 获取玩家视角缩放级别 +- [GetPlayerCameraPos](GetPlayerCameraPos): 获取视角三维坐标 +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraFrontVector.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraFrontVector.md new file mode 100644 index 00000000000..6b786752b7c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraFrontVector.md @@ -0,0 +1,67 @@ +--- +title: GetPlayerCameraFrontVector +sidebar_label: GetPlayerCameraFrontVector +description: 本函数将返回玩家当前在三维空间中的瞄准方向坐标,该坐标相对于视角位置,具体位置信息请参见[GetPlayerCameraPos](GetPlayerCameraPos)。 +tags: ["玩家", "视角"] +--- + +## 描述 + +本函数将返回玩家当前在三维空间中的瞄准方向坐标,该坐标相对于视角位置,具体位置信息请参见[GetPlayerCameraPos](GetPlayerCameraPos)。 + +| 参数名 | 说明 | +| -------- | ----------------------------------------- | +| playerid | 需要获取视角前向向量的玩家 ID | +| &Float:x | 用于存储 X 坐标的浮点变量(通过引用传递) | +| &Float:y | 用于存储 Y 坐标的浮点变量(通过引用传递) | +| &Float:z | 用于存储 Z 坐标的浮点变量(通过引用传递) | + +## 返回值 + +坐标数据将存储在指定的变量中。 + +## 示例代码 + +```c +// 一个利用该向量的简单命令,使用GetPlayerCameraPos获取的位置数据。该命令将在玩家视线方向生成九头蛇导弹 +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/test camera vector")) + { + new + Float:fPX, Float:fPY, Float:fPZ, + Float:fVX, Float:fVY, Float:fVZ, + Float:object_x, Float:object_y, Float:object_z; + + // 修改此常量可调整缩放比例。数值越大,生成物体离视角越远 + // 使用负值将使向量反向,物体将在相反方向生成 + const + Float:fScale = 5.0; + + GetPlayerCameraPos(playerid, fPX, fPY, fPZ); + GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ); + + object_x = fPX + floatmul(fVX, fScale); + object_y = fPY + floatmul(fVY, fScale); + object_z = fPZ + floatmul(fVZ, fScale); + + CreateObject(345, object_x, object_y, object_z, 0.0, 0.0, 0.0); + + return 1; + } + + return 0; +} +``` + +## 注意事项 + +:::tip + +无论玩家处于车辆中还是步行状态,都可以获取视角数据 + +::: + +## 相关函数 + +- [GetPlayerCameraPos](GetPlayerCameraPos): 获取玩家视角位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraMode.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraMode.md new file mode 100644 index 00000000000..9e373c0bd0b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraMode.md @@ -0,0 +1,46 @@ +--- +title: GetPlayerCameraMode +sidebar_label: GetPlayerCameraMode +description: 返回指定玩家当前的GTA视角模式。 +tags: ["玩家", "视角"] +--- + +## 描述 + +返回指定玩家当前的 GTA[视角模式](../resources/cameramodes)。该模式可用于判断玩家是否处于瞄准、乘客位射击等状态。 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取视角模式的玩家 ID | + +## 返回值 + +整数形式的视角模式(若玩家未连接则返回-1) + +## 示例代码 + +```c +/* 当玩家在聊天框输入'cameramode'时,将显示此信息 */ +public OnPlayerText(playerid, text[]) +{ + if (strcmp(text, "cameramode", true) == 0) + { + new string[48]; + format(string, sizeof(string), "当前视角模式: %d", GetPlayerCameraMode(playerid)); + SendClientMessage(playerid, 0xA9C4E4FF, string); + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerCameraPos](GetPlayerCameraPos): 获取玩家视角位置 +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 +- [SetPlayerCameraPos](SetPlayerCameraPos): 设置玩家视角位置 +- [SetPlayerCameraLookAt](SetPlayerCameraLookAt): 设置玩家视角焦点 +- [SetCameraBehindPlayer](SetCameraBehindPlayer): 重置玩家视角至背后 + +## 相关资源 + +- [视角模式列表](../resources/cameramodes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraPos.md new file mode 100644 index 00000000000..de4c395c82c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraPos.md @@ -0,0 +1,51 @@ +--- +title: GetPlayerCameraPos +sidebar_label: GetPlayerCameraPos +description: 获取玩家视角的三维坐标位置 +tags: ["玩家", "视角"] +--- + +## 描述 + +获取玩家当前视角的三维空间坐标位置 + +| 参数名 | 说明 | +| -------- | ----------------------------------------- | +| playerid | 需要获取视角坐标的玩家 ID | +| &Float:x | 用于存储 X 坐标的浮点变量(通过引用传递) | +| &Float:y | 用于存储 Y 坐标的浮点变量(通过引用传递) | +| &Float:z | 用于存储 Z 坐标的浮点变量(通过引用传递) | + +## 返回值 + +坐标数据将存储在指定的变量中。 + +## 示例代码 + +```c +public OnPlayerDisconnect(playerid) +{ + new Float:x, Float:y, Float:z; + GetPlayerCameraPos(playerid, x, y, z); + + printf("玩家断开连接时视角坐标为 %f, %f, %f", x, y, z); + return 1; +} +``` + +## 注意事项 + +:::warning + +玩家视角坐标每秒仅更新一次(瞄准状态除外)。如需依赖视角坐标进行操作,建议设置 1 秒间隔的定时器 + +::: + +## 相关函数 + +- [SetPlayerCameraPos](SetPlayerCameraPos): 设置玩家视角位置 +- [GetPlayerCameraZoom](GetPlayerCameraZoom): 获取玩家视角缩放级别 +- [GetPlayerCameraAspectRatio](GetPlayerCameraAspectRatio): 获取玩家视角宽高比 +- [GetPlayerCameraMode](GetplayerCameraMode): 获取玩家视角模式 +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 +- [GetPlayerZAim](GetPlayerZAim): 获取玩家垂直瞄准角度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetActor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetActor.md new file mode 100644 index 00000000000..09b06ca7890 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetActor.md @@ -0,0 +1,81 @@ +--- +title: GetPlayerCameraTargetActor +sidebar_label: GetPlayerCameraTargetActor +description: 允许你获取玩家当前正在注视的角色(若有)的ID。 +tags: ["玩家", "视角", "角色"] +--- + + + +## 描述 + +获取玩家当前正在注视的角色(若有)的 ID。 + +| 参数名 | 说明 | +| -------- | ----------------------------- | +| playerid | 需要获取目标角色 ID 的玩家 ID | + +## 返回值 + +玩家正在注视的角色 ID(若无可视角色则返回 INVALID_ACTOR_ID) + +## 示例代码 + +```c +new bool:ActorHandsup[MAX_ACTORS]; + +public OnPlayerConnect(playerid) +{ + EnablePlayerCameraTarget(playerid, true); + return 1; +} + +public OnPlayerUpdate(playerid) +{ + // 检测玩家当前注视的角色(若有) + new playerTargetActor = GetPlayerCameraTargetActor(playerid); + + if (playerTargetActor != INVALID_ACTOR_ID) + { + // 获取玩家当前武器以检测是否持械 + new playerWeapon = GetPlayerWeapon(playerid); + + // 获取玩家按键状态以检测是否处于瞄准状态 + new KEY:keys, updown, leftright; + GetPlayerKeys(playerid, keys, updown, leftright); + + // 若角色未举手且玩家持械瞄准 + if (!ActorHandsup[playerTargetActor] && playerWeapon >= 22 && playerWeapon <= 42 && keys & KEY_AIM) + { + // 应用举手动画 + ApplyActorAnimation(playerTargetActor, "SHOP", "SHP_HandsUp_Scr",4.1,0,0,0,1,0); + + // 标记角色已举手状态 + ActorHandsup[playerTargetActor] = true; + } + } + return 1; +} +``` + +## 注意事项 + +:::tip + +本函数仅返回玩家视角方向上的角色 ID,如需检测玩家是否正在瞄准该角色,请使用[GetPlayerTargetActor](GetPlayerTargetActor) + +::: + +:::warning + +本功能默认禁用以节省带宽,需使用[EnablePlayerCameraTarget](EnablePlayerCameraTarget)为每个玩家单独启用 + +::: + +## 相关函数 + +- [GetPlayerTargetActor](GetPlayerTargetActor): 获取指定玩家正在瞄准的角色 ID +- [GetPlayerCameraTargetPlayer](GetPlayerCameratargetPlayer): 获取玩家当前注视的玩家 ID +- [GetPlayerCameraTargetVehicle](GetPlayerCameraTargetVehicle): 获取玩家当前注视的车辆 ID +- [GetPlayerCameraTargetObject](GetPlayerCameraTargetObject): 获取玩家当前注视的物体 ID +- [GetPlayerCameraFrontVector](GetPlayerCaemraFrontVector): 获取玩家视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetObject.md new file mode 100644 index 00000000000..6130de456a5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetObject.md @@ -0,0 +1,68 @@ +--- +title: GetPlayerCameraTargetObject +sidebar_label: GetPlayerCameraTargetObject +description: 获取玩家当前正在注视的物体ID +tags: ["玩家", "视角"] +--- + + + +## 描述 + +获取玩家当前正在注视的物体 ID + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +玩家正在注视的物体 ID(若无可视物体则返回 INVALID_OBJECT_ID) + +## 示例代码 + +```c +new globalObjectID; + +public OnGameModeInit() +{ + // 创建全局测试物体 + globalObjectID = CreateObject(1337, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/check", true)) + { + new objectid = GetPlayerCameraTargetObject(playerid); + + // 检测是否为全局物体 + if (objectid == globalObjectID) + { + SendClientMessage(playerid, -1, "你正在注视目标物体"); + } + // 检测是否无物体被注视 + else if (objectid == INVALID_OBJECT_ID) // INVALID_OBJECT_ID = 65535 + { + SendClientMessage(playerid, -1, "未检测到注视物体"); + } + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +本功能默认禁用以节省带宽,需使用[EnablePlayerCameraTarget](EnablePlayerCameraTarget)为每个玩家单独启用 + +::: + +## 相关函数 + +- [GetPlayerCameraTargetVehicle](GetplayerCameraTargetVehicle): 获取玩家当前注视的车辆 ID +- [GetPlayerCameraTargetPlayer](GetplayerCameraTargetPlayer): 获取玩家当前注视的玩家 ID +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayer.md new file mode 100644 index 00000000000..4e2f19d620a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayer.md @@ -0,0 +1,46 @@ +--- +title: GetPlayerCameraTargetPlayer +sidebar_label: GetPlayerCameraTargetPlayer +description: 获取指定玩家当前正在注视的其他玩家ID +tags: ["玩家", "视角"] +--- + + + +## 描述 + +获取指定玩家当前正在注视的其他玩家 ID + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +被注视玩家的 ID(若无可视玩家则返回 INVALID_PLAYER_ID) + +## 示例代码 + +```c +new playerTarget = GetPlayerCameraTargetPlayer(playerid); + +if (IsPlayerAdmin(playerTarget)) +{ + GameTextForPlayer(playerid, "正在注视管理员玩家", 3000, 3); +} +``` + +## 注意事项 + +:::warning + +请勿与[GetPlayerTargetPlayer](GetPlayerTargetPlayer)混淆。GetPlayerTargetPlayer 返回玩家正在用武器瞄准的玩家 ID,而本函数返回玩家视角中心点所指向的玩家 ID + +::: + +## 相关函数 + +- [GetPlayerCameraTargetActor](GetPlayerCameraTargetActor): 获取玩家当前注视的角色 ID +- [GetPlayerCameraTargetVehicle](GetPlayerCameraTargetVehicle): 获取玩家当前注视的车辆 ID +- [GetPlayerCameraTargetObject](GetPlayerCameraTargetObject): 获取玩家当前注视的物体 ID +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayerObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayerObject.md new file mode 100644 index 00000000000..4cb210f1a0b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetPlayerObject.md @@ -0,0 +1,65 @@ +--- +title: GetPlayerCameraTargetPlayerObject +sidebar_label: GetPlayerCameraTargetPlayerObject +description: 获取玩家当前正在注视的玩家物体ID +tags: ["玩家", "视角", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家当前正在注视的玩家创建物体(player-object)的 ID + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +玩家正在注视的玩家物体 ID(若无可视物体则返回 INVALID_OBJECT_ID) + +## 示例代码 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 19174, 978.9045, -986.3599, 40.9522, 0.0000, 0.0000, 228.0000); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/check", true)) + { + new objectid = GetPlayerCameraTargetPlayerObject(playerid); + if (objectid == gPlayerObject[playerid]) + { + SendClientMessage(playerid, -1, "你正在注视自己的玩家物体"); + } + else if (objectid == INVALID_OBJECT_ID) // INVALID_OBJECT_ID = 65535 + { + SendClientMessage(playerid, -1, "未检测到注视的玩家物体"); + } + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +本功能默认禁用以节省带宽,需使用[EnablePlayerCameraTarget](EnablePlayerCameraTarget)为每个玩家单独启用 + +::: + +## 相关函数 + +- [GetPlayerCameraTargetObject](GetPlayerCameraTargetObject): 获取玩家注视的全局物体 ID +- [GetPlayerCameraTargetVehicle](GetplayerCameraTargetVehicle): 获取玩家注视的车辆 ID +- [GetPlayerCameraTargetPlayer](GetplayerCameraTargetPlayer): 获取玩家注视的玩家 ID +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetVehicle.md new file mode 100644 index 00000000000..52856166197 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraTargetVehicle.md @@ -0,0 +1,81 @@ +--- +title: GetPlayerCameraTargetVehicle +sidebar_label: GetPlayerCameraTargetVehicle +description: 获取玩家当前正在注视的车辆ID +tags: ["玩家", "车辆", "视角"] +--- + + + +## 描述 + +获取玩家当前正在注视的车辆 ID + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +玩家正在注视的车辆 ID(若无则返回 INVALID_VEHICLE_ID) + +## 示例代码 + +```c +new globalVehicleID; + +public OnGameModeInit() +{ + // 创建全局测试车辆(警用巡逻车) + globalVehicleID = CreateVehicle(596, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, -1, -1, -1); + return 1; +} + +public OnPlayerConnect(playerid) +{ + // 启用玩家视角目标检测功能 + EnablePlayerCameraTarget(playerid, true); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/check", true)) + { + new vehicleid = GetPlayerCameraTargetVehicle(playerid); + + // 检测是否注视预设车辆 + if (vehicleid == globalVehicleID) + { + SendClientMessage(playerid, -1, "你正在注视你的车辆!"); + } + else + { + SendClientMessage(playerid, -1, "未检测到目标车辆"); + } + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +本函数每次只能返回一个车辆 ID(通常为距离玩家最近的车辆),即使玩家视角范围内存在多个车辆 + +::: + +:::warning + +本功能默认禁用以节省带宽,需使用[EnablePlayerCameraTarget](EnablePlayerCameraTarget)为每个玩家单独启用 + +::: + +## 相关函数 + +- [GetPlayerCameraTargetPlayer](GetPlayerCameraTargetPlayer): 获取玩家注视的玩家 ID +- [GetPlayerCameraTargetObject](GetPlayerCameraTargetObject): 获取玩家注视的物体 ID +- [EnablePlayerCameraTarget](EnablePlayerCameraTarget): 启用玩家视角目标检测功能 +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraUpVector.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraUpVector.md new file mode 100644 index 00000000000..972e34a06a6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraUpVector.md @@ -0,0 +1,34 @@ +--- +title: GetPlayerCameraUpVector +sidebar_label: GetPlayerCameraUpVector +description: 本函数用于获取玩家视角垂直方向向量,即指向屏幕顶部中间的坐标向量 +tags: ["玩家", "视角"] +--- + +## 描述 + +本函数返回玩家视角垂直方向向量,该向量指向屏幕顶部中心点的三维坐标方向 + +| 参数名 | 说明 | +| -------- | --------------------------------------------- | +| playerid | 需要获取视角垂直向量的玩家 ID | +| &Float:x | 用于存储 X 坐标分量的浮点变量(通过引用传递) | +| &Float:y | 用于存储 Y 坐标分量的浮点变量(通过引用传递) | +| &Float:z | 用于存储 Z 坐标分量的浮点变量(通过引用传递) | + +## 返回值 + +三维向量数据将存储在指定的变量中 + +## 注意事项 + +:::warning + +本函数已在 SA-MP 0.3b 版本中移除 + +::: + +## 相关函数 + +- [GetPlayerCameraPos](GetPlayerCameraPos): 获取玩家视角位置坐标 +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraZoom.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraZoom.md new file mode 100644 index 00000000000..8b84ab23441 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCameraZoom.md @@ -0,0 +1,41 @@ +--- +title: GetPlayerCameraZoom +sidebar_label: GetPlayerCameraZoom +description: 获取指定玩家的游戏视角缩放级别 +tags: ["玩家", "视角"] +--- + +## 描述 + +获取指定玩家当前使用的游戏视角缩放级别 + +| 参数名 | 说明 | +| -------- | ----------------------------- | +| playerid | 需要获取视角缩放级别的玩家 ID | + +## 返回值 + +玩家当前视角缩放级别(普通视角/狙击镜等),返回浮点数值 + +## 示例代码 + +```c +// 显示玩家当前视角缩放级别 +new string[128]; +format(string, sizeof(string), "你的视角缩放级别: %f", GetPlayerCameraZoom(playerid)); +SendClientMessage(playerid, -1, string); +``` + +## 注意事项 + +:::tip + +本函数获取的是游戏内置视角系统(包含狙击镜缩放)的缩放级别,与武器模型自带的缩放效果无关 + +::: + +## 相关函数 + +- [GetPlayerCameraAspectRatio](GetPlayerCameraAspectRatio): 获取玩家视角宽高比 +- [GetPlayerCameraPos](GetPlayerCameraPos): 获取玩家视角位置坐标 +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCheckpoint.md new file mode 100644 index 00000000000..8e370f4b047 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCheckpoint.md @@ -0,0 +1,54 @@ +--- +title: GetPlayerCheckpoint +sidebar_label: GetPlayerCheckpoint +description: 获取玩家当前检查点的位置信息 +tags: ["玩家", "检查点"] +--- + + + +## 描述 + +获取玩家当前激活的检查点位置及参数信息 + +| 参数名 | 说明 | +| -------------- | ----------------------------------------------- | +| playerid | 需要获取检查点信息的玩家 ID | +| &Float:centreX | 存储检查点中心 X 坐标的浮点变量(通过引用传递) | +| &Float:centreY | 存储检查点中心 Y 坐标的浮点变量(通过引用传递) | +| &Float:centreZ | 存储检查点中心 Z 坐标的浮点变量(通过引用传递) | +| &Float:radius | 存储检查点半径的浮点变量(通过引用传递) | + +## 返回值 + +本函数不直接返回值,数据将通过引用参数返回 + +## 示例代码 + +```c +SetPlayerCheckpoint(playerid, 408.9874, 2537.8059, 16.5455, 1.5); + +new Float:centreX, + Float:centreY, + Float:centreZ, + Float:radius; + +GetPlayerCheckpoint(playerid, centreX, centreY, centreZ, radius); +``` + +## 相关函数 + +- [SetPlayerCheckpoint](SetPlayerCheckpoint): 为玩家创建普通检查点 +- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): 禁用玩家当前检查点 +- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): 检测玩家是否处于检查点内 +- [IsPlayerCheckpointActive](IsPlayerCheckpointActive): 检测玩家是否激活检查点 +- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): 创建竞速检查点 +- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): 禁用竞速检查点 +- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): 检测玩家是否处于竞速检查点 + +## 相关回调 + +- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): 当玩家进入检查点时触发 +- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): 当玩家离开检查点时触发 +- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): 当玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): 当玩家离开竞速检查点时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerClass.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerClass.md new file mode 100644 index 00000000000..2203f6a2046 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerClass.md @@ -0,0 +1,70 @@ +--- +title: GetPlayerClass +sidebar_label: GetPlayerClass +description: 获取职业配置数据 +tags: ["class"] +--- + + + +## 描述 + +获取已注册职业的配置数据 + +| 参数名 | 说明 | +| --------------- | ------------------------------------------- | +| classid | 要获取数据的职业 ID | +| &team | 存储队伍 ID 的变量(通过引用传递) | +| &skin | 存储角色皮肤的变量(通过引用传递) | +| &Float:spawnX | 存储出生点 X 坐标的浮点变量(通过引用传递) | +| &Float:spawnY | 存储出生点 Y 坐标的浮点变量(通过引用传递) | +| &Float:spawnZ | 存储出生点 Z 坐标的浮点变量(通过引用传递) | +| &Float:angle | 存储出生朝向角度的浮点变量(通过引用传递) | +| &WEAPON:weapon1 | 存储第一主武器的变量(通过引用传递) | +| &ammo1 | 存储第一武器弹药的变量(通过引用传递) | +| &WEAPON:weapon2 | 存储第二主武器的变量(通过引用传递) | +| &ammo2 | 存储第二武器弹药的变量(通过引用传递) | +| &WEAPON:weapon3 | 存储第三主武器的变量(通过引用传递) | +| &ammo3 | 存储第三武器弹药的变量(通过引用传递) | + +## 示例代码 + +```c +new + classid = 10, + team, + skin, + Float:spawnX, + Float:spawnY, + Float:spawnZ, + Float:angle, + WEAPON:weapon1, + ammo1, + WEAPON:weapon2, + ammo2, + WEAPON:weapon3, + ammo3; + +GetPlayerClass(classid, team, skin, spawnX, spawnY, spawnZ, angle, weapon1, ammo1, weapon2, ammo2, weapon3, ammo3); + +printf("[职业ID %d 配置详情]\n\ + 队伍: %d\n\ + 皮肤: %d\n\ + 出生点X: %f\n\ + 出生点Y: %f\n\ + 出生点Z: %f\n\ + 朝向角度: %f\n\ + 武器1: %d\n\ + 弹药1: %d\n\ + 武器2: %d\n\ + 弹药2: %d\n\ + 武器3: %d\n\ + 弹药3: %d", + classid, team, skin, spawnX, spawnY, spawnZ, angle, weapon1, ammo1, weapon2, ammo2, weapon3, ammo3); +``` + +## 相关函数 + +- [AddPlayerClass](AddPlayerClass): 添加基础职业配置 +- [AddPlayerClassEx](AddPlayerClassEx): 添加带默认队伍的扩展职业配置 +- [GetAvailableClasses](GetAvailableClasses): 获取已定义的职业总数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerColor.md new file mode 100644 index 00000000000..f7b6df64b02 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerColor.md @@ -0,0 +1,42 @@ +--- +title: GetPlayerColor +sidebar_label: GetPlayerColor +description: 获取玩家昵称颜色及雷达标记颜色 +tags: ["玩家"] +--- + +## 描述 + +获取玩家昵称及雷达标记的显示颜色(仅在调用 SetPlayerColor 后生效) + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要获取颜色的玩家 ID | + +## 返回值 + +玩家的颜色值(若未设置颜色或玩家未连接则返回 0) + +## 示例代码 + +```c +SendClientMessage(playerid, GetPlayerColor(playerid), "本条消息将使用你的专属颜色 :)"); + +new output[144]; +format(output, sizeof(output), "可通过{%06x}格式代码嵌入玩家颜色!", GetPlayerColor(playerid) >>> 8); +SendClientMessage(playerid, -1, output); +// 消息将以白色显示,其中'嵌入颜色'部分使用玩家颜色 +``` + +## 注意事项 + +:::warning + +若未预先调用 SetPlayerColor 设置颜色,本函数将返回 0。点击[此处](../../tutorials/colorfix)查看修复方法 + +::: + +## 相关函数 + +- [SetPlayerColor](SetPlayerColor): 设置玩家颜色 +- [ChangeVehicleColor](ChangeVehicleColor): 修改车辆颜色 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCustomSkin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCustomSkin.md new file mode 100644 index 00000000000..f80d7a8ed97 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerCustomSkin.md @@ -0,0 +1,43 @@ +--- +title: GetPlayerCustomSkin +sidebar_label: GetPlayerCustomSkin +description: 获取玩家从服务器下载的自定义皮肤类ID +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家通过[AddCharModel](AddCharModel)下载的自定义皮肤类 ID + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要获取皮肤的玩家 ID | + +## 返回值 + +通过 AddCharModel 函数设置的 newid 参数值(若未使用自定义皮肤则返回 0) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/customskin", true)) + { + new string[32]; + new customSkin = GetPlayerCustomSkin(playerid); + + format(string, sizeof(string), "您的自定义皮肤ID: %d", customSkin); + SendClientMessage(playerid, -1, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerSkin](GetPlayerSkin): 获取玩家当前使用的皮肤 ID +- [SetPlayerSkin](SetPlayerSkin): 设置玩家皮肤模型 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialog.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialog.md new file mode 100644 index 00000000000..7044dbfc7af --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialog.md @@ -0,0 +1,43 @@ +--- +title: GetPlayerDialog +sidebar_label: GetPlayerDialog +description: 获取当前显示给玩家的对话框ID +tags: ["玩家", "对话框"] +--- + +:::warning + +本函数已弃用,请使用[GetPlayerDialogID](GetPlayerDialogID) + +::: + +## 描述 + +获取当前显示给玩家的对话框 ID + +| 参数名 | 说明 | +| -------- | ----------- | +| playerid | 目标玩家 ID | + +## 返回值 + +当前显示的对话框 ID。若玩家未连接或未打开对话框则返回**INVALID_DIALOG_ID** + +## 示例代码 + +```c +new dialogID = GetPlayerDialog(playerid); +if (dialogID != INVALID_DIALOG_ID) +{ + // 玩家当前存在激活的对话框 +} +``` + +## 相关函数 + +- [GetPlayerDialogData](GetPlayerDialogData): 获取当前对话框关联数据 +- [ShowPlayerDialog](ShowPlayerDialog): 向玩家显示同步对话框(同一时间只能存在一个) + +## 相关回调 + +- [OnDialogResponse](../callbacks/OnDialogResponse): 当玩家响应对话框时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogData.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogData.md new file mode 100644 index 00000000000..399b8860dac --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogData.md @@ -0,0 +1,61 @@ +--- +title: GetPlayerDialogData +sidebar_label: GetPlayerDialogData +description: 获取当前显示给玩家的对话框数据 +tags: ["玩家", "对话框"] +--- + + + +## 描述 + +获取当前显示给玩家的对话框完整配置数据 + +| 参数名 | 说明 | +| ------------------- | -------------------------------------------- | +| playerid | 需要获取数据的玩家 ID | +| &DIALOG_STYLE:style | 存储对话框样式的枚举变量(通过引用传递) | +| title[] | 存储标题文本的数组变量(通过引用传递) | +| titleSize | 标题数组的长度 | +| body[] | 存储内容文本的数组变量(通过引用传递) | +| bodySize | 内容数组的长度 | +| button1[] | 存储第一个按钮文本的数组变量(通过引用传递) | +| button1Size | 按钮 1 数组的长度 | +| button2[] | 存储第二个按钮文本的数组变量(通过引用传递) | +| button2Size | 按钮 2 数组的长度 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接或未打开对话框) + +## 示例代码 + +```c +enum +{ + DIALOG_LOGIN +} + +ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "登录系统", "请输入您的密码:", "登录", "取消"); + +new + DIALOG_STYLE:style, + title[32], + body[64], + button1[16], + button2[16]; + +GetPlayerDialogData(playerid, style, title, sizeof(title), body, sizeof(body), button1, sizeof(button1), button2, sizeof(button2)); +``` + +## 相关函数 + +- [ShowPlayerDialog](ShowPlayerDialog): 向玩家显示同步对话框(同一时间只能存在一个) +- [HidePlayerDialog](HidePlayerDialog): 隐藏当前显示的对话框 +- [GetPlayerDialogID](GetPlayerDialogID): 获取当前对话框的 ID + +## 相关回调 + +- [OnDialogResponse](../callbacks/OnDialogResponse): 当玩家响应对话框时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogID.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogID.md new file mode 100644 index 00000000000..99dfd549282 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDialogID.md @@ -0,0 +1,39 @@ +--- +title: GetPlayerDialogID +sidebar_label: GetPlayerDialogID +description: 获取当前显示给玩家的对话框ID +tags: ["玩家", "对话框"] +--- + + + +## 描述 + +获取当前显示给玩家的对话框 ID + +| 参数名 | 说明 | +| -------- | ----------- | +| playerid | 目标玩家 ID | + +## 返回值 + +当前显示的对话框 ID。若玩家未连接或未打开对话框则返回**INVALID_DIALOG_ID** + +## 示例代码 + +```c +new dialogID = GetPlayerDialogID(playerid); +if (dialogID != INVALID_DIALOG_ID) +{ + // 玩家当前存在激活的对话框 +} +``` + +## 相关函数 + +- [GetPlayerDialogData](GetPlayerDialogData): 获取当前对话框的完整配置数据 +- [ShowPlayerDialog](ShowPlayerDialog): 向玩家显示同步对话框(同一时间只能存在一个) + +## 相关回调 + +- [OnDialogResponse](../callbacks/OnDialogResponse): 当玩家响应对话框时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDistanceFromPoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDistanceFromPoint.md new file mode 100644 index 00000000000..c91c71ef4e2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDistanceFromPoint.md @@ -0,0 +1,47 @@ +--- +title: GetPlayerDistanceFromPoint +sidebar_label: GetPlayerDistanceFromPoint +description: 计算玩家与指定地图坐标点之间的距离 +tags: ["玩家"] +--- + +## 描述 + +计算玩家当前位置与指定三维地图坐标点之间的直线距离 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要计算距离的玩家 ID | +| Float:x | 目标点的 X 坐标 | +| Float:y | 目标点的 Y 坐标 | +| Float:z | 目标点的 Z 坐标 | + +## 返回值 + +玩家与目标点之间的三维空间距离(浮点数值) + +## 示例代码 + +```c +/* 当玩家在聊天框中输入'/vend'时触发 */ +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/vend", true) == 0) + { + new + Float:distance = GetPlayerDistanceFromPoint(playerid, 237.9, 115.6, 1010.2), + string[64]; + + format(string, sizeof(string), "你距离自动贩卖机还有 %0.2f 米", distance); + SendClientMessage(playerid, 0xA9C4E4FF, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [IsPlayerInRangeOfPoint](IsPlayerInRangeOfPoint): 检测玩家是否在指定坐标点范围内 +- [GetVehicleDistanceFromPoint](GetVehicleDistanceFromPoint): 计算车辆与坐标点之间的距离 +- [GetPlayerPos](GetPlayerPos): 获取玩家当前位置坐标 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDrunkLevel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDrunkLevel.md new file mode 100644 index 00000000000..21c2e76534d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerDrunkLevel.md @@ -0,0 +1,35 @@ +--- +title: GetPlayerDrunkLevel +sidebar_label: GetPlayerDrunkLevel +description: 检测玩家当前的醉酒等级 +tags: ["玩家"] +--- + +## 描述 + +检测玩家当前的醉酒等级。当等级低于 2000 时表示清醒状态。醉酒等级会以每秒 26 点的速度自动降低,最终会稳定在 2000 点。高醉酒等级会影响玩家视角和车辆操控,玩家使用酒瓶道具时该数值会增加(可通过 SetPlayerSpecialAction 赋予酒瓶道具)。 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +玩家的醉酒等级整数值 + +## 示例代码 + +```c +public OnPlayerStateChange(playerid, oldstate, newstate) +{ + if (newstate == PLAYER_STATE_DRIVER && GetPlayerDrunkLevel(playerid) > 1999) + { + SendClientMessage(playerid, 0xFFFFFFFF, "禁止酒驾!"); + RemovePlayerFromVehicle(playerid); // 强制移出车辆 + } +} +``` + +## 相关函数 + +- [SetPlayerDrunkLevel](SetPlayerDrunkLevel): 设置玩家醉酒等级 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFacingAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFacingAngle.md new file mode 100644 index 00000000000..7533b3fd74c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFacingAngle.md @@ -0,0 +1,62 @@ +--- +title: GetPlayerFacingAngle +sidebar_label: GetPlayerFacingAngle +description: 获取玩家当前朝向角度 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前面朝方向的水平旋转角度 + +| 参数名 | 说明 | +| ------------ | ---------------------------------- | +| playerid | 需要获取角度的玩家 ID | +| &Float:angle | 存储角度的浮点变量(通过引用传递) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家不存在) + +玩家当前角度将存储在指定变量中 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/angle", true)) + { + new string[64]; + new Float:angle; + + GetPlayerFacingAngle(playerid, angle); + format(string, sizeof(string), "当前朝向角度: %0.2f", angle); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +当玩家处于车辆内时,本函数返回的角度通常不准确。建议使用[GetVehicleZAngle](GetVehicleZAngle)获取车辆 Z 轴旋转角度 + +::: + +:::warning + +GTA:SA 中的角度方向与现实相反:90 度实际指向西方(现实为东方)。角度转换公式为:360 - 角度值。北/南方向仍对应 0/360 度和 180 度 + +::: + +## 相关函数 + +- [GetVehicleZAngle](GetVehicleZAngle): 获取车辆 Z 轴旋转角度 +- [SetPlayerFacingAngle](SetPlayerFacingAngle): 设置玩家朝向角度 +- [GetPlayerRotationQuat](GetPlayerRotationQuat): 获取玩家的四元数旋转参数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFightingStyle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFightingStyle.md new file mode 100644 index 00000000000..065c12fbd16 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerFightingStyle.md @@ -0,0 +1,73 @@ +--- +title: GetPlayerFightingStyle +sidebar_label: GetPlayerFightingStyle +description: 获取玩家当前使用的战斗风格 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前使用的近战战斗风格类型 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取战斗风格的玩家 ID | + +## 返回值 + +玩家当前使用的[战斗风格](../resources/fightingstyles)ID + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/fightstyle", true)) + { + new string[64]; + new FIGHT_STYLE:style = GetPlayerFightingStyle(playerid); + new styleName[11]; + + switch (style) + { + case FIGHT_STYLE_NORMAL: + { + styleName = "普通"; + } + case FIGHT_STYLE_BOXING: + { + styleName = "拳击"; + } + case FIGHT_STYLE_KUNGFU: + { + styleName = "功夫"; + } + case FIGHT_STYLE_KNEEHEAD: + { + styleName = "膝撞"; + } + case FIGHT_STYLE_GRABKICK: + { + styleName = "擒踢"; + } + case FIGHT_STYLE_ELBOW: + { + styleName = "肘击"; + } + } + + format(string, sizeof(string), "你当前使用的是%s战斗风格!", styleName); + SendClientMessage(playerid, 0xFFFFFFAA, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SetPlayerFightingStyle](SetPlayerFightingStyle): 设置玩家的战斗风格 + +## 相关资源 + +- [战斗风格列表](../resources/fightingstyles) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGhostMode.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGhostMode.md new file mode 100644 index 00000000000..1cf79594bf4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGhostMode.md @@ -0,0 +1,34 @@ +--- +title: GetPlayerGhostMode +sidebar_label: GetPlayerGhostMode +description: 获取玩家幽灵模式状态 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家当前幽灵模式的激活状态 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +**true** - 幽灵模式已激活 + +**false** - 幽灵模式未激活 + +## 示例代码 + +```c +new string[64]; +format(string, sizeof(string), "你的幽灵模式已%s", GetPlayerGhostMode(playerid) ? "启用" : "禁用"); +SendClientMessage(playerid, -1, string); +``` + +## 相关函数 + +- [TogglePlayerGhostMode](TogglePlayerGhostMode): 切换玩家幽灵模式状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGravity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGravity.md new file mode 100644 index 00000000000..c77e5ec2872 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerGravity.md @@ -0,0 +1,42 @@ +--- +title: GetPlayerGravity +sidebar_label: GetPlayerGravity +description: 获取玩家当前重力值 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家当前的重力值设置 + +| 参数名 | 说明 | +| -------- | ----------------------- | +| playerid | 需要获取重力值的玩家 ID | + +## 返回值 + +玩家的重力值(浮点数值) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/mygravity", true)) + { + new string[32]; + format(string, sizeof(string), "你的当前重力值: %f", GetPlayerGravity(playerid)); + SendClientMessage(playerid, 0xFFFF00FF, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SetPlayerGravity](SetPlayerGravity): 设置玩家重力值 +- [GetGravity](GetGravity): 获取全局重力值 +- [SetGravity](SetGravity): 设置全局重力值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHealth.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHealth.md new file mode 100644 index 00000000000..9ee11d81619 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHealth.md @@ -0,0 +1,58 @@ +--- +title: GetPlayerHealth +sidebar_label: GetPlayerHealth +description: 获取玩家当前生命值 +tags: ["玩家"] +--- + +## 描述 + +本函数用于获取玩家当前的生命值,常用于反作弊检测等场景 + +| 参数名 | 说明 | +| ------------- | ------------------------------------ | +| playerid | 需要获取生命值的玩家 ID | +| &Float:health | 存储生命值的浮点变量(通过引用传递) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +玩家当前生命值将存储在指定变量中 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/doctor", true) == 0) + { + // 当玩家输入/doctor时,若生命值低于50则恢复至50 + new Float:health; + GetPlayerHealth(playerid, health); + + if (health < 50.0) + { + SetPlayerHealth(playerid, 50.0); + } + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +服务端可设置极大生命值,但客户端最大显示值为 255(超过部分会循环计算:256→0,257→1)。生命值获取时会取整,如设置 50.15 将返回 50.0 + +::: + +## 相关函数 + +- [SetPlayerHealth](SetPlayerHealth): 设置玩家生命值 +- [GetVehicleHealth](GetVehicleHealth): 获取车辆耐久值 +- [GetPlayerArmour](GetPlayerArmour): 获取玩家护甲值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHydraReactorAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHydraReactorAngle.md new file mode 100644 index 00000000000..4a0bd657a32 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerHydraReactorAngle.md @@ -0,0 +1,32 @@ +--- +title: GetPlayerHydraReactorAngle +sidebar_label: GetPlayerHydraReactorAngle +description: 获取玩家车辆的九头蛇推进器角度 +tags: ["玩家", "车辆"] +--- + + + +## 描述 + +获取玩家当前驾驶的九头蛇战机(Hydra)推进器角度 + +## 参数 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要获取的玩家 ID | + +## 返回值 + +九头蛇战机推进器角度值(整数类型) + +## 示例代码 + +```c +new reactorAngle = GetPlayerHydraReactorAngle(playerid); +``` + +## 相关函数 + +- [GetVehicleHydraReactorAngle](GetVehicleHydraReactorAngle): 直接通过车辆 ID 获取九头蛇推进器角度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerInterior.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerInterior.md new file mode 100644 index 00000000000..6585a17824c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerInterior.md @@ -0,0 +1,47 @@ +--- +title: GetPlayerInterior +sidebar_label: GetPlayerInterior +description: 获取玩家当前所在的室内编号 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前所在的室内编号。已知室内编号及对应坐标位置可参考[室内位置列表](../../resources/interiorids) + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取室内编号的玩家 ID | + +## 返回值 + +玩家当前所在的室内编号(整数类型) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid,text[]) +{ + if (strcmp(cmdtext, "/int", true) == 0) + { + new string[64]; + format(string, sizeof(string), "你当前所在的室内编号是 %i", GetPlayerInterior(playerid)); + SendClientMessage(playerid, 0xFF8000FF, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +NPC 玩家将始终返回室内编号 0 + +::: + +## 相关函数 + +- [SetPlayerInterior](SetPlayerInterior): 设置玩家的室内编号 +- [GetPlayerVirtualWorld](GetPlayerVirtualWorld): 获取玩家所在的虚拟世界 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerIp.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerIp.md new file mode 100644 index 00000000000..decc66b05cc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerIp.md @@ -0,0 +1,65 @@ +--- +title: GetPlayerIp +sidebar_label: GetPlayerIp +description: 获取指定玩家的IP地址并存储到字符串中 +tags: ["玩家", "IP地址"] +--- + +## 描述 + +获取指定玩家的 IP 地址并存储到字符串数组中 + +| 参数名 | 说明 | +| ---------------- | ---------------------------------------- | +| playerid | 需要获取 IP 地址的玩家 ID | +| ip[] | 存储 IP 地址的字符串数组(通过引用传递) | +| len = sizeof(ip) | IP 地址的最大存储长度(推荐 16 字节) | + +## 返回值 + +玩家的 IP 地址将存储在指定的数组中 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + new ipAddress[16]; + GetPlayerIp(playerid, ipAddress, sizeof(ipAddress)); + if (!strcmp(ipAddress, "127.0.0.1")) + { + SendClientMessage(playerid, 0xFFFFFFFF, "欢迎来到您的服务器,管理员 :)"); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +PAWN 语言区分大小写,错误使用 GetPlayerIP(大写)将无法正常工作 + +::: + +:::warning + +**SA-MP 服务端**:在[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)回调中使用时将返回无效 IP(255.255.255.255),建议在[OnPlayerConnect](../callbacks/OnPlayerConnect)中保存 IP 地址 + +**open.mp 服务端**:支持在[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)回调中正常获取 IP + +::: + +## 相关函数 + +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家的 IP 和端口 +- [GetPlayerRawIp](GetPlayerRawIp): 获取玩家原始 IP 地址 +- [GetPlayerName](GetPlayerName): 获取玩家昵称 +- [GetPlayerPing](GetPlayerPing): 获取玩家网络延迟 +- [GetPlayerVersion](GetPlayerVersion): 获取玩家客户端版本 + +## 相关回调 + +- [OnIncomingConnection](../callbacks/OnIncomingConnection): 玩家尝试连接服务器时触发 +- [OnPlayerConnect](../callbacks/OnPlayerConnect): 玩家成功连接时触发 +- [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect): 玩家断开连接时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerKeys.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerKeys.md new file mode 100644 index 00000000000..122053d7ca8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerKeys.md @@ -0,0 +1,65 @@ +--- +title: GetPlayerKeys +sidebar_label: GetPlayerKeys +description: 检测玩家当前按下的按键状态 +tags: ["玩家"] +--- + +## 描述 + +检测玩家当前操作的按键状态(行走/驾驶控制) + +| 参数名 | 说明 | +| ---------- | ----------------------------------------------------------------------------------------------------- | +| playerid | 需要检测的玩家 ID | +| &KEY:keys | 存储按键位掩码的变量(通过引用传递),用于检测特定功能键状态,详见[按键位掩码说明](../resources/keys) | +| &updown | 存储上下方向键状态(KEY_UP/KEY_DOWN) | +| &leftright | 存储左右方向键状态(KEY_LEFT/KEY_RIGHT) | + +## 返回值 + +按键状态数据将存储在指定的变量中 + +## 示例代码 + +```c +public OnPlayerUpdate(playerid) +{ + new + KEY:keys, updown, leftright; + + GetPlayerKeys(playerid, keys, updown, leftright); + + if (updown == KEY_UP) + { + SendClientMessage(playerid, -1, "上方向键按下"); + } + else if (updown == KEY_DOWN) + { + SendClientMessage(playerid, -1, "下方向键按下"); + } + + if (leftright == KEY_LEFT) + { + SendClientMessage(playerid, -1, "左方向键按下"); + } + else if (leftright == KEY_RIGHT) + { + SendClientMessage(playerid, -1, "右方向键按下"); + } + return 1; +} +``` + +## 注意事项 + +:::warning + +1. 仅能检测功能映射,而非物理按键。例如无法直接检测空格键,但可检测 SPRINT 功能(默认映射为空格) +2. 自 0.3.7 版本起,车辆中的 A/D 键无法检测,但可通过 keys 参数检测 W/S 键 + +::: + +## 相关资源 + +- [按键位掩码对照表](../resources/keys) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLandingGearState.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLandingGearState.md new file mode 100644 index 00000000000..9f0e6ac86c0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLandingGearState.md @@ -0,0 +1,32 @@ +--- +title: GetPlayerLandingGearState +sidebar_label: GetPlayerLandingGearState +description: 获取玩家当前驾驶飞机的起落架状态 +tags: ["玩家", "飞机"] +--- + + + +## 描述 + +获取玩家当前驾驶飞机的[起落架状态](../resources/landinggearstate) + +## 参数 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 示例代码 + +```c +new LANDING_GEAR_STATE:state = GetPlayerLandingGearState(playerid); +``` + +## 相关函数 + +- [GetVehicleLandingGearState](GetVehicleLandingGearState): 通过飞机 ID 直接获取起落架状态(需配合最新驾驶员数据) + +## 相关资源 + +- [飞机起落架状态说明](../resources/landinggearstate) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastShotVectors.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastShotVectors.md new file mode 100644 index 00000000000..929f48eaea9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastShotVectors.md @@ -0,0 +1,68 @@ +--- +title: GetPlayerLastShotVectors +sidebar_label: GetPlayerLastShotVectors +description: 获取玩家最后一次射击子弹的起始点和命中点坐标 +tags: ["玩家"] +--- + +## 描述 + +获取玩家最后一次射击子弹的起始点和命中点坐标 + +| 参数名 | 说明 | +| -------------- | --------------------------------------- | +| playerid | 需要获取射击信息的玩家 ID | +| &Float:originX | 用于存储子弹发射原点 X 坐标的浮点型变量 | +| &Float:originY | 用于存储子弹发射原点 Y 坐标的浮点型变量 | +| &Float:originZ | 用于存储子弹发射原点 Z 坐标的浮点型变量 | +| &Float:hitPosX | 用于存储子弹命中点 X 坐标的浮点型变量 | +| &Float:hitPosY | 用于存储子弹命中点 Y 坐标的浮点型变量 | +| &Float:hitPosZ | 用于存储子弹命中点 Z 坐标的浮点型变量 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的玩家不存在) + +最后一次射击的坐标信息会被存储在指定的变量中 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/lastshot", true) == 0) + { + new string[128], + Float:originX, Float:originY, Float:originZ, + Float:hitPosX, Float:hitPosY, Float:hitPosZ; + + GetPlayerLastShotVectors(playerid, originX, originY, originZ, hitPosX, hitPosY, hitPosZ); + + format(string, sizeof(string), "Last Shot Information: Origin: %f, %f, %f. Hit position: %f, %f, %f", originX, originY, originZ, hitPosX, hitPosY, hitPosZ); + SendClientMessage(playerid, -1, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +- 本函数仅在开启延迟补偿时生效 +- 若子弹未命中任何物体,命中点坐标将返回 0。当前无法计算子弹在空中的飞行距离 + +::: + +## 相关函数 + +- [GetPlayerWeaponData](GetPlayerWeaponData): 获取玩家持有的武器信息 +- [GetPlayerWeapon](GetPlayerWeapon): 获取玩家当前手持的武器 +- [VectorSize](VectorSize): 计算向量的模长 + +## 相关回调函数 + +- [OnPlayerWeaponShot](../callbacks/OnPlayerWeaponShot): 当玩家发射武器时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedTrailerID.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedTrailerID.md new file mode 100644 index 00000000000..e081afde8c6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedTrailerID.md @@ -0,0 +1,38 @@ +--- +title: GetPlayerLastSyncedTrailerID +sidebar_label: GetPlayerLastSyncedTrailerID +description: 获取玩家最后同步的拖车ID +tags: ["玩家", "车辆"] +--- + + + +:::warning + +该函数尚未实现。 + +::: + +## 描述 + +获取玩家最后同步的拖车 ID + +## 参数 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要查询的玩家 ID | + +## 返回值 + +返回最后同步的拖车 ID + +## 示例代码 + +```c +new trailerid = GetPlayerLastSyncedTrailerID(playerid); +``` + +## 相关函数 + +- [GetPlayerLastSyncedVehicleID](GetPlayerLastSyncedVehicleID): 获取玩家最后同步的车辆 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedVehicleID.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedVehicleID.md new file mode 100644 index 00000000000..dda5acc38bc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerLastSyncedVehicleID.md @@ -0,0 +1,38 @@ +--- +title: GetPlayerLastSyncedVehicleID +sidebar_label: GetPlayerLastSyncedVehicleID +description: 获取玩家最后同步的车辆ID +tags: ["玩家", "车辆"] +--- + + + +:::warning + +该函数尚未实现。 + +::: + +## 描述 + +获取玩家最后同步的车辆 ID + +## 参数 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要查询的玩家 ID | + +## 返回值 + +返回最后同步的车辆 ID + +## 示例代码 + +```c +new vehicleid = GetPlayerLastSyncedVehicleID(playerid); +``` + +## 相关函数 + +- [GetPlayerLastSyncedTrailerID](GetPlayerLastSyncedTrailerID): 获取玩家最后同步的拖车 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMarkerForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMarkerForPlayer.md new file mode 100644 index 00000000000..fdba9bfc464 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMarkerForPlayer.md @@ -0,0 +1,39 @@ +--- +title: GetPlayerMarkerForPlayer +sidebar_label: GetPlayerMarkerForPlayer +description: 获取指定玩家在另一玩家视角下的名牌和雷达标记颜色 +tags: ["玩家"] +--- + + + +## 描述 + +获取指定玩家在另一玩家视角下的**名牌**和**雷达标记**颜色 + +| 参数名 | 说明 | +| -------- | ------------------------------------------------------ | +| playerid | 可以看到目标玩家改变后标记/名牌颜色的观察者玩家 ID | +| targetid | 被修改标记颜色的目标玩家 ID | + +## 返回值 + +目标玩家的**名牌**和**雷达标记**颜色值 + +## 示例代码 + +```c +// 让玩家42看到玩家1的标记为红色 +SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF); + +new markerColour = GetPlayerMarkerForPlayer(42, 1); +// markerColour = 0xFF0000FF +``` + +## 相关函数 + +- [ShowPlayerMarkers](ShowPlayerMarkers): 设置服务器是否显示雷达标记 +- [LimitPlayerMarkerRadius](LimitPlayerMarkerRadius): 限制玩家标记显示半径 +- [SetPlayerColor](SetPlayerColor): 设置玩家全局颜色 +- [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): 控制特定玩家昵称标签的可见性 +- [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): 为指定玩家设置其他玩家的雷达标记 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMenu.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMenu.md new file mode 100644 index 00000000000..0bfe2a4c954 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMenu.md @@ -0,0 +1,47 @@ +--- +title: GetPlayerMenu +sidebar_label: GetPlayerMenu +description: 获取玩家当前正在查看的菜单ID(由ShowMenuForPlayer显示) +tags: ["玩家", "菜单"] +--- + +## 描述 + +获取玩家当前正在查看的菜单 ID(由 ShowMenuForPlayer 显示) + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取当前菜单的玩家 ID | + +## 返回值 + +玩家当前显示的菜单 ID,若未显示菜单则返回`INVALID_MENU`(255) + +返回值带有**Menu:**标签 + +## 示例代码 + +```c +new Menu:currentMenu = GetPlayerMenu(playerid); // 将玩家当前菜单存入'currentMenu'变量 +``` + +## 注意事项 + +:::tip + +当没有显示菜单时,会返回上一次显示的菜单 ID + +::: + +## 相关函数 + +- [ShowMenuForPlayer](ShowMenuForPlayer): 为玩家显示菜单 +- [HideMenuForPlayer](HideMenuForPlayer): 隐藏玩家的菜单 +- [CreateMenu](CreateMenu): 创建新菜单 +- [DestroyMenu](DestroyMenu): 销毁菜单 +- [AddMenuItem](AddMenuItem): 添加菜单项 + +## 相关回调函数 + +- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): 当玩家选择菜单项时触发 +- [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu): 当玩家退出菜单时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMoney.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMoney.md new file mode 100644 index 00000000000..614a06ff324 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerMoney.md @@ -0,0 +1,34 @@ +--- +title: GetPlayerMoney +sidebar_label: GetPlayerMoney +description: 获取玩家当前持有的金钱数额 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前持有的金钱数额 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要查询金钱的玩家 ID | + +## 返回值 + +玩家当前持有的金钱数额 + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + new string[32]; + format(string, sizeof(string), "当前金钱: $%i", GetPlayerMoney(playerid)); + SendClientMessage(playerid, 0x00FF00FF, string); +} +``` + +## 相关函数 + +- [GivePlayerMoney](GivePlayerMoney): 给予玩家金钱 +- [ResetPlayerMoney](ResetPlayerMoney): 重置玩家金钱至\$0 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md new file mode 100644 index 00000000000..f29c590323d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md @@ -0,0 +1,58 @@ +--- +title: GetPlayerName +sidebar_label: GetPlayerName +description: 获取玩家的昵称 +tags: ["玩家"] +--- + +## 描述 + +获取玩家的昵称 + +| 参数名 | 说明 | +| -------- | ------------------------------------------------------------------------- | +| playerid | 需要获取昵称的玩家 ID | +| name[] | 用于存储昵称的数组(引用传递) | +| len | 存储字符串的长度,建议设置为 MAX_PLAYER_NAME + 1。其中+1 用于容纳空终止符 | + +## 返回值 + +返回玩家昵称的长度 + +**0** 表示指定玩家不存在 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + // 获取连接玩家的昵称并向其他玩家显示加入消息 + new name[MAX_PLAYER_NAME + 1]; + GetPlayerName(playerid, name, sizeof(name)); + + new string[128]; + format(string, sizeof(string), "%s 加入了服务器。", name); + SendClientMessageToAll(0xC4C4C4FF, string); + + return 1; +} +``` + +## 注意事项 + +:::tip + +通过 [SetPlayerName](SetPlayerName) 设置玩家昵称时,最大长度为 24 个字符(定义为`MAX_PLAYER_NAME`) + +客户端实际可使用的昵称长度为 3-20 个字符,超出范围的昵称会被服务器拒绝连接 + +::: + +## 相关函数 + +- [SetPlayerName](SetPlayerName): 设置玩家昵称 +- [IsValidNickName](IsValidNickName): 检查昵称是否有效 +- [GetPlayerIp](GetPlayerIp): 获取玩家 IP 地址 +- [GetPlayerPing](GetPlayerPing): 获取玩家网络延迟 +- [GetPlayerScore](GetPlayerScore): 获取玩家分数 +- [GetPlayerVersion](GetPlayerVersion): 获取玩家客户端版本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerNetworkStats.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerNetworkStats.md new file mode 100644 index 00000000000..56afff403bd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerNetworkStats.md @@ -0,0 +1,56 @@ +--- +title: GetPlayerNetworkStats +sidebar_label: GetPlayerNetworkStats +description: 获取玩家的网络统计信息并保存到字符串中 +tags: ["玩家", "网络监控"] +--- + +## 描述 + +获取玩家的网络统计信息并保存到字符串中 + +| 参数名 | 说明 | +| ---------------------- | ---------------------------------------- | +| playerid | 需要获取网络统计数据的玩家 ID | +| output[] | 存储网络统计数据的字符串(通过引用传递) | +| size = sizeof (output) | 存储字符串的缓冲区长度 | + +## 返回值 + +本函数总是返回 1 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/mynetstats")) + { + new stats[400+1]; + GetPlayerNetworkStats(playerid, stats, sizeof(stats)); + ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "我的网络统计", stats, "确定", ""); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +当在[OnPlayerDisconnect](OnPlayerDisconnect)回调中使用时,若玩家正常退出可能返回不准确数据。通常在玩家被踢出或超时的情况下数据准确 + +::: + +## 相关函数 + +- [GetNetworkStats](GetNetworkStats): 获取服务器的网络统计信息并保存到字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家已连接的时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器从玩家接收的网络消息数量 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器从玩家接收的数据量(字节) +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送给玩家的网络消息数量 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送给玩家的数据量(字节) +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取服务器最近一秒从玩家接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家的丢包率百分比 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家的连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家的 IP 地址和端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedData.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedData.md new file mode 100644 index 00000000000..5e4406b1a9e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedData.md @@ -0,0 +1,43 @@ +--- +title: GetPlayerObjectAttachedData +sidebar_label: GetPlayerObjectAttachedData +description: 获取玩家物体的附加数据 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体的附加数据 + +| 参数名 | 说明 | +| -------------- | -------------------------------------- | +| playerid | 玩家 ID | +| objectid | 需要获取附加数据的玩家物体 ID | +| &parentVehicle | 存储父级车辆 ID 的变量(通过引用传递) | +| &parentObject | 存储父级物体 ID 的变量(通过引用传递) | +| &parentPlayer | 存储父级玩家 ID 的变量(通过引用传递) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new + parentVehicle, + parentObject, + parentPlayer; + +// 存储父级ID +GetPlayerObjectAttachedData(playerid, playerobjectid, parentVehicle, parentObject, parentPlayer); +``` + +## 相关函数 + +- [GetPlayerObjectAttachedOffset](GetPlayerObjectAttachedOffset): 获取玩家物体的附加偏移和旋转 +- [GetObjectAttachedData](GetObjectAttachedData): 获取全局物体的附加数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedOffset.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedOffset.md new file mode 100644 index 00000000000..64567d5f5f4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectAttachedOffset.md @@ -0,0 +1,49 @@ +--- +title: GetPlayerObjectAttachedOffset +sidebar_label: GetPlayerObjectAttachedOffset +description: 获取玩家物体的附加偏移和旋转 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体的附加偏移和旋转 + +| 参数名 | 说明 | +| ---------------- | --------------------------------------------- | +| playerid | 玩家 ID | +| objectid | 需要获取偏移和旋转的玩家物体 ID | +| &Float:offsetX | 存储 X 轴偏移量的浮点型变量(通过引用传递) | +| &Float:offsetY | 存储 Y 轴偏移量的浮点型变量(通过引用传递) | +| &Float:offsetZ | 存储 Z 轴偏移量的浮点型变量(通过引用传递) | +| &Float:rotationX | 存储 X 轴旋转角度的浮点型变量(通过引用传递) | +| &Float:rotationY | 存储 Y 轴旋转角度的浮点型变量(通过引用传递) | +| &Float:rotationZ | 存储 Z 轴旋转角度的浮点型变量(通过引用传递) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new + Float:offsetX, + Float:offsetY, + Float:offsetZ, + Float:rotationX, + Float:rotationY, + Float:rotationZ; + +// 获取玩家物体的附加偏移和旋转数据 +GetPlayerObjectAttachedOffset(playerid, playerobjectid, offsetX, offsetY, offsetZ, rotationX, rotationY, rotationZ); +``` + +## 相关函数 + +- [GetPlayerObjectAttachedData](GetPlayerObjectAttachedData): 获取玩家物体的附加数据 +- [GetObjectAttachedOffset](GetObjectAttachedOffset): 获取全局物体的附加偏移和旋转 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectDrawDistance.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectDrawDistance.md new file mode 100644 index 00000000000..cee5c4dfd9a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectDrawDistance.md @@ -0,0 +1,34 @@ +--- +title: GetPlayerObjectDrawDistance +sidebar_label: GetPlayerObjectDrawDistance +description: 获取玩家物体的绘制距离 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体的绘制距离 + +| 参数名 | 说明 | +| -------- | ----------------------------- | +| playerid | 玩家 ID | +| objectid | 需要获取绘制距离的玩家物体 ID | + +## 返回值 + +以浮点数形式返回绘制距离 + +## 示例代码 + +```c +new playerobjectid = CreatePlayerObject(playerid, 3335, 672.53485, -656.11023, 15.26560, 3.00000, 0.00000, 0.00000, 100.0); + +new Float:drawDistance = GetPlayerObjectDrawDistance(playerid, playerobjectid); +// drawDistance = 100.0 +``` + +## 相关函数 + +- [GetObjectDrawDistance](GetObjectDrawDistance): 获取全局物体的绘制距离 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterial.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterial.md new file mode 100644 index 00000000000..f7c9874fbd5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterial.md @@ -0,0 +1,57 @@ +--- +title: GetPlayerObjectMaterial +sidebar_label: GetPlayerObjectMaterial +description: 获取玩家物体指定索引的材质数据 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体指定索引的材质数据 + +| 参数名 | 说明 | +| ------------------ | ------------------------------------ | +| playerid | 玩家 ID | +| objectid | 玩家物体 ID | +| materialIndex | 材质索引号(0-15) | +| &modelid | 存储模型 ID 的变量(通过引用传递) | +| textureLibrary[] | 存储纹理库名称的数组(通过引用传递) | +| textureLibrarySize | 纹理库数组的缓冲区大小 | +| textureName[] | 存储纹理名称的数组(通过引用传递) | +| textureNameSize | 纹理名称数组的缓冲区大小 | +| &materialColour | 存储材质颜色的变量(通过引用传递) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在或材质索引无效) + +## 示例代码 + +```c +new playerobjectid = CreatePlayerObject(playerid, 19371, 978.71143, -925.25708, 42.63720, 0.00000, 0.00000, 2.00000); +SetPlayerObjectMaterial(playerid, playerobjectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); + +new + modelid, + textureLibrary[16], + textureName[16], + materialColour; + +GetPlayerObjectMaterial(playerid, playerobjectid, 0, modelid, textureLibrary, sizeof(textureLibrary), textureName, sizeof(textureName), materialColour); +// modelid = 19341 +// textureLibrary = "egg_texts" +// textureName = "easter_egg01" +// materialColour = 0xFFFFFFFF +``` + +## 相关函数 + +- [SetPlayerObjectMaterial](SetPlayerObjectMaterial): 替换玩家物体的材质纹理 +- [SetPlayerObjectMaterialText](SetPlayerObjectMaterialText): 为玩家物体设置材质文本 +- [IsPlayerObjectMaterialSlotUsed](IsPlayerObjectMaterialSlotUsed): 检查玩家物体材质槽是否被使用 +- [GetPlayerObjectMaterialText](GetPlayerObjectMaterialText): 获取玩家物体的材质文本数据 +- [GetObjectMaterial](GetObjectMaterial): 获取全局物体的材质数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterialText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterialText.md new file mode 100644 index 00000000000..a01098784a0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMaterialText.md @@ -0,0 +1,69 @@ +--- +title: GetPlayerObjectMaterialText +sidebar_label: GetPlayerObjectMaterialText +description: 获取玩家物体指定索引的材质文本数据 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体指定索引的材质文本数据 + +| 参数名 | 说明 | +| ----------------------------------------- | -------------------------------------- | +| playerid | 玩家 ID | +| objectid | 玩家物体 ID | +| materialIndex | 材质索引号(0-15) | +| text[] | 存储文本内容的数组(通过引用传递) | +| textSize | 文本数组的缓冲区大小 | +| &OBJECT_MATERIAL_SIZE:materialSize | 存储材质尺寸枚举的变量(通过引用传递) | +| fontFace[] | 存储字体名称的数组(通过引用传递) | +| fontFaceSize | 字体名称数组的缓冲区大小 | +| &fontSize | 存储字体大小的变量(通过引用传递) | +| &bool:bold | 存储粗体状态的布尔变量(通过引用传递) | +| &fontColour | 存储字体颜色的变量(通过引用传递) | +| &backgroundColour | 存储背景颜色的变量(通过引用传递) | +| &OBJECT_MATERIAL_TEXT_ALIGN:textAlignment | 存储文本对齐方式的变量(通过引用传递) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在或材质索引无效) + +## 示例代码 + +```c +new playerobjectid = CreatePlayerObject(playerid, 19174, 986.42767, -983.14850, 40.95220, 0.00000, 0.00000, 186.00000); +SetPlayerObjectMaterialText(playerid, playerobjectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); + +new + text[16], + OBJECT_MATERIAL_SIZE:materialSize, + fontFace[16], + fontSize, + bool:bold, + fontColour, + backgroundColour, + OBJECT_MATERIAL_TEXT_ALIGN:textAlignment; + +GetPlayerObjectMaterialText(playerid, playerobjectid, 0, text, sizeof(text), materialSize, fontFace, sizeof(fontFace), fontSize, bold, fontColour, backgroundColour, textAlignment); +// text = "OPEN.MP" +// materialSize = OBJECT_MATERIAL_SIZE_256x128 +// fontFace = "Arial" +// fontSize = 38 +// bold = true +// fontColour = 0xFF0000FF +// backgroundColour = 0x00000000 +// textAlignment = OBJECT_MATERIAL_TEXT_ALIGN_LEFT +``` + +## 相关函数 + +- [SetPlayerObjectMaterial](SetPlayerObjectMaterial): 替换玩家物体的材质纹理 +- [SetPlayerObjectMaterialText](SetPlayerObjectMaterialText): 为玩家物体设置材质文本 +- [IsPlayerObjectMaterialSlotUsed](IsPlayerObjectMaterialSlotUsed): 检查玩家物体材质槽是否被使用 +- [GetPlayerObjectMaterial](GetPlayerObjectMaterial): 获取玩家物体的材质数据 +- [GetObjectMaterialText](GetObjectMaterialText): 获取全局物体的材质文本数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectModel.md new file mode 100644 index 00000000000..20b2279544e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectModel.md @@ -0,0 +1,40 @@ +--- +title: GetPlayerObjectModel +sidebar_label: GetPlayerObjectModel +description: 获取玩家物体的模型ID +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体的模型 ID + +| 参数名 | 说明 | +| -------- | ----------------------------- | +| playerid | 需要查询的玩家 ID | +| objectid | 需要获取模型 ID 的玩家物体 ID | + +## 返回值 + +玩家物体的模型 ID + +若玩家或物体不存在,返回**-1**或**0** + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + new objectid = CreatePlayerObject(playerid, 19609, 666.57239, 1750.79749, 4.95627, 0.00000, 0.00000, -156.00000); + + new modelid = GetPlayerObjectModel(playerid, objectid); + printf("物体模型ID: %d", modelid); // 输出: "物体模型ID: 19609" + return 1; +} +``` + +## 相关函数 + +- [GetObjectModel](GetObjectModel): 获取全局物体的模型 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMoveSpeed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMoveSpeed.md new file mode 100644 index 00000000000..7b1533bab2d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMoveSpeed.md @@ -0,0 +1,37 @@ +--- +title: GetPlayerObjectMoveSpeed +sidebar_label: GetPlayerObjectMoveSpeed +description: 获取玩家物体的移动速度 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体的移动速度 + +| 参数名 | 说明 | +| -------- | ----------------------------- | +| playerid | 玩家 ID | +| objectid | 需要获取移动速度的玩家物体 ID | + +## 返回值 + +以浮点数形式返回移动速度 + +## 示例代码 + +```c +new playerobjectid = CreatePlayerObject(playerid, 985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); +MovePlayerObject(playerid, playerobjectid, 1003.3915, -643.3342, 114.5122, 0.8); + +new Float:moveSpeed = GetPlayerObjectMoveSpeed(playerid, playerobjectid); +// moveSpeed = 0.8 +``` + +## 相关函数 + +- [MovePlayerObject](MovePlayerObject): 移动玩家物体到新位置并设置速度 +- [SetPlayerObjectMoveSpeed](SetPlayerObjectMoveSpeed): 设置玩家物体的移动速度 +- [GetObjectMoveSpeed](GetObjectMoveSpeed): 获取全局物体的移动速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetPos.md new file mode 100644 index 00000000000..636678045af --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetPos.md @@ -0,0 +1,48 @@ +--- +title: GetPlayerObjectMovingTargetPos +sidebar_label: GetPlayerObjectMovingTargetPos +description: 获取玩家物体的移动目标位置 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体的移动目标位置 + +| 参数名 | 说明 | +| -------------- | ------------------------------------------- | +| playerid | 玩家 ID | +| objectid | 需要获取目标位置的玩家物体 ID | +| &Float:targetX | 存储目标 X 坐标的浮点型变量(通过引用传递) | +| &Float:targetY | 存储目标 Y 坐标的浮点型变量(通过引用传递) | +| &Float:targetZ | 存储目标 Z 坐标的浮点型变量(通过引用传递) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new playerobjectid = CreatePlayerObject(playerid, 985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); +MovePlayerObject(playerid, playerobjectid, 1003.3915, -643.3342, 114.5122, 0.8); + +new + Float:targetX, + Float:targetY, + Float:targetZ; + +GetPlayerObjectMovingTargetPos(playerid, playerobjectid, targetX, targetY, targetZ); +// targetX = 1003.3915 +// targetY = -643.3342 +// targetZ = 114.5122 +``` + +## 相关函数 + +- [GetPlayerObjectMovingTargetRot](GetPlayerObjectMovingTargetRot): 获取玩家物体的移动目标旋转 +- [GetObjectMovingTargetPos](GetObjectMovingTargetPos): 获取全局物体的移动目标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetRot.md new file mode 100644 index 00000000000..ca3757a1c8f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectMovingTargetRot.md @@ -0,0 +1,48 @@ +--- +title: GetPlayerObjectMovingTargetRot +sidebar_label: GetPlayerObjectMovingTargetRot +description: 获取玩家物体的移动目标旋转 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体的移动目标旋转 + +| 参数名 | 说明 | +| ---------------- | ------------------------------------------------- | +| playerid | 玩家 ID | +| objectid | 需要获取目标旋转的玩家物体 ID | +| &Float:rotationX | 存储 X 轴目标旋转角度的浮点型变量(通过引用传递) | +| &Float:rotationY | 存储 Y 轴目标旋转角度的浮点型变量(通过引用传递) | +| &Float:rotationZ | 存储 Z 轴目标旋转角度的浮点型变量(通过引用传递) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new playerobjectid = CreatePlayerObject(playerid, 968, 1023.79541, -943.75879, 42.31450, 0.00000, 0.00000, 10.00000); +MovePlayerObject(playerid, playerobjectid, 1023.79541, -943.75879, 42.31450, 0.8, 0.00000, -90.00000, 10.00000); + +new + Float:rotationX, + Float:rotationY, + Float:rotationZ; + +GetPlayerObjectMovingTargetRot(playerid, playerobjectid, rotationX, rotationY, rotationZ); +// rotationX = 0.00000 +// rotationY = -90.00000 +// rotationZ = 10.00000 +``` + +## 相关函数 + +- [GetPlayerObjectMovingTargetPos](GetPlayerObjectMovingTargetPos): 获取玩家物体的移动目标位置 +- [GetObjectMovingTargetRot](GetObjectMovingTargetRot): 获取全局物体的移动目标旋转 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectPos.md new file mode 100644 index 00000000000..2b478cde2e9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectPos.md @@ -0,0 +1,66 @@ +--- +title: GetPlayerObjectPos +sidebar_label: GetPlayerObjectPos +description: 获取玩家物体的位置(通过CreatePlayerObject创建) +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +获取玩家物体(通过[CreatePlayerObject](CreatePlayerObject)创建)的位置 + +| 参数名 | 说明 | +| -------- | --------------------------------------- | +| playerid | 需要获取物体位置的玩家 ID | +| objectid | 需要获取位置的物体 ID | +| &Float:x | 存储 X 坐标的浮点型变量(通过引用传递) | +| &Float:y | 存储 Y 坐标的浮点型变量(通过引用传递) | +| &Float:z | 存储 Z 坐标的浮点型变量(通过引用传递) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家或物体不存在) + +物体的位置会被存储在指定的变量中 + +## 示例代码 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + new Float:x, Float:y, Float:z; + GetPlayerObjectPos(playerid, gPlayerObject[playerid], x, y, z); + // x = 2001.195679 + // y = 1547.113892 + // z = 14.283400 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 为单个玩家创建物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体是否有效 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转角度 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家身上 +- [CreateObject](CreateObject): 创建全局物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [IsValidObject](IsValidObject): 验证全局物体是否有效 +- [MoveObject](MoveObject): 移动全局物体 +- [StopObject](StopObject): 停止全局物体移动 +- [SetObjectPos](SetObjectPos): 设置全局物体位置 +- [SetObjectRot](SetObjectRot): 设置全局物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取全局物体位置 +- [GetObjectRot](GetObjectRot): 获取全局物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将全局物体附加到玩家身上 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectRot.md new file mode 100644 index 00000000000..6992bb2505a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectRot.md @@ -0,0 +1,62 @@ +--- +title: GetPlayerObjectRot +sidebar_label: GetPlayerObjectRot +description: 获取玩家物体的旋转角度 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +该函数用于获取玩家物体的当前旋转角度。旋转角度通过引用方式存储在三个 rotationX/rotationY/rotationZ 变量中。 + +| 参数名 | 说明 | +| ---------------- | --------------------------------------------- | +| playerid | 关联该物体的玩家 ID | +| objectid | 需要获取旋转角度的物体 ID | +| &Float:rotationX | 存储 X 轴旋转角度的浮点型变量(通过引用传递) | +| &Float:rotationY | 存储 Y 轴旋转角度的浮点型变量(通过引用传递) | +| &Float:rotationZ | 存储 Z 轴旋转角度的浮点型变量(通过引用传递) | + +## 返回值 + +物体的旋转角度将被存储在指定的变量中 + +## 示例代码 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + new Float:rotationX, Float:rotationY, Float:rotationZ; + GetPlayerObjectRot(playerid, gPlayerObject[playerid], rotationX, rotationY, rotationZ); + // rotationX = 0.0 + // rotationY = 0.0 + // rotationZ = 96.0 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 为单个玩家创建物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体是否有效 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体位置 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家身上 +- [CreateObject](CreateObject): 创建全局物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [IsValidObject](IsValidObject): 验证全局物体是否有效 +- [MoveObject](MoveObject): 移动全局物体 +- [StopObject](StopObject): 停止全局物体移动 +- [SetObjectPos](SetObjectPos): 设置全局物体位置 +- [SetObjectRot](SetObjectRot): 设置全局物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取全局物体位置 +- [GetObjectRot](GetObjectRot): 获取全局物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将全局物体附加到玩家身上 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectSyncRotation.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectSyncRotation.md new file mode 100644 index 00000000000..915b3ace069 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerObjectSyncRotation.md @@ -0,0 +1,37 @@ +--- +title: GetPlayerObjectSyncRotation +sidebar_label: GetPlayerObjectSyncRotation +description: 获取玩家物体的同步旋转状态 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +获取玩家物体的同步旋转状态 + +| 参数名 | 说明 | +| -------- | ----------- | +| playerid | 玩家 ID | +| objectid | 玩家物体 ID | + +## 返回值 + +返回玩家物体的同步旋转状态(布尔值`true`/`false`) + +## 示例代码 + +```c +new objectid = CreatePlayerObject(...); +new parentid = CreatePlayerObject(...); +AttachPlayerObjectToObject(playerid, objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true); + +new bool:syncRotation = GetPlayerObjectSyncRotation(playerid, objectid); +// syncRotation = true +``` + +## 相关函数 + +- [AttachPlayerObjectToObject](AttachPlayerObjectToObject): 将玩家物体附加到其他物体 +- [GetObjectSyncRotation](GetObjectSyncRotation): 获取全局物体的同步旋转状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupModel.md new file mode 100644 index 00000000000..0d9f2bec77d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupModel.md @@ -0,0 +1,50 @@ +--- +title: GetPlayerPickupModel +sidebar_label: GetPlayerPickupModel +description: 获取玩家拾取物的模型ID +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +获取玩家拾取物的模型 ID + +| 参数名 | 说明 | +| -------- | ------------------------------- | +| playerid | 玩家 ID | +| pickupid | 需要获取模型 ID 的玩家拾取物 ID | + +## 返回值 + +返回玩家拾取物的模型 ID + +## 示例代码 + +```c +new PlayerPickup[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1239, 1, 2010.0979, 1222.0642, 10.8206, -1); + + new model = GetPlayerPickupModel(playerid, PlayerPickup[playerid]); + // model = 1239 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建仅对单个玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家拾取物是否有效 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检查玩家拾取物是否已流加载给玩家 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家拾取物坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家拾取物坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家拾取物模型 +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家拾取物类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家拾取物类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家拾取物虚拟世界 ID +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家拾取物虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupPos.md new file mode 100644 index 00000000000..e6ef884233f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupPos.md @@ -0,0 +1,60 @@ +--- +title: GetPlayerPickupPos +sidebar_label: GetPlayerPickupPos +description: 获取玩家拾取物的坐标 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +获取玩家拾取物的坐标 + +| 参数名 | 说明 | +| -------- | --------------------------------------- | +| playerid | 玩家 ID | +| pickupid | 需要获取坐标的玩家拾取物 ID | +| &Float:x | 存储 X 坐标的浮点型变量(通过引用传递) | +| &Float:y | 存储 Y 坐标的浮点型变量(通过引用传递) | +| &Float:z | 存储 Z 坐标的浮点型变量(通过引用传递) | + +## 返回值 + +本函数不返回特定值,坐标数据通过参数传递 + +## 示例代码 + +```c +new PlayerPickup[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1239, 1, 2010.0979, 1222.0642, 10.8206, -1); + + new + Float:x, + Float:y, + Float:z; + + GetPlayerPickupPos(playerid, PlayerPickup[playerid], x, y, z); + // x = 2010.0979 + // y = 1222.0642 + // z = 10.8206 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建仅对单个玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家拾取物是否有效 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检查玩家拾取物是否已流加载给玩家 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家拾取物坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家拾取物模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家拾取物模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家拾取物类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家拾取物类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家拾取物虚拟世界 ID +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家拾取物虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupType.md new file mode 100644 index 00000000000..b1551ee2320 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupType.md @@ -0,0 +1,52 @@ +--- +title: GetPlayerPickupType +sidebar_label: GetPlayerPickupType +description: 获取玩家拾取物的类型 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +获取玩家拾取物的类型 + +| 参数名 | 说明 | +| -------- | --------------------------- | +| playerid | 玩家 ID | +| pickupid | 需要获取类型的玩家拾取物 ID | + +## 返回值 + +返回玩家拾取物的类型 + +**-1** 表示玩家拾取物无效 + +## 示例代码 + +```c +new PlayerPickup[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1239, 1, 2010.0979, 1222.0642, 10.8206, -1); + + new type = GetPlayerPickupType(playerid, PlayerPickup[playerid]); + // type = 1 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建仅对单个玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家拾取物是否有效 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检查玩家拾取物是否已流加载给玩家 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家拾取物坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家拾取物坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家拾取物模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家拾取物模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家拾取物类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家拾取物虚拟世界 ID +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家拾取物虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupVirtualWorld.md new file mode 100644 index 00000000000..054106cacde --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPickupVirtualWorld.md @@ -0,0 +1,50 @@ +--- +title: GetPlayerPickupVirtualWorld +sidebar_label: GetPlayerPickupVirtualWorld +description: 获取玩家拾取物的虚拟世界ID +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +获取玩家拾取物的虚拟世界 ID + +| 参数名 | 说明 | +| -------- | ----------------------------------- | +| playerid | 玩家 ID | +| pickupid | 需要获取虚拟世界 ID 的玩家拾取物 ID | + +## 返回值 + +返回玩家拾取物所在的虚拟世界 ID + +## 示例代码 + +```c +new PlayerPickup[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1239, 1, 2010.0979, 1222.0642, 10.8206, 20); + + new worldid = GetPlayerPickupVirtualWorld(playerid, PlayerPickup[playerid]); + // worldid = 20 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建仅对单个玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家拾取物是否有效 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检查玩家拾取物是否已流加载给玩家 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家拾取物坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家拾取物坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家拾取物模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家拾取物模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家拾取物类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家拾取物类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家拾取物虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPing.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPing.md new file mode 100644 index 00000000000..9247faa429f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPing.md @@ -0,0 +1,81 @@ +--- +title: GetPlayerPing +sidebar_label: GetPlayerPing +description: 获取玩家的网络延迟(Ping) +tags: ["玩家"] +--- + +## 描述 + +获取玩家的网络延迟(Ping)。Ping 值表示服务器与客户端之间通信的往返时间。 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取 Ping 值的玩家 ID | + +## 返回值 + +返回玩家当前的 Ping 值(单位:毫秒) + +## 示例代码 + +```c +new string[24]; +format(string, sizeof(string), "你的Ping值: %d", GetPlayerPing(playerid)); +SendClientMessage(playerid, -1, string); +``` + +
+ +**自动踢出高延迟玩家示例:** + +```c +// 声明定时器ID数组,默认值为0 +new gPlayerPingTimer[MAX_PLAYERS] = {0, ...}; + +// 定义最大允许Ping值 +const MAX_ACCEPTED_PING = 500; + +public OnPlayerConnect(playerid) +{ + // 创建定时器检测玩家Ping值 + gPlayerPingTimer[playerid] = SetTimerEx("Ping_Timer", 3 * 1000, true, "i", playerid); +} + +public OnPlayerDisconnect(playerid, reason) +{ + // 清除定时器 + KillTimer(gPlayerPingTimer[playerid]); + gPlayerPingTimer[playerid] = 0; +} + +// 转发函数(回调) +forward Ping_Timer(playerid); +public Ping_Timer(playerid) +{ + // 如果玩家的ping值超过通常接受的高ping值,则踢出玩家 + if (ping > MAX_ACCEPTED_PING) + { + new string[128]; + format(string, sizeof(string), "你因高延迟被踢出(当前Ping值:%d)", ping); + SendClientMessage(playerid, -1, string); + + Kick(playerid); + } + return 1; +} +``` + +## 注意事项 + +:::warning + +玩家刚连接时,Ping 值可能暂时显示为 65535 + +::: + +## 相关函数 + +- [GetPlayerIp](GetPlayerIp): 获取玩家 IP 地址 +- [GetPlayerName](GetPlayerName): 获取玩家昵称 +- [GetPlayerVersion](GetPlayerVersion): 获取玩家客户端版本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPoolSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPoolSize.md new file mode 100644 index 00000000000..f5d87a42d9c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPoolSize.md @@ -0,0 +1,30 @@ +--- +title: GetPlayerPoolSize +sidebar_label: GetPlayerPoolSize +description: 获取服务器当前使用的最大玩家ID +tags: ["玩家"] +--- + + + +## 描述 + +获取服务器当前正在使用的最高玩家 ID。注意在 SA-MP 中该函数存在缺陷,即使没有玩家在线也会返回`0`。open.mp 已修正此问题,返回`-1`,但建议改用`MAX_PLAYERS`或`foreach`替代本函数。 + +## 示例代码 + +```c +FreezeAll() +{ + // 将返回值赋给变量j以避免每次循环都调用函数 + for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++) + { + TogglePlayerControllable(i, 0); // 冻结所有玩家操作 + } +} +``` + +## 相关函数 + +- [GetVehiclePoolSize](GetVehiclePoolSize): 获取服务器当前使用的最大车辆 ID +- [GetMaxPlayers](GetMaxPlayers): 获取服务器最大玩家容量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPos.md new file mode 100644 index 00000000000..0987071be6c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerPos.md @@ -0,0 +1,55 @@ +--- +title: GetPlayerPos +sidebar_label: GetPlayerPos +description: 获取玩家的三维坐标位置 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前的三维坐标位置(X/Y/Z 轴坐标) + +| 参数名 | 说明 | +| -------- | ----------------------------------------- | +| playerid | 需要获取位置的玩家 ID | +| &Float:x | 存储 X 轴坐标的浮点型变量(通过引用传递) | +| &Float:y | 存储 Y 轴坐标的浮点型变量(通过引用传递) | +| &Float:z | 存储 Z 轴坐标的浮点型变量(通过引用传递) | + +## 返回值 + +**true** - 执行成功 + +**false** - 执行失败(玩家未连接) + +## 示例代码 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 声明三个浮点变量存储坐标 + new Float:x, Float:y, Float:z; + + // 调用GetPlayerPos获取玩家坐标 + GetPlayerPos(playerid, x, y, z); + + // 在玩家死亡位置生成现金拾取物 + CreatePickup(1212, 4, x, y, z, -1); + return 1; +} +``` + +## 注意事项 + +:::warning + +在[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)和 OnPlayerRequestClass 回调中使用时可能返回不可靠值(因玩家尚未生成) + +::: + +## 相关函数 + +- [SetPlayerPos](SetPlayerPos): 设置玩家坐标位置 +- [GetVehiclePos](GetVehiclePos): 获取车辆坐标位置 +- [IsPlayerInRangeOfPoint](IsPlayerInRangeOfPoint): 检测玩家是否在指定点附近 +- [GetPlayerDistanceFromPoint](GetPlayerDistanceFromPoint): 计算玩家与指定点的距离 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRaceCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRaceCheckpoint.md new file mode 100644 index 00000000000..76a33eb7813 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRaceCheckpoint.md @@ -0,0 +1,60 @@ +--- +title: GetPlayerRaceCheckpoint +sidebar_label: GetPlayerRaceCheckpoint +description: 获取玩家当前竞速检查点的位置信息 +tags: ["玩家", "检查点", "竞速检查点"] +--- + + + +## 描述 + +获取玩家当前竞速检查点的位置信息(包含中心点、下一个检查点位置及半径) + +| 参数名 | 说明 | +| -------------- | --------------------------------------------------- | +| playerid | 需要获取检查点信息的玩家 ID | +| &Float:centreX | 存储中心点 X 坐标的浮点型变量(通过引用传递) | +| &Float:centreY | 存储中心点 Y 坐标的浮点型变量(通过引用传递) | +| &Float:centreZ | 存储中心点 Z 坐标的浮点型变量(通过引用传递) | +| &Float:nextX | 存储下一个检查点 X 坐标的浮点型变量(通过引用传递) | +| &Float:nextY | 存储下一个检查点 Y 坐标的浮点型变量(通过引用传递) | +| &Float:nextZ | 存储下一个检查点 Z 坐标的浮点型变量(通过引用传递) | +| &Float:radius | 存储检查点半径的浮点型变量(通过引用传递) | + +## 返回值 + +本函数不返回具体值,数据通过参数传递 + +## 示例代码 + +```c +SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_NORMAL, 373.1631, 2502.4644, 16.4774, 269.8644, 2503.4963, 16.4774, 2.0); + +new Float:centreX, + Float:centreY, + Float:centreZ, + Float:nextX, + Float:nextY, + Float:nextZ, + Float:radius; + +GetPlayerRaceCheckpoint(playerid, centreX, centreY, centreZ, nextX, nextY, nextZ, radius); +``` + +## 相关函数 + +- [SetPlayerCheckpoint](SetPlayerCheckpoint): 为玩家设置普通检查点 +- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): 禁用玩家的普通检查点 +- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): 检测玩家是否处于普通检查点 +- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): 设置竞速检查点 +- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): 禁用竞速检查点 +- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): 检测玩家是否处于竞速检查点 +- [IsPlayerRaceCheckpointActive](IsPlayerRaceCheckpointActive): 检测玩家是否有激活的竞速检查点 + +## 相关回调函数 + +- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): 玩家进入普通检查点时触发 +- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): 玩家离开普通检查点时触发 +- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): 玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): 玩家离开竞速检查点时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRawIp.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRawIp.md new file mode 100644 index 00000000000..1bf4bc8b4e1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRawIp.md @@ -0,0 +1,44 @@ +--- +title: GetPlayerRawIp +sidebar_label: GetPlayerRawIp +description: 获取玩家的原始IPv4地址(整数形式) +tags: ["玩家", "IP地址"] +--- + + + +## 描述 + +获取指定玩家的原始 IPv4 地址(以整数形式表示) + +| 参数名 | 说明 | +| -------- | ----------------------------- | +| playerid | 需要获取原始 IP 地址的玩家 ID | + +## 返回值 + +以整数形式返回玩家的原始 IPv4 地址 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + new rawIp = GetPlayerRawIp(playerid); + SendClientMessage(playerid, 0xFFFF00FF, "服务器:您的原始IP地址:%d", rawIp); + return 1; +} +``` + +## 注意事项 + +:::tip + +PAWN 语言区分大小写。使用 GetPlayerRawIP(带大写 IP)将无法生效 + +::: + +## 相关函数 + +- [GetPlayerIp](GetPlayerIp): 获取玩家的字符串形式 IP 地址 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家的 IP 地址和端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRotationQuat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRotationQuat.md new file mode 100644 index 00000000000..adbae5d40af --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerRotationQuat.md @@ -0,0 +1,54 @@ +--- +title: GetPlayerRotationQuat +sidebar_label: GetPlayerRotationQuat +description: 以四元数形式获取玩家三维旋转参数 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家在所有三维轴向上的旋转参数(四元数表示法) + +| 参数名 | 说明 | +| -------- | ------------------------------------------------ | +| playerid | 需要获取旋转参数的玩家 ID | +| &Float:w | 存储四元数第一个分量的浮点型变量(通过引用传递) | +| &Float:x | 存储四元数第二个分量的浮点型变量(通过引用传递) | +| &Float:y | 存储四元数第三个分量的浮点型变量(通过引用传递) | +| &Float:z | 存储四元数第四个分量的浮点型变量(通过引用传递) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +玩家的旋转参数将被存储在指定的浮点变量中 + +## 示例代码 + +```c +new + Float:w, + Float:x, + Float:y, + Float:z; + +GetPlayerRotationQuat(playerid, w, x, y, z); +``` + +## 注意事项 + +:::tip + +本函数仅用于获取旋转参数,无法直接设置玩家旋转(可通过[SetPlayerFacingAngle](SetPlayerFacingAngle)设置 Z 轴朝向) + +::: + +## 相关函数 + +- [SetPlayerFacingAngle](SetPlayerFacingAngle): 设置玩家面朝方向(Z 轴旋转) +- [GetPlayerFacingAngle](GetPlayerFacingAngle): 获取玩家面朝方向 +- [GetVehicleRotationQuat](GetVehicleRotationQuat): 获取车辆四元数旋转参数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerScore.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerScore.md new file mode 100644 index 00000000000..13969430b55 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerScore.md @@ -0,0 +1,39 @@ +--- +title: GetPlayerScore +sidebar_label: GetPlayerScore +description: 获取玩家通过SetPlayerScore设置的分数 +tags: ["玩家"] +--- + +## 描述 + +该函数用于获取玩家通过[SetPlayerScore](SetPlayerScore)设置的分数值 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要获取分数的玩家 ID | + +## 返回值 + +返回玩家的当前分数值 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid,text[]) +{ + if (!strcmp(cmdtext, "/score", true)) + { + new string[32]; + format(string, sizeof(string), "你的分数: %i", GetPlayerScore(playerid)); + SendClientMessage(playerid, COLOR_ORANGE, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SetPlayerScore](SetPlayerScore): 设置玩家分数 +- [GetPlayerPing](GetPlayerPing): 获取玩家网络延迟 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSirenState.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSirenState.md new file mode 100644 index 00000000000..7111af257b2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSirenState.md @@ -0,0 +1,50 @@ +--- +title: GetPlayerSirenState +sidebar_label: GetPlayerSirenState +description: 获取玩家车辆的警笛状态 +tags: ["玩家", "车辆"] +--- + + + +## 描述 + +获取玩家当前所处车辆的警笛开关状态 + +## 参数 + +| 参数名 | 说明 | +| -------- | ------- | +| playerid | 玩家 ID | + +## 返回值 + +返回警笛状态布尔值(true=开启,false=关闭) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/siren", true)) + { + if (!IsPlayerInAnyVehicle(playerid)) + { + return 1; + } + + new bool:sirenState = GetPlayerSirenState(playerid); + + SendClientMessage(playerid, 0xFFFF00FF, "车辆警笛状态:%s", sirenState ? "开启" : "关闭"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SetVehicleParamsSirenState](SetVehicleParamsSirenState): 设置车辆警笛开关状态 +- [ToggleVehicleSirenEnabled](ToggleVehicleSirenEnabled): 切换车辆警笛状态 +- [IsVehicleSirenEnabled](IsVehicleSirenEnabled): 检测车辆警笛是否启用 +- [GetVehicleSirenState](GetVehicleSirenState): 获取车辆警笛状态(通过车辆 ID) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkillLevel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkillLevel.md new file mode 100644 index 00000000000..ae3a6e748a9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkillLevel.md @@ -0,0 +1,58 @@ +--- +title: GetPlayerSkillLevel +sidebar_label: GetPlayerSkillLevel +description: 获取玩家特定武器类型的技能等级 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家指定武器类型的技能等级 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------------- | +| playerid | 玩家 ID | +| WEAPONSKILL:skill | 要查询的[武器技能类型](../resources/weaponskills) | + +## 返回值 + +**0** - 执行失败(无效的武器技能类型) + +其他情况返回该武器类型的技能等级 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/skill", true)) + { + new string[64]; + + new skill = GetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL); + + format(string, sizeof(string), "你的手枪技能等级为 %d", skill); + SendClientMessage(playerid, 0xFFFF00FF, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +skill 参数是武器技能类型,不是武器 ID。点击[此处](../resources/weaponskills)查看技能类型列表 + +::: + +## 相关函数 + +- [SetPlayerSkillLevel](SetPlayerSkillLevel): 设置玩家的武器技能等级 + +## 扩展阅读 + +- [武器技能类型](../resources/weaponskills): 用于设置玩家技能等级的武器类型列表 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkin.md new file mode 100644 index 00000000000..61229f2cb5e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSkin.md @@ -0,0 +1,54 @@ +--- +title: GetPlayerSkin +sidebar_label: GetPlayerSkin +description: 获取玩家的皮肤ID +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前使用的皮肤 ID + +| 参数名 | 说明 | +| -------- | ---------------------- | +| playerid | 需要获取皮肤 ID 的玩家 | + +## 返回值 + +返回玩家的[皮肤 ID](../resources/skins) + +**0** 表示获取失败(玩家无效) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/myskin", true)) + { + new string[32]; + new playerSkin = GetPlayerSkin(playerid); + + format(string, sizeof(string), "你的皮肤ID: %d", playerSkin); + SendClientMessage(playerid, -1, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +在调用[SetSpawnInfo](SetSpawnInfo)后但玩家尚未重生时,返回的是新设置的皮肤 ID。若通过[SpawnPlayer](SpawnPlayer)重生玩家,会返回旧的皮肤 ID + +::: + +## 相关函数 + +- [SetPlayerSkin](SetPlayerSkin): 设置玩家皮肤 + +## 扩展资源 + +- [皮肤 ID 列表](../resources/skins) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpecialAction.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpecialAction.md new file mode 100644 index 00000000000..b20c3dca0a7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpecialAction.md @@ -0,0 +1,41 @@ +--- +title: GetPlayerSpecialAction +sidebar_label: GetPlayerSpecialAction +description: 获取玩家当前的特殊动作状态 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前激活的特殊动作状态 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要查询的玩家 ID | + +## 返回值 + +返回玩家的特殊动作状态(参见:[特殊动作 ID 列表](../resources/specialactions)) + +## 示例代码 + +```c +public OnPlayerUpdate(playerid) +{ + // 检测玩家是否使用喷气背包并封禁 + if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) + { + Ban(playerid); + } + return 1; +} +``` + +## 相关函数 + +- [SetPlayerSpecialAction](SetPlayerSpecialAction): 设置玩家特殊动作 +- [GetPlayerState](GetPlayerState): 获取玩家当前状态 + +## 扩展资源 + +- [特殊动作 ID 列表](../resources/specialactions) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateID.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateID.md new file mode 100644 index 00000000000..19eac6b9c03 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateID.md @@ -0,0 +1,54 @@ +--- +title: GetPlayerSpectateID +sidebar_label: GetPlayerSpectateID +description: 获取玩家正在观战的目标ID(玩家或车辆) +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家当前正在观战的玩家或车辆的 ID + +| 参数名 | 说明 | +| -------- | ------- | +| playerid | 玩家 ID | + +## 返回值 + +返回被观战目标的 ID(玩家 ID 或车辆 ID) + +## 示例代码 + +```c +new spectateType = GetPlayerSpectateType(playerid); + +if (spectateType == 1) +{ + new spectateVehicleId = GetPlayerSpectateID(playerid); +} +else if (spectateType == 2) +{ + new spectatePlayerId = GetPlayerSpectateID(playerid); +} +``` + +## 注意事项 + +:::info + +需要配合[GetPlayerSpectateType](GetPlayerSpectateType)判断观战类型,详见[观战类型说明](../resources/spectatetypes) + +::: + +## 相关函数 + +- [PlayerSpectatePlayer](PlayerSpectatePlayer): 观战指定玩家 +- [PlayerSpectateVehicle](PlayerSpectateVehicle): 观战指定车辆 +- [TogglePlayerSpectating](TogglePlayerSpectating): 切换玩家观战状态 +- [GetPlayerSpectateType](GetPlayerSpectateType): 获取玩家观战类型 + +## 扩展资源 + +- [观战类型说明](../resources/spectatetypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateType.md new file mode 100644 index 00000000000..b49e1f7550b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSpectateType.md @@ -0,0 +1,46 @@ +--- +title: GetPlayerSpectateType +sidebar_label: GetPlayerSpectateType +description: 获取玩家的观战类型(车辆或玩家) +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家当前的观战类型(正在观战车辆或玩家) + +| 参数名 | 说明 | +| -------- | ------- | +| playerid | 玩家 ID | + +## 返回值 + +返回玩家的[观战类型](../resources/spectatetypes) + +## 示例代码 + +```c +new spectateType = GetPlayerSpectateType(playerid); + +if (spectateType == 1) // 观战车辆模式 +{ + SendClientMessage(playerid, -1, "你正在观战一辆车辆"); +} +else if (spectateType == 2) // 观战玩家模式 +{ + SendClientMessage(playerid, -1, "你正在观战其他玩家"); +} +``` + +## 相关函数 + +- [PlayerSpectatePlayer](PlayerSpectatePlayer): 观战指定玩家 +- [PlayerSpectateVehicle](PlayerSpectateVehicle): 观战指定车辆 +- [TogglePlayerSpectating](TogglePlayerSpectating): 切换观战状态 +- [GetPlayerSpectateID](GetPlayerSpectateID): 获取观战目标 ID + +## 扩展资源 + +- [观战类型说明](../resources/spectatetypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerState.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerState.md new file mode 100644 index 00000000000..2658fa85bee --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerState.md @@ -0,0 +1,47 @@ +--- +title: GetPlayerState +sidebar_label: GetPlayerState +description: 获取玩家当前的状态 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前的游戏状态 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要获取状态的玩家 ID | + +## 返回值 + +返回玩家当前的[状态值](../resources/playerstates)(整数形式) + +## 示例代码 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + new PLAYER_STATE:state = GetPlayerState(killerid); // 获取击杀者的状态 + + if (state == PLAYER_STATE_DRIVER) // 如果击杀者处于驾驶状态 + { + // 驾驶车辆时击杀,扣除金钱 + GivePlayerMoney(killerid, -10000); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerSpecialAction](GetPlayerSpecialAction): 获取玩家特殊动作状态 +- [SetPlayerSpecialAction](SetPlayerSpecialAction): 设置玩家特殊动作 + +## 相关回调 + +- [OnPlayerStateChange](../callbacks/OnPlayerStateChange): 玩家状态变更时触发 + +## 扩展资源 + +- [玩家状态列表](../resources/playerstates) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingObjectID.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingObjectID.md new file mode 100644 index 00000000000..6589a2841da --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingObjectID.md @@ -0,0 +1,42 @@ +--- +title: GetPlayerSurfingObjectID +sidebar_label: GetPlayerSurfingObjectID +description: 获取玩家正在“冲浪”的物体ID。 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前正在“冲浪”的物体 ID。 + +| 参数名 | 描述 | +| -------- | ------------------------ | +| playerid | 正在冲浪物体的玩家标识符 | + +## 返回值 + +成功返回被“冲浪”的移动物体 ID。若玩家未在任何移动的物体上方“冲浪”,返回`INVALID_OBJECT_ID`。 + +## 示例 + +```c +/* 当玩家在聊天框中输入 'objectsurfing' 时触发 */ +public OnPlayerText(playerid, text[]) +{ + if (strcmp(text, "objectsurfing", true) == 0) + { + new + szMessage[30]; + + format(szMessage, sizeof(szMessage), "你正在冲浪物体 #%d。", GetPlayerSurfingObjectID(playerid)); + SendClientMessage(playerid, 0xA9C4E4FF, szMessage); + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerSurfingPlayerObjectID](GetPlayerSurfingPlayerObjectID): 获取玩家正在“冲浪”的玩家私有物体 ID +- [GetPlayerSurfingVehicleID](GetPlayerSurfingVehicleID): 获取玩家正在“冲浪”(停留在车顶)的车辆 ID +- [GetPlayerSurfingOffsets](GetPlayerSurfingOffsets): 获取玩家“冲浪”时的坐标偏移量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingOffsets.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingOffsets.md new file mode 100644 index 00000000000..9c8a82fbad3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingOffsets.md @@ -0,0 +1,45 @@ +--- +title: GetPlayerSurfingOffsets +sidebar_label: GetPlayerSurfingOffsets +description: 获取玩家“冲浪”时的坐标偏移量。 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家“冲浪”时的坐标偏移量参数。 + +| 参数名 | 描述 | +| -------------- | ----------------------------------------- | +| playerid | 目标玩家标识符 | +| &Float:offsetX | 用于存储 X 轴偏移量的浮点变量(引用传递) | +| &Float:offsetY | 用于存储 Y 轴偏移量的浮点变量(引用传递) | +| &Float:offsetZ | 用于存储 Z 轴偏移量的浮点变量(引用传递) | + +## 返回值 + +本函数不返回特定值。 + +## 示例 + +```c +new surfingVehicleId = GetPlayerSurfingVehicleID(playerid); +if (surfingVehicleId != INVALID_VEHICLE_ID) +{ + new + Float:offsetX, + Float:offsetY, + Float:offsetZ; + + GetPlayerSurfingOffsets(playerid, offsetX, offsetY, offsetZ); + + SendClientMessage(playerid, -1, "X轴偏移量 = %.2f Y轴偏移量 = %.2f Z轴偏移量 = %.2f", offsetX, offsetY, offsetZ); +} +``` + +## 相关函数 + +- [GetPlayerSurfingObjectID](GetPlayerSurfingObjectID): 获取玩家正在“冲浪”的物体 ID +- [GetPlayerSurfingVehicleID](GetPlayerSurfingVehicleID): 获取玩家正在“冲浪”(停留在车顶)的车辆 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingPlayerObjectID.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingPlayerObjectID.md new file mode 100644 index 00000000000..fcbef858188 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingPlayerObjectID.md @@ -0,0 +1,44 @@ +--- +title: GetPlayerSurfingPlayerObjectID +sidebar_label: GetPlayerSurfingPlayerObjectID +description: 获取玩家正在“冲浪”的玩家私有物体ID。 +tags: ["玩家", "物体", "玩家私有物体"] +--- + + + +## 描述 + +获取玩家当前正在“冲浪”的玩家私有物体 ID。 + +| 参数名 | 描述 | +| -------- | -------------------------- | +| playerid | 正在“冲浪”物体的玩家标识符 | + +## 返回值 + +成功返回被“冲浪”的移动物体 ID。若玩家未在任何移动的物体上方“冲浪”,返回`INVALID_OBJECT_ID`。 + +## 示例 + +```c +/* 当玩家在聊天框中输入 'objectsurfing' 时触发 */ +public OnPlayerText(playerid, text[]) +{ + if (strcmp(text, "objectsurfing", true) == 0) + { + new + szMessage[46]; + + format(szMessage, sizeof(szMessage), "你正在“冲浪”玩家私有物体 #%d。", GetPlayerSurfingPlayerObjectID(playerid)); + SendClientMessage(playerid, 0xA9C4E4FF, szMessage); + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerSurfingObjectID](GetPlayerSurfingObjectID): 获取玩家正在“冲浪”的物体 ID +- [GetPlayerSurfingVehicleID](GetPlayerSurfingVehicleID): 获取玩家正在“冲浪”(停留在车顶)的车辆 ID +- [GetPlayerSurfingOffsets](GetPlayerSurfingOffsets): 获取玩家“冲浪”时的坐标偏移量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingVehicleID.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingVehicleID.md new file mode 100644 index 00000000000..a04fff803e6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerSurfingVehicleID.md @@ -0,0 +1,37 @@ +--- +title: GetPlayerSurfingVehicleID +sidebar_label: GetPlayerSurfingVehicleID +description: 获取玩家正在“冲浪”(停留在车顶)的车辆ID。 +tags: ["玩家", "车辆"] +--- + +## 描述 + +获取玩家当前正在“冲浪”(停留在车顶)的车辆 ID。 + +| 参数名 | 描述 | +| -------- | -------------------------------------- | +| playerid | 需要查询“冲浪”车辆 ID 的目标玩家标识符 | + +## 返回值 + +成功返回被“冲浪”的车辆 ID。若玩家未“冲浪”任何车辆或目标车辆无驾驶员,返回`INVALID_VEHICLE_ID`。 + +若指定玩家未连接服务器,同样返回`INVALID_VEHICLE_ID`。 + +## 示例 + +```c +new surfingVehicleId = GetPlayerSurfingVehicleID(playerid); +if (surfingVehicleId == INVALID_VEHICLE_ID) +{ + SendClientMessage(playerid, COLOR_RED, "你当前没有“冲浪”任何车辆。"); +} +``` + +## 相关函数 + +- [GetPlayerVehicleID](GetPlayerVehicleID): 获取玩家当前乘坐的车辆 ID +- [GetPlayerVehicleSeat](GetPlayerVehicleSeat): 检测玩家在车辆内的座位位置 +- [GetPlayerSurfingObjectID](GetPlayerSurfingObjectID): 获取玩家正在“冲浪”的物体 ID +- [GetPlayerSurfingOffsets](GetPlayerSurfingOffsets): 获取玩家“冲浪”时的坐标偏移量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetActor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetActor.md new file mode 100644 index 00000000000..728271a31bd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetActor.md @@ -0,0 +1,52 @@ +--- +title: GetPlayerTargetActor +sidebar_label: GetPlayerTargetActor +description: 获取指定玩家正在瞄准的角色ID +tags: ["玩家"] +--- + + + +## 描述 + +获取指定玩家当前瞄准的角色(Actor)ID + +| 名称 | 说明 | +| -------- | --------------------- | +| playerid | 需要获取目标的玩家 ID | + +## 返回值 + +被瞄准的角色 ID,若无目标则返回 `INVALID_ACTOR_ID` + +## 示例代码 + +```c +public OnPlayerUpdate(playerid) +{ + new + targetActorId = GetPlayerTargetActor(playerid), + string[32]; + + format(string, sizeof(string), "您正在瞄准角色ID %d", targetActorId); + SendClientMessage(playerid, -1, string); + return 1; +} +``` + +## 注意事项 + +:::warning + +不适用于游戏手柄/控制器,且存在有效距离限制。狙击步枪(Sniper Rifle)无法锁定目标,因此不会返回任何角色。 + +::: + +## 相关函数 + +- [GetPlayerCameraTargetActor](GetPlayerCameraTargetActor): 获取玩家视角目标角色(若存在) +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 + +## 相关回调 + +- [OnPlayerGiveDamageActor](../callbacks/OnPlayerGiveDamageActor): 当玩家对角色造成伤害时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetPlayer.md new file mode 100644 index 00000000000..d8c08e58640 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTargetPlayer.md @@ -0,0 +1,49 @@ +--- +title: GetPlayerTargetPlayer +sidebar_label: GetPlayerTargetPlayer +description: 检查玩家正在瞄准的目标玩家 +tags: ["玩家"] +--- + +## 描述 + +检查指定玩家当前瞄准的目标玩家 + +| 名称 | 说明 | +| -------- | --------------------- | +| playerid | 需要获取目标的玩家 ID | + +## 返回值 + +被瞄准的玩家 ID,若无目标则返回 `INVALID_PLAYER_ID` + +## 示例代码 + +```c +public OnPlayerUpdate(playerid) +{ + // 存储目标ID + new playerTargetId = GetPlayerTargetPlayer(playerid); + if (playerTargetId != INVALID_PLAYER_ID && GetPlayerTeam(playerTargetId) == GetPlayerTeam(playerid)) + { + GameTextForPlayer(playerid, "~R~禁止攻击队友!", 5000, 3); + } +} +``` + +## 注意事项 + +:::warning + +不适用于游戏手柄/控制器,且存在有效距离限制。狙击步枪(Sniper Rifle)无法锁定目标,因此不会返回任何玩家。 + +::: + +## 相关函数 + +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取玩家视角前向向量 + +## 相关回调 + +- [OnPlayerGiveDamage](../callbacks/OnPlayerGiveDamage): 当玩家造成伤害时触发 +- [OnPlayerTakeDamage](../callbacks/OnPlayerTakeDamage): 当玩家受到伤害时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTeam.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTeam.md new file mode 100644 index 00000000000..4ef6144710a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTeam.md @@ -0,0 +1,47 @@ +--- +title: GetPlayerTeam +sidebar_label: GetPlayerTeam +description: 获取玩家所属队伍的ID +tags: ["玩家"] +--- + +## 描述 + +获取指定玩家当前所属的队伍编号 + +| 名称 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取队伍信息的玩家 ID | + +## 返回值 + +**0-254:** 玩家所属队伍 ID(0 为有效队伍) + +**255:** 定义为 NO_TEAM,表示玩家未加入任何队伍 + +**-1:** 函数执行失败(玩家未连接) + +## 示例代码 + +```c +enum +{ + TEAM_ONE = 1, + TEAM_TWO +}; + +public OnPlayerSpawn(playerid) +{ + // 队伍1的玩家应在拉斯维加斯机场生成 + if (GetPlayerTeam(playerid) == TEAM_ONE) + { + SetPlayerPos(playerid, 1667.8909, 1405.5618, 10.7801); + } + return 1; +} +``` + +## 相关函数 + +- [SetPlayerTeam](SetPlayerTeam): 设置玩家队伍 +- [SetTeamCount](SetTeamCount): 设置可用队伍数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTime.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTime.md new file mode 100644 index 00000000000..94ca634c2ae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTime.md @@ -0,0 +1,41 @@ +--- +title: GetPlayerTime +sidebar_label: GetPlayerTime +description: 获取玩家当前的游戏时间 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前的游戏时间。该时间通过[SetWorldTime](SetWorldTime)设置,或当使用[TogglePlayerClock](TogglePlayerClock)时由游戏自动设置。 + +| 名称 | 说明 | +| -------- | -------------------------- | +| playerid | 需要获取游戏时间的玩家 ID | +| &hour | 存储小时的变量(引用传递) | +| &minute | 存储分钟的变量(引用传递) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +当前游戏时间将存储在指定变量中 + +## 示例代码 + +```c +new hour, minutes; +GetPlayerTime(playerid, hour, minutes); +if (hour == 13 && minutes == 37) +{ + SendClientMessage(playerid, COLOR_WHITE, "当前时间为13点37分!"); +} +``` + +## 相关函数 + +- [SetPlayerTime](SetPlayerTime): 设置玩家时间 +- [SetWorldTime](SetWorldTime): 设置全局服务器时间 +- [TogglePlayerClock](TogglePlayerClock): 切换右上角时钟显示 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTrainSpeed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTrainSpeed.md new file mode 100644 index 00000000000..282a961d492 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerTrainSpeed.md @@ -0,0 +1,29 @@ +--- +title: GetPlayerTrainSpeed +sidebar_label: GetPlayerTrainSpeed +description: 获取玩家火车的行驶速度 +tags: ["玩家", "车辆"] +--- + + + +## 描述 + +获取玩家当前驾驶的火车的行驶速度 + +## 参数说明 + +| 名称 | 说明 | +| -------- | --------- | +| playerid | 玩家的 ID | + +## 示例代码 + +```c +new Float:speed = GetPlayerTrainSpeed(playerid); +SendClientMessage(playerid, 0xFFFF00FF, "您的火车当前速度:%f", speed); +``` + +## 相关函数 + +- [GetVehicleTrainSpeed](GetVehicleTrainSpeed): 获取火车的行驶速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleID.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleID.md new file mode 100644 index 00000000000..699c10af481 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleID.md @@ -0,0 +1,38 @@ +--- +title: GetPlayerVehicleID +sidebar_label: GetPlayerVehicleID +description: 获取玩家当前所在的车辆ID +tags: ["玩家", "车辆"] +--- + +## 描述 + +获取玩家当前乘坐的车辆 ID + +**注意:** 并非车辆的模型 ID,获取模型 ID 请参考[GetVehicleModel](GetVehicleModel) + +| 名称 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取车辆信息的玩家 ID | + +## 返回值 + +车辆 ID,若不在车辆中则返回**0** + +## 示例代码 + +```c +// 当玩家在车辆中时添加10倍氮气加速(可通过指令触发) +new vehicleId = GetPlayerVehicleID(playerid); +if (vehicleId != 0) +{ + AddVehicleComponent(vehicleId, 1010); +} +``` + +## 相关函数 + +- [IsPlayerInVehicle](IsPlayerInVehicle): 检测玩家是否处于特定车辆 +- [IsPlayerInAnyVehicle](IsPlayerInAnyVehicle): 检测玩家是否处于任何车辆 +- [GetPlayerVehicleSeat](GetPlayerVehicleSeat): 获取玩家所在车辆座位号 +- [GetVehicleModel](GetVehicleModel): 获取车辆的模型 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleSeat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleSeat.md new file mode 100644 index 00000000000..21d1aaaedbb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVehicleSeat.md @@ -0,0 +1,64 @@ +--- +title: GetPlayerVehicleSeat +sidebar_label: GetPlayerVehicleSeat +description: 获取玩家所在的车辆座位号 +tags: ["玩家", "车辆"] +--- + +## 描述 + +获取指定玩家当前在车辆中的座位编号 + +| 名称 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取座位信息的玩家 ID | + +## 返回值 + +玩家当前所在的座位编号: +- **-1** 未处于车辆中 +- **0** 驾驶位 +- **1** 前排乘客位 +- **2** 后排左侧乘客位 +- **3** 后排右侧乘客位 +- **4+** 扩展乘客位(如客车等) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/myseat", true) == 0) + { + new + playerSeat = GetPlayerVehicleSeat(playerid); + + // 异常状态处理 + if (playerSeat == 128) + { + return SendClientMessage(playerid, 0xFFFFFFFF, "无法获取座位信息,发生系统错误"); + } + + new + string[24]; + + format(string, sizeof(string), "您的座位号:%i", playerSeat); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; + } + return 0; +} +``` + +| ID | 座位位置 | +| --- | -------------------- | +| 0 | 驾驶位 | +| 1 | 前排乘客位 | +| 2 | 后排左侧乘客位 | +| 3 | 后排右侧乘客位 | +| 4+ | 扩展乘客位(客车等) | + +## 相关函数 + +- [GetPlayerVehicleID](GetPlayerVehicleID): 获取玩家所在车辆的 ID +- [PutPlayerInVehicle](PutPlayerInVehicle): 将玩家放置到指定车辆座位 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVelocity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVelocity.md new file mode 100644 index 00000000000..91896771d22 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVelocity.md @@ -0,0 +1,47 @@ +--- +title: GetPlayerVelocity +sidebar_label: GetPlayerVelocity +description: 获取玩家在X/Y/Z轴上的运动速度 +tags: ["玩家"] +--- + +## 描述 + +获取玩家在三维坐标系中的运动速度(X/Y/Z 轴分量) + +| 名称 | 说明 | +| -------- | ----------------------------------- | +| playerid | 需要获取速度数据的玩家 ID | +| &Float:x | 存储 X 轴速度的浮点变量(引用传递) | +| &Float:y | 存储 Y 轴速度的浮点变量(引用传递) | +| &Float:z | 存储 Z 轴速度的浮点变量(引用传递) | + +## 返回值 + +本函数不直接返回值,三维速度分量将存储于指定的浮点变量中 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/velocity", true)) + { + new + Float:x, Float:y, Float:z, + string[128]; + + GetPlayerVelocity(playerid, x, y, z); + + format(string, sizeof(string), "您当前的运动速度:X轴 %.2f,Y轴 %.2f,Z轴 %.2f", x, y, z); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; + } +} +``` + +## 相关函数 + +- [SetPlayerVelocity](SetPlayerVelocity): 设置玩家的运动速度 +- [SetVehicleVelocity](SetVehicleVelocity): 设置车辆的运动速度 +- [GetVehicleVelocity](GetVehicleVelocity): 获取车辆的运动速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVersion.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVersion.md new file mode 100644 index 00000000000..c61f0b52066 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVersion.md @@ -0,0 +1,56 @@ +--- +title: GetPlayerVersion +sidebar_label: GetPlayerVersion +description: 返回玩家客户端的SA-MP版本信息 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前连接的 SA-MP 客户端版本信息 + +| 名称 | 说明 | +| ---------------------- | -------------------------------- | +| playerid | 需要获取版本信息的玩家 ID | +| version[] | 存储版本信息的字符串(引用传递) | +| len = sizeof (version) | 版本信息的最大存储长度 | + +## 返回值 + +客户端版本信息将存储在指定的字符数组中 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + new version[24]; + GetPlayerVersion(playerid, version, sizeof(version)); + + new string[64]; + format(string, sizeof(string), "您的SA-MP客户端版本:%s", version); + SendClientMessage(playerid, 0xFFFFFFFF, string); + // 可能显示:"您的SA-MP客户端版本:0.3.7" + return 1; +} +``` + +## 注意事项 + +:::tip + +客户端版本字符串最长 24 字符,超长会导致连接被拒绝。常规玩家版本长度通常在 5 字符(0.3.7)至 9 字符(0.3.DL-R1)之间 + +::: + +:::warning + +当指定玩家是 NPC 时,版本信息字符串将返回空值 + +::: + +## 相关函数 + +- [GetPlayerName](GetPlayerName): 获取玩家昵称 +- [GetPlayerPing](GetPlayerPing): 获取玩家网络延迟 +- [GetPlayerIp](GetPlayerIp): 获取玩家 IP 地址 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVirtualWorld.md new file mode 100644 index 00000000000..9ccc34250a7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerVirtualWorld.md @@ -0,0 +1,48 @@ +--- +title: GetPlayerVirtualWorld +sidebar_label: GetPlayerVirtualWorld +description: 获取玩家当前所在的虚拟世界 +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前所在的虚拟世界编号 + +| 名称 | 说明 | +| -------- | ----------------------------- | +| playerid | 需要获取虚拟世界信息的玩家 ID | + +## 返回值 + +玩家当前所在的虚拟世界编号 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/world", true)) + { + new string[32]; + format(string, sizeof(string), "您所在的虚拟世界编号:%i", GetPlayerVirtualWorld(playerid)); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +虚拟世界与室内空间(Interior)是两个独立的概念 + +::: + +## 相关函数 + +- [SetPlayerVirtualWorld](SetPlayerVirtualWorld): 设置玩家虚拟世界 +- [GetVehicleVirtualWorld](GetVehicleVirtualWorld): 获取车辆所在虚拟世界 +- [GetPlayerInterior](GetPlayerInterior): 获取玩家当前室内空间编号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWantedLevel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWantedLevel.md new file mode 100644 index 00000000000..25aff504721 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWantedLevel.md @@ -0,0 +1,44 @@ +--- +title: GetPlayerWantedLevel +sidebar_label: GetPlayerWantedLevel +description: 获取玩家的通缉等级 +tags: ["玩家"] +--- + +## 描述 + +获取指定玩家的当前通缉等级(警星数量) + +| 名称 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取通缉等级的玩家 ID | + +## 返回值 + +玩家当前的警星等级(0-6 级) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/getmywantedlevel", true) == 0) + { + // 获取当前通缉等级并发送给玩家 + new + wantedLevel = GetPlayerWantedLevel(playerid), + message[64]; + + format(message, sizeof(message), "您当前的通缉等级为:%i 星", wantedLevel); + SendClientMessage(playerid, 0xFF0000FF, message); + + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SetPlayerWantedLevel](SetPlayerWantedLevel): 设置玩家通缉等级 +- [PlayCrimeReportForPlayer](PlayCrimeReportForPlayer): 为玩家播放犯罪通告 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeapon.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeapon.md new file mode 100644 index 00000000000..534d1b8a31a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeapon.md @@ -0,0 +1,62 @@ +--- +title: GetPlayerWeapon +sidebar_label: GetPlayerWeapon +description: 获取玩家当前持有的武器ID +tags: ["玩家"] +--- + +## 描述 + +获取玩家当前手持武器的 ID 编号 + +| 名称 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取武器信息的玩家 ID | + +## 返回值 + +玩家当前持有的武器 ID。若指定玩家不存在,返回 **-1** + +## 示例代码 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 检测杀手是否为有效玩家 + if (killerid != INVALID_PLAYER_ID) + { + // WEAPON_MINIGUN常量在标准库中预定义为38(火神机枪) + if (GetPlayerWeapon(killerid) == WEAPON_MINIGUN) + { + // 检测到火神机枪则封禁 + Ban(killerid); + } + } + return 1; +} +``` + +## 注意事项 + +:::tip + +当玩家处于驾驶状态(`PLAYER_STATE_DRIVER`)或乘客状态(`PLAYER_STATE_PASSENGER`)时,本函数返回玩家进入车辆前持有的武器。若通过作弊手段在车辆内生成武器,本函数无法检测。 + +::: + +:::warning + +有时可能返回 **-1**(无效武器 ID),具体原因尚未明确,建议遇到此返回值时丢弃相关数据。 + +::: + +## 相关函数 + +- [GetPlayerWeaponData](GetPlayerWeaponData): 获取玩家武器库详细信息 +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家指定武器 +- [ResetPlayerWeapons](ResetPlayerWeapons): 清空玩家所有武器 +- [RemovePlayerWeapon](RemovePlayerWeapon): 移除玩家特定武器 + +## 相关资源 + +- [武器 ID 列表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponData.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponData.md new file mode 100644 index 00000000000..338707cdf44 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponData.md @@ -0,0 +1,66 @@ +--- +title: GetPlayerWeaponData +sidebar_label: GetPlayerWeaponData +description: 获取玩家指定武器槽的武器及弹药信息 +tags: ["玩家"] +--- + +## 描述 + +获取玩家特定武器槽(如'SMG'槽位)中的武器类型及剩余弹药量 + +| 名称 | 说明 | +| ---------------- | ------------------------------------------------------- | +| playerid | 需要获取武器数据的玩家 ID | +| WEAPON_SLOT:slot | [武器槽编号](../resources/weaponslots)(0-12) | +| &WEAPON:weapons | 存储[武器 ID](../resources/weaponids)的变量(引用传递) | +| &ammo | 存储弹药量的变量(引用传递) | + +## 返回值 + +**1** - 函数执行成功 + +**0** - 函数执行失败(玩家未连接或武器槽编号无效) + +## 示例代码 + +```c +// 常见用法:遍历所有武器槽并将信息存入二维数组 +// 数组第一列为武器ID,第二列为弹药量 + +new weapons[13][2]; + +for (new i = 0; i <= 12; i++) +{ + GetPlayerWeaponData(playerid, WEAPON_SLOT:i, weapons[i][0], weapons[i][1]); +} +``` + +另一个示例: + +```c +new + weaponid, + ammo; + +// 获取玩家手枪槽位的武器信息 +GetPlayerWeaponData(playerid, WEAPON_SLOT_PISTOL, weaponid, ammo); +``` + +## 注意事项 + +:::tip + +即使武器弹药已耗尽,仍会返回该武器信息 + +::: + +## 相关函数 + +- [GetPlayerWeapon](GetPlayerWeapon): 获取玩家当前手持武器 +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家指定武器 + +## 相关资源 + +- [武器槽位列表](../resources/weaponslots) +- [武器 ID 对照表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponState.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponState.md new file mode 100644 index 00000000000..b2a11ed6de3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeaponState.md @@ -0,0 +1,52 @@ +--- +title: GetPlayerWeaponState +sidebar_label: GetPlayerWeaponState +description: 检查玩家武器的当前状态 +tags: ["玩家"] +--- + +## 描述 + +获取指定玩家武器的当前状态信息 + +| 名称 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取武器状态的玩家 ID | + +## 返回值 + +玩家的[武器状态编号](../resources/weaponstates)。若指定玩家不存在,返回 **0** + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/wstate", true)) + { + new WEAPONSTATE:state = GetPlayerWeaponState(playerid); + + static weaponStates[4][64] = + { + "当前武器弹药已耗尽", // WEAPONSTATE_NO_BULLETS + "当前武器仅剩最后一发弹药", // WEAPONSTATE_LAST_BULLET + "当前武器弹药充足", // WEAPONSTATE_MORE_BULLETS + "正在装填当前武器" // WEAPONSTATE_RELOADING + }; + + new string[144]; + format(string, sizeof(string), "您的武器状态:%s", weaponStates[_:state]); + SendClientMessage(playerid, -1, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家指定武器 + +## 相关资源 + +- [武器状态列表](../resources/weaponstates) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeather.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeather.md new file mode 100644 index 00000000000..80f53ef2128 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWeather.md @@ -0,0 +1,42 @@ +--- +title: GetPlayerWeather +sidebar_label: GetPlayerWeather +description: 获取玩家的天气ID +tags: ["玩家"] +--- + + + +## 描述 + +获取指定玩家的天气 ID + +| 名称 | 说明 | +| -------- | ------------------------- | +| playerid | 需要获取天气信息的玩家 ID | + +## 返回值 + +玩家当前的天气 ID 编号 + +## 示例代码 + +```c +SetPlayerWeather(playerid, 8); + +printf("玩家天气ID:%d", GetPlayerWeather(playerid)); +// 输出结果为"玩家天气ID:8" +``` + +## 相关函数 + +- [SetPlayerWeather](SetPlayerWeather): 设置玩家独立天气 +- [SetWeather](SetWeather): 设置全局服务器天气 + +## 相关资源 + +- [天气 ID 列表](../resources/weatherid) + +``` + +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWorldBounds.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWorldBounds.md new file mode 100644 index 00000000000..728d34417f3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerWorldBounds.md @@ -0,0 +1,51 @@ +--- +title: GetPlayerWorldBounds +sidebar_label: GetPlayerWorldBounds +description: 获取玩家的世界边界范围 +tags: ["玩家"] +--- + + + +## 描述 + +获取指定玩家的世界边界坐标范围 + +| 名称 | 说明 | +| ----------- | --------------------------------------- | +| playerid | 需要获取边界信息的玩家 ID | +| &Float:maxX | 存储 X 轴最大边界的浮点变量(引用传递) | +| &Float:minX | 存储 X 轴最小边界的浮点变量(引用传递) | +| &Float:maxY | 存储 Y 轴最大边界的浮点变量(引用传递) | +| &Float:minY | 存储 Y 轴最小边界的浮点变量(引用传递) | + +## 返回值 + +本函数不直接返回值,边界坐标将存储于指定变量中 + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + SetPlayerWorldBounds(playerid, -1212.0, -1420.0, 2628.5, 2430.5); + + new + Float:maxX, + Float:minX, + Float:maxY, + Float:minY; + + GetPlayerWorldBounds(playerid, maxX, minX, maxY, minY); + // maxX = -1212.0 + // minX = -1420.0 + // maxY = 2628.5 + // minY = 2430.5 + return 1; +} +``` + +## 相关函数 + +- [SetPlayerWorldBounds](SetPlayerWorldBounds): 设置玩家的世界边界(越界时会被推回) +- [ClearPlayerWorldBounds](ClearPlayerWorldBounds): 重置玩家的世界边界为默认范围 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerZAim.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerZAim.md new file mode 100644 index 00000000000..f0e724f4ce0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerZAim.md @@ -0,0 +1,32 @@ +--- +title: GetPlayerZAim +sidebar_label: GetPlayerZAim +description: 获取玩家的Z轴瞄准角度 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家的 Z 轴瞄准角度(与视角和瞄准机制相关) + +| 名称 | 说明 | +| -------- | ------------------------------ | +| playerid | 需要获取 Z 轴瞄准角度的玩家 ID | + +## 返回值 + +玩家的 Z 轴瞄准角度(浮点数值) + +## 示例代码 + +```c +new Float:zAim = GetPlayerZAim(playerid); + +SendClientMessage(playerid, -1, "Z轴瞄准角度 = %f", zAim); +``` + +## 相关函数 + +- [GetPlayerCameraPos](GetPlayerCameraPos): 获取玩家视角三维坐标 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayers.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayers.md new file mode 100644 index 00000000000..8aa93331f95 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayers.md @@ -0,0 +1,39 @@ +--- +title: GetPlayers +sidebar_label: GetPlayers +description: 获取当前在线玩家的ID数组 +tags: ["玩家"] +--- + + + +## 描述 + +获取当前服务器在线玩家的 ID 数组 + +| 参数名 | 说明 | +| --------- | ---------------------------------- | +| players[] | 存储玩家 ID 的数组(通过引用传递) | +| size | 数组的容量大小 | + +## 返回值 + +返回实际存入数组的玩家数量 + +## 示例代码 + +假设服务器有 5 个在线玩家: + +```c +new players[MAX_PLAYERS]; +new length; + +length = GetPlayers(players, sizeof(players)); +// players数组现在包含在线玩家ID:{ 0, 1, 2, 3, 4 } +// length变量的值为5 +``` + +## 相关函数 + +- [GetVehicles](GetVehicles): 获取已创建车辆的 ID 数组 +- [GetActors](GetActors): 获取已创建角色的 ID 数组 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetRandomVehicleColourPair.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetRandomVehicleColourPair.md new file mode 100644 index 00000000000..f65dc44df57 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetRandomVehicleColourPair.md @@ -0,0 +1,38 @@ +--- +title: GetRandomVehicleColourPair +sidebar_label: GetRandomVehicleColourPair +description: 获取指定车辆模型的有效随机颜色索引组合 +tags: ["车辆"] +--- + + + +## 描述 + +获取指定车辆模型的有效随机颜色索引组合 + +## 参数说明 + +| 名称 | 说明 | +| ------------ | -------------------------------------------- | +| modelid | [车辆模型 ID](../resources/vehicleid) | +| &colour1 | 存储主颜色索引的变量(引用传递) | +| &colour2 | 存储副颜色索引的变量(引用传递) | +| &colour3 = 0 | 存储第三颜色索引的变量(可选参数,引用传递) | +| &colour4 = 0 | 存储第四颜色索引的变量(可选参数,引用传递) | + +## 示例代码 + +```c +new + colour1, + colour2; + +// 获取Sultan车型的随机颜色组合(模型ID 560) +GetRandomVehicleColourPair(560, colour1, colour2); +``` + +## 相关函数 + +- [VehicleColourIndexToColour](VehicleColourIndexToColour): 将颜色索引转换为 HEX 颜色值(RGBA 格式) +- [GetVehicleColours](GetVehicleColours): 获取车辆当前颜色配置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetRunningTimers.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetRunningTimers.md new file mode 100644 index 00000000000..ecb3cc86f89 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetRunningTimers.md @@ -0,0 +1,32 @@ +--- +title: GetRunningTimers +sidebar_label: GetRunningTimers +description: 获取当前运行的定时器数量 +tags: [] +--- + +:::warning + +本函数已弃用,请使用[CountRunningTimers](CountRunningTimers) + +::: + +## 描述 + +获取当前通过[SetTimer](SetTimer)和[SetTimerEx](SetTimerEx)创建的运行中定时器数量 + +## 返回值 + +当前激活的定时器总数 + +## 示例代码 + +```c +printf("正在运行的定时器数量: %d", GetRunningTimers()); +``` + +## 相关函数 + +- [SetTimer](SetTimer): 创建基础定时器 +- [SetTimerEx](SetTimerEx): 创建带参数的定时器 +- [KillTimer](KillTimer): 终止指定定时器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarFloat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarFloat.md new file mode 100644 index 00000000000..4b6ae841193 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarFloat.md @@ -0,0 +1,41 @@ +--- +title: GetSVarFloat +sidebar_label: GetSVarFloat +description: 获取浮点型服务器变量的值。 +tags: ["服务器变量", "svar"] +--- + + + +## 描述 + +获取浮点型服务器变量的值。 + +| 参数名 | 说明 | +| ------------ | ----------------------------------------------------------------------- | +| const svar[] | 服务器变量名称(不区分大小写)
通过[SetSVarFloat](SetSVarFloat)设置 | + +## 返回值 + +返回指定服务器变量的浮点值。 + +即使变量未设置仍会返回 0.0。 + +## 示例 + +```c +// 设置版本号 +SetSVarFloat("Version", 0.37); + +// 打印服务器当前版本 +printf("Version: %.2f", GetSVarFloat("Version")); +``` + +## 相关函数 + +- [SetSVarInt](SetSVarInt): 设置整型服务器变量 +- [GetSVarInt](GetSVarInt): 获取整型服务器变量 +- [SetSVarString](SetSVarString): 设置字符串型服务器变量 +- [GetSVarString](GetSVarString): 获取字符串型服务器变量 +- [SetSVarFloat](SetSVarFloat): 设置浮点型服务器变量 +- [DeleteSVar](DeleteSVar): 删除服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarInt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarInt.md new file mode 100644 index 00000000000..f4d1ce9998f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarInt.md @@ -0,0 +1,41 @@ +--- +title: GetSVarInt +sidebar_label: GetSVarInt +description: 获取整型服务器变量的值。 +tags: ["服务器变量", "svar"] +--- + + + +## 描述 + +获取整型服务器变量的值。 + +| 参数名 | 说明 | +| ------------ | ------------------------------------------------------------------- | +| const svar[] | 服务器变量名称(不区分大小写)
通过[SetSVarInt](SetSVarInt)设置 | + +## 返回值 + +返回指定服务器变量的整型值。 + +即使变量未设置仍会返回 0。 + +## 示例 + +```c +// 设置版本号 +SetSVarInt("Version", 37); + +// 打印服务器当前版本 +printf("Version: %d", GetSVarInt("Version")); +``` + +## 相关函数 + +- [SetSVarInt](SetSVarInt): 设置整型服务器变量 +- [SetSVarString](SetSVarString): 设置字符串型服务器变量 +- [GetSVarString](GetSVarString): 获取字符串型服务器变量 +- [SetSVarFloat](SetSVarFloat): 设置浮点型服务器变量 +- [GetSVarFloat](GetSVarFloat): 获取浮点型服务器变量 +- [DeleteSVar](DeleteSVar): 删除服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarNameAtIndex.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarNameAtIndex.md new file mode 100644 index 00000000000..adb27395e54 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarNameAtIndex.md @@ -0,0 +1,27 @@ +--- +title: GetSVarNameAtIndex +sidebar_label: GetSVarNameAtIndex +description: 通过索引获取服务器变量名称 +tags: ["服务器变量", "svar"] +--- + +## 描述 + +通过索引获取服务器变量的名称 + +| 参数名 | 说明 | +| ---------------------- | -------------------------------- | +| index | 服务器变量的索引值 | +| output[] | 存储变量名的数组(通过引用传递) | +| size = sizeof (output) | 返回字符串的最大长度 | + +## 返回值 + +本函数无特定返回值 + +## 相关函数 + +- [GetSVarType](GetSVarType): 获取服务器变量类型 +- [GetSVarInt](GetSVarInt): 获取整型服务器变量 +- [GetSVarFloat](GetSVarFloat): 获取浮点型服务器变量 +- [GetSVarString](GetSVarString): 获取字符串型服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarString.md new file mode 100644 index 00000000000..b9cf7471db6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarString.md @@ -0,0 +1,43 @@ +--- +title: GetSVarString +sidebar_label: GetSVarString +description: 获取字符串型服务器变量的值。 +tags: ["服务器变量", "svar"] +--- + + + +## 描述 + +获取字符串型服务器变量的值。 + +| 参数名 | 说明 | +| --------------------- | ------------------------------------------------------------------------- | +| const svar[] | 服务器变量名称(不区分大小写)
通过[SetSVarString](SetSVarString)设置 | +| output[] | 存储字符串值的数组(通过引用传递) | +| len = sizeof (output) | 返回字符串的最大长度 | + +## 返回值 + +返回字符串的长度。 + +## 示例 + +```c +// 设置版本号 +SetSVarString("Version", "0.3.7"); + +// 打印服务器当前版本 +new string[5 + 1]; +GetSVarString("Version", string, sizeof(string)); +printf("Version: %s", string); +``` + +## 相关函数 + +- [SetSVarInt](SetSVarInt): 设置整型服务器变量 +- [GetSVarInt](GetSVarInt): 获取整型服务器变量 +- [SetSVarString](SetSVarString): 设置字符串型服务器变量 +- [SetSVarFloat](SetSVarFloat): 设置浮点型服务器变量 +- [GetSVarFloat](GetSVarFloat): 获取浮点型服务器变量 +- [DeleteSVar](DeleteSVar): 删除服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarType.md new file mode 100644 index 00000000000..cf6582463fc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarType.md @@ -0,0 +1,71 @@ +--- +title: GetSVarType +sidebar_label: GetSVarType +description: 获取服务器变量的类型(整型/浮点型/字符串型) +tags: ["服务器变量", "svar"] +--- + +## 描述 + +获取服务器变量的数据类型(整型、浮点型或字符串型) + +| 参数名 | 说明 | +| ------------ | -------------------------- | +| const svar[] | 要获取类型的服务器变量名称 | + +## 返回值 + +返回服务器变量的[类型](../resources/svartypes) + +## 示例 + +```c +stock PrintSVar(varname[]) +{ + switch(GetSVarType(varname)) + { + case SERVER_VARTYPE_NONE: + { + return 0; + } + case SERVER_VARTYPE_INT: + { + printf("整型变量 '%s': %i", varname, GetSVarInt(varname)); + } + case SERVER_VARTYPE_FLOAT: + { + printf("浮点型变量 '%s': %f", varname, GetSVarFloat(varname)); + } + case SERVER_VARTYPE_STRING: + { + new varstring[256]; + GetSVarString(varname, varstring); + + printf("字符串变量 '%s': %s", varname, varstring); + } + } + return 1; +} + +public OnGameModeInit() +{ + SetSVarInt("Version", 37); + + PrintSVar("Version"); // 输出:整型变量 'Version': 37 + return 1; +} +``` + +## 相关函数 + +- [SetSVarInt](SetSVarInt): 设置整型服务器变量 +- [GetSVarInt](GetSVarInt): 获取整型服务器变量 +- [SetSVarString](SetSVarString): 设置字符串型服务器变量 +- [GetSVarString](GetSVarString): 获取字符串型服务器变量 +- [SetSVarFloat](SetSVarFloat): 设置浮点型服务器变量 +- [GetSVarFloat](GetSVarFloat): 获取浮点型服务器变量 +- [DeleteSVar](DeleteSVar): 删除服务器变量 + +## 相关资源 + +- [服务器变量类型](../resources/svartypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarsUpperIndex.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarsUpperIndex.md new file mode 100644 index 00000000000..e3e7bc847aa --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSVarsUpperIndex.md @@ -0,0 +1,41 @@ +--- +title: GetSVarsUpperIndex +sidebar_label: GetSVarsUpperIndex +description: 获取服务器变量的最大索引值(每个服务器变量都有唯一的标识号用于查找,本函数返回当前最大索引值)。 +tags: ["服务器变量", "svar"] +--- + +## 描述 + +每个服务器变量(SVar)都有唯一的标识号用于查找,本函数返回当前已存在的最大索引值。 + +## 示例 + +```c +// 将最大索引值存入变量'SVarUpperIndex'并加1 +new SVarUpperIndex = GetSVarsUpperIndex() + 1; + +// 该变量用于统计已设置的服务器变量数量 +new sVarCount; + +new sVarName[128]; + +for(new i = 0; i != sVarUpperIndex; i++) // 遍历所有在最大索引值以下的服务器变量ID +{ + // 首先获取服务器变量名称 + GetSVarNameAtIndex(i, sVarName, sizeof(sVarName)); + + // 若变量已设置(类型非0),则计数加1 + if (GetSVarType(sVarName) != 0) + { + sVarCount ++; + } +} + +printf("当前共设置了 %i 个服务器变量。最大索引值(最高ID): %i.", sVarCount, SVarUpperIndex-1); +``` + +## 相关函数 + +- [GetSVarNameAtIndex](GetSVarNameAtIndex): 通过索引获取服务器变量名称 +- [GetSVarType](GetSVarType): 获取服务器变量类型 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerRuleFlags.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerRuleFlags.md new file mode 100644 index 00000000000..43911e738ed --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerRuleFlags.md @@ -0,0 +1,45 @@ +--- +title: GetServerRuleFlags +sidebar_label: GetServerRuleFlags +description: 获取服务器规则的标志位 +tags: ["规则"] +--- + + + +:::warning + +本函数暂未实现,请勿在生产环境使用 + +::: + +## 描述 + +获取指定服务器规则的标志位信息 + +## 返回值 + +返回服务器规则标志位 + +## 示例代码 + +```c +public OnGameModeInit() +{ + // 添加并配置Discord服务器规则 + AddServerRule("discord", "discord.gg/samp"); + SetServerRuleFlags("discord", 1); + + // 获取并打印规则标志位 + new E_SERVER_RULE_FLAGS:flags = GetServerRuleFlags("discord"); + printf("规则标志位: %d", _:flags); // 输出"规则标志位: 1" + return 1; +} +``` + +## 相关函数 + +- [AddServerRule](AddServerRule): 添加服务器规则 +- [RemoveServerRule](RemoveServerRule): 移除服务器规则 +- [IsValidServerRule](IsValidServerRule): 验证规则有效性 +- [SetServerRuleFlags](SetServerRuleFlags): 设置服务器规则标志位 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerTickRate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerTickRate.md new file mode 100644 index 00000000000..04a419343b4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerTickRate.md @@ -0,0 +1,20 @@ +--- +title: GetServerTickRate +sidebar_label: GetServerTickRate +description: 获取服务器的 Tick 速率(类似 FPS) +tags: [] +--- + +## 描述 + +获取服务器当前的 Tick 运行速率(即每秒逻辑更新次数) + +## 示例代码 + +```c +printf("当前服务器Tick速率为:%i", GetServerTickRate()); +``` + +## 相关函数 + +- [GetNetworkStats](GetNetworkStats): 获取服务器网络状态并保存到字符串 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsBool.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsBool.md new file mode 100644 index 00000000000..345dd164b62 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsBool.md @@ -0,0 +1,52 @@ +--- +title: GetServerVarAsBool +sidebar_label: GetServerVarAsBool +description: 获取服务器布尔型变量的值 +tags: [] +--- + +:::warning + +本函数自 0.3.7 R2 版本起已弃用,请使用[GetConsoleVarAsBool](GetConsoleVarAsBool) + +::: + +## 描述 + +获取服务器布尔型变量(true/false)的当前值 + +| 名称 | 说明 | +| --------------- | ------------------ | +| const varname[] | 目标布尔型变量名称 | + +## 返回值 + +指定服务器变量的布尔值。若变量非布尔类型或不存在返回 **0** + +## 示例代码 + +```c +public OnGameModeInit() +{ + // 检测服务器query功能是否启用 + new queryEnabled = GetServerVarAsBool("query"); + if (!queryEnabled) + { + print("警告:查询功能已禁用,服务器将不会显示在服务器列表中"); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +在服务器控制台输入'varlist'命令可查看所有可用变量及其类型 + +::: + +## 相关函数 + +- [GetServerVarAsString](GetServerVarAsString): 以字符串形式获取服务器变量 +- [GetServerVarAsInt](GetServerVarAsInt): 以整型数值获取服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsInt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsInt.md new file mode 100644 index 00000000000..4cf56363f56 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsInt.md @@ -0,0 +1,45 @@ +--- +title: GetServerVarAsInt +sidebar_label: GetServerVarAsInt +description: 获取服务器整型变量的值 +tags: [] +--- + +:::warning + +本函数自 0.3.7 R2 版本起已弃用,请使用[GetConsoleVarAsInt](GetConsoleVarAsInt) + +::: + +## 描述 + +获取服务器整型变量的当前数值 + +| 名称 | 说明 | +| --------------- | ---------------- | +| const varname[] | 目标整型变量名称 | + +## 返回值 + +指定服务器变量的整型数值。若变量非整型或不存在返回 **0** + +## 示例代码 + +```c +// 获取服务器端口配置 +new serverPort = GetServerVarAsInt("port"); +printf("服务器端口号:%i", serverPort); // 输出示例:"服务器端口号:7777" +``` + +## 注意事项 + +:::tip + +在服务器控制台输入'varlist'命令可查看所有可用变量及其类型 + +::: + +## 相关函数 + +- [GetServerVarAsString](GetServerVarAsString): 以字符串形式获取服务器变量 +- [GetServerVarAsBool](GetServerVarAsBool): 以布尔值形式获取服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsString.md new file mode 100644 index 00000000000..d96af971dd7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetServerVarAsString.md @@ -0,0 +1,62 @@ +--- +title: GetServerVarAsString +sidebar_label: GetServerVarAsString +description: 获取服务器变量的字符串值。 +tags: [] +--- + +:::warning + +该函数自 0.3.7 R2 版本起已弃用,请使用 GetConsoleVarAsString + +::: + +## 描述 + +获取服务器变量的字符串值。 + +| 参数名 | 说明 | +| --------------- | -------------------------------- | +| const varname[] | 要获取值的字符串变量名称 | +| buffer[] | 用于存储值的数组(通过引用传递) | +| len | 应存储的字符串长度 | + +## 返回值 + +返回字符串的长度。如果指定服务器变量不是字符串类型或不存在则返回 0。 + +## 示例 + +```c +public OnGameModeInit() +{ + new hostname[64]; + GetServerVarAsString("hostname", hostname, sizeof(hostname)); + printf("Hostname: %s", hostname); +} +``` + +## 注意事项 + +:::tip + +当变量名为 filterscripts 或 plugins 时,本函数仅返回第一个滤镜脚本或插件的名称。这是一个已知缺陷。 + +::: + +:::tip + +在服务器控制台输入 'varlist' 可显示可用服务器变量及其类型列表。 + +::: + +:::warning + +在非字符串类型变量(整型/布尔型/浮点型)或不存在变量上使用本函数将导致服务器崩溃!这是一个已知缺陷。 + +::: + +## 相关函数 + +- [GetServerVarAsInt](GetServerVarAsInt): 以整型获取服务器变量 +- [GetServerVarAsBool](GetServerVarAsBool): 以布尔值获取服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSpawnInfo.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSpawnInfo.md new file mode 100644 index 00000000000..7e76408bc51 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetSpawnInfo.md @@ -0,0 +1,75 @@ +--- +title: GetSpawnInfo +sidebar_label: GetSpawnInfo +description: 获取玩家的当前重生数据,即下一次重生的位置信息。 +tags: ["玩家"] +--- + + + +## 描述 + +获取玩家的当前重生数据,即下一次重生的位置信息。 + +| 参数名 | 说明 | +| --------------- | -------------------------------------- | +| playerid | 要获取重生信息的玩家 ID | +| &team | 存储队伍 ID 的变量(通过引用传递) | +| &skin | 存储皮肤 ID 的变量(通过引用传递) | +| &Float:spawnX | 存储 X 坐标的浮点变量(通过引用传递) | +| &Float:spawnY | 存储 Y 坐标的浮点变量(通过引用传递) | +| &Float:spawnZ | 存储 Z 坐标的浮点变量(通过引用传递) | +| &Float:angle | 存储面向角度的浮点变量(通过引用传递) | +| &WEAPON:weapon1 | 存储武器 1 的变量(通过引用传递) | +| &ammo1 | 存储弹药 1 的变量(通过引用传递) | +| &WEAPON:weapon2 | 存储武器 2 的变量(通过引用传递) | +| &ammo2 | 存储弹药 2 的变量(通过引用传递) | +| &WEAPON:weapon3 | 存储武器 3 的变量(通过引用传递) | +| &ammo3 | 存储弹药 3 的变量(通过引用传递) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定玩家未连接) + +## 示例 + +```c +public OnPlayerRequestClass(playerid, classid) +{ + SetSpawnInfo(playerid, NO_TEAM, 293, 1139.4786, -1761.3989, 13.5844, 0.0000, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); + + new + team, + skin, + Float:spawnX, + Float:spawnY, + Float:spawnZ, + Float:angle, + WEAPON:weapon1, + ammo1, + WEAPON:weapon2, + ammo2, + WEAPON:weapon3, + ammo3; + + GetSpawnInfo(playerid, team, skin, spawnX, spawnY, spawnZ, angle, weapon1, ammo1, weapon2, ammo2, weapon3, ammo3); + // team = NO_TEAM + // skin = 293 + // spawnX = 1139.4786 + // spawnY = -1761.3989 + // spawnZ = 13.5844 + // angle = 0.0000 + // weapon1 = WEAPON_SAWEDOFF + // ammo1 = 36 + // weapon2 = WEAPON_UZI + // ammo2 = 150 + // weapon3 = WEAPON_FIST + // ammo3 = 0 +} +``` + +## 相关函数 + +- [SetSpawnInfo](SetSpawnInfo): 用于修改指定玩家的重生信息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTickCount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTickCount.md new file mode 100644 index 00000000000..c29ef0786f5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTickCount.md @@ -0,0 +1,73 @@ +--- +title: GetTickCount +sidebar_label: GetTickCount +description: 返回一个每毫秒递增的数值。 +tags: ["时间"] +--- + +## 描述 + +返回一个每毫秒递增的数值。该数值的绝对值在不同系统中可能有差异,仅用于比较两个时间点的间隔。 + +## 示例 + +限制玩家每 10 秒(10000 毫秒)只能使用一次指令: + +```c +static gLastCommandUse[MAX_PLAYERS]; + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/limited") == 0) + { + if (GetTickCount() - gLastCommandUse[playerid] >= 10000) + { + // 时间间隔足够 + SendClientMessage(playerid, COLOUR_ERROR, "指令已执行!"); + gLastCommandUse[playerid] = GetTickCount(); + } + else + { + SendClientMessage(playerid, COLOUR_ERROR, "请等待冷却"); + } + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +`GetTickCount` 的有效差值范围约为 25 天(2147483647 毫秒)。只要事件间隔在此范围内,本函数能完美工作,但需注意整数溢出的情况: + +```c +new start = GetTickCount(); +// 长时间代码 +new end = GetTickCount(); +if (start + 2000 > end) +{ + // 代码执行时间小于两秒 +} +``` + +当`start`接近最大值时,计算可能产生溢出导致错误判断。建议改用以下安全方式: + +```c +new start = GetTickCount(); +// 长时间代码 +new end = GetTickCount(); +if (2000 > end - start) +{ + // 代码执行时间小于两秒 +} +``` + +通过调整比较顺序,可完全避免溢出问题。两种写法在模运算中等效,但后者更安全。 + +::: + +## 相关函数 + +- [Tickcount](Tickcount): 获取服务器的实际运行时间 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerInterval.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerInterval.md new file mode 100644 index 00000000000..7c6e738097c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerInterval.md @@ -0,0 +1,49 @@ +--- +title: GetTimerInterval +sidebar_label: GetTimerInterval +description: 获取定时器的间隔时间。 +tags: ["定时器"] +--- + + + +## 描述 + +获取定时器的间隔时间。 + +## 参数 + +| 参数名 | 说明 | +| ------- | ------------------------- | +| timerid | 要获取间隔时间的定时器 ID | + +## 返回值 + +返回定时器的间隔时间(单位:毫秒)。 + +## 示例 + +```c +new g_Timer; + +public OnGameModeInit() +{ + // 设置每分钟重复的定时器 + g_Timer = SetTimer("TimerCallback", 60000, true); + + // 获取并打印定时器间隔 + new interval = GetTimerInterval(g_Timer); + printf("定时器ID %d 间隔: %d 毫秒", g_Timer, interval); + return 1; +} +``` + +## 相关函数 + +- [SetTimer](SetTimer): 设置定时器 +- [SetTimerEx](SetTimerEx): 带参数设置定时器 +- [KillTimer](KillTimer): 终止定时器 +- [IsValidTimer](IsValidTimer): 验证定时器有效性 +- [IsRepeatingTimer](IsRepeatingTimer): 检测定时器是否循环 +- [GetTimerRemaining](GetTimerRemaining): 获取定时器剩余时间 +- [CountRunningTimers](CountRunningTimers): 统计运行中的定时器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerRemaining.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerRemaining.md new file mode 100644 index 00000000000..c1aa0774259 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetTimerRemaining.md @@ -0,0 +1,49 @@ +--- +title: GetTimerRemaining +sidebar_label: GetTimerRemaining +description: 获取定时器的剩余间隔时间。 +tags: ["定时器"] +--- + + + +## 描述 + +获取定时器的剩余间隔时间。 + +## 参数 + +| 参数名 | 说明 | +| ------- | ----------------------------- | +| timerid | 要获取剩余间隔时间的定时器 ID | + +## 返回值 + +返回定时器的剩余间隔时间(单位:毫秒)。 + +## 示例 + +```c +new g_Timer; + +public OnGameModeInit() +{ + // 设置每分钟重复的定时器 + g_Timer = SetTimer("TimerCallback", 60000, true); + + // 获取并打印剩余间隔时间 + new remainingInterval = GetTimerRemaining(g_Timer); + printf("定时器ID %d 剩余间隔时间: %d 毫秒", g_Timer, remainingInterval); + return 1; +} +``` + +## 相关函数 + +- [SetTimer](SetTimer): 设置定时器 +- [SetTimerEx](SetTimerEx): 带参数设置定时器 +- [KillTimer](KillTimer): 终止定时器 +- [IsValidTimer](IsValidTimer): 验证定时器有效性 +- [IsRepeatingTimer](IsRepeatingTimer): 检测定时器是否循环 +- [GetTimerInterval](GetTimerInterval): 获取定时器间隔时间 +- [CountRunningTimers](CountRunningTimers): 统计运行中的定时器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleCab.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleCab.md new file mode 100644 index 00000000000..468da7b2f56 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleCab.md @@ -0,0 +1,30 @@ +--- +title: GetVehicleCab +sidebar_label: GetVehicleCab +description: 获取连接到车辆的驾驶室ID +tags: ["车辆"] +--- + + + +## 描述 + +获取连接到车辆的驾驶室 ID + +| 参数名 | 说明 | +| --------- | --------------------- | +| vehicleid | 要获取驾驶室的车辆 ID | + +## 返回值 + +驾驶室对应的车辆 ID,若无连接则返回 **0** + +## 示例 + +```c +new cabId = GetVehicleCab(vehicleid); +``` + +## 相关函数 + +- [GetVehicleTrailer](GetVehicleTrailer): 获取连接到车辆的挂车 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleColours.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleColours.md new file mode 100644 index 00000000000..98b71a9a2c4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleColours.md @@ -0,0 +1,48 @@ +--- +title: GetVehicleColours +sidebar_label: GetVehicleColours +description: 获取车辆颜色 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆的主色和副色信息 + +## 参数说明 + +| 参数名 | 说明 | +| --------- | -------------------------------- | +| vehicleid | 目标车辆 ID | +| &colour1 | 存储主色值的变量(通过引用传递) | +| &colour2 | 存储副色值的变量(通过引用传递) | + +## 示例 + +```c +public OnGameModeInit() +{ + // 创建一辆Sultan车辆并设置颜色 + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + + new + colour1, + colour2; + + // 获取并存储车辆颜色值 + GetVehicleColours(vehicleid, colour1, colour2); + // colour1 = 6 (主色) + // colour2 = 0 (副色) + return 1; +} +``` + +## 相关函数 + +- [ChangeVehicleColours](ChangeVehicleColours): 更改车辆的主色和副色 + +## 相关资源 + +- [车辆颜色 ID 对照表](../resources/vehiclecolorid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentInSlot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentInSlot.md new file mode 100644 index 00000000000..51c59d6531f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentInSlot.md @@ -0,0 +1,73 @@ +--- +title: GetVehicleComponentInSlot +sidebar_label: GetVehicleComponentInSlot +description: 获取车辆指定改装槽位中安装的组件ID +tags: ["车辆"] +--- + +## 描述 + +获取车辆在特定改装槽位中已安装的组件 ID(改装店改装部件)。 + +| 参数名 | 说明 | +| --------------- | --------------------------------------------------------------- | +| vehicleid | 要检查改装组件的车辆 ID | +| CARMODTYPE:slot | [改装槽位类型](../resources/Componentslots)(需检查的组件槽位) | + +## 返回值 + +返回指定槽位中安装的组件 ID。 + +若车辆不存在或该槽位未安装组件,则返回 **0**。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/myspoiler", cmdtext, true)) + { + if (!IsPlayerInAnyVehicle(playerid)) + { + return 1; + } + + new + component = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_SPOILER); + + if (component == 1049) + { + SendClientMessage(playerid, -1, "你的Elegy安装了Alien尾翼!"); + } + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +已知缺陷: + +- 对 CARMODTYPE_STEREO 槽位无效 +- 前防撞杠和前保险杠组件都存储在 CARMODTYPE_FRONT_BUMPER 槽位,若同时安装仅返回最后安装的组件 +- 后防撞杠和后保险杠组件都存储在 CARMODTYPE_REAR_BUMPER 槽位,若同时安装仅返回最后安装的组件 +- 左右侧裙组件都存储在 CARMODTYPE_SIDESKIRT 槽位,若同时安装仅返回最后安装的组件 + +::: + +## 相关函数 + +- [AddVehicleComponent](AddVehicleComponent): 为车辆添加改装组件 +- [GetVehicleComponentType](GetVehicleComponentType): 通过组件 ID 获取其类型 + +## 相关回调 + +- [OnVehicleMod](../callbacks/OnVehicleMod): 当车辆被改装时触发 +- [OnEnterExitModShop](../callbacks/OnEnterExitModShop): 当车辆进出改装店时触发 + +## 相关资源 + +- [车辆改装槽位说明](../resources/Componentslots) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentType.md new file mode 100644 index 00000000000..bbf1cc9b518 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleComponentType.md @@ -0,0 +1,53 @@ +--- +title: GetVehicleComponentType +sidebar_label: GetVehicleComponentType +description: 根据组件ID获取其类型 +tags: ["车辆"] +--- + +## 描述 + +根据组件 ID 获取其对应的改装槽位类型 + +| 参数名 | 说明 | +| --------- | --------------- | +| component | 要检查的组件 ID | + +## 返回值 + +返回指定组件的槽位 ID,若组件无效则返回 **-1** + +## 示例 + +```c +public OnVehicleMod(playerid, vehicleid, componentid) +{ + new + CARMODTYPE:componentType = GetVehicleComponentType(componentid); + + if (componentType != CARMODTYPE_NONE) + { + new + string[64]; + + format(string, sizeof(string), "你在 %i 号槽位改装了车辆", componentType); + SendClientMessage(playerid, 0xFFFFFFFF, string); + } + else + { + SendClientMessage(playerid, 0xFF0000FF, "无效的改装组件"); + } + return 1; +} +``` + +## 相关函数 + +- [AddVehicleComponent](AddVehicleComponent): 为车辆添加改装组件 +- [RemoveVehicleComponent](RemoveVehicleComponent): 移除车辆改装组件 +- [GetVehicleComponentInSlot](GetVehicleComponentInSlot): 获取车辆指定槽位的组件 + +## 相关回调 + +- [OnVehicleMod](../callbacks/OnVehicleMod): 当车辆被改装时触发 +- [OnEnterExitModShop](../callbacks/OnEnterExitModShop): 当车辆进出改装店时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDamageStatus.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDamageStatus.md new file mode 100644 index 00000000000..22ec65974d9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDamageStatus.md @@ -0,0 +1,62 @@ +--- +title: GetVehicleDamageStatus +sidebar_label: GetVehicleDamageStatus +description: 获取车辆的损坏状态信息 +tags: ["车辆"] +--- + +:::tip + +有关处理车辆损坏值的实用函数,请参阅[此处](../resources/damagestatus)。 + +::: + +## 描述 + +获取车辆的损坏状态信息 + +| 参数名 | 说明 | +| --------------------------- | -------------------------------------- | +| vehicleid | 要获取损坏状态的车辆 ID | +| VEHICLE_PANEL_STATUS:panels | 存储面板损坏数据的变量(通过引用传递) | +| VEHICLE_DOOR_STATUS:doors | 存储车门损坏数据的变量(通过引用传递) | +| VEHICLE_LIGHT_STATUS:lights | 存储车灯损坏数据的变量(通过引用传递) | +| VEHICLE_TYRE_STATUS:tyres | 存储轮胎损坏数据的变量(通过引用传递) | + +## 返回值 + +**1** - 函数执行成功 + +**0** - 函数执行失败(指定车辆不存在) + +## 示例 + +```c +new + VEHICLE_PANEL_STATUS:panels, + VEHICLE_DOOR_STATUS:doors, + VEHICLE_LIGHT_STATUS:lights, + VEHICLE_TYRE_STATUS:tyres; + +GetVehicleDamageStatus(vehicleid, panels, doors, lights, tyres); +printf("车辆损坏状态: [面板]: %d - [车门]: %d - [车灯]: %d - [轮胎]: %d", panels, doors, lights, tyres); +``` + +## 相关函数 + +- [UpdateVehicleDamageStatus](UpdateVehicleDamageStatus): 更新车辆损坏状态 +- [SetVehicleHealth](SetVehicleHealth): 设置车辆健康值 +- [GetVehicleHealth](GetVehicleHealth): 获取车辆健康值 +- [RepairVehicle](RepairVehicle): 完全修复车辆 + +## 相关回调 + +- [OnVehicleDamageStatusUpdate](../callbacks/OnVehicleDamageStatusUpdate): 当车辆损坏状态变化时触发 + +## 相关资源 + +- [损坏状态处理](../resources/damagestatus) +- [车辆面板状态](../resources/vehicle-panel-status) +- [车辆车门状态](../resources/vehicle-door-status) +- [车辆灯光状态](../resources/vehicle-light-status) +- [车辆轮胎状态](../resources/vehicle-tire-status) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDistanceFromPoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDistanceFromPoint.md new file mode 100644 index 00000000000..0307583ef0d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDistanceFromPoint.md @@ -0,0 +1,48 @@ +--- +title: GetVehicleDistanceFromPoint +sidebar_label: GetVehicleDistanceFromPoint +description: 计算车辆与指定坐标点之间的距离(浮点型) +tags: ["车辆"] +--- + +## 描述 + +本函数用于计算车辆与指定地图坐标点之间的距离(浮点型),适用于检测车辆与某位置的间距。 + +| 参数名 | 说明 | +| --------- | ------------------- | +| vehicleid | 要计算距离的车辆 ID | +| Float:x | 目标点的 X 坐标 | +| Float:y | 目标点的 Y 坐标 | +| Float:z | 目标点的 Z 坐标 | + +## 返回值 + +返回车辆到指定坐标点的距离(浮点型) + +## 示例 + +```c +/* 当玩家在聊天框输入'vendingmachine'时触发此功能 */ +public OnPlayerText(playerid, text[]) +{ + if (strcmp(text, "vendingmachine", true) == 0) + { + new + string[64], + vehicleid = GetPlayerVehicleID(playerid); + + new + Float:distance = GetVehicleDistanceFromPoint(vehicleid, 237.9, 115.6, 1010.2); + + format(string, sizeof(string), "您距离自动售货机还有%.2f米。", distance); + SendClientMessage(playerid, 0xA9C4E4FF, string); + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerDistanceFromPoint](GetPlayerDistanceFromPoint): 获取玩家到点的距离 +- [GetVehiclePos](GetVehiclePos): 获取车辆坐标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDriver.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDriver.md new file mode 100644 index 00000000000..6a7c5ded059 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleDriver.md @@ -0,0 +1,42 @@ +--- +title: GetVehicleDriver +sidebar_label: GetVehicleDriver +description: 获取驾驶指定车辆的玩家ID +tags: ["车辆"] +--- + + + +## 描述 + +获取驾驶指定车辆的玩家 ID + +## 参数说明 + +| 参数名 | 说明 | +| --------- | --------------------- | +| vehicleid | 要获取驾驶员的车辆 ID | + +## 返回值 + +返回驾驶员 ID(玩家 ID) + +`INVALID_PLAYER_ID` - 表示车辆当前无驾驶员 + +## 示例 + +```c +public OnPlayerExitVehicle(playerid, vehicleid) +{ + new driverid = GetVehicleDriver(vehicleid); + if (driverid != INVALID_PLAYER_ID) + { + SendClientMessage(driverid, -1, "有人正在离开你的车辆。"); + } + return 1; +} +``` + +## 相关函数 + +- [GetVehicleLastDriver](GetVehicleLastDriver): 获取车辆最后驾驶员 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHealth.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHealth.md new file mode 100644 index 00000000000..540ef8f8cf4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHealth.md @@ -0,0 +1,73 @@ +--- +title: GetVehicleHealth +sidebar_label: GetVehicleHealth +description: 获取车辆的健康值 +tags: ["车辆"] +--- + +## 描述 + +获取车辆的健康值 + +| 参数名 | 说明 | +| ------------- | ------------------------------------ | +| vehicleid | 要获取健康值的车辆 ID | +| &Float:health | 存储健康值的浮点变量(通过引用传递) | + +## 返回值 + +**true** - 执行成功 + +**false** - 执行失败(无效的车辆 ID) + +实际健康值通过引用变量返回,非函数返回值本身。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/repair", true) == 0) + { + new + Float:vehicleHealth, + vehicleid = GetPlayerVehicleID(playerid); + + GetVehicleHealth(vehicleid, vehicleHealth); + + if (vehicleHealth > 500.0) + { + return SendClientMessage(playerid, COLOR_RED, "车辆无需修理!"); + } + + SetVehicleHealth(vehicleid, 1000.0); + SendClientMessage(playerid, COLOR_GREEN, "车辆已修复!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +车辆满血量为 1000,但更高的数值可以提升车辆耐久度。详细健康值说明请参阅[此处](../resources/vehiclehealth)。 + +::: + +:::tip + +当车辆健康值低于 250 时会起火,数秒后将爆炸。 + +::: + +## 相关函数 + +- [SetVehicleHealth](SetVehicleHealth): 设置车辆健康值 +- [GetPlayerHealth](GetPlayerHealth): 获取玩家生命值 +- [GetPlayerArmour](GetPlayerArmour): 获取玩家护甲值 + +## 相关资源 + +- [车辆健康值说明](../resources/vehiclehealth) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHydraReactorAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHydraReactorAngle.md new file mode 100644 index 00000000000..2651d9916c0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleHydraReactorAngle.md @@ -0,0 +1,28 @@ +--- +title: GetVehicleHydraReactorAngle +sidebar_label: GetVehicleHydraReactorAngle +description: 获取九头蛇战机推进器角度 +tags: ["车辆"] +--- + + + +## 描述 + +获取九头蛇战机的推进器角度 + +## 参数说明 + +| 参数名 | 说明 | +| --------- | ----------------- | +| vehicleid | 目标九头蛇战机 ID | + +## 示例 + +```c +new reactorAngle = GetVehicleHydraReactorAngle(vehicleid); +``` + +## 相关函数 + +- [GetPlayerHydraReactorAngle](GetPlayerHydraReactorAngle): 获取玩家九头蛇战机推进器角度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleInterior.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleInterior.md new file mode 100644 index 00000000000..7839e47c431 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleInterior.md @@ -0,0 +1,40 @@ +--- +title: GetVehicleInterior +sidebar_label: GetVehicleInterior +description: 获取车辆的室内空间ID。 +tags: ["车辆"] +--- + + + +## 描述 + +获取指定车辆的室内空间 ID。 + +## 参数 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 目标车辆的 ID。 | + +## 返回值 + +返回车辆的室内空间 ID。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + LinkVehicleToInterior(vehicleid, 15); + + new interiorid = GetVehicleInterior(vehicleid); + // interiorid = 15 + return 1; +} +``` + +## 相关函数 + +- [LinkVehicleToInterior](LinkVehicleToInterior): 将车辆链接到指定室内空间。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLandingGearState.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLandingGearState.md new file mode 100644 index 00000000000..e99526831c4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLandingGearState.md @@ -0,0 +1,32 @@ +--- +title: GetVehicleLandingGearState +sidebar_label: GetVehicleLandingGearState +description: 获取最近驾驶员的飞机当前起落架状态。 +tags: ["车辆"] +--- + + + +## 描述 + +获取最近驾驶员操作的飞机当前[起落架状态](../resources/landinggearstate)。 + +## 参数 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 目标飞机的 ID。 | + +## 示例代码 + +```c +new LANDING_GEAR_STATE:state = GetVehicleLandingGearState(vehicleid); +``` + +## 相关函数 + +- [GetPlayerLandingGearState](GetPlayerLandingGearState): 获取当前玩家所在飞机的起落架状态。 + +## 相关资源 + +- [飞机起落架状态说明](../resources/landinggearstate) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLastDriver.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLastDriver.md new file mode 100644 index 00000000000..36544ede800 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleLastDriver.md @@ -0,0 +1,52 @@ +--- +title: GetVehicleLastDriver +sidebar_label: GetVehicleLastDriver +description: 获取车辆的最后驾驶员。 +tags: ["车辆"] +--- + + + +## 描述 + +获取指定车辆的最后驾驶员。 + +## 参数 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 目标车辆的 ID。 | + +## 返回值 + +返回最后驾驶员的玩家 ID。 + +`INVALID_PLAYER_ID` - 表示该车辆没有最后驾驶员记录 + +## 示例代码 + +```c +new g_Vehicle; + +public OnGameModeInit() +{ + g_Vehicle = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); +} + +public OnGameModeExit() +{ + new lastDriver = GetVehicleLastDriver(g_Vehicle); + if (lastDriver != INVALID_PLAYER_ID) + { + printf("车辆ID %d 的最后驾驶员: %d", g_Vehicle, lastDriver); + } + else + { + printf("车辆ID %d 没有最后驾驶员记录", g_Vehicle); + } +} +``` + +## 相关函数 + +- [GetVehicleDriver](GetVehicleDriver): 获取当前驾驶车辆的玩家 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleMatrix.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleMatrix.md new file mode 100644 index 00000000000..5888648fae9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleMatrix.md @@ -0,0 +1,48 @@ +--- +title: GetVehicleMatrix +sidebar_label: GetVehicleMatrix +description: 获取车辆的实际旋转矩阵。 +tags: ["车辆"] +--- + + + +## 描述 + +获取指定车辆的实际旋转矩阵。 + +## 参数 + +| 参数名 | 说明 | +| ------------- | ---------------------------------------------- | +| vehicleid | 目标车辆的 ID。 | +| &Float:rightX | 用于存储 rightX 坐标的浮点变量(通过引用传递) | +| &Float:rightY | 用于存储 rightY 坐标的浮点变量(通过引用传递) | +| &Float:rightZ | 用于存储 rightZ 坐标的浮点变量(通过引用传递) | +| &Float:upX | 用于存储 upX 坐标的浮点变量(通过引用传递) | +| &Float:upY | 用于存储 upY 坐标的浮点变量(通过引用传递) | +| &Float:upZ | 用于存储 upZ 坐标的浮点变量(通过引用传递) | +| &Float:atX | 用于存储 atX 坐标的浮点变量(通过引用传递) | +| &Float:atY | 用于存储 atY 坐标的浮点变量(通过引用传递) | +| &Float:atZ | 用于存储 atZ 坐标的浮点变量(通过引用传递) | + +## 示例代码 + +```c +new + Float:rightX, + Float:rightY, + Float:rightZ, + Float:upX, + Float:upY, + Float:upZ, + Float:atX, + Float:atY, + Float:atZ; + +GetVehicleMatrix(vehicleid, rightX, rightY, rightZ, upX, upY, upZ, atX, atY, atZ); +``` + +## 相关函数 + +- [GetVehicleRotationQuat](GetVehicleRotationQuat): 以四元数形式返回车辆在所有轴上的旋转参数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModel.md new file mode 100644 index 00000000000..ca30906910b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModel.md @@ -0,0 +1,42 @@ +--- +title: GetVehicleModel +sidebar_label: GetVehicleModel +description: 获取车辆的模型ID。 +tags: ["车辆"] +--- + +## 描述 + +获取指定车辆的模型 ID。 + +| 参数名 | 说明 | +| --------- | --------------------- | +| vehicleid | 需要查询的目标车辆 ID | + +## 返回值 + +返回车辆的[模型 ID](../resources/vehicleid),若车辆不存在则返回 **0** + +## 示例代码 + +```c +public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) +{ + if (GetVehicleModel(vehicleid) == 411) // 411是Infernus车型 + { + SendClientMessage(playerid, 0xFFFFFFFF, "酷炫的Infernus!"); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerVehicleID](GetPlayerVehicleID): 获取玩家所在车辆的 ID +- [GetVehiclePos](GetVehiclePos): 获取车辆的坐标位置 +- [GetVehicleZAngle](GetVehicleZAngle): 获取车辆当前的水平旋转角度 +- [GetPlayerVehicleSeat](GetPlayerVehicleSeat): 检测玩家所在的车辆座位 + +## 相关资源 + +- [车辆模型 ID 对照表](../resources/vehicleid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelCount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelCount.md new file mode 100644 index 00000000000..9d64f9ea1ac --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelCount.md @@ -0,0 +1,37 @@ +--- +title: GetVehicleModelCount +sidebar_label: GetVehicleModelCount +description: 获取指定车辆模型的数量。 +tags: ["车辆"] +--- + + + +## 描述 + +获取指定车辆模型在服务器上的实例数量。 + +## 参数 + +| 参数名 | 说明 | +| ------- | ------------------------------------------- | +| modelid | 目标[车辆模型](../resources/vehicleid)的 ID | + +## 示例代码 + +```c +public OnGameModeInit() +{ + CreateVehicle(560, 2112.7607, -1308.3751, 23.6797, 90.0000, -1, -1, 100); + CreateVehicle(560, 2104.5730, -1308.3313, 23.6797, 90.0000, -1, -1, 100); + CreateVehicle(560, 2120.3616, -1308.4973, 23.6797, 90.0000, -1, -1, 100); + + new modelid = 560; + printf("车辆模型:%d - 数量:%d", modelid, GetVehicleModelCount(modelid)); // 车辆模型:560 - 数量:3 +} +``` + +## 相关函数 + +- [CreateVehicle](CreateVehicle): 创建一辆车辆 +- [GetVehicleModelsUsed](GetVehicleModelsUsed): 获取服务器上已使用的车辆模型数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelInfo.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelInfo.md new file mode 100644 index 00000000000..586b3b239bf --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelInfo.md @@ -0,0 +1,41 @@ +--- +title: GetVehicleModelInfo +sidebar_label: GetVehicleModelInfo +description: 获取特定车辆模型的详细信息,例如尺寸或座位位置 +tags: ["车辆"] +--- + +## 描述 + +获取特定车辆模型的详细信息,例如尺寸或座位位置 + +| 参数名 | 说明 | +| --------------------------- | ---------------------------------------------------------- | +| vehiclemodel | 需要查询的车辆模型 ID | +| VEHICLE_MODEL_INFO:infotype | 需要获取的[信息类型](../resources/vehicleinformationtypes) | +| &Float:x | 用于存储 X 轴数据的浮点变量 | +| &Float:y | 用于存储 Y 轴数据的浮点变量 | +| &Float:z | 用于存储 Z 轴数据的浮点变量 | + +## 返回值 + +车辆信息将被存储到指定的变量中。 + +## 示例代码 + +```c +new + Float: x, Float: y, Float: z; +// 获取411号车辆模型(Infernus)的尺寸 +GetVehicleModelInfo(411, VEHICLE_MODEL_INFO_SIZE, x, y, z); +// 控制台输出"Infernus的尺寸为:宽2.3米,长5.7米,高1.3米" +printf("Infernus的尺寸为:宽%.1f米,长%.1f米,高%.1f米", x, y, z); +``` + +## 相关函数 + +- [GetVehicleModel](GetVehicleModel): 获取车辆的模型 ID + +## 相关资源 + +- [车辆信息类型说明](../resources/vehicleinformationtypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelsUsed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelsUsed.md new file mode 100644 index 00000000000..30edf94be23 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleModelsUsed.md @@ -0,0 +1,25 @@ +--- +title: GetVehicleModelsUsed +sidebar_label: GetVehicleModelsUsed +description: 获取服务器上已使用的车辆模型数量。 +tags: ["车辆"] +--- + + + +## 描述 + +获取服务器上已使用的车辆模型数量。 + +## 示例 + +```c +public OnGameModeInit() +{ + printf("已使用车辆模型数: %d", GetVehicleModelsUsed()); +} +``` + +## 相关函数 + +- [GetVehicleModelCount](GetVehicleModelCount): 获取指定车辆模型的计数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleNumberPlate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleNumberPlate.md new file mode 100644 index 00000000000..92fb3cf91bc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleNumberPlate.md @@ -0,0 +1,39 @@ +--- +title: GetVehicleNumberPlate +sidebar_label: GetVehicleNumberPlate +description: 获取车辆的牌照号码。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆的牌照号码。 + +## 参数 + +| 参数名 | 说明 | +| -------------------- | ------------------------------------ | +| vehicleid | 车辆 ID | +| plate[] | 用于存储车牌号的数组,通过引用传递。 | +| len = sizeof (plate) | 应当存储的车牌字符长度。 | + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + SetVehicleNumberPlate(vehicleid, "ABCD 123"); + + new numberPlate[16]; + GetVehicleNumberPlate(vehicleid, numberPlate); + // numberPlate = "ABCD 123" + return 1; +} +``` + +## 相关函数 + +- [SetVehicleNumberPlate](SetVehicleNumberPlate): 设置车辆牌照 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleOccupiedTick.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleOccupiedTick.md new file mode 100644 index 00000000000..a8eb933e931 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleOccupiedTick.md @@ -0,0 +1,39 @@ +--- +title: GetVehicleOccupiedTick +sidebar_label: GetVehicleOccupiedTick +description: 获取车辆的占用时间。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆的占用时间。 + +## 参数 + +| 参数名 | 说明 | +| --------- | ------------------ | +| vehicleid | 目标车辆的 ID 编号 | + +## 返回值 + +返回以毫秒为单位的占用时长。 + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + new occupiedTick = GetVehicleOccupiedTick(vehicleid); + printf("车辆ID %d 占用时长: %d 毫秒", vehicleid, occupiedTick); + return 1; +} +``` + +## 相关函数 + +- [SetVehicleOccupiedTick](SetVehicleOccupiedTick): 设置车辆的占用时间 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePaintjob.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePaintjob.md new file mode 100644 index 00000000000..e8a42e509ea --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePaintjob.md @@ -0,0 +1,40 @@ +--- +title: GetVehiclePaintjob +sidebar_label: GetVehiclePaintjob +description: 获取车辆的涂装方案编号。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆当前的涂装方案编号。 + +## 参数 + +| 参数名 | 说明 | +| --------- | ------------------ | +| vehicleid | 目标车辆的 ID 编号 | + +## 返回值 + +返回[涂装方案编号](../resources/paintjobs)。 + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + ChangeVehiclePaintjob(vehicleid, 2); + + new paintjob = GetVehiclePaintjob(vehicleid); + // paintjob = 2 + return 1; +} +``` + +## 相关函数 + +- [ChangeVehiclePaintjob](ChangeVehiclePaintjob): 修改车辆涂装方案 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarDoors.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarDoors.md new file mode 100644 index 00000000000..aa386f7911e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarDoors.md @@ -0,0 +1,44 @@ +--- +title: GetVehicleParamsCarDoors +sidebar_label: GetVehicleParamsCarDoors +description: 获取车辆车门的当前状态。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆各个车门的当前开启状态 + +| 参数名 | 说明 | +| ---------------- | -------------------------------------------------- | +| vehicleid | 目标车辆 ID | +| &bool:frontLeft | 用于存储驾驶员侧车门状态的整型变量(按引用传递) | +| &bool:frontRight | 用于存储副驾驶侧车门状态的整型变量(按引用传递) | +| &bool:rearLeft | 用于存储左后车门状态的整型变量(若车辆存在该车门) | +| &bool:rearRight | 用于存储右后车门状态的整型变量(若车辆存在该车门) | + +## 返回值 + +车辆的车门状态将被存储到指定的变量中。 + +## 注意事项 + +:::tip + +各变量返回值对应状态: + +**-1**: 未设置车门状态 + +**1**: 开启状态 + +**0**: 关闭状态 + +::: + +## 相关函数 + +- [SetVehicleParamsCarDoors](SetVehicleParamsCarDoors): 控制车辆车门的开关状态 +- [SetVehicleParamsCarWindows](SetVehicleParamsCarWindows): 控制车辆车窗的开关状态 +- [GetVehicleParamsCarWindows](GetVehicleParamsCarWindows): 获取车辆车窗的当前状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarWindows.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarWindows.md new file mode 100644 index 00000000000..f0f8b68137a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsCarWindows.md @@ -0,0 +1,44 @@ +--- +title: GetVehicleParamsCarWindows +sidebar_label: GetVehicleParamsCarWindows +description: 获取车辆车窗的当前状态。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆各个车窗的当前开启状态 + +| 参数名 | 说明 | +| ---------------- | -------------------------------------------------- | +| vehicleid | 目标车辆 ID | +| &bool:frontLeft | 用于存储驾驶员侧车窗状态的整型变量(按引用传递) | +| &bool:frontRight | 用于存储副驾驶侧车窗状态的整型变量(按引用传递) | +| &bool:rearLeft | 用于存储左后车窗状态的整型变量(若车辆存在该车窗) | +| &bool:rearRight | 用于存储右后车窗状态的整型变量(若车辆存在该车窗) | + +## 返回值 + +车辆的车窗状态将被存储到指定的变量中。 + +## 注意事项 + +:::tip + +各变量返回值对应状态: + +**-1**: 未设置车窗状态(通常为关闭状态,除非显式设置为-1) + +**0**: 开启状态 + +**1**: 关闭状态 + +::: + +## 相关函数 + +- [SetVehicleParamsCarWindows](SetVehicleParamsCarWindows): 控制车辆车窗的开关状态 +- [GetVehicleParamsCarDoors](GetVehicleParamsCarDoors): 获取车辆车门的当前状态 +- [SetVehicleParamsCarDoors](SetVehicleParamsCarDoors): 控制车辆车门的开关状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsEx.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsEx.md new file mode 100644 index 00000000000..c8eb255a789 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsEx.md @@ -0,0 +1,50 @@ +--- +title: GetVehicleParamsEx +sidebar_label: GetVehicleParamsEx +description: 获取车辆的扩展参数。 +tags: ["车辆"] +--- + +## 描述 + +获取车辆的扩展参数集。 + +| 参数名 | 说明 | +| --------------- | -------------------------------------------------------------------- | +| vehicleid | 目标车辆 ID | +| &bool:engine | 存储引擎状态的布尔变量(按引用传递),1 表示引擎处于运行状态 | +| &bool:lights | 存储车灯状态的布尔变量(按引用传递),1 表示车灯开启 | +| &bool:alarm | 存储警报器状态的布尔变量(按引用传递),1 表示警报正在(或曾)鸣响 | +| &bool:doors | 存储车门锁状态的布尔变量(按引用传递),1 表示车门已上锁 | +| &bool:bonnet | 存储引擎盖状态的布尔变量(按引用传递),1 表示引擎盖开启 | +| &bool:boot | 存储后备箱状态的布尔变量(按引用传递),1 表示后备箱开启 | +| &bool:objective | 存储任务目标状态的布尔变量(按引用传递),1 表示任务目标处于激活状态 | + +## 返回值 + +**true** - 操作成功 + +**false** - 操作失败(无效的车辆 ID) + +车辆参数实际存储于通过引用传递的变量中,而非通过返回值获取。 + +## 示例 + +```c +new + bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective; +GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); +// 该操作将使上述所有变量更新为对应部件的状态值 +``` + +## 注意事项 + +:::tip + +若参数未被预先设置(即未使用 SetVehicleParamsEx 进行设置),返回值将为-1('未设置'状态) + +::: + +## 相关函数 + +- [SetVehicleParamsEx](SetVehicleParamsEx): 为所有玩家设置车辆的扩展参数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsSirenState.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsSirenState.md new file mode 100644 index 00000000000..de33964b4dc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleParamsSirenState.md @@ -0,0 +1,56 @@ +--- +title: GetVehicleParamsSirenState +sidebar_label: GetVehicleParamsSirenState +description: 获取车辆警笛的开关状态。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆警笛的当前开关状态。 + +| 参数名 | 说明 | +| --------- | ---------------------------- | +| vehicleid | 要检测警笛状态的车辆 ID 编号 | + +## 返回值 + +**-1:** 车辆警笛尚未被设置(默认关闭状态) + +**0:** 警笛处于关闭状态 + +**1:** 警笛处于开启状态 + +## 示例 + +```c +new + siren = GetVehicleParamsSirenState(vehicleid); + +if (siren == 1) +{ + // 警笛开启,执行相关操作 +} +else if (siren == 0) +{ + // 警笛关闭,执行相关操作 +} +else +{ + // 该车辆未配置警笛系统 +} +``` + +## 注意事项 + +:::warning + +由于返回值-1 和 0 均表示"关闭",不能直接使用布尔条件判断。若使用类似 if(sirenstate) 的判断语句,当值为-1 或 1 时都会返回 true。正确的做法是明确检查返回值是否等于 1。 + +::: + +## 相关函数 + +- [SetVehicleParamsSirenState](SetVehicleParamsSirenState): 控制车辆警笛的开关状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePoolSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePoolSize.md new file mode 100644 index 00000000000..ac4aefe46b1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePoolSize.md @@ -0,0 +1,29 @@ +--- +title: GetVehiclePoolSize +sidebar_label: GetVehiclePoolSize +description: 获取服务器当前使用的最大车辆ID。 +tags: ["车辆"] +--- + + + +## 描述 + +获取服务器当前已使用的最大车辆 ID 编号。注意在 SA-MP 中该函数存在缺陷,即使没有车辆时也会返回`0`。open.mp 已修正此问题,无车辆时返回`-1`,但建议改用`MAX_VEHICLES`或`foreach`替代方案。 + +## 示例 + +```c +RepairAllVehicles() +{ + // 车辆ID从1开始计数 + for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++) + { + RepairVehicle(i); + } +} +``` + +## 相关函数 + +- [GetPlayerPoolSize](GetPlayerPoolSize): 获取当前连接服务器的最大玩家 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePos.md new file mode 100644 index 00000000000..4bdcf1eafd5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehiclePos.md @@ -0,0 +1,59 @@ +--- +title: GetVehiclePos +sidebar_label: GetVehiclePos +description: 获取车辆的坐标位置。 +tags: ["车辆"] +--- + +## 描述 + +获取车辆的三维坐标位置。 + +| 参数名 | 说明 | +| --------- | --------------------------------------- | +| vehicleid | 目标车辆 ID | +| &Float:x | 存储 X 坐标的浮点型变量(通过引用传递) | +| &Float:y | 存储 Y 坐标的浮点型变量(通过引用传递) | +| &Float:z | 存储 Z 坐标的浮点型变量(通过引用传递) | + +## 返回值 + +**true** - 操作成功 + +**false** - 操作失败(指定车辆不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/vehpos", true) == 0) + { + new vehicleid = GetPlayerVehicleID(playerid); + + // 检测玩家是否处于车辆内 + if (vehicleid == 0) + { + return SendClientMessage(playerid, -1, "您当前未处于任何车辆中!"); + } + + new + Float:vehX, Float:vehY, Float:vehZ, + string[128]; + + GetVehiclePos(vehicleid, vehX, vehY, vehZ); + format(string, sizeof(string), "当前车辆坐标:X=%f Y=%f Z=%f", vehX, vehY, vehZ); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; + } + + return 0; +} +``` + +## 相关函数 + +- [GetVehicleDistanceFromPoint](GetVehicleDistanceFromPoint): 获取车辆与指定坐标点之间的距离 +- [SetVehiclePos](SetVehiclePos): 设置车辆坐标位置 +- [GetVehicleZAngle](GetVehicleZAngle): 获取车辆水平旋转角度 +- [GetVehicleRotationQuat](GetVehicleRotationQuat): 获取车辆旋转四元数值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnDelay.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnDelay.md new file mode 100644 index 00000000000..1fa1b89685c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnDelay.md @@ -0,0 +1,35 @@ +--- +title: GetVehicleRespawnDelay +sidebar_label: GetVehicleRespawnDelay +description: 获取车辆的重生延迟时间。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆当前设置的重生延迟时间(单位:秒)。 + +## 参数 + +| 参数名 | 说明 | +| --------- | ------------------ | +| vehicleid | 目标车辆的 ID 编号 | + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + new respawnDelay = GetVehicleRespawnDelay(vehicleid); + // 重生延迟时间 = 60 秒 + return 1; +} +``` + +## 相关函数 + +- [SetVehicleRespawnDelay](SetVehicleRespawnDelay): 设置车辆的重生延迟时间 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnTick.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnTick.md new file mode 100644 index 00000000000..df96f58adf6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRespawnTick.md @@ -0,0 +1,39 @@ +--- +title: GetVehicleRespawnTick +sidebar_label: GetVehicleRespawnTick +description: 获取车辆的重生计时。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆当前的重生计时(单位:毫秒)。 + +## 参数 + +| 参数名 | 说明 | +| --------- | ------------------ | +| vehicleid | 目标车辆的 ID 编号 | + +## 返回值 + +返回以毫秒为单位的重生剩余时间。 + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + new respawnTick = GetVehicleRespawnTick(vehicleid); + printf("车辆ID %d 重生倒计时: %d 毫秒", vehicleid, respawnTick); + return 1; +} +``` + +## 相关函数 + +- [SetVehicleRespawnTick](SetVehicleRespawnTick): 设置车辆的重生计时 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRotationQuat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRotationQuat.md new file mode 100644 index 00000000000..31c1166b4c2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleRotationQuat.md @@ -0,0 +1,53 @@ +--- +title: GetVehicleRotationQuat +sidebar_label: GetVehicleRotationQuat +description: 获取车辆的四元数旋转参数。 +tags: ["车辆"] +--- + +## 描述 + +获取车辆基于四元数(Quaternion)的三维旋转参数。 + +| 参数名 | 说明 | +| --------- | --------------------------------------------- | +| vehicleid | 目标车辆 ID | +| &Float:w | 存储四元数 w 分量的浮点型变量(通过引用传递) | +| &Float:x | 存储四元数 x 分量的浮点型变量(通过引用传递) | +| &Float:y | 存储四元数 y 分量的浮点型变量(通过引用传递) | +| &Float:z | 存储四元数 z 分量的浮点型变量(通过引用传递) | + +## 返回值 + +**true** - 操作成功执行 + +**false** - 操作执行失败(指定车辆不存在) + +车辆的四元数旋转参数将被存储至指定的变量中。 + +## 示例 + +```c +new + Float:w, + Float:x, + Float:y, + Float:z; + +GetVehicleRotationQuat(vehicleid, w, x, y, z); +``` + +## 注意事项 + +:::tip + +- 本函数没有对应的设置方法(只能通过 SetVehicleZAngle 设置 Z 轴角度) +- 对于无人驾驶的车辆,本函数可能返回不准确数值。原因是当车辆未被占用时,其内部旋转矩阵的第三行数据可能损坏 + +::: + +## 相关函数 + +- [GetVehicleZAngle](GetVehicleZAngle): 获取车辆 Z 轴水平旋转角度 +- [GetVehicleRotation](GetVehicleRotation): 获取车辆的三轴旋转角度 +- [GetVehicleMatrix](GetVehicleMatrix): 获取车辆的实际旋转矩阵数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSeats.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSeats.md new file mode 100644 index 00000000000..f4bdfb48fd1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSeats.md @@ -0,0 +1,36 @@ +--- +title: GetVehicleSeats +sidebar_label: GetVehicleSeats +description: 获取车辆的座位数量。 +tags: ["车辆"] +--- + + + +## 描述 + +获取指定车辆模型的座位数量。 + +| 参数名 | 说明 | +| ------- | ----------------- | +| modelid | 目标车辆的模型 ID | + +## 返回值 + +成功返回座位数量,若模型 ID 无效则返回**255**。 + +## 示例 + +```c +new vehicleid = GetPlayerVehicleID(playerid); +new modelid = GetVehicleModel(vehicleid); +new seats = GetVehicleSeats(modelid); + +new string[64]; +format(string, sizeof(string), "当前车辆座位数: %d", seats); +SendClientMessage(playerid, -1, string); +``` + +## 相关函数 + +- [PutPlayerInVehicle](PutPlayerInVehicle): 将玩家放入车辆中 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSirenState.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSirenState.md new file mode 100644 index 00000000000..e6f8c5d8405 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSirenState.md @@ -0,0 +1,41 @@ +--- +title: GetVehicleSirenState +sidebar_label: GetVehicleSirenState +description: 获取车辆的警笛开关状态。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆当前警笛的启用状态。 + +## 参数 + +| 参数名 | 说明 | +| --------- | ------------------ | +| vehicleid | 目标车辆的 ID 编号 | + +## 返回值 + +返回布尔值表示警笛状态:**true** 开启 / **false** 关闭 + +## 示例 + +```c +public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) +{ + new bool:sirenState = GetVehicleSirenState(vehicleid); + + SendClientMessage(playerid, 0xFFFF00FF, "警笛状态: %s", sirenState ? "开启" : "关闭"); + return 1; +} +``` + +## 相关函数 + +- [SetVehicleParamsSirenState](SetVehicleParamsSirenState): 设置车辆警笛的开关状态 +- [ToggleVehicleSirenEnabled](ToggleVehicleSirenEnabled): 切换车辆警笛的启用状态 +- [IsVehicleSirenEnabled](IsVehicleSirenEnabled): 检测车辆警笛是否处于开启状态 +- [GetPlayerSirenState](GetPlayerSirenState): 获取玩家当前车辆的警笛状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSpawnInfo.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSpawnInfo.md new file mode 100644 index 00000000000..b24d959589b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleSpawnInfo.md @@ -0,0 +1,49 @@ +--- +title: GetVehicleSpawnInfo +sidebar_label: GetVehicleSpawnInfo +description: 获取车辆的生成位置与颜色参数。 +tags: ["车辆"] +--- + + + +## 描述 + +获取车辆的重生坐标位置与涂装颜色配置。 + +## 参数 + +| 参数名 | 说明 | +| ------------- | ----------------------------------------- | +| vehicleid | 目标车辆 ID | +| &Float:spawnX | 存储重生点 X 坐标的浮点变量(按引用传递) | +| &Float:spawnY | 存储重生点 Y 坐标的浮点变量(按引用传递) | +| &Float:spawnZ | 存储重生点 Z 坐标的浮点变量(按引用传递) | +| &Float:angle | 存储重生角度的浮点变量(按引用传递) | +| &colour1 | 存储主色调编号的整型变量(按引用传递) | +| &colour2 | 存储副色调编号的整型变量(按引用传递) | + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + + new + Float:spawnX, + Float:spawnY, + Float:spawnZ, + Float:angle, + colour1, + colour2; + + GetVehicleSpawnInfo(vehicleid, spawnX, spawnY, spawnZ, angle, colour1, colour2); + // 获取生成信息 + return 1; +} +``` + +## 相关函数 + +- [SetVehicleSpawnInfo](SetVehicleSpawnInfo): 设置车辆型号、重生坐标、涂装颜色、重生延迟与所属场景 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTower.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTower.md new file mode 100644 index 00000000000..c9dde48fa09 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTower.md @@ -0,0 +1,34 @@ +--- +title: GetVehicleTower +sidebar_label: GetVehicleTower +description: 获取车辆连接的驾驶室ID(已弃用) +tags: ["车辆"] +--- + +:::warning + +该函数已弃用,请使用[获取车辆驾驶室](GetVehicleCab)函数替代。 + +::: + +## 描述 + +获取与车辆连接的驾驶室单元 ID。 + +| 参数名 | 说明 | +| --------- | --------------------------- | +| vehicleid | 需要查询驾驶室的目标车辆 ID | + +## 返回值 + +成功返回驾驶室的车辆 ID,若未连接驾驶室则返回**0** + +## 示例 + +```c +new cabId = GetVehicleTower(vehicleid); +``` + +## 相关函数 + +- [GetVehicleTrailer](GetVehicleTrailer): 获取车辆连接的拖车 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrailer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrailer.md new file mode 100644 index 00000000000..9e80941fb49 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrailer.md @@ -0,0 +1,40 @@ +--- +title: GetVehicleTrailer +sidebar_label: GetVehicleTrailer +description: 获取车辆所连接拖车的ID编号。 +tags: ["车辆"] +--- + +## 描述 + +获取与当前车辆连接的拖车单元 ID。 + +| 参数名 | 说明 | +| --------- | ----------------------------- | +| vehicleid | 需要查询拖车连接的目标车辆 ID | + +## 返回值 + +成功返回拖车的车辆 ID 编号,若未连接拖车则返回**0** + +## 示例 + +```c +new + trailerId = GetVehicleTrailer(vehicleid); +DetachTrailerFromVehicle(trailerId); +``` + +## 注意事项 + +:::warning + +该函数不适用于火车类轨道车辆 + +::: + +## 相关函数 + +- [AttachTrailerToVehicle](AttachTrailerToVehicle): 将拖车连接到指定车辆 +- [DetachTrailerFromVehicle](DetachTrailerFromVehicle): 从车辆分离已连接的拖车 +- [IsTrailerAttachedToVehicle](IsTrailerAttachedToVehicle): 检测拖车是否连接到车辆 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrainSpeed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrainSpeed.md new file mode 100644 index 00000000000..6e10838facc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleTrainSpeed.md @@ -0,0 +1,31 @@ +--- +title: GetVehicleTrainSpeed +sidebar_label: GetVehicleTrainSpeed +description: 获取列车的当前行驶速度。 +tags: ["车辆"] +--- + + + +## 描述 + +获取列车类车辆的实时运行速度。 + +## 参数 + +| 参数名 | 说明 | +| --------- | ---------------------- | +| vehicleid | 目标列车车辆的 ID 编号 | + +## 示例 + +```c +new vehicleid = GetPlayerVehicleID(playerid); + +new Float:speed = GetVehicleTrainSpeed(vehicleid); +``` + +## 相关函数 + +- [GetPlayerTrainSpeed](GetPlayerTrainSpeed): 获取玩家当前驾驶的列车速度 +- [SetVehicleTrainSpeed](SetVehicleTrainSpeed): 设置轨道列车的运行速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVelocity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVelocity.md new file mode 100644 index 00000000000..9046c2ffcf7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVelocity.md @@ -0,0 +1,65 @@ +--- +title: GetVehicleVelocity +sidebar_label: GetVehicleVelocity +description: 获取车辆在XYZ轴上的三维速度。 +tags: ["车辆"] +--- + +## 描述 + +获取车辆在三维空间中的运动速度分量。 + +| 参数名 | 说明 | +| --------- | ------------------------------------------- | +| vehicleid | 目标车辆 ID | +| &Float:x | 存储 X 轴速度分量的浮点变量(通过引用传递) | +| &Float:y | 存储 Y 轴速度分量的浮点变量(通过引用传递) | +| &Float:z | 存储 Z 轴速度分量的浮点变量(通过引用传递) | + +## 返回值 + +**true** - 操作成功执行 + +**false** - 操作执行失败(指定车辆不存在) + +车辆的三维速度分量将被存储至指定变量。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/GetMyCarVelocity", cmdtext)) + { + if (!IsPlayerInAnyVehicle(playerid)) + { + return 1; + } + + new + Float: vehVelocity[3], + string[128]; + + GetVehicleVelocity(GetPlayerVehicleID(playerid), vehVelocity[0], vehVelocity[1], vehVelocity[2]); + + format(string, sizeof(string), "当前三维速度:X%.2f Y%.2f Z%.2f", vehVelocity[0], vehVelocity[1], vehVelocity[2]); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +本函数可配合公式计算车辆的实际移动速度(单位:千米/小时 或 米/秒) + +::: + +## 相关函数 + +- [SetVehicleVelocity](SetVehicleVelocity): 设置车辆的三维速度 +- [SetPlayerVelocity](SetPlayerVelocity): 设置玩家的三维速度 +- [GetPlayerVelocity](GetPlayerVelocity): 获取玩家的三维速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVirtualWorld.md new file mode 100644 index 00000000000..a4a8d229f77 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleVirtualWorld.md @@ -0,0 +1,31 @@ +--- +title: GetVehicleVirtualWorld +sidebar_label: GetVehicleVirtualWorld +description: 获取车辆所在的虚拟世界编号。 +tags: ["车辆"] +--- + +## 描述 + +获取车辆当前所处的虚拟世界编号。 + +| 参数名 | 说明 | +| --------- | ------------------ | +| vehicleid | 目标车辆的 ID 编号 | + +## 返回值 + +返回整型数值表示车辆所在的虚拟世界编号 + +## 示例 + +```c +new + vehicleWorld = GetVehicleVirtualWorld(vehicleid); +SetPlayerVirtualWorld(playerid, vehicleWorld); +``` + +## 相关函数 + +- [SetVehicleVirtualWorld](SetVehicleVirtualWorld): 设置车辆所处的虚拟世界 +- [GetPlayerVirtualWorld](GetPlayerVirtualWorld): 获取玩家当前所在的虚拟世界编号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleZAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleZAngle.md new file mode 100644 index 00000000000..6e9ec9128d9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicleZAngle.md @@ -0,0 +1,55 @@ +--- +title: GetVehicleZAngle +sidebar_label: GetVehicleZAngle +description: 获取车辆在Z轴(水平方向)的旋转角度。 +tags: ["车辆"] +--- + +## 描述 + +获取车辆在 Z 轴(偏航角)的水平旋转角度。 + +| 参数名 | 说明 | +| ------------ | ------------------------------------------- | +| vehicleid | 目标车辆 ID | +| &Float:angle | 存储 Z 轴旋转角度的浮点变量(通过引用传递) | + +## 返回值 + +**true** - 操作成功执行 + +**false** - 操作执行失败(指定车辆不存在) + +车辆的旋转角度将被存储至指定变量。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/vehrot", true) == 0) + { + new + vehicleid, + Float:rotZ, + string[64]; + + vehicleid = GetPlayerVehicleID(playerid); + + GetVehicleZAngle(vehicleid, rotZ); + + format(string, sizeof(string), "当前车辆旋转角度:%.0f度", rotZ); + SendClientMessage(playerid, 0xFFFFFFFF, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GetVehicleRotationQuat](GetVehicleRotationQuat): 获取车辆的四元数旋转参数 +- [SetVehicleZAngle](SetVehicleZAngle): 设置车辆的水平朝向角度 +- [GetVehiclePos](GetVehiclePos): 获取车辆的三维坐标位置 +- [GetVehicleMatrix](GetVehicleMatrix): 获取车辆的实际旋转矩阵 +- [GetPlayerFacingAngle](GetPlayerFacingAngle): 获取玩家的水平朝向角度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicles.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicles.md new file mode 100644 index 00000000000..fb0e048209f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetVehicles.md @@ -0,0 +1,35 @@ +--- +title: GetVehicles +sidebar_label: GetVehicles +description: 获取服务器上已创建车辆的ID数组。 +tags: ["车辆"] +--- + + + +## 描述 + +获取服务器上所有已生成车辆的 ID 数组变量。 + +| 参数名 | 说明 | +| ---------- | -------------------------------------- | +| vehicles[] | 用于存储车辆 ID 的数组(通过引用传递) | +| size | 目标数组的容量大小 | + +## 返回值 + +返回数组中实际存储的车辆数量。 + +## 示例 + +```c +new vehicles[MAX_VEHICLES]; + +GetVehicles(vehicles, sizeof(vehicles)); +// `vehicles` 数组现在包含已创建的车辆ID。{ 0, 1, 2, 3, 4, ... } +``` + +## 相关函数 + +- [GetPlayers](GetPlayers): 获取当前在线玩家的 ID 数组 +- [GetActors](GetActors): 获取服务器上已创建角色的 ID 数组 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponName.md new file mode 100644 index 00000000000..d43ddcf42ba --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponName.md @@ -0,0 +1,62 @@ +--- +title: GetWeaponName +sidebar_label: GetWeaponName +description: 获取武器的名称。 +tags: [] +--- + +## 描述 + +获取指定武器的名称。 + +| 参数名 | 说明 | +| --------------------- | ----------------------------------------------------- | +| WEAPON:weaponid | 武器的 ID 编号 | +| weapon[] | 存储武器名称的数组(按引用传递) | +| len = sizeof (weapon) | 应存储的武器名称最大长度(通常使用 sizeof(name)获取) | + +## 返回值 + +**true** - 操作成功执行 + +**false** - 操作执行失败(指定武器不存在) + +武器的名称将被存储到指定数组中。 + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 变量声明,killerName默认值为"World" + new + weaponName[32], + string[64], + playerName[MAX_PLAYER_NAME], + killerName[MAX_PLAYER_NAME] = "World"; + + // 获取武器/击杀原因及玩家昵称 + GetWeaponName(reason, weaponName, sizeof(weaponName)); + GetPlayerName(playerid, playerName, sizeof(playerName)); + + // 检测玩家是否被其他玩家击杀 + if (killerid != INVALID_PLAYER_ID) + { + // 清空killerName字符串 + killerName[0] = EOS; + // 获取击杀者名称 + GetPlayerName(killerid, killerName, sizeof(killerName)); + } + + // 向全局聊天发送死亡信息 + format(string, sizeof(string), "%s (%i) 使用 %s 击杀了 %s (%i)", killerName, killerid, playerName, playerid, weaponName); + SendClientMessageToAll(0xFFFFFFAA, string); + return 1; +} +``` + +## 相关函数 + +- [GetPlayerWeapon](GetPlayerWeapon): 获取玩家当前持有的武器 +- [AllowInteriorWeapons](AllowInteriorWeapons): 设置室内是否允许使用武器 +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家指定武器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponSlot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponSlot.md new file mode 100644 index 00000000000..b02bae1be45 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeaponSlot.md @@ -0,0 +1,49 @@ +--- +title: GetWeaponSlot +sidebar_label: GetWeaponSlot +description: 获取武器的槽位编号。 +tags: ["武器"] +--- + + + +## 描述 + +获取指定武器对应的槽位编号。 + +| 参数名 | 说明 | +| --------------- | ------------------ | +| WEAPON:weaponid | 目标武器的 ID 编号 | + +## 返回值 + +返回对应的[武器槽位](../resources/weaponslots)编号(0 - 12) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/weaponslot", true) == 0) + { + new WEAPON:weaponid = GetPlayerWeapon(playerid); // 存储玩家当前手持武器的ID + new WEAPON_SLOT:slot = GetWeaponSlot(weaponid); // 存储武器对应的槽位编号 + SendClientMessage(playerid, -1, "当前武器占用槽位:%d", slot); // 向玩家发送格式化消息 + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerWeapon](GetPlayerWeapon): 获取玩家当前持有的武器 ID +- [GetPlayerWeaponData](GetPlayerWeaponData): 获取玩家指定槽位的武器及弹药数据(例如 SMG 槽位) +- [GetPlayerAmmo](GetPlayerAmmo): 获取玩家当前武器的剩余弹药量 +- [SetPlayerArmedWeapon](SetPlayerArmedWeapon): 设置玩家切换至已持有的指定武器 +- [ResetPlayerWeapon](ResetPlayerWeapons): 清空玩家所有武器 +- [RemovePlayerWeapon](RemovePlayerWeapon): 移除玩家持有的指定武器 + +## 相关资源 + +- [武器槽位系统](../resources/weaponslots) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeather.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeather.md new file mode 100644 index 00000000000..50bebdaf680 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWeather.md @@ -0,0 +1,31 @@ +--- +title: GetWeather +sidebar_label: GetWeather +description: 获取当前全局天气。 +tags: [] +--- + + + +## 描述 + +获取服务器当前的全局天气状态。 + +## 示例 + +```c +SetWeather(19); + +printf("当前全局天气:%d", GetWeather()); +// 输出将为"当前全局天气:19" +``` + +## 相关函数 + +- [SetWeather](SetWeather): 为所有玩家设置全局天气 +- [GetPlayerWeather](GetPlayerWeather): 获取玩家个人天气设置 +- [SetPlayerWeather](SetPlayerWeather): 设置玩家独立天气效果 + +## 相关资源 + +- [天气 ID 对照表](../resources/weatherid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWorldTime.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWorldTime.md new file mode 100644 index 00000000000..a3fc29710da --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetWorldTime.md @@ -0,0 +1,26 @@ +--- +title: GetWorldTime +sidebar_label: GetWorldTime +description: 获取当前世界时间。 +tags: ["世界时间"] +--- + + + +## 描述 + +获取服务器当前的全局世界时间。 + +## 示例 + +```c +SetWorldTime(12); + +printf("当前世界时间:%d", GetWorldTime()); +// 输出将为"当前世界时间:12" +``` + +## 相关函数 + +- [SetWorldTime](SetWorldTime): 为所有玩家设置全局时间(精确到小时) +- [SetPlayerTime](SetPlayerTime): 设置玩家独立时间显示 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerMoney.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerMoney.md new file mode 100644 index 00000000000..3ceaa47c24a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerMoney.md @@ -0,0 +1,43 @@ +--- +title: GivePlayerMoney +sidebar_label: GivePlayerMoney +description: 给予或扣除玩家的资金。 +tags: ["玩家"] +--- + +## 描述 + +对指定玩家进行资金增减操作。 + +| 参数名 | 说明 | +| -------- | -------------------------------------- | +| playerid | 目标玩家的 ID 编号 | +| money | 资金数额(正数表示给予,负数表示扣除) | + +## 返回值 + +**1** - 操作成功执行 + +**0** - 操作执行失败(玩家未连接) + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + if (killerid != INVALID_PLAYER_ID) + { + // 给予击杀者1000美元奖励 + GivePlayerMoney(killerid, 1000); + SendClientMessage(killerid, -1, "您因击杀获得1000美元奖励"); + } + + // 扣除死亡玩家500美元 + GivePlayerMoney(playerid, -500); +} +``` + +## 相关函数 + +- [ResetPlayerMoney](ResetPlayerMoney): 重置玩家资金至\$0 +- [GetPlayerMoney](GetPlayerMoney): 获取玩家当前资金总额 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerWeapon.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerWeapon.md new file mode 100644 index 00000000000..0c3d5749881 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GivePlayerWeapon.md @@ -0,0 +1,39 @@ +--- +title: GivePlayerWeapon +sidebar_label: GivePlayerWeapon +description: 给予玩家指定武器及弹药。 +tags: ["玩家"] +--- + +## 描述 + +为玩家添加指定武器及相应数量的弹药。 + +| 参数名 | 说明 | +| --------------- | ----------------------------------------- | +| playerid | 目标玩家的 ID 编号 | +| WEAPON:weaponid | 要给予的[武器 ID](../resources/weaponids) | +| ammo | 给予的弹药数量 | + +## 返回值 + +**1** - 操作成功执行 + +**0** - 操作执行失败(玩家未连接) + +## 示例 + +```c +GivePlayerWeapon(playerid, WEAPON_SAWEDOFF, 64); // 给予玩家短管霰弹枪及64发弹药 +``` + +## 相关函数 + +- [SetPlayerArmedWeapon](SetPlayerArmedWeapon): 设置玩家当前手持武器 +- [GetPlayerWeapon](GetPlayerWeapon): 获取玩家当前持有的武器 +- [ResetPlayerWeapons](ResetPlayerWeapons): 移除玩家所有武器 +- [RemovePlayerWeapon](RemovePlayerWeapon): 移除玩家指定武器 + +## 相关资源 + +- [武器 ID 对照表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HTTP.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HTTP.md new file mode 100644 index 00000000000..f774780f575 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HTTP.md @@ -0,0 +1,85 @@ +--- +title: HTTP +sidebar_label: HTTP +description: 发送线程化的HTTP请求 +tags: ["http"] +--- + +## 描述 + +发送异步 HTTP 请求。 + +| 参数 | 说明 | +| ------------------ | -------------------------------------------------------------- | +| index | 用于区分相同回调请求的标识符(通常使用玩家 ID) | +| HTTP_METHOD:method | 请求[类型](../resources/http-request-methods)(GET/POST/HEAD) | +| const url[] | 目标 URL(无需包含'http://'前缀) | +| const data[] | 需要随请求发送的 POST 数据 | +| const callback[] | 处理该请求响应的回调函数名称 | + +## 返回值 + +成功返回 1,失败返回 0 + +## 定义 + +```c +// HTTP请求类型 +#define HTTP_GET (HTTP_METHOD:1) // 发送常规HTTP请求 +#define HTTP_POST (HTTP_METHOD:2) // 发送带POST数据的HTTP请求 +#define HTTP_HEAD (HTTP_METHOD:3) // 发送HTTP请求但忽略响应内容,仅返回状态码 + +// HTTP错误响应码 +// 这些代码是对常规HTTP状态码的补充 +#define HTTP_ERROR_BAD_HOST (HTTP_ERROR:1) // 无效主机 +#define HTTP_ERROR_NO_SOCKET (HTTP_ERROR:2) // 无法创建套接字 +#define HTTP_ERROR_CANT_CONNECT (HTTP_ERROR:3) // 连接失败 +#define HTTP_ERROR_CANT_WRITE (HTTP_ERROR:4) // 写入失败 +#define HTTP_ERROR_CONTENT_TOO_BIG (HTTP_ERROR:5) // 响应内容过大 +#define HTTP_ERROR_MALFORMED_RESPONSE (HTTP_ERROR:6) // 响应格式错误 +``` + +## 示例 + +```c +forward MyHttpResponse(index, response_code, data[]); + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/hello", cmdtext, true)) + { + HTTP(playerid, HTTP_GET, "assets.open.mp/hello.txt", "", "MyHttpResponse"); + return 1; + } + return 0; +} + +public MyHttpResponse(index, response_code, data[]) +{ + new buffer[128]; + + if (response_code == 200) // 请求成功 + { + format(buffer, sizeof(buffer), "服务器返回内容: %s", data); + SendClientMessage(index, 0xFFFFFFFF, buffer); + } + else + { + format(buffer, sizeof(buffer), "请求失败!状态码: %d", response_code); + SendClientMessage(index, 0xFF0000FF, buffer); + } +} +``` + +## 注意事项 + +:::tip + +除了上述错误代码,本函数也支持标准 HTTP 状态码,例如 404(页面未找到)、500(服务器错误)和 403(禁止访问) + +::: + +## 相关信息 + +- [HTTP 请求方法](../resources/http-request-methods) +- [HTTP 错误响应码](../resources/http-error-response-codes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasGameText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasGameText.md new file mode 100644 index 00000000000..62bb9e8e8c8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasGameText.md @@ -0,0 +1,46 @@ +--- +title: HasGameText +sidebar_label: HasGameText +description: 检测玩家当前是否显示指定样式的游戏文本。 +tags: ["玩家"] +--- + + + +## 描述 + +检测玩家当前是否显示指定样式的游戏文本。 + +| 参数名 | 说明 | +| -------- | --------------------------------------------------- | +| playerid | 要检测的玩家 ID 编号 | +| style | 要检测的[游戏文本样式](../resources/gametextstyles) | + +## 返回值 + +**true** - 玩家当前显示该样式游戏文本 + +**false** - 玩家未显示该样式游戏文本 + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + GameTextForPlayer(playerid, "欢迎来到服务器!", 5000, 3); + + if (HasGameText(playerid, 3)) + { + // 当检测到3号样式文本时执行操作 + } + return 1; +} +``` + +## 相关函数 + +- [GameTextForPlayer](GameTextForPlayer): 向玩家显示游戏文本 +- [HideGameTextForPlayer](HideGameTextForPlayer): 隐藏玩家指定样式的游戏文本 +- [GameTextForAll](GameTextForAll): 向所有玩家显示游戏文本 +- [HideGameTextForAll](HideGameTextForAll): 全局隐藏指定样式的游戏文本 +- [GetGameText](GetGameText): 获取指定样式游戏文本的详细信息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasObjectCameraCollision.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasObjectCameraCollision.md new file mode 100644 index 00000000000..54b31ce4af0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasObjectCameraCollision.md @@ -0,0 +1,40 @@ +--- +title: HasObjectCameraCollision +sidebar_label: HasObjectCameraCollision +description: 检查物体是否启用了视角碰撞功能。 +tags: ["物体"] +--- + + + +## 描述 + +检测物体是否启用了视角碰撞功能(通过[SetObjectNoCameraCollision](SetObjectNoCameraCollision)设置)。 + +| 参数名 | 说明 | +| -------- | -------------------- | +| objectid | 待检测的物体 ID 编号 | + +## 返回值 + +`true` - 物体视角碰撞功能已启用 + +`false` - 物体视角碰撞功能已禁用 + +## 示例 + +```c +if (HasObjectCameraCollision(objectid)) +{ + printf("物体 %d 视角碰撞状态: 已启用", objectid); +} +else +{ + printf("物体 %d 视角碰撞状态: 已禁用", objectid); +} +``` + +## 相关函数 + +- [SetObjectNoCameraCollision](SetObjectNoCameraCollision): 禁用玩家视角与指定物体的碰撞检测 +- [HasPlayerObjectCameraCollision](HasPlayerObjectCameraCollision): 检查玩家私有物体是否启用了视角碰撞功能 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasPlayerObjectCameraCollision.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasPlayerObjectCameraCollision.md new file mode 100644 index 00000000000..d18e2a10464 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasPlayerObjectCameraCollision.md @@ -0,0 +1,41 @@ +--- +title: HasPlayerObjectCameraCollision +sidebar_label: HasPlayerObjectCameraCollision +description: 检查玩家私有物体是否启用了视角碰撞功能。 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +检测玩家私有物体是否启用了视角碰撞功能(通过[SetPlayerObjectNoCameraCollision](SetPlayerObjectNoCameraCollision)设置)。 + +| 参数名 | 说明 | +| -------- | ------------------------ | +| playerid | 目标玩家的 ID 编号 | +| objectid | 待检测的私有物体 ID 编号 | + +## 返回值 + +`true` - 玩家私有物体视角碰撞功能已启用 + +`false` - 玩家私有物体视角碰撞功能已禁用 + +## 示例 + +```c +if (HasPlayerObjectCameraCollision(playerid, playerobjectid)) +{ + printf("玩家 %d 的私有物体 %d 视角碰撞状态: 已启用", playerid, playerobjectid); +} +else +{ + printf("玩家 %d 的私有物体 %d 视角碰撞状态: 已禁用", playerid, playerobjectid); +} +``` + +## 相关函数 + +- [SetPlayerObjectNoCameraCollision](SetPlayerObjectNoCameraCollision): 设置玩家私有物体的视角碰撞状态 +- [HasObjectCameraCollision](HasObjectCameraCollision): 检测全局物体是否启用了视角碰撞功能 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasVehicleBeenOccupied.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasVehicleBeenOccupied.md new file mode 100644 index 00000000000..a92c3b5f91a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HasVehicleBeenOccupied.md @@ -0,0 +1,45 @@ +--- +title: HasVehicleBeenOccupied +sidebar_label: HasVehicleBeenOccupied +description: 检查车辆是否曾被占用过。 +tags: ["车辆"] +--- + + + +## 描述 + +检测指定车辆是否曾被玩家占用过。 + +## 参数 + +| 参数名 | 说明 | +| --------- | ------------------ | +| vehicleid | 目标车辆的 ID 编号 | + +## 返回值 + +**true** - 车辆存在被占用记录 + +**false** - 车辆从未被玩家占用 + +## 示例 + +```c +if (HasVehicleBeenOccupied(vehicleid)) +{ + printf("车辆 %d 存在玩家占用记录", vehicleid); + // 执行相关逻辑(如重置车辆状态) +} +else +{ + // 车辆保持初始生成状态 + RepairVehicle(vehicleid); +} +``` + +## 相关函数 + +- [SetVehicleBeenOccupied](SetVehicleBeenOccupied): 标记车辆的占用状态 +- [GetVehicleOccupiedTick](GetVehicleOccupiedTick): 获取车辆最后被占用的时间戳 +- [ResetVehicleOccupiedStatus](ResetVehicleOccupiedStatus): 重置车辆的占用记录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForAll.md new file mode 100644 index 00000000000..26589477da5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForAll.md @@ -0,0 +1,46 @@ +--- +title: HideGameTextForAll +sidebar_label: HideGameTextForAll +description: 隐藏所有玩家的指定样式游戏文本。 +tags: ["玩家", "游戏文本"] +--- + + + +## 描述 + +停止为所有玩家显示指定样式的游戏文本。 + +| 参数名 | 说明 | +| ------ | ------------------------------------------------------- | +| style | 要隐藏的[游戏文本样式](../resources/gametextstyles)编号 | + +## 返回值 + +此函数没有返回值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/hidegametext3", true)) + { + if (!IsPlayerAdmin(playerid)) + { + return 1; + } + + HideGameTextForAll(3); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [HideGameTextForPlayer](HideGameTextForPlayer): 隐藏单个玩家的游戏文本 +- [GameTextForPlayer](GameTextForPlayer): 为玩家显示游戏文本 +- [GameTextForAll](GameTextForAll): 为所有玩家显示游戏文本 +- [TextDrawHideForAll](TextDrawHideForAll): 隐藏全服文本绘图元素 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForPlayer.md new file mode 100644 index 00000000000..f760255bb4f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideGameTextForPlayer.md @@ -0,0 +1,40 @@ +--- +title: HideGameTextForPlayer +sidebar_label: HideGameTextForPlayer +description: 停止向玩家显示游戏文本样式。 +tags: ["玩家", "游戏文本"] +--- + + + +## 描述 + +停止向指定玩家显示特定样式的游戏文本。 + +| 参数 | 说明 | +| -------- | ----------------------------------------------- | +| playerid | 需要隐藏游戏文本的玩家 ID | +| style | 要隐藏的文本[样式](../resources/gametextstyles) | + +## 返回值 + +本函数不返回任何特定值。 + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + HideGameTextForPlayer(playerid, 3); + return 1; +} +``` + +## 相关函数 + +- [HideGameTextForAll](HideGameTextForAll): 停止为所有玩家显示游戏文本样式 +- [GameTextForPlayer](GameTextForPlayer): 向玩家显示游戏文本 +- [GameTextForAll](GameTextForAll): 向所有玩家显示游戏文本 +- [GetGameText](GetGameText): 获取指定游戏文本样式的所有信息 +- [HasGameText](HasGameText): 玩家当前是否显示着指定样式的游戏文本? +- [TextDrawHideForAll](TextDrawHideForAll): 为所有玩家隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideMenuForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideMenuForPlayer.md new file mode 100644 index 00000000000..3cb0355f2c8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideMenuForPlayer.md @@ -0,0 +1,73 @@ +--- +title: HideMenuForPlayer +sidebar_label: HideMenuForPlayer +description: 隐藏玩家的菜单 +tags: ["玩家", "菜单"] +--- + +## 描述 + +隐藏指定玩家的菜单。 + +| 参数 | 说明 | +| ----------- | ---------------------------------------------------------------------------------------------------------------- | +| Menu:menuid | 要隐藏的菜单 ID。由 CreateMenu 生成并传递给[OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow)回调。 | +| playerid | 需要隐藏菜单的玩家 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/menuhide", true) == 0) + { + new Menu:myMenu = GetPlayerMenu(playerid); + HideMenuForPlayer(myMenu, playerid); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +如果传入无效的菜单 ID,会导致服务端和玩家客户端崩溃(此问题已在 open.mp 中修复) + +::: + +:::tip + +该函数始终需要菜单 ID 参数,但在 SA:MP 中该参数未被实际使用。无论传入任何值,都会关闭玩家当前正在查看的菜单。 + +旧代码可能如下所示: + +```c +gShopMenu = CreateMenu("text", 2, 100.0, 30.0, 7.0); + +HideMenuForPlayer(gShopMenu, playerid); +``` + +这种写法会始终关闭玩家当前查看的菜单,无论实际显示的是哪个菜单。现在您需要记录玩家当前查看的菜单,或直接获取: + +```c +gShopMenu = CreateMenu("text", 2, 100.0, 30.0, 7.0); + +HideMenuForPlayer(GetPlayerMenu(playerid), playerid); +``` + +::: + +## 相关函数 + +- [CreateMenu](CreateMenu): 创建菜单 +- [AddMenuItem](AddMenuItem): 为指定菜单添加选项 +- [SetMenuColumnHeader](SetMenuColumnHeader): 设置菜单列标题 +- [ShowMenuForPlayer](ShowMenuForPlayer): 为玩家显示菜单 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideObjectForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideObjectForPlayer.md new file mode 100644 index 00000000000..567499f0b03 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideObjectForPlayer.md @@ -0,0 +1,49 @@ +--- +title: HideObjectForPlayer +sidebar_label: HideObjectForPlayer +description: 对玩家隐藏物体 +tags: ["玩家", "物体"] +--- + + + +## 描述 + +对指定玩家隐藏物体。 + +## 参数 + +| 参数 | 说明 | +| -------- | ----------------- | +| playerid | 玩家 ID | +| objectid | 需要隐藏的物体 ID | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定的玩家或物体不存在) + +## 示例 + +```c +new gObject; + +public OnGameModeInit() +{ + gObject = CreateObject(1431, 921.12201, -1206.78613, 16.52670, 0.00000, 0.00000, 90.00000); + return 1; +} + +public OnPlayerConnect(playerid) +{ + HideObjectForPlayer(playerid, gObject); + return 1; +} +``` + +## 相关函数 + +- [ShowObjectForPlayer](ShowObjectForPlayer): 对玩家显示物体 +- [IsObjectHiddenForPlayer](IsObjectHiddenForPlayer): 检查物体是否对玩家隐藏 +- [CreateObject](CreateObject): 创建物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HidePickupForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HidePickupForPlayer.md new file mode 100644 index 00000000000..2e50f9d192f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HidePickupForPlayer.md @@ -0,0 +1,58 @@ +--- +title: HidePickupForPlayer +sidebar_label: HidePickupForPlayer +description: 对指定玩家隐藏拾取物 +tags: ["玩家", "拾取物"] +--- + + + +## 描述 + +对指定玩家隐藏特定拾取物。 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 玩家 ID | +| pickupid | 需要隐藏的拾取物 ID | + +## 返回值 + +本函数始终返回 **true**。 + +## 示例 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + HidePickupForPlayer(playerid, g_Pickup); + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 检查拾取物是否有效 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检查拾取物是否已为玩家流式加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检查拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 ID +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物虚拟世界 ID +- [ShowPickupForPlayer](ShowPickupForPlayer): 对玩家显示拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家调整拾取物模型、类型和位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HidePlayerDialog.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HidePlayerDialog.md new file mode 100644 index 00000000000..751747ca835 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HidePlayerDialog.md @@ -0,0 +1,49 @@ +--- +title: HidePlayerDialog +sidebar_label: HidePlayerDialog +description: 隐藏玩家当前可见的任何对话框 +tags: ["玩家", "对话框"] +--- + + + +## 描述 + +隐藏玩家当前可见的任何对话框。 + +| 参数 | 说明 | +| -------- | --------------------------- | +| playerid | 需要隐藏当前对话框的玩家 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接或未查看对话框) + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + if (IsAccountRegistered(playerid)) // (假设函数,用于检查玩家昵称是否已注册) + { + ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "登录", "请输入密码", "登录", ""); // 向玩家显示登录对话框 + + new ipAddress[16]; + GetPlayerIp(playerid, ipAddress, sizeof(ipAddress)); // 获取玩家IP地址 + + if (IsBanned(ipAddress)) // 检查IP是否被封禁 + { + SendClientMessage(playerid, 0xFF0000FF, "您已被封禁!"); + HidePlayerDialog(playerid); // 隐藏登录对话框 + } + } +} +``` + +## 相关函数 + +- [ShowPlayerDialog](ShowPlayerDialog): 向玩家显示同步对话框(同一时间只能显示一个) +- [GetPlayerDialogData](GetPlayerDialogData): 获取玩家当前对话框的数据 +- [GetPlayerDialogID](GetPlayerDialogID): 获取玩家当前对话框的 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideVehicle.md new file mode 100644 index 00000000000..a138c5ee0c0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/HideVehicle.md @@ -0,0 +1,40 @@ +--- +title: HideVehicle +sidebar_label: HideVehicle +description: 将车辆从游戏中隐藏 +tags: ["车辆"] +--- + + + +:::warning + +此功能尚未实现 + +::: + +## 描述 + +将指定车辆从游戏中隐藏。 + +## 参数 + +| 参数 | 说明 | +| --------- | ----------------- | +| vehicleid | 需要隐藏的车辆 ID | + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(536, 2496.5034, 5.6658, 27.2247, 180.0000, -1, -1, 60); + HideVehicle(vehicleid); + return 1; +} +``` + +## 相关函数 + +- [ShowVehicle](ShowVehicle): 显示隐藏的车辆 +- [IsVehicleHidden](IsVehicleHidden): 检查车辆是否隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraLookAt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraLookAt.md new file mode 100644 index 00000000000..abec75181bb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraLookAt.md @@ -0,0 +1,62 @@ +--- +title: InterpolateCameraLookAt +sidebar_label: InterpolateCameraLookAt +description: 以指定速度平滑过渡玩家视角的注视点坐标 +tags: ["玩家", "插值过渡"] +--- + +## 描述 + +以指定速度在两个坐标点之间平滑过渡玩家视角的注视点。可与[InterpolateCameraPos](InterpolateCameraPos)配合使用。 + +| 参数 | 说明 | +| ------------ | ------------------------------------------------------------------------------------------------------------------------ | +| playerid | 需要移动视角的玩家 ID | +| Float:fromX | 视角起始注视点的 X 坐标 | +| Float:fromY | 视角起始注视点的 Y 坐标 | +| Float:fromZ | 视角起始注视点的 Z 坐标 | +| Float:toX | 视角目标注视点的 X 坐标 | +| Float:toY | 视角目标注视点的 Y 坐标 | +| Float:toZ | 视角目标注视点的 Z 坐标 | +| time | 过渡完成所需的毫秒时间 | +| CAM_MOVE:cut | 使用的[视角切换样式](../resources/cameracutstyles)。默认 CAMERA_CUT(瞬间切换无意义)。应设为 CAMERA_MOVE 实现平滑过渡。 | + +## 返回值 + +本函数不返回特定值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/rotateme", true)) + { + TogglePlayerSpectating(playerid, true); + InterpolateCameraLookAt(playerid, 50.0, 50.0, 10.0, -50.0, 50.0, 10.0, 10000, CAMERA_MOVE); + // x1 y1 z1 x2 y2 z2 + // 视角初始注视点(x1,y1,z1),经过10000毫秒(10秒)后平滑过渡到注视点(x2,y2,z2) + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +- 使用[TogglePlayerSpectating](TogglePlayerSpectating)可在视角移动时保持物体正常加载 +- 使用[SetCameraBehindPlayer](SetCameraBehindPlayer)可重置视角至玩家背后视角 + +::: + +## 相关函数 + +- [InterpolateCameraPos](InterpolateCameraPos): 平滑移动玩家视角位置 +- [SetPlayerCameraLookAt](SetPlayerCameraLookAt): 设置视角注视点 +- [SetPlayerCameraPos](SetPlayerCameraPos): 设置视角位置 + +## 相关资源 + +- [视角切换样式](../resources/cameracutstyles) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraPos.md new file mode 100644 index 00000000000..7fd5a3dbe6e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/InterpolateCameraPos.md @@ -0,0 +1,61 @@ +--- +title: InterpolateCameraPos +sidebar_label: InterpolateCameraPos +description: 在设定时间内将玩家的视角从一个位置平滑移动到另一个位置 +tags: ["玩家", "插值过渡"] +--- + +## 描述 + +在指定时间内平滑移动玩家视角的位置。常用于脚本控制的过场动画。 + +| 参数 | 说明 | +| ------------ | ---------------------------------------------------------------------------------------------------------- | +| playerid | 需要移动视角的玩家 ID | +| Float:fromX | 视角起始位置的 X 坐标 | +| Float:fromY | 视角起始位置的 Y 坐标 | +| Float:fromZ | 视角起始位置的 Z 坐标 | +| Float:toX | 视角目标位置的 X 坐标 | +| Float:toY | 视角目标位置的 Y 坐标 | +| Float:toZ | 视角目标位置的 Z 坐标 | +| time | 移动持续毫秒数 | +| CAM_MOVE:cut | [视角切换样式](../resources/cameracutstyles)。默认 CAMERA_CUT(瞬间切换)。应设为 CAMERA_MOVE 实现平滑移动 | + +## 返回值 + +本函数不返回特定值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/moveme", true)) + { + TogglePlayerSpectating(playerid, true); + InterpolateCameraPos(playerid, 0.0, 0.0, 10.0, 1000.0, 1000.0, 30.0, 10000, CAMERA_MOVE); + // 在10000毫秒(10秒)内将玩家视角从A点(0,0,10)平滑移动到B点(1000,1000,30) + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +- 使用[TogglePlayerSpectating](TogglePlayerSpectating)可在视角移动期间保持物体正常加载并隐藏 HUD 界面 +- 使用[SetCameraBehindPlayer](SetCameraBehindPlayer)可重置视角至玩家背后视角 + +::: + +## 相关函数 + +- [InterpolateCameraLookAt](InterpolateCameraLookAt): 平滑调整视角注视点 +- [SetPlayerCameraPos](SetPlayerCameraPos): 直接设置视角位置 +- [SetPlayerCameraLookAt](SetPlayerCameraLookAt): 直接设置视角注视方向 + +## 相关资源 + +- [视角切换样式](../resources/cameracutstyles) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Is3DTextLabelStreamedIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Is3DTextLabelStreamedIn.md new file mode 100644 index 00000000000..927662fc902 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Is3DTextLabelStreamedIn.md @@ -0,0 +1,48 @@ +--- +title: Is3DTextLabelStreamedIn +sidebar_label: Is3DTextLabelStreamedIn +description: 检查3D文本标签是否已为玩家流加载 +tags: ["3d文本标签"] +--- + + + +## 描述 + +检查指定 3D 文本标签是否已为玩家完成流加载。 + +| 参数 | 说明 | +| ------------- | -------------- | +| playerid | 玩家 ID | +| Text3D:textid | 3D 文本标签 ID | + +## 返回值 + +**true** - 3D 文本标签已为玩家流加载 +**false** - 尚未完成加载或标签不存在 + +## 示例 + +```c +new Text3D:gMyLabel; + +public OnGameModeInit() +{ + gMyLabel = Create3DTextLabel("当前坐标:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + if (Is3DTextLabelStreamedIn(playerid, gMyLabel)) + { + // 执行相关操作 + } + return 1; +} +``` + +## 相关函数 + +- [Create3DTextLabel](Create3DTextLabel): 在指定坐标创建 3D 文本标签 +- [IsPlayerStreamedIn](IsPlayerStreamedIn): 检查玩家是否已为另一玩家流加载 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsActorInvulnerable.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsActorInvulnerable.md new file mode 100644 index 00000000000..15577987942 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsActorInvulnerable.md @@ -0,0 +1,49 @@ +--- +title: IsActorInvulnerable +sidebar_label: IsActorInvulnerable +description: 检查角色是否处于无敌状态 +tags: ["角色"] +--- + + + +## 描述 + +检查指定角色是否处于无敌状态。 + +| 参数 | 说明 | +| ------- | ----------------- | +| actorid | 需要检查的角色 ID | + +## 返回值 + +**true** - 角色处于无敌状态 + +**false** - 角色可受到伤害 + +## 示例 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // 在武器商店创建销售员角色 + + if (IsActorInvulnerable(gMyActor)) + { + print("角色处于无敌状态。"); + } + else + { + print("角色可被伤害。"); + } + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor): 创建角色(静态 NPC) +- [SetActorInvulnerable](SetActorInvulnerable): 设置角色无敌状态 +- [SetActorHealth](SetActorHealth): 设置角色生命值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsActorStreamedIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsActorStreamedIn.md new file mode 100644 index 00000000000..618699ada5e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsActorStreamedIn.md @@ -0,0 +1,48 @@ +--- +title: IsActorStreamedIn +sidebar_label: IsActorStreamedIn +description: 检查角色是否已为玩家流加载 +tags: ["角色"] +--- + + + +## 描述 + +检查指定角色是否已为玩家完成流加载。 + +| 参数 | 说明 | +| -------- | ----------------- | +| actorid | 需要检查的角色 ID | +| playerid | 玩家 ID | + +## 返回值 + +**1** - 角色已为玩家流加载 +**0** - 角色尚未加载或不存在 + +## 示例 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(0, 0.0, 0.0, 3.0, 0.0); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + if (IsActorStreamedIn(gMyActor, playerid)) + { + // 执行相关操作 + } + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor): 创建角色(静态 NPC) +- [IsPlayerStreamedIn](IsPlayerStreamedIn): 检查玩家是否已为另一玩家流加载 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsAdminTeleportAllowed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsAdminTeleportAllowed.md new file mode 100644 index 00000000000..7a82edbe369 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsAdminTeleportAllowed.md @@ -0,0 +1,32 @@ +--- +title: IsAdminTeleportAllowed +sidebar_label: IsAdminTeleportAllowed +description: 检查是否允许远程控制台管理员通过右键点击地图传送 +tags: [] +--- + + + +## 描述 + +检查远程控制台管理员是否被允许通过右键点击地图进行传送。 + +## 返回值 + +**true** - 允许传送 +**false** - 禁止传送 + +## 示例 + +```c +if (IsAdminTeleportAllowed()) +{ + // 执行相关操作 +} +``` + +## 相关函数 + +- [AllowAdminTeleport](AllowAdminTeleport): 设置远程控制台管理员的传送权限 +- [AllowPlayerTeleport](AllowPlayerTeleport): 控制玩家传送功能开关 +- [IsPlayerAdmin](IsPlayerAdmin): 检查玩家是否具有远程控制台权限 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsBanned.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsBanned.md new file mode 100644 index 00000000000..ffc95814c50 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsBanned.md @@ -0,0 +1,47 @@ +--- +title: IsBanned +sidebar_label: IsBanned +description: 检查指定IP地址是否被封禁 +tags: ["IP地址"] +--- + + + +## 描述 + +检查指定 IP 地址是否存在于封禁列表中。 + +| 参数 | 说明 | +| ----------------- | ------------------ | +| const ipAddress[] | 需要检查的 IP 地址 | + +## 返回值 + +**true** - IP 地址已被封禁 +**false** - IP 地址未被封禁 + +## 示例 + +```c +if (IsBanned("255.255.255.255")) +{ + // 执行相关操作 +} +``` + +## 注意事项 + +:::tip + +封禁列表可通过查看 **bans.json** 文件获取 + +::: + +## 相关函数 + +- [BlockIpAddress](BlockIpAddress): 禁止指定 IP 地址在设定时间内连接服务器 +- [UnBlockIpAddress](UnBlockIpAddress): 解除已封禁的 IP 地址 +- [Ban](Ban): 封禁指定玩家 +- [BanEx](BanEx): 使用自定义原因封禁玩家 +- [Kick](Kick): 踢出指定玩家 +- [ClearBanList](ClearBanList): 清空封禁列表 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneFlashingForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneFlashingForPlayer.md new file mode 100644 index 00000000000..1df7b4734b6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneFlashingForPlayer.md @@ -0,0 +1,37 @@ +--- +title: IsGangZoneFlashingForPlayer +sidebar_label: IsGangZoneFlashingForPlayer +description: 检查帮派区域是否对玩家闪烁 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +检查指定帮派区域是否正在对玩家闪烁。 + +| 参数 | 说明 | +| -------- | ----------------- | +| playerid | 需要检查的玩家 ID | +| zoneid | 帮派区域 ID | + +## 返回值 + +**true** - 帮派区域正在对玩家闪烁 +**false** - 帮派区域未对玩家闪烁 + +## 相关函数 + +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 对玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 对所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 +- [IsValidGangZone](IsValidGangZone): 验证帮派区域有效性 +- [IsPlayerInGangZone](IsPlayerInGangZone): 检查玩家是否在帮派区域内 +- [IsGangZoneVisibleForPlayer](IsGangZoneVisibleForPlayer): 检查帮派区域是否对玩家可见 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneVisibleForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneVisibleForPlayer.md new file mode 100644 index 00000000000..e908e9e6645 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsGangZoneVisibleForPlayer.md @@ -0,0 +1,36 @@ +--- +title: IsGangZoneVisibleForPlayer +sidebar_label: IsGangZoneVisibleForPlayer +description: 检查帮派区域是否对玩家可见 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +检查指定帮派区域是否对玩家可见。 + +| 参数 | 说明 | +| -------- | ----------------- | +| playerid | 需要检查的玩家 ID | +| zoneid | 帮派区域 ID | + +## 返回值 + +**true** - 帮派区域对玩家可见 +**false** - 帮派区域不可见或未加载 + +## 相关函数 + +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 对玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 对所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 +- [IsValidGangZone](IsValidGangZone): 验证帮派区域有效性 +- [IsPlayerInGangZone](IsPlayerInGangZone): 检查玩家是否在帮派区域内 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuDisabled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuDisabled.md new file mode 100644 index 00000000000..510261f29c9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuDisabled.md @@ -0,0 +1,26 @@ +--- +title: IsMenuDisabled +sidebar_label: IsMenuDisabled +description: 检查菜单是否被禁用 +tags: ["菜单"] +--- + + + +## 描述 + +检查指定菜单是否处于禁用状态。 + +| 参数 | 说明 | +| ----------- | ----------------- | +| Menu:menuid | 需要检查的菜单 ID | + +## 返回值 + +**true** - 菜单已被禁用 +**false** - 菜单未被禁用 + +## 相关函数 + +- [IsValidMenu](IsValidMenu): 验证菜单 ID 有效性 +- [IsMenuRowDisabled](IsMenuRowDisabled): 检查菜单行是否禁用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuRowDisabled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuRowDisabled.md new file mode 100644 index 00000000000..92a3c880b0e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsMenuRowDisabled.md @@ -0,0 +1,26 @@ +--- +title: IsMenuRowDisabled +sidebar_label: IsMenuRowDisabled +description: 检查菜单行是否被禁用 +tags: ["菜单"] +--- + + + +## 描述 + +检查指定菜单行是否被禁用。 + +| 参数 | 说明 | +| ----------- | ----------------- | +| Menu:menuid | 需要检查的菜单 ID | + +## 返回值 + +**true** - 菜单行已被禁用 +**false** - 菜单行未被禁用 + +## 相关函数 + +- [IsValidMenu](IsValidMenu): 验证菜单 ID 有效性 +- [IsMenuDisabled](IsMenuDisabled): 检查菜单是否禁用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsNickNameCharacterAllowed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsNickNameCharacterAllowed.md new file mode 100644 index 00000000000..c74459d24db --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsNickNameCharacterAllowed.md @@ -0,0 +1,40 @@ +--- +title: IsNickNameCharacterAllowed +sidebar_label: IsNickNameCharacterAllowed +description: 检查字符是否允许在昵称中使用 +tags: [] +--- + + + +## 描述 + +检查指定字符是否允许用于玩家昵称。 + +| 参数 | 说明 | +| --------- | -------------- | +| character | 需要检查的字符 | + +## 返回值 + +**true** - 该字符允许使用 +**false** - 该字符禁止使用 + +## 示例 + +```c +public OnGameModeInit() +{ + AllowNickNameCharacter('*', true); // 允许字符* + + if (IsNickNameCharacterAllowed('*')) + { + print("字符*已被允许用于昵称。"); + } + return 1; +} +``` + +## 相关函数 + +- [AllowNickNameCharacter](AllowNickNameCharacter): 设置昵称字符使用权限 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectHiddenForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectHiddenForPlayer.md new file mode 100644 index 00000000000..9b33b8f6f13 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectHiddenForPlayer.md @@ -0,0 +1,66 @@ +--- +title: IsObjectHiddenForPlayer +sidebar_label: IsObjectHiddenForPlayer +description: 检查物体是否对指定玩家隐藏 +tags: ["玩家", "物体"] +--- + + + +## 描述 + +检查指定物体是否对玩家处于隐藏状态。 + +## 参数 + +| 参数 | 说明 | +| -------- | ----------------- | +| playerid | 玩家 ID | +| objectid | 需要检查的物体 ID | + +## 返回值 + +`true` - 物体对玩家处于隐藏状态 +`false` - 物体对玩家可见 + +## 示例 + +```c +new gObject; + +public OnGameModeInit() +{ + // 在坐标921.12, -1206.78, 16.52创建木箱物体 + gObject = CreateObject(1431, 921.12201, -1206.78613, 16.52670, 0.0, 0.0, 90.0); + return 1; +} + +public OnPlayerConnect(playerid) +{ + HideObjectForPlayer(playerid, gObject); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + if (IsObjectHiddenForPlayer(playerid, gObject)) + { + printf("物体 %d 对玩家 %d 处于隐藏状态", gObject, playerid); + } + return 1; +} +``` + +## 注意事项 + +:::提示 + +可通过[HideObjectForPlayer](HideObjectForPlayer)函数为指定玩家隐藏物体 + +::: + +## 相关函数 + +- [HideObjectForPlayer](HideObjectForPlayer): 对玩家隐藏物体 +- [ShowObjectForPlayer](ShowObjectForPlayer): 对玩家显示物体 +- [CreateObject](CreateObject): 创建新物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMaterialSlotUsed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMaterialSlotUsed.md new file mode 100644 index 00000000000..a637c251b78 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMaterialSlotUsed.md @@ -0,0 +1,51 @@ +--- +title: IsObjectMaterialSlotUsed +sidebar_label: IsObjectMaterialSlotUsed +description: 检查物体材质槽位是否被使用 +tags: ["物体"] +--- + + + +## 描述 + +检测物体指定材质槽位的使用类型。 + +| 参数 | 说明 | +| ------------- | -------------------- | +| objectid | 物体 ID | +| materialIndex | 材质槽位索引(0-15) | + +## 返回值 + +返回材质槽位使用类型: + +`0` - 未使用 +`1` - 材质贴图 +`2` - 文本贴图 + +## 示例 + +```c +// 创建物体并设置标准材质 +new objectid = CreateObject(19371, 978.71143, -925.25708, 42.63720, 0.0, 0.0, 2.0); +SetObjectMaterial(objectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); + +new type = IsObjectMaterialSlotUsed(objectid, 0); // 返回1 +``` + +```c +// 创建物体并设置文本材质 +new objectid = CreateObject(19174, 986.42767, -983.14850, 40.95220, 0.0, 0.0, 186.0); +SetObjectMaterialText(objectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); + +new type = IsObjectMaterialSlotUsed(objectid, 0); // 返回2 +``` + +## 相关函数 + +- [SetObjectMaterial](SetObjectMaterial): 为物体设置游戏内建材质 +- [SetObjectMaterialText](SetObjectMaterialText): 为物体设置文本材质 +- [GetObjectMaterial](GetObjectMaterial): 获取物体材质数据 +- [GetObjectMaterialText](GetObjectMaterialText): 获取物体文本材质数据 +- [IsPlayerObjectMaterialSlotUsed](IsPlayerObjectMaterialSlotUsed): 检查玩家物体材质槽位使用状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMoving.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMoving.md new file mode 100644 index 00000000000..99c9d9be528 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsObjectMoving.md @@ -0,0 +1,49 @@ +--- +title: IsObjectMoving +sidebar_label: IsObjectMoving +description: 检查指定物体是否处于移动状态 +tags: ["物体"] +--- + + + +## 描述 + +检测指定物体是否正在移动。 + +| 参数 | 说明 | +| -------- | ----------------- | +| objectid | 需要检测的物体 ID | + +## 返回值 + +**true** - 物体正在移动 +**false** - 物体处于静止状态 + +## 示例 + +```c +new gAirportGate; + +public OnGameModeInit() +{ + gAirportGate = CreateObject(980, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + + MoveObject(gAirportGate, 0.0, 0.0, 15.0, 1.00); + + if (IsObjectMoving(gAirportGate)) + { + StopObject(gAirportGate); + } + return 1; +} +``` + +## 相关函数 + +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 + +## 相关回调 + +- [OnObjectMoved](../callbacks/OnObjectMoved): 当物体停止移动时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupHiddenForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupHiddenForPlayer.md new file mode 100644 index 00000000000..c5ce10b7fd4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupHiddenForPlayer.md @@ -0,0 +1,64 @@ +--- +title: IsPickupHiddenForPlayer +sidebar_label: IsPickupHiddenForPlayer +description: 检查指定拾取物是否对玩家隐藏 +tags: ["玩家", "拾取物"] +--- + + + +## 描述 + +检查特定拾取物是否对指定玩家处于隐藏状态。 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 玩家 ID | +| pickupid | 需要检查的拾取物 ID | + +## 返回值 + +**true** - 拾取物已对玩家隐藏 +**false** - 拾取物可见或不存在 + +## 示例 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + HidePickupForPlayer(playerid, g_Pickup); + + if (IsPickupHiddenForPlayer(playerid, g_Pickup)) + { + // 执行相关逻辑 + } + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建动态拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检查拾取物是否流式加载 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物显示模型 +- [GetPickupModel](GetPickupModel): 获取模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置所属虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取虚拟世界 ID +- [ShowPickupForPlayer](ShowPickupForPlayer): 对玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家自定义拾取物属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupStreamedIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupStreamedIn.md new file mode 100644 index 00000000000..d15748e0d40 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPickupStreamedIn.md @@ -0,0 +1,62 @@ +--- +title: IsPickupStreamedIn +sidebar_label: IsPickupStreamedIn +description: 检查指定拾取物是否已为玩家流式加载 +tags: ["玩家", "拾取物"] +--- + + + +## 描述 + +检测特定拾取物是否已完成对玩家的流式加载过程。 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 玩家 ID | +| pickupid | 需要检查的拾取物 ID | + +## 返回值 + +**true** - 拾取物已完成流式加载 +**false** - 未完成加载或拾取物不存在 + +## 示例 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1); + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + if (IsPickupStreamedIn(playerid, g_Pickup)) + { + // 当玩家死亡时检测到拾取物已加载 + } + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建动态拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检查拾取物隐藏状态 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置显示模型 +- [GetPickupModel](GetPickupModel): 获取模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置所属虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取虚拟世界 ID +- [ShowPickupForPlayer](ShowPickupForPlayer): 对玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 自定义玩家专属拾取物属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAdmin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAdmin.md new file mode 100644 index 00000000000..c6d3d3e9409 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAdmin.md @@ -0,0 +1,41 @@ +--- +title: IsPlayerAdmin +sidebar_label: IsPlayerAdmin +description: 检查玩家是否以RCON管理员身份登录 +tags: ["玩家", "远程控制台", "管理"] +--- + +## 描述 + +检测指定玩家是否已登录为 RCON 管理员。 + +| 参数 | 说明 | +| -------- | ----------------- | +| playerid | 需要检查的玩家 ID | + +## 返回值 + +**true** - 玩家具有 RCON 管理员权限 +**false** - 玩家未获得 RCON 权限 + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + if (IsPlayerAdmin(playerid)) + { + SendClientMessageToAll(0xDEEE20FF, "管理员已生成"); + } + return 1; +} +``` + +## 相关函数 + +- [SetPlayerAdmin](SetPlayerAdmin): 授予玩家 RCON 管理员权限 +- [SendRconCommand](SendRconCommand): 通过脚本发送 RCON 指令 + +## 相关回调 + +- [OnRconLoginAttempt](../callbacks/OnRconLoginAttempt): 当玩家尝试登录 RCON 时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAttachedObjectSlotUsed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAttachedObjectSlotUsed.md new file mode 100644 index 00000000000..1a3540d345d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerAttachedObjectSlotUsed.md @@ -0,0 +1,55 @@ +--- +title: IsPlayerAttachedObjectSlotUsed +sidebar_label: IsPlayerAttachedObjectSlotUsed +description: 检查玩家是否在指定索引槽位附加了物体 +tags: ["玩家", "物体", "附加物"] +--- + +## 描述 + +检测玩家是否在指定索引槽位附加了物体。 + +| 参数 | 说明 | +| -------- | ------------------ | +| playerid | 需要检查的玩家 ID | +| index | 需要检查的槽位索引 | + +## 返回值 + +**true** - 该槽位已被附加物体占用 +**false** - 该槽位未被使用 + +## 示例 + +```c +stock CountAttachedObjects(playerid) +{ + new count; + for (new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++) + { + if (IsPlayerAttachedObjectSlotUsed(playerid, i)) + { + count++; + } + } + return count; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/count", true)) + { + new string[32]; + format(string, sizeof(string), "附加物体数量: %d", CountAttachedObjects(playerid)); + SendClientMessage(playerid, -1, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SetPlayerAttachedObject](SetPlayerAttachedObject): 为玩家附加物体 +- [RemovePlayerAttachedObject](RemovePlayerAttachedObject): 移除玩家附加物体 +- [GetPlayerAttachedObject](GetPlayerAttachedObject): 获取玩家附加物体数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCameraTargetEnabled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCameraTargetEnabled.md new file mode 100644 index 00000000000..8df18857903 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCameraTargetEnabled.md @@ -0,0 +1,39 @@ +--- +title: IsPlayerCameraTargetEnabled +sidebar_label: IsPlayerCameraTargetEnabled +description: 检查玩家视角目标功能是否启用 +tags: ["玩家"] +--- + + + +## 描述 + +检测玩家视角目标功能是否处于启用状态。 + +| 参数 | 说明 | +| -------- | ------- | +| playerid | 玩家 ID | + +## 返回值 + +**true** - 功能已启用 +**false** - 功能已禁用 + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + if (IsPlayerCameraTargetEnabled(playerid)) + { + // 执行相关操作 + } + + return 1; +} +``` + +## 相关函数 + +- [EnablePlayerCameraTarget](EnablePlayerCameraTarget): 切换玩家视角目标功能开关 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCheckpointActive.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCheckpointActive.md new file mode 100644 index 00000000000..3e5b6e6e75b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCheckpointActive.md @@ -0,0 +1,39 @@ +--- +title: IsPlayerCheckpointActive +sidebar_label: IsPlayerCheckpointActive +description: 检查玩家当前是否显示检查点 +tags: ["玩家", "检查点"] +--- + + + +## 描述 + +检测玩家当前是否显示常规检查点。 + +| 参数 | 说明 | +| -------- | ----------------- | +| playerid | 需要检查的玩家 ID | + +## 返回值 + +**false** - 未显示任何检查点 +**true** - 存在活动的检查点 + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + if (IsPlayerCheckpointActive(playerid)) + { + // 执行检查点相关操作 + } +} +``` + +## 相关函数 + +- [SetPlayerCheckpoint](SetPlayerCheckpoint): 为玩家创建常规检查点 +- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): 检查玩家是否处于检查点范围内 +- [IsPlayerRaceCheckpointActive](IsPlayerRaceCheckpointActive): 检查玩家当前是否显示竞速检查点 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerConnected.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerConnected.md new file mode 100644 index 00000000000..4e38510b062 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerConnected.md @@ -0,0 +1,52 @@ +--- +title: IsPlayerConnected +sidebar_label: IsPlayerConnected +description: 检查玩家是否已连接 +tags: ["玩家"] +--- + +## 描述 + +检测指定玩家 ID 是否对应已连接玩家。 + +| 参数 | 说明 | +| -------- | ----------------- | +| playerid | 需要检查的玩家 ID | + +## 返回值 + +**true** - 玩家已连接 +**false** - 玩家未连接 + +## 示例 + +```c +KillPlayer(playerid) +{ + if (!IsPlayerConnected(playerid)) + { + printf("玩家ID %i 未连接!", playerid); + } + else + { + SetPlayerHealth(playerid, 0.0); + } +} +``` + +## 注意事项 + +:::tip + +许多其他函数已内置连接状态检查,实际开发中可酌情省略本函数调用 + +::: + +## 相关函数 + +- [IsPlayerAdmin](IsPlayerAdmin): 检查玩家是否具有 RCON 管理员权限 + +## 相关回调 + +- [OnPlayerConnect](../callbacks/OnPlayerConnect): 玩家连接服务器时触发 +- [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect): 玩家断开连接时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerControllable.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerControllable.md new file mode 100644 index 00000000000..e9125933026 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerControllable.md @@ -0,0 +1,40 @@ +--- +title: IsPlayerControllable +sidebar_label: IsPlayerControllable +description: 检查玩家是否可被控制 +tags: ["玩家"] +--- + + + +## 描述 + +检测玩家角色是否处于可控制状态。 + +| 参数 | 说明 | +| -------- | ------- | +| playerid | 玩家 ID | + +## 返回值 + +**true** - 玩家可控制 +**false** - 玩家不可控制(如被冻结状态) + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + // 如果玩家被冻结则解除冻结 + if (!IsPlayerControllable(playerid)) + { + TogglePlayerControllable(playerid, true); + } + + return 1; +} +``` + +## 相关函数 + +- [TogglePlayerControllable](TogglePlayerControllable): 切换玩家控制状态(同时禁用视角移动) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCuffed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCuffed.md new file mode 100644 index 00000000000..d32da6d2a51 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerCuffed.md @@ -0,0 +1,32 @@ +--- +title: IsPlayerCuffed +sidebar_label: IsPlayerCuffed +description: 检查玩家是否被手铐铐住 +tags: ["玩家"] +--- + + + +## 描述 + +检查玩家是否处于手铐束缚的特殊动作状态。 + +| 参数 | 说明 | +| -------- | ----------------- | +| playerid | 需要检查的玩家 ID | + +## 返回值 + +**true** - 玩家处于被铐状态 +**false** - 玩家未被束缚 + +## 示例 + +```c +SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED); + +if (IsPlayerCuffed(playerid)) +{ + // 执行相关逻辑 +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneFlashing.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneFlashing.md new file mode 100644 index 00000000000..c10ac8bf87a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneFlashing.md @@ -0,0 +1,70 @@ +--- +title: IsPlayerGangZoneFlashing +sidebar_label: IsPlayerGangZoneFlashing +description: 检查玩家的私人帮派区域是否处于闪烁状态 +tags: ["玩家", "帮派区域", "私人帮派区域"] +--- + + + +## 描述 + +检测指定玩家的私人帮派区域是否正在闪烁。 + +| 参数 | 说明 | +| -------- | ------------------------- | +| playerid | 绑定帮派区域的玩家 ID | +| zoneid | 需要检查的私人帮派区域 ID | + +## 返回值 + +**true** - 帮派区域正在闪烁 +**false** - 未闪烁或区域不存在 + +## 示例 + +```c +new gGangZoneID[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 为玩家创建私人帮派区域(坐标范围) + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + // 向玩家显示红色帮派区域 + PlayerGangZoneShow(playerid, gGangZoneID[playerid], 0xFF0000FF); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + // 设置帮派区域闪烁(青色闪烁效果) + PlayerGangZoneFlash(playerid, gGangZoneID[playerid], 0x45D1ABFF); + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + if (IsPlayerGangZoneFlashing(playerid, gGangZoneID[playerid])) + { + PlayerGangZoneStopFlash(playerid, gGangZoneID[playerid]); + } + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁玩家帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示玩家帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏玩家帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动帮派区域闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止闪烁效果 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色值 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取基础颜色值 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围(最小/最大 XY 坐标) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证帮派区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在专属区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检查帮派区域可见性状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneVisible.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneVisible.md new file mode 100644 index 00000000000..d8427462ff6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerGangZoneVisible.md @@ -0,0 +1,72 @@ +--- +title: IsPlayerGangZoneVisible +sidebar_label: IsPlayerGangZoneVisible +description: 检查玩家帮派区域是否可见 +tags: ["玩家", "帮派区域", "玩家帮派区域"] +--- + + + +## 描述 + +检查玩家帮派区域是否可见 + +| 参数名 | 说明 | +| -------- | ------------------------- | +| playerid | 绑定玩家帮派区域的玩家 ID | +| zoneid | 玩家帮派区域 ID | + +## 返回值 + +**true** - 玩家帮派区域可见 + +**false** - 玩家帮派区域不可见 + +## 示例代码 + +```c +new gGangZoneID[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + // 向玩家显示帮派区域 + PlayerGangZoneShow(playerid, gGangZoneID[playerid], 0xFF0000FF); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/zone", true)) + { + if (IsPlayerGangZoneVisible(playerid, gGangZoneID[playerid])) + { + SendClientMessage(playerid, 0x00FF00FF, "Gangzone is visible."); + } + else + { + SendClientMessage(playerid, 0xFF0000FF, "Gangzone is not visible."); + } + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁玩家帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示玩家帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏玩家帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动玩家帮派区域闪烁 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止玩家帮派区域闪烁 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取玩家帮派区域闪烁颜色 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取玩家帮派区域颜色 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取帮派区域坐标(以 minX, minY, maxX, maxY 表示) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证玩家帮派区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在帮派区域内 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测玩家帮派区域是否在闪烁 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用玩家进出区域时的回调 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInAnyVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInAnyVehicle.md new file mode 100644 index 00000000000..06a6e57d3ce --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInAnyVehicle.md @@ -0,0 +1,46 @@ +--- +title: IsPlayerInAnyVehicle +sidebar_label: IsPlayerInAnyVehicle +description: 检查玩家是否处于任何车辆内(作为驾驶员或乘客) +tags: ["玩家", "车辆"] +--- + +## 描述 + +检测玩家是否乘坐于任何车辆内(包含驾驶位或乘客座位) + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +**true** - 玩家正在车辆内 + +**false** - 玩家未处于任何车辆 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/invehicle", true) == 0) + { + if (IsPlayerInAnyVehicle(playerid)) + { + SendClientMessage(playerid, 0x00FF00FF, "你正在车辆中"); + } + else + { + SendClientMessage(playerid, 0xFF0000FF, "你未乘坐任何车辆"); + } + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [IsPlayerInVehicle](IsPlayerInVehicle): 检测玩家是否处于指定车辆 +- [GetPlayerVehicleSeat](GetPlayerVehicleSeat): 获取玩家当前乘坐的座位编号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInCheckpoint.md new file mode 100644 index 00000000000..36b4f3c9a33 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInCheckpoint.md @@ -0,0 +1,45 @@ +--- +title: IsPlayerInCheckpoint +sidebar_label: IsPlayerInCheckpoint +description: 检测玩家是否处于检查点内,可用于房产或传送点等场景 +tags: ["玩家", "检查点"] +--- + +## 描述 + +检测玩家当前是否处于检查点范围内,该功能常用于房产系统或传送点等交互场景 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +**false** - 玩家未处于检查点内 + +**true** - 玩家正处于检查点内 + +## 示例代码 + +```c +if (IsPlayerInCheckpoint(playerid)) +{ + SetPlayerHealth(playerid, 100.0); +} +``` + +## 相关函数 + +- [SetPlayerCheckpoint](SetPlayerCheckpoint): 为玩家创建检查点 +- [IsPlayerCheckpointActive](IsPlayerCheckpointActive): 检测玩家当前是否显示检查点 +- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): 禁用玩家当前检查点 +- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): 为玩家创建竞速检查点 +- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): 禁用玩家当前竞速检查点 +- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): 检测玩家是否处于竞速检查点 + +## 相关回调 + +- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): 当玩家进入检查点时触发 +- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): 当玩家离开检查点时触发 +- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): 当玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): 当玩家离开竞速检查点时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInDriveByMode.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInDriveByMode.md new file mode 100644 index 00000000000..da79c2f3175 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInDriveByMode.md @@ -0,0 +1,31 @@ +--- +title: IsPlayerInDriveByMode +sidebar_label: IsPlayerInDriveByMode +description: 检测玩家是否处于驾驶扫射模式 +tags: ["玩家"] +--- + + + +## 描述 + +检测玩家是否处于驾驶扫射模式 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +**true** - 玩家处于驾驶扫射模式 + +**false** - 玩家未处于驾驶扫射模式 + +## 示例代码 + +```c +if (IsPlayerInDriveByMode(playerid)) +{ + // 执行相关操作 +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInGangZone.md new file mode 100644 index 00000000000..2dc74cf6a9a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInGangZone.md @@ -0,0 +1,50 @@ +--- +title: IsPlayerInGangZone +sidebar_label: IsPlayerInGangZone +description: 检测玩家是否处于帮派区域内 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +检测玩家是否处于帮派区域内 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | +| zoneid | 帮派区域 ID | + +## 返回值 + +**true** - 玩家处于帮派区域内 + +**false** - 玩家未处于帮派区域内 + +## 注意事项 + +:::warning + +本函数仅适用于 open.mp 平台,SA-MP 需使用[YSF 插件](https://github.com/IS4Code/YSF/releases) + +::: + +:::warning + +必须预先调用[UseGangZoneCheck](UseGangZoneCheck)函数方可使用本检测功能 + +::: + +## 相关函数 + +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为全体玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为全体玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家闪烁 +- [IsValidGangZone](IsValidGangZone): 验证帮派区域有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInModShop.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInModShop.md new file mode 100644 index 00000000000..dd295079a09 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInModShop.md @@ -0,0 +1,52 @@ +--- +title: IsPlayerInModShop +sidebar_label: IsPlayerInModShop +description: 检测玩家是否处于改装店内 +tags: ["玩家"] +--- + + + +## 描述 + +检测玩家是否处于改装店内 + +## 参数说明 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +**true** - 玩家处于改装店内 + +**false** - 玩家未处于改装店内 + +## 示例代码 + +```c +if (IsPlayerInModShop(playerid)) +{ + SendClientMessage(playerid, 0xFFFF00FF, "你正处于改装店内"); +} +else +{ + SendClientMessage(playerid, 0xFF0000FF, "你未处于改装店内"); +} +``` + +## 相关函数 + +下列函数可能对本功能有参考价值,因存在关联性: + +- [AddVehicleComponent](AddVehicleComponent): 为车辆添加改装组件 + +## 相关回调 + +下列回调可能与本功能相关,建议配合使用: + +- [OnVehicleMod](../callbacks/OnVehicleMod): 当车辆被改装时触发 +- [OnVehicleRespray](../callbacks/OnVehicleRespray): 当玩家离开改装店时触发(即使未更改颜色) +- [OnVehiclePaintjob](../callbacks/OnVehiclePaintjob): 当玩家预览车辆涂装时触发 +- [OnEnterExitModShop](../callbacks/OnEnterExitModShop): 当玩家进出改装店时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInPlayerGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInPlayerGangZone.md new file mode 100644 index 00000000000..ae8df0155c0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInPlayerGangZone.md @@ -0,0 +1,69 @@ +--- +title: IsPlayerInPlayerGangZone +sidebar_label: IsPlayerInPlayerGangZone +description: 验证玩家是否处于其绑定的玩家帮派区域 +tags: ["玩家", "帮派区域", "玩家帮派区域"] +--- + + + +## 描述 + +检测指定玩家是否处于其专属的玩家帮派区域范围内 + +| 参数名 | 说明 | +| -------- | ----------------------- | +| playerid | 绑定该帮派区域的玩家 ID | +| zoneid | 玩家帮派区域标识符 | + +## 返回值 + +**true** - 玩家处于专属帮派区域 + +**false** - 玩家未处于专属帮派区域 + +## 示例代码 + +```c +new gGangZoneID[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/zone", true)) + { + if (IsPlayerInPlayerGangZone(playerid, gGangZoneID[playerid])) + { + SendClientMessage(playerid, 0x00FF00FF, "您正处于专属帮派领地"); + } + else + { + SendClientMessage(playerid, 0xFF0000FF, "您未处于专属帮派领地"); + } + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 移除玩家专属帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示玩家专属帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏玩家专属帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 激活帮派区域闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止帮派区域闪烁 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取帮派区域闪烁颜色 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取帮派区域基础颜色 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取帮派区域坐标范围(minX, minY, maxX, maxY) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证玩家帮派区域有效性 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测帮派区域可见状态 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测帮派区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出状态监测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRaceCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRaceCheckpoint.md new file mode 100644 index 00000000000..67decd153d1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRaceCheckpoint.md @@ -0,0 +1,45 @@ +--- +title: IsPlayerInRaceCheckpoint +sidebar_label: IsPlayerInRaceCheckpoint +description: 检测玩家是否处于当前设置的竞速检查点内 +tags: ["玩家", "检查点", "竞速检查点"] +--- + +## 描述 + +检测玩家是否处于通过 SetPlayerRaceCheckpoint 设置的竞速检查点范围内 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +**true** - 玩家处于竞速检查点内 + +**false** - 玩家未处于竞速检查点内 + +## 示例代码 + +```c +if (IsPlayerInRaceCheckpoint(playerid)) +{ + SetPlayerHealth(playerid, 100.0); +} +``` + +## 相关函数 + +- [SetPlayerCheckpoint](SetPlayerCheckpoint): 为玩家创建常规检查点 +- [IsPlayerRaceCheckpointActive](IsPlayerRaceCheckpointActive): 检测玩家是否显示竞速检查点 +- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): 禁用玩家当前常规检查点 +- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): 检测玩家是否处于常规检查点 +- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): 为玩家创建竞速检查点 +- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): 禁用玩家当前竞速检查点 + +## 相关回调 + +- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): 当玩家进入常规检查点时触发 +- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): 当玩家离开常规检查点时触发 +- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): 当玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): 当玩家离开竞速检查点时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRangeOfPoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRangeOfPoint.md new file mode 100644 index 00000000000..9c20d1123cd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInRangeOfPoint.md @@ -0,0 +1,47 @@ +--- +title: IsPlayerInRangeOfPoint +sidebar_label: IsPlayerInRangeOfPoint +description: 检测玩家是否处于指定坐标点范围内 +tags: ["玩家"] +--- + +## 描述 + +快速检测玩家是否处于三维坐标点范围内(原生函数性能优于 PAWN 的距离公式计算) + +| 参数名 | 说明 | +| ----------- | -------------------------------------- | +| playerid | 目标玩家 ID | +| Float:range | 检测半径(最大有效距离,使用浮点数值) | +| Float:x | 检测点 X 坐标(浮点数值) | +| Float:y | 检测点 Y 坐标(浮点数值) | +| Float:z | 检测点 Z 坐标(浮点数值) | + +## 返回值 + +**true** - 玩家坐标在检测范围内 + +**false** - 玩家坐标超出检测范围 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/stadium", true)) + { + if (IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438)) + { + SendClientMessage(playerid, 0xFFFFFFFF, "您位于体育馆入口区域!"); + } + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerDistanceFromPoint](GetPlayerDistanceFromPoint): 获取玩家与坐标点精确距离 +- [GetVehicleDistanceFromPoint](GetVehicleDistanceFromPoint): 获取车辆与坐标点精确距离 +- [GetPlayerPos](GetPlayerPos): 获取玩家当前三维坐标 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInVehicle.md new file mode 100644 index 00000000000..07164948c76 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerInVehicle.md @@ -0,0 +1,51 @@ +--- +title: IsPlayerInVehicle +sidebar_label: IsPlayerInVehicle +description: 验证玩家是否乘坐于特定车辆实例 +tags: ["玩家", "车辆"] +--- + +## 描述 + +检测玩家当前是否乘坐于指定车辆实例内 + +| 参数名 | 说明 | +| --------- | ------------------------------------ | +| playerid | 目标玩家 ID | +| vehicleid | 车辆实例 ID(注意:非车辆模型 ID!) | + +## 返回值 + +**true** - 玩家处于该车辆内 + +**false** - 玩家未处于该车辆内 + +## 示例代码 + +```c +new gSpecialCar; + +public OnGameModeInit() +{ + gSpecialCar = AddStaticVehicle(411, 0.0, 0.0, 5.0, 0.0, -1, -1); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/gSpecialCar", true) == 0) + { + if (IsPlayerInVehicle(playerid, gSpecialCar)) + { + SendClientMessage(playerid, -1, "您正在特殊车辆中!"); + } + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [IsPlayerInAnyVehicle](IsPlayerInAnyVehicle): 检测玩家是否乘坐于任意车辆 +- [GetPlayerVehicleSeat](GetPlayerVehicleSeat): 查询玩家当前座位位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerNPC.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerNPC.md new file mode 100644 index 00000000000..1451efb6c86 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerNPC.md @@ -0,0 +1,40 @@ +--- +title: IsPlayerNPC +sidebar_label: IsPlayerNPC +description: 验证玩家身份是否为非玩家角色(NPC) +tags: ["玩家", "非玩家角色"] +--- + +## 描述 + +检测指定玩家是否属于系统控制的非玩家角色(NPC) + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 需要检测的玩家 ID | + +## 返回值 + +**true** - 目标为 NPC 角色 + +**false** - 目标为真实玩家 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + if (IsPlayerNPC(playerid)) + { + SendClientMessageToAll(-1, "有NPC角色接入服务器!"); + return 1; + } + + // 以下代码仅在真实玩家连接时执行 +} +``` + +## 相关函数 + +- [ConnectNPC](ConnectNPC): 建立 NPC 角色连接 +- [IsPlayerAdmin](IsPlayerAdmin): 验证玩家管理员权限状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMaterialSlotUsed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMaterialSlotUsed.md new file mode 100644 index 00000000000..ff95df76304 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMaterialSlotUsed.md @@ -0,0 +1,58 @@ +--- +title: IsPlayerObjectMaterialSlotUsed +sidebar_label: IsPlayerObjectMaterialSlotUsed +description: 检测玩家物体材质槽位是否被使用 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +检测指定玩家物体的材质槽位使用状态 + +| 参数名 | 说明 | +| ------------- | ------------------------------- | +| playerid | 目标玩家 ID | +| objectid | 玩家物体 ID | +| materialIndex | 材质槽位索引值(有效范围 0-15) | + +## 返回值 + +返回材质槽位使用类型: + +`0` - 未使用 + +`1` - 材质贴图 + +`2` - 文本贴图 + +## 示例代码 + +```c +new playerobjectid = CreatePlayerObject(playerid, 19371, 978.71143, -925.25708, 42.63720, 0.0, 0.0, 2.0); +SetPlayerObjectMaterial(playerid, playerobjectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); + +new type = IsPlayerObjectMaterialSlotUsed(playerid, playerobjectid, 0); +// type值为1 +``` + +另一示例: + +```c +new playerobjectid = CreatePlayerObject(playerid, 19174, 986.42767, -983.14850, 40.95220, 0.0, 0.0, 186.0); +SetPlayerObjectMaterialText(playerid, playerobjectid, "OPEN.MP", 0, + OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, + OBJECT_MATERIAL_TEXT_ALIGN_LEFT); + +new type = IsPlayerObjectMaterialSlotUsed(playerid, playerobjectid, 0); +// type值为2 +``` + +## 相关函数 + +- [SetPlayerObjectMaterial](SetPlayerObjectMaterial): 为玩家物体设置游戏内建材质 +- [SetPlayerObjectMaterialText](SetPlayerObjectMaterialText): 为玩家物体设置文本材质 +- [GetPlayerObjectMaterial](GetPlayerObjectMaterial): 获取玩家物体材质数据 +- [GetPlayerObjectMaterialText](GetPlayerObjectMaterialText): 获取玩家物体文本材质数据 +- [IsObjectMaterialSlotUsed](IsObjectMaterialSlotUsed): 检测物体材质槽位使用状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMoving.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMoving.md new file mode 100644 index 00000000000..8c3099e79d6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerObjectMoving.md @@ -0,0 +1,68 @@ +--- +title: IsPlayerObjectMoving +sidebar_label: IsPlayerObjectMoving +description: 检测指定玩家物体是否处于移动中 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +检测指定玩家物体是否处于移动状态 + +| 参数名 | 说明 | +| -------- | ------------------- | +| playerid | 需检测的玩家 ID | +| objectid | 待检测的玩家物体 ID | + +## 返回值 + +**1** - 玩家物体正在移动 + +**0** - 玩家物体处于静止 + +## 示例代码 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.2834, 0.0, 0.0, 96.0); + + MovePlayerObject(playerid, gPlayerObject[playerid], 2001.195679, 1547.113892, 10.0, 2.0); + + if (IsPlayerObjectMoving(playerid, gPlayerObject[playerid])) + { + StopPlayerObject(playerid, gPlayerObject[playerid]); + } + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachObjectToPlayer): 将玩家物体附加至玩家 +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [IsObjectMoving](IsObjectMoving): 检测物体移动状态 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加至玩家 + +## 相关回调 + +- [OnPlayerObjectMoved](../callbacks/OnPlayerObjectMoved): 当玩家物体停止移动时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerPickupStreamedIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerPickupStreamedIn.md new file mode 100644 index 00000000000..2bde68b1d76 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerPickupStreamedIn.md @@ -0,0 +1,57 @@ +--- +title: IsPlayerPickupStreamedIn +sidebar_label: IsPlayerPickupStreamedIn +description: 检测某个玩家拾取物是否已为该玩家加载。 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +检测指定玩家的专属拾取物是否已完成流加载。 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 要检测的玩家 ID | +| pickupid | 要检测的玩家拾取物 ID | + +## 返回值 + +当目标拾取物已完成流加载时返回 **true**,未加载时返回 **false**。 + +## 示例代码 + +```c +new PlayerPickup[MAX_PLAYERS]; // 创建变量存储玩家拾取物ID + +public OnPlayerConnect(playerid) +{ + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1242, 2, 2010.0979, 1222.0642, 10.8206, -1); + // 创建防弹衣拾取物并存储ID到变量 + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + if (IsPlayerPickupStreamedIn(playerid, PlayerPickup[playerid])) + { + // 执行相关逻辑 + } + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建专属玩家的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家专属拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家拾取物有效性 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家拾取物坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家拾取物坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置拾取物模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取拾取物模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置拾取物类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取拾取物类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置拾取物虚拟世界 +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取拾取物所在虚拟世界 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerRaceCheckpointActive.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerRaceCheckpointActive.md new file mode 100644 index 00000000000..5eaa8474458 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerRaceCheckpointActive.md @@ -0,0 +1,38 @@ +--- +title: IsPlayerRaceCheckpointActive +sidebar_label: IsPlayerRaceCheckpointActive +description: 检测玩家当前是否显示竞速检查点。 +tags: ["玩家", "检查点", "竞速检查点"] +--- + + + +## 描述 + +检测指定玩家的竞速检查点是否处于激活可见状态。 + +| 参数名 | 说明 | +| -------- | --------------- | +| playerid | 要检测的玩家 ID | + +## 返回值 + +当未显示竞速检查点时返回 **false**,否则返回 **true** + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + if (IsPlayerRaceCheckpointActive(playerid)) + { + // 执行相关逻辑 + } +} +``` + +## 相关函数 + +- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): 创建玩家专属竞速检查点 +- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): 检测玩家是否处于竞速检查点范围内 +- [IsPlayerCheckpointActive](IsPlayerCheckpointActive): 检测玩家是否激活普通检查点 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerSpawned.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerSpawned.md new file mode 100644 index 00000000000..cc00956b33d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerSpawned.md @@ -0,0 +1,40 @@ +--- +title: IsPlayerSpawned +sidebar_label: IsPlayerSpawned +description: 检测玩家是否已重生。 +tags: ["玩家"] +--- + + + +## 描述 + +检测指定玩家是否处于重生状态。 + +| 参数名 | 说明 | +| -------- | --------------- | +| playerid | 要检测的玩家 ID | + +## 返回值 + +**true** - 玩家已重生 + +**false** - 玩家未重生 + +## 示例代码 + +```c +public OnPlayerText(playerid, text[]) +{ + if (!IsPlayerSpawned(playerid)) + { + SendClientMessage(playerid, COLOR_RED, "错误:你必须重生后才能发送消息。"); + return 0; + } + return 1; +} +``` + +## 相关函数 + +- [SpawnPlayer](SpawnPlayer): 使玩家(重新)重生 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerStreamedIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerStreamedIn.md new file mode 100644 index 00000000000..5f7fc3850af --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerStreamedIn.md @@ -0,0 +1,58 @@ +--- +title: IsPlayerStreamedIn +sidebar_label: IsPlayerStreamedIn +description: 检测玩家是否在另一玩家的客户端中完成流加载。 +tags: ["玩家"] +--- + +## 描述 + +检测指定玩家是否在目标玩家的客户端中完成流加载。 + +| 参数名 | 说明 | +| ----------- | ------------------------------- | +| playerid | 被检测的玩家 ID | +| forplayerid | 目标玩家 ID(检测的客户端主体) | + +## 返回值 + +**true** - 玩家已完成流加载 + +**false** - 玩家未完成流加载 + +## 示例代码 + +```c +if (IsPlayerStreamedIn(playerid, 0)) +{ + SendClientMessage(playerid, -1, "ID 0 可以看到你。"); +} +``` + +## 注意事项 + +:::tip + +**SA-MP 服务器:** 玩家距离超过 200 米时自动流卸载(参见[server.cfg](../../server/server.cfg) - **stream_distance**) + +**open.mp 服务器:** 玩家距离超过 200 米时自动流卸载(参见[config.json](../../server/config.json) - **network.stream_radius**) + +::: + +:::warning + +玩家无法在自己的客户端流加载自身,当 playerid 与 forplayerid 相同时始终返回 false! + +::: + +## 相关函数 + +- [IsActorStreamedIn](IsActorStreamedIn): 检测角色是否已为玩家流加载 +- [IsVehicleStreamedIn](IsVehicleStreamedIn): 检测车辆是否已为玩家流加载 + +## 相关回调 + +- [OnPlayerStreamIn](../callbacks/OnPlayerStreamIn): 玩家完成流加载时触发 +- [OnPlayerStreamOut](../callbacks/OnPlayerStreamOut): 玩家完成流卸载时触发 +- [OnVehicleStreamIn](../callbacks/OnVehicleStreamIn): 车辆完成流加载时触发 +- [OnVehicleStreamOut](../callbacks/OnVehicleStreamOut): 车辆完成流卸载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTeleportAllowed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTeleportAllowed.md new file mode 100644 index 00000000000..71aae2c507e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTeleportAllowed.md @@ -0,0 +1,45 @@ +--- +title: IsPlayerTeleportAllowed +sidebar_label: IsPlayerTeleportAllowed +description: 该玩家是否可以通过右键点击地图进行传送? +tags: ["玩家"] +--- + + + +## 描述 + +检测指定玩家是否拥有地图右键传送权限。 + +| 参数名 | 说明 | +| -------- | --------------- | +| playerid | 要检测的玩家 ID | + +## 返回值 + +**true** - 允许地图传送 + +**false** - 禁止地图传送 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + AllowPlayerTeleport(playerid, true); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + if (IsPlayerTeleportAllowed(playerid)) + { + // 执行相关操作 + } + return 1; +} +``` + +## 相关函数 + +- [AllowPlayerTeleport](AllowPlayerTeleport): 设置玩家的地图传送权限 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTextDrawVisible.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTextDrawVisible.md new file mode 100644 index 00000000000..97a242624a3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerTextDrawVisible.md @@ -0,0 +1,63 @@ +--- +title: IsPlayerTextDrawVisible +sidebar_label: IsPlayerTextDrawVisible +description: 检测玩家专属文本绘图是否对指定玩家可见。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +检测指定玩家的专属文本绘图是否处于显示状态。 + +| 参数名 | 说明 | +| ----------------- | ----------------- | +| playerid | 要检测的玩家 ID | +| PlayerText:textid | 玩家文本绘图的 ID | + +## 返回值 + +**true** - 文本绘图当前可见 + +**false** - 文本绘图当前不可见 + +## 示例代码 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; // 创建玩家文本绘图存储数组 + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的OPEN.MP服务器"); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + if (IsPlayerTextDrawVisible(playerid, welcomeText[playerid])) + { + // 玩家文本绘图已显示 + } + else + { + // 玩家文本绘图未显示 + } +} +``` + +## 相关函数 + +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置文本框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置绘制区域尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 启用文本描边 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置文本阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用比例间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 启用文本框 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 更新文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏文本绘图 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 验证文本绘图有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOfficialClient.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOfficialClient.md new file mode 100644 index 00000000000..bd1d86f44f2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOfficialClient.md @@ -0,0 +1,40 @@ +--- +title: IsPlayerUsingOfficialClient +sidebar_label: IsPlayerUsingOfficialClient +description: 检测玩家是否使用官方SA-MP客户端。 +tags: ["玩家"] +--- + + + +## 描述 + +检测指定玩家是否使用官方 SA-MP 客户端。 + +| 参数名 | 说明 | +| -------- | --------------- | +| playerid | 要检测的玩家 ID | + +## 返回值 + +当玩家使用官方客户端时返回 1,否则返回 0 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + if (IsPlayerUsingOfficialClient(playerid) == 0) + { + SendClientMessage(playerid, 0xFF0000FF, "[踢出]: 检测到您未使用官方SA-MP客户端!"); + Kick(playerid); + } + + return 1; +} +``` + +## 相关函数 + +- [IsPlayerUsingOmp](IsPlayerUsingOmp): 检测玩家是否使用 open.mp 启动器 +- [SendClientCheck](SendClientCheck): 执行客户端内存校验 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOmp.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOmp.md new file mode 100644 index 00000000000..a5ec941c53e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerUsingOmp.md @@ -0,0 +1,47 @@ +--- +title: IsPlayerUsingOmp +sidebar_label: IsPlayerUsingOmp +description: 检测玩家是否使用open.mp启动器。 +tags: ["玩家"] +--- + + + +## 描述 + +检测指定玩家是否正在使用 open.mp 启动器。 + +| 参数名 | 说明 | +| -------- | --------------- | +| playerid | 要检测的玩家 ID | + +## 返回值 + +当玩家使用 open.mp 启动器时返回 1,否则返回 0 + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + // 玩家正在使用open.mp启动器 + if(IsPlayerUsingOmp(playerid)) + { + SendClientMessage(playerid, -1, "您正在使用open.mp启动器。"); + } + + // 玩家未使用open.mp启动器 + else + { + SendClientMessage(playerid, 0xFF0000FF, "[踢出]: 检测到您未使用open.mp启动器"); + Kick(playerid); + } + + return 1; +} +``` + +## 相关函数 + +- [IsPlayerUsingOfficialClient](IsPlayerUsingOfficialClient): 检测玩家是否使用官方 SA-MP 客户端 +- [SendClientCheck](SendClientCheck): 执行客户端内存校验 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerWidescreenToggled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerWidescreenToggled.md new file mode 100644 index 00000000000..ed900c45879 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsPlayerWidescreenToggled.md @@ -0,0 +1,40 @@ +--- +title: IsPlayerWidescreenToggled +sidebar_label: IsPlayerWidescreenToggled +description: 检测玩家宽屏模式开启状态。 +tags: ["玩家"] +--- + + + +## 描述 + +检测指定玩家的宽屏模式是否处于激活状态。 + +| 参数名 | 说明 | +| -------- | --------------- | +| playerid | 要检测的玩家 ID | + +## 返回值 + +**true** - 玩家已启用宽屏模式 + +**false** - 玩家未启用宽屏模式 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/widescreencheck", true)) + { + SendClientMessage(playerid, -1, "宽屏模式:%s", IsPlayerWidescreenToggled(playerid) ? "开启" : "关闭"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [TogglePlayerWidescreen](TogglePlayerWidescreen): 切换玩家宽屏模式状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsRepeatingTimer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsRepeatingTimer.md new file mode 100644 index 00000000000..7a533cc342c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsRepeatingTimer.md @@ -0,0 +1,49 @@ +--- +title: IsRepeatingTimer +sidebar_label: IsRepeatingTimer +description: 检测定时器是否设置为循环执行。 +tags: ["定时器"] +--- + + + +## 描述 + +检测指定定时器是否配置为循环模式。 + +## 参数说明 + +| 参数名 | 说明 | +| ------- | ----------------- | +| timerid | 要检测的定时器 ID | + +## 返回值 + +**true**: 定时器为循环模式 + +**false**: 定时器为单次模式 + +## 示例代码 + +```c +new g_Timer; // 声明定时器存储变量 + +public OnGameModeInit() +{ + g_Timer = SetTimer("TimerCallback", 60000, true); // 创建每分钟循环的定时器 + + if (IsRepeatingTimer(g_Timer)) + { + // 执行循环模式相关操作 + } + return 1; +} +``` + +## 相关函数 + +- [SetTimer](SetTimer): 创建基础定时器 +- [SetTimerEx](SetTimerEx): 创建带参数的定时器 +- [KillTimer](KillTimer): 终止定时器运行 +- [IsValidTimer](IsValidTimer): 验证定时器有效性 +- [CountRunningTimers](CountRunningTimers): 统计运行中的定时器数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsTextDrawVisibleForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsTextDrawVisibleForPlayer.md new file mode 100644 index 00000000000..254eecdd741 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsTextDrawVisibleForPlayer.md @@ -0,0 +1,56 @@ +--- +title: IsTextDrawVisibleForPlayer +sidebar_label: IsTextDrawVisibleForPlayer +description: 检测玩家的文本绘图是否可见。 +tags: ["文本绘图"] +--- + + + +## 描述 + +检测指定玩家的全局文本绘图是否处于显示状态。 + +| 参数名 | 说明 | +| ----------- | ------------------- | +| playerid | 要检测的玩家 ID | +| Text:textid | 要检测的文本绘图 ID | + +## 返回值 + +**true** - 文本绘图当前可见 + +**false** - 文本绘图当前隐藏 + +## 示例代码 + +```c +new Text:gMyTextdraw; // 声明全局文本绘图变量 + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(240.0, 580.0, "示例文本"); + return 1; +} + +public OnPlayerConnect(playerid) +{ + TextDrawShowForPlayer(playerid, gMyTextdraw); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + if (IsTextDrawVisibleForPlayer(playerid, gMyTextdraw)) + { + // 文本绘图对玩家可见 + } + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建全局文本绘图 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为指定玩家隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsTrailerAttachedToVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsTrailerAttachedToVehicle.md new file mode 100644 index 00000000000..d68ad21936a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsTrailerAttachedToVehicle.md @@ -0,0 +1,35 @@ +--- +title: IsTrailerAttachedToVehicle +sidebar_label: IsTrailerAttachedToVehicle +description: 检测车辆是否连接有拖车。 +tags: ["车辆"] +--- + +## 描述 + +检测指定车辆是否连接有拖车。可通过[GetVehicleTrailer](GetVehicleTrailer)获取拖车 ID(若存在)。 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 要检测的车辆 ID | + +## 返回值 + +**true** - 车辆当前连接拖车 + +**false** - 车辆未连接拖车 + +## 示例代码 + +```c +if (IsTrailerAttachedToVehicle(vehicleid)) +{ + printf("车辆 %i 正在牵引拖车!", vehicleid); +} +``` + +## 相关函数 + +- [GetVehicleTrailer](GetVehicleTrailer): 获取车辆牵引的拖车 ID +- [AttachTrailerToVehicle](AttachTrailerToVehicle): 将拖车连接到车辆 +- [DetachTrailerFromVehicle](DetachTrailerFromVehicle): 解除车辆与拖车的连接 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValid3DTextLabel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValid3DTextLabel.md new file mode 100644 index 00000000000..2d13f692b43 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValid3DTextLabel.md @@ -0,0 +1,42 @@ +--- +title: IsValid3DTextLabel +sidebar_label: IsValid3DTextLabel +description: 检测3D文本标签是否有效。 +tags: ["3D文本标签"] +--- + + + +## 描述 + +检测指定的全局 3D 文本标签是否有效。 + +| 参数名 | 说明 | +| ------------- | ----------------------- | +| Text3D:textid | 要检测的 3D 文本标签 ID | + +## 返回值 + +当 3D 文本标签有效时返回 **true**,无效时返回 **false** + +## 示例代码 + +```c +new Text3D:gMyLabel; // 声明全局3D文本标签变量 + +public OnGameModeInit() +{ + gMyLabel = Create3DTextLabel("当前坐标:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false); + + if (IsValid3DTextLabel(gMyLabel)) + { + // 执行相关逻辑 + } + return 1; +} +``` + +## 相关函数 + +- [Create3DTextLabel](Create3DTextLabel): 在指定坐标创建全局 3D 文本标签 +- [IsValidPlayer3DTextLabel](IsValidPlayer3DTextLabel): 检测玩家 3D 文本标签有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidActor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidActor.md new file mode 100644 index 00000000000..49403ce9f42 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidActor.md @@ -0,0 +1,45 @@ +--- +title: IsValidActor +sidebar_label: IsValidActor +description: 检测角色ID是否有效。 +tags: ["角色"] +--- + + + +## 描述 + +检测指定角色 ID 是否有效。 + +| 参数名 | 说明 | +| ------- | --------------- | +| actorid | 要检测的角色 ID | + +## 返回值 + +**true** - 角色有效 + +**false** - 角色无效 + +## 示例代码 + +```c +new gMyActor; // 声明角色存储变量 + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // 在武器商店创建销售员角色 + + if (IsValidActor(gMyActor)) + { + SetActorHealth(gMyActor, 100.0); // 设置角色生命值 + } + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor): 创建新角色 +- [GetActorPoolSize](GetActorPoolSize): 获取服务器最大角色 ID +- [SetActorHealth](SetActorHealth): 设置角色生命值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidAnimationLibrary.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidAnimationLibrary.md new file mode 100644 index 00000000000..6b906214a28 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidAnimationLibrary.md @@ -0,0 +1,41 @@ +--- +title: IsValidAnimationLibrary +sidebar_label: IsValidAnimationLibrary +description: 检测指定动画库是否有效。 +tags: ["动画"] +--- + + + +## 描述 + +检测给定动画库名称是否有效。 + +| 参数名 | 说明 | +| ------------ | ------------------ | +| const name[] | 待检测的动画库名称 | + +## 返回值 + +当动画库有效时返回 **true**,否则返回 **false** + +## 示例代码 + +```c +if (IsValidAnimationLibrary("PED")) +{ + // 动画库有效 +} +else +{ + // 动画库无效 +} +``` + +## 相关函数 + +- [ApplyAnimation](ApplyAnimation): 为玩家应用动画效果 + +## 相关资源 + +- [动画资源](../resources/animations) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidCustomModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidCustomModel.md new file mode 100644 index 00000000000..b9c0996e7c0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidCustomModel.md @@ -0,0 +1,28 @@ +--- +title: IsValidCustomModel +sidebar_label: IsValidCustomModel +description: 检测自定义模型ID是否有效。 +tags: ["自定义模型", "自定义皮肤", "简单模型"] +--- + + + +## 描述 + +检测指定的自定义模型 ID 是否有效。 + +| 参数名 | 说明 | +| ------- | --------------------- | +| modelid | 要检测的自定义模型 ID | + +## 返回值 + +**true** - 自定义模型 ID 有效 + +**false** - 自定义模型 ID 无效 + +## 相关函数 + +- [AddSimpleModel](AddSimpleModel): 添加新的自定义简单物体模型 +- [AddSimpleModelTimed](AddSimpleModelTimed): 添加带时限的自定义简单物体模型 +- [GetCustomModelPath](GetCustomModelPath): 获取自定义模型文件路径 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidGangZone.md new file mode 100644 index 00000000000..8d0dbdd597d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidGangZone.md @@ -0,0 +1,34 @@ +--- +title: IsValidGangZone +sidebar_label: IsValidGangZone +description: 检测帮派区域是否有效。 +tags: ["帮派区域"] +--- + + + +## 描述 + +检测指定帮派区域 ID 是否有效。 + +| 参数名 | 说明 | +| ------ | ------------------- | +| zoneid | 要检测的帮派区域 ID | + +## 返回值 + +**true** - 帮派区域有效 + +**false** - 帮派区域无效 + +## 相关函数 + +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 为所有玩家显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 为玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 为所有玩家隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 使帮派区域对玩家闪烁 +- [GangZoneFlashForAll](GangZoneFlashForAll): 使帮派区域对所有玩家闪烁 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止帮派区域对玩家的闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止帮派区域对所有玩家的闪烁 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidMenu.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidMenu.md new file mode 100644 index 00000000000..5a871ff2e73 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidMenu.md @@ -0,0 +1,36 @@ +--- +title: IsValidMenu +sidebar_label: IsValidMenu +description: 检测菜单ID是否有效。 +tags: ["菜单"] +--- + +## 描述 + +检测指定菜单 ID 是否有效。 + +| 参数名 | 说明 | +| ----------- | --------------- | +| Menu:menuid | 要检测的菜单 ID | + +## 返回值 + +**true** - 菜单有效 + +**false** - 菜单无效 + +## 相关函数 + +- [CreateMenu](CreateMenu): 创建新菜单 +- [DestroyMenu](DestroyMenu): 销毁指定菜单 +- [DisableMenu](DisableMenu): 禁用菜单 +- [DisableMenuRow](DisableMenuRow): 全局禁用指定菜单行 +- [AddMenuItem](AddMenuItem): 添加菜单选项 +- [SetMenuColumnHeader](SetMenuColumnHeader): 设置菜单列标题 +- [IsMenuDisabled](IsMenuDisabled): 检测菜单禁用状态 +- [IsMenuRowDisabled](IsMenuRowDisabled): 检测菜单行禁用状态 + +## 相关回调 + +- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): 玩家选择菜单项时触发 +- [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu): 玩家退出菜单时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidNickName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidNickName.md new file mode 100644 index 00000000000..00a3db164f8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidNickName.md @@ -0,0 +1,47 @@ +--- +title: IsValidNickName +sidebar_label: IsValidNickName +description: 检测昵称是否符合规范。 +tags: [] +--- + + + +## 描述 + +检测指定昵称字符串是否符合服务器命名规则。 + +| 参数名 | 说明 | +| ------------ | ------------------ | +| const name[] | 待检测的昵称字符串 | + +## 返回值 + +当昵称符合规范时返回 **true**,否则返回 **false** + +## 示例代码 + +```c +if (IsValidNickName("Barnaby_Keene")) +{ + // 执行相关操作 +} +else +{ + SendClientMessage(playerid, 0xFF0000FF, "您的昵称不符合规范。"); +} +``` + +## 注意事项 + +:::tip + +默认允许的昵称字符包含:数字(0-9)、大小写字母(a-z/A-Z)以及符号 `[]()$@.\_=` + +::: + +## 相关函数 + +- [AllowNickNameCharacter](AllowNickNameCharacter): 允许特定字符用于昵称 +- [SetPlayerName](SetPlayerName): 设置玩家昵称 +- [GetPlayerName](GetPlayerName): 获取玩家当前昵称 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidObject.md new file mode 100644 index 00000000000..df7a1fcece9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidObject.md @@ -0,0 +1,71 @@ +--- +title: IsValidObject +sidebar_label: IsValidObject +description: 检测指定ID的物体是否存在。 +tags: ["物体"] +--- + +## 描述 + +检测指定 ID 的游戏物体是否存在于服务器中。 + +| 参数名 | 说明 | +| -------- | --------------- | +| objectid | 要检测的物体 ID | + +## 返回值 + +**true** - 物体存在 + +**false** - 物体不存在 + +## 示例代码 + +```c +new objectid; // 全局物体存储变量 + +public OnGameModeInit() +{ + objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + return 1; +} + +public OnGameModeExit() +{ + if (IsValidObject(objectid)) + { + DestroyObject(objectid); // 安全销毁物体 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +本函数仅检测物体实例是否存在,不验证模型 ID 是否有效 + +::: + +## 相关函数 + +- [CreateObject](CreateObject): 创建全局可见物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家身上 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 检测玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到另一玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPickup.md new file mode 100644 index 00000000000..7dc8cc64485 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPickup.md @@ -0,0 +1,57 @@ +--- +title: IsValidPickup +sidebar_label: IsValidPickup +description: 检测拾取物是否有效。 +tags: ["拾取物"] +--- + + + +## 描述 + +检测指定拾取物 ID 是否有效。 + +| 参数名 | 说明 | +| -------- | ----------------- | +| pickupid | 要检测的拾取物 ID | + +## 返回值 + +当拾取物有效时返回 **true**,无效时返回 **false** + +## 示例代码 + +```c +new g_Pickup; // 全局拾取物存储变量 + +public OnGameModeInit() +{ + // 在坐标(1503.33,1432.35,10.11)创建防弹衣拾取物 + g_Pickup = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1); + + if (IsValidPickup(g_Pickup)) + { + // 执行有效状态处理 + } + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建全局拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测玩家是否加载该拾取物 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物对玩家是否隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物所在虚拟世界 +- [ShowPickupForPlayer](ShowPickupForPlayer): 为玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 为玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家自定义拾取物属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayer3DTextLabel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayer3DTextLabel.md new file mode 100644 index 00000000000..e73b807f6cf --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayer3DTextLabel.md @@ -0,0 +1,41 @@ +--- +title: IsValidPlayer3DTextLabel +sidebar_label: IsValidPlayer3DTextLabel +description: 检测玩家的3D文本标签是否有效。 +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +检测指定玩家的专属 3D 文本标签是否有效。 + +| 参数名 | 说明 | +| ------------------- | --------------------- | +| playerid | 要检测的玩家 ID | +| PlayerText3D:textid | 玩家的 3D 文本标签 ID | + +## 返回值 + +当 3D 文本标签有效时返回 **true**,无效时返回 **false** + +## 示例代码 + +```c +new PlayerText3D:playerTextId; // 声明玩家3D文本标签变量 +new Float:X, Float:Y, Float:Z; + +GetPlayerPos(playerid, X, Y, Z); // 获取玩家当前位置 +playerTextId = CreatePlayer3DTextLabel(playerid, "你好\n我在你的位置", 0x008080FF, X, Y, Z, 40.0); + +if (IsValidPlayer3DTextLabel(playerid, playerTextId)) +{ + // 执行有效状态处理 +} +``` + +## 相关函数 + +- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): 创建玩家专属 3D 文本标签 +- [IsValid3DTextLabel](IsValid3DTextLabel): 检测全局 3D 文本标签有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerGangZone.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerGangZone.md new file mode 100644 index 00000000000..88c53003ed6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerGangZone.md @@ -0,0 +1,62 @@ +--- +title: IsValidPlayerGangZone +sidebar_label: IsValidPlayerGangZone +description: 检测玩家帮派区域有效性 +tags: ["玩家", "帮派区域", "玩家帮派区域"] +--- + + + +## 描述 + +检测指定玩家的帮派区域是否有效。 + +| 参数名 | 说明 | +| -------- | ----------------------- | +| playerid | 绑定的玩家 ID | +| zoneid | 要检测的玩家帮派区域 ID | + +## 返回值 + +**true** - 帮派区域有效 + +**false** - 帮派区域无效 + +## 示例代码 + +```c +// 用于存储帮派区域ID的变量 +new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); +} + +public OnPlayerSpawn(playerid) +{ + // 检测帮派区域有效性 + if(IsValidPlayerGangZone(playerid, gGangZoneID[playerid])) + { + PlayerGangZoneDestroy(playerid, gGangZoneID[playerid]); + gGangZoneID[playerid] = INVALID_GANG_ZONE; + } +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁玩家帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示玩家帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏玩家帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动帮派区域闪烁 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止帮派区域闪烁 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色值 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取基础颜色值 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域中 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出检测回调 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerObject.md new file mode 100644 index 00000000000..815e5a841d3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerObject.md @@ -0,0 +1,69 @@ +--- +title: IsValidPlayerObject +sidebar_label: IsValidPlayerObject +description: 检测玩家专属物体有效性 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +检测指定玩家的专属物体 ID 是否有效。 + +| 参数名 | 说明 | +| -------- | ------------------- | +| playerid | 要检测的玩家 ID | +| objectid | 要检测的玩家物体 ID | + +## 返回值 + +**true** - 玩家物体存在 + +**false** - 玩家物体不存在 + +## 示例代码 + +```c +new gPlayerObject[MAX_PLAYERS]; // 玩家物体存储数组 + +public OnPlayerConnect(playerid) +{ + // 在坐标(2001.19,1547.11,14.28)为玩家创建专属物体 + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + return 1; +} + +public OnPlayerDisconnect(playerid, reason) +{ + // 安全检测后删除物体 + if (IsValidPlayerObject(playerid, gPlayerObject[playerid])) + { + DestroyPlayerObject(playerid, gPlayerObject[playerid]); + } + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到另一玩家 + +### 全局物体操作 + +- [CreateObject](CreateObject): 创建全局可见物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [IsValidObject](IsValidObject): 检测全局物体有效性 +- [MoveObject](MoveObject): 移动全局物体 +- [StopObject](StopObject): 停止全局物体移动 +- [SetObjectPos](SetObjectPos): 设置全局物体坐标 +- [SetObjectRot](SetObjectRot): 设置全局物体旋转 +- [GetObjectPos](GetObjectPos): 获取全局物体坐标 +- [GetObjectRot](GetObjectRot): 获取全局物体旋转 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将全局物体附加到玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerPickup.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerPickup.md new file mode 100644 index 00000000000..92ad26f754a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerPickup.md @@ -0,0 +1,53 @@ +--- +title: IsValidPlayerPickup +sidebar_label: IsValidPlayerPickup +description: 检测玩家专属拾取物有效性 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +检测指定玩家的专属拾取物是否有效。 + +| 参数名 | 说明 | +| -------- | ----------------- | +| playerid | 要检测的玩家 ID | +| pickupid | 玩家专属拾取物 ID | + +## 返回值 + +当玩家专属拾取物有效时返回 **true**,无效时返回 **false** + +## 示例代码 + +```c +new PlayerPickup[MAX_PLAYERS]; // 声明玩家拾取物存储数组 + +public OnPlayerConnect(playerid) +{ + // 在坐标(2010.0979,1222.0642,10.8206)创建防弹衣拾取物 + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1242, 2, 2010.0979, 1222.0642, 10.8206, -1); + + if (IsValidPlayerPickup(playerid, PlayerPickup[playerid])) + { + // 执行有效状态处理 + } + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建玩家专属拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家专属拾取物 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检测玩家是否加载该拾取物 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家专属拾取物坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家专属拾取物坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家专属拾取物模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家专属拾取物模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家专属拾取物类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家专属拾取物类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家专属拾取物虚拟世界 +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家专属拾取物所在虚拟世界 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerTextDraw.md new file mode 100644 index 00000000000..4c4faa125b2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidPlayerTextDraw.md @@ -0,0 +1,64 @@ +--- +title: IsValidPlayerTextDraw +sidebar_label: IsValidPlayerTextDraw +description: 检测玩家文本绘图有效性 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +检测指定玩家的专属文本绘图是否有效。 + +## 参数说明 + +| 参数名 | 说明 | +| ----------------- | ----------------- | +| playerid | 要检测的玩家 ID | +| PlayerText:textid | 玩家的文本绘图 ID | + +## 返回值 + +当玩家文本绘图有效时返回 **true**,否则返回 **false** + +## 示例代码 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; // 玩家文本绘图存储数组 + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的OPEN.MP服务器"); + + if (IsValidPlayerTextDraw(playerid, welcomeText[playerid])) + { + // 玩家文本绘图有效 + } + else + { + // 玩家文本绘图无效 + } +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建全局文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁全局文本绘图 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置绘制区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidServerRule.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidServerRule.md new file mode 100644 index 00000000000..498d389ebae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidServerRule.md @@ -0,0 +1,38 @@ +--- +title: IsValidServerRule +sidebar_label: IsValidServerRule +description: 检测服务器规则有效性 +tags: ["服务器规则"] +--- + + + +## 描述 + +检测指定服务器规则是否有效。 + +| 参数名 | 说明 | +| ------------ | ---------------------- | +| const rule[] | 待检测的服务器规则名称 | + +## 返回值 + +当服务器规则有效时返回 **true**,否则返回 **false** + +## 示例代码 + +```c +if (IsValidServerRule("version")) +{ + // 服务器规则有效 +} +else +{ + // 服务器规则无效 +} +``` + +## 相关函数 + +- [AddServerRule](AddServerRule): 添加服务器规则 +- [RemoveServerRule](RemoveServerRule): 移除服务器规则 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTextDraw.md new file mode 100644 index 00000000000..7a134d4d302 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTextDraw.md @@ -0,0 +1,64 @@ +--- +title: IsValidTextDraw +sidebar_label: IsValidTextDraw +description: 检测文本绘图有效性 +tags: ["文本绘图"] +--- + + + +## 描述 + +检测指定文本绘图是否有效。 + +## 参数说明 + +| 参数名 | 说明 | +| ----------- | ------------------- | +| Text:textid | 要检测的文本绘图 ID | + +## 返回值 + +当文本绘图有效时返回 **true**,无效时返回 **false** + +## 示例代码 + +```c +new Text:gMyTextdraw; // 全局文本绘图存储变量 + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + + if (IsValidTextDraw(gMyTextdraw)) + { + // 文本绘图有效 + } + else + { + // 文本绘图无效 + } + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置绘制区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTimer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTimer.md new file mode 100644 index 00000000000..892cc1b7fa4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidTimer.md @@ -0,0 +1,59 @@ +--- +title: IsValidTimer +sidebar_label: IsValidTimer +description: 检测定时器有效性 +tags: ["定时器"] +--- + + + +## 描述 + +检测指定定时器 ID 是否有效。 + +## 参数说明 + +| 参数名 | 说明 | +| ------- | ----------------- | +| timerid | 要检测的定时器 ID | + +## 返回值 + +**true**: 定时器有效 + +**false**: 定时器无效 + +## 示例代码 + +```c +new g_Timer; // 全局定时器存储变量 + +public OnGameModeInit() +{ + // 创建每分钟循环的定时器 + g_Timer = SetTimer("TimerCallback", 60000, true); + return 1; +} + +public OnGameModeExit() +{ + if (IsValidTimer(g_Timer)) + { + printf("定时器ID %d 有效,即将终止", g_Timer); + KillTimer(g_Timer); + } + else + { + printf("定时器ID %d 无效", g_Timer); + } + return 1; +} +``` + +## 相关函数 + +- [SetTimer](SetTimer): 创建基础定时器 +- [SetTimerEx](SetTimerEx): 创建带参数的定时器 +- [KillTimer](KillTimer): 终止定时器运行 +- [IsRepeatingTimer](IsRepeatingTimer): 检测定时器循环状态 +- [CountRunningTimers](CountRunningTimers): 统计运行中的定时器数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidVehicle.md new file mode 100644 index 00000000000..3f1700ed2e6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsValidVehicle.md @@ -0,0 +1,65 @@ +--- +title: IsValidVehicle +sidebar_label: IsValidVehicle +description: 检测车辆是否已创建 +tags: ["车辆"] +--- + +:::note + +此函数在 SA-MP 服务器旧版库中不存在,但[维护库的最新版本](https://github.com/pawn-lang/samp-stdlib)包含此函数及其他缺失声明。 + +::: + +## 描述 + +检测指定车辆是否已被成功创建。 + +## 参数说明 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 要检测的车辆 ID | + +## 返回值 + +**true** - 车辆存在 + +**false** - 车辆不存在 + +## 示例代码 + +```c +#if !defined IsValidVehicle + native IsValidVehicle(vehicleid); +#endif + +// 统计服务器车辆数量 +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/countvehicles", true)) + { + new + count, + string[128]; + + for (new i = 0; i < MAX_VEHICLES; i++) + { + if (IsValidVehicle(i)) + { + count++; + } + } + + format(string, sizeof(string), "* 当前服务器共有 %d 辆有效车辆。", count); + SendClientMessage(playerid, 0x33CCCCFF, string); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerVehicleID](GetPlayerVehicleID): 获取玩家当前所在车辆 ID +- [GetVehicleModel](GetVehicleModel): 获取车辆模型 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleDead.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleDead.md new file mode 100644 index 00000000000..9c9b2950422 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleDead.md @@ -0,0 +1,41 @@ +--- +title: IsVehicleDead +sidebar_label: IsVehicleDead +description: 检测车辆是否处于损毁状态 +tags: ["车辆"] +--- + + + +## 描述 + +检测指定车辆是否处于损毁状态。 + +## 参数说明 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 要检测的车辆 ID | + +## 返回值 + +**true** - 车辆已损毁 + +**false** - 车辆正常运作 + +## 示例代码 + +```c +if (IsVehicleDead(vehicleid)) +{ + // 车辆已损毁 +} +else +{ + // 车辆正常运作 +} +``` + +## 相关函数 + +- [`SetVehicleDead`](SetVehicleDead): 设置车辆损毁状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleHidden.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleHidden.md new file mode 100644 index 00000000000..005fa0a0835 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleHidden.md @@ -0,0 +1,48 @@ +--- +title: IsVehicleHidden +sidebar_label: IsVehicleHidden +description: 检测车辆是否隐藏 +tags: ["车辆"] +--- + + + +:::warning + +该函数当前尚未实现 + +::: + +## 描述 + +检测指定车辆是否处于隐藏状态。 + +## 参数说明 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 要检测的车辆 ID | + +## 返回值 + +**true** - 车辆已隐藏 + +**false** - 车辆可见 + +## 示例代码 + +```c +if (IsVehicleHidden(vehicleid)) +{ + // 车辆已隐藏 +} +else +{ + // 车辆可见 +} +``` + +## 相关函数 + +- [HideVehicle](HideVehicle): 将车辆设为隐藏状态 +- [ShowVehicle](ShowVehicle): 取消车辆隐藏状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleOccupied.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleOccupied.md new file mode 100644 index 00000000000..e71e080e0ae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleOccupied.md @@ -0,0 +1,41 @@ +--- +title: IsVehicleOccupied +sidebar_label: IsVehicleOccupied +description: 检测车辆是否被占用 +tags: ["车辆"] +--- + + + +## 描述 + +检测指定车辆是否处于被占用状态。 + +## 参数说明 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 要检测的车辆 ID | + +## 返回值 + +**true** - 车辆已被占用 + +**false** - 车辆未被占用 + +## 示例代码 + +```c +if (IsVehicleOccupied(vehicleid)) +{ + // 车辆已被占用 +} +else +{ + // 车辆未被占用 +} +``` + +## 相关函数 + +- [SetVehicleBeenOccupied](SetVehicleBeenOccupied): 设置车辆占用状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleSirenEnabled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleSirenEnabled.md new file mode 100644 index 00000000000..4590461e845 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleSirenEnabled.md @@ -0,0 +1,42 @@ +--- +title: IsVehicleSirenEnabled +sidebar_label: IsVehicleSirenEnabled +description: 检测车辆警笛状态 +tags: ["车辆"] +--- + + + +## 描述 + +检测指定车辆的警笛是否处于开启状态。 + +## 参数说明 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 要检测的车辆 ID | + +## 返回值 + +**true** - 警笛开启 + +**false** - 警笛关闭 + +## 示例代码 + +```c +if (IsVehicleSirenEnabled(vehicleid)) +{ + // 警笛已开启 +} +else +{ + // 警笛已关闭 +} +``` + +## 相关函数 + +- [`SetVehicleParamsSirenState`](SetVehicleParamsSirenState): 设置车辆警笛状态 +- [`ToggleVehicleSirenEnabled`](ToggleVehicleSirenEnabled): 切换车辆警笛状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleStreamedIn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleStreamedIn.md new file mode 100644 index 00000000000..b9ff72da20b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/IsVehicleStreamedIn.md @@ -0,0 +1,51 @@ +--- +title: IsVehicleStreamedIn +sidebar_label: IsVehicleStreamedIn +description: 检测玩家是否加载了指定车辆 +tags: ["车辆"] +--- + +## 描述 + +检测指定车辆是否在玩家的游戏世界中已加载(流加载)。只有玩家附近的车辆才会被加载(可见)。 + +| 参数名 | 说明 | +| --------- | --------------- | +| vehicleid | 要检测的车辆 ID | +| playerid | 要检测的玩家 ID | + +## 返回值 + +**true** - 车辆已加载至玩家游戏 + +**false** - 车辆未加载或执行失败(玩家/车辆不存在) + +## 示例代码 + +```c +new streamedVehicleCount; // 已加载车辆计数器 + +// 遍历所有车辆ID +for(new i = 1; i < MAX_VEHICLES; i++) +{ + if (IsVehicleStreamedIn(i, playerid)) + { + streamedVehicleCount++; // 统计已加载车辆 + } +} + +new string[144]; +format(string, sizeof(string), "您当前已加载了 %i 辆车辆。", streamedVehicleCount); +SendClientMessage(playerid, -1, string); // 发送统计结果给玩家 +``` + +## 相关函数 + +- [IsPlayerStreamedIn](IsPlayerStreamedIn): 检测玩家是否已加载至其他玩家的游戏 + +## 相关回调 + +- [OnVehicleStreamIn](../callbacks/OnVehicleStreamIn): 当车辆加载时触发 +- [OnVehicleStreamOut](../callbacks/OnVehicleStreamOut): 当车辆卸载时触发 +- [OnPlayerStreamIn](../callbacks/OnPlayerStreamIn): 当玩家加载至他人游戏时触发 +- [OnPlayerStreamOut](../callbacks/OnPlayerStreamOut): 当玩家从他人游戏卸载时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Kick.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Kick.md new file mode 100644 index 00000000000..9c435c6a569 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Kick.md @@ -0,0 +1,62 @@ +--- +title: Kick +sidebar_label: Kick +description: 将玩家踢出服务器,玩家需要退出游戏并重新连接才能继续游玩。 +tags: ["玩家", "管理"] +--- + +## 描述 + +将指定玩家踢出服务器。被踢出的玩家必须退出游戏并重新连接才能继续游玩。 + +| 参数名 | 说明 | +| -------- | --------------- | +| playerid | 要踢出的玩家 ID | + +## 返回值 + +该函数总是返回 1,即使执行失败(指定玩家不存在)。 + +## 注意事项 + +:::warning + +任何在 Kick()之前直接执行的操作(如使用[SendClientMessage](SendClientMessage)发送消息)将无法送达玩家。必须使用定时器延迟踢出操作。 + +::: + +## 示例代码 + +```c +// 为了在连接关闭前显示消息(例如踢出原因) +// 需要使用定时器创建延迟。这个延迟只需几毫秒, +// 但本示例使用完整的一秒以确保可靠性。 + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/kickme", true) == 0) + { + // 踢出执行该命令的玩家 + + // 首先发送踢出提示 + SendClientMessage(playerid, 0xFF0000FF, "您已被踢出服务器!"); + + // 通过定时器在1秒后执行踢出 + SetTimerEx("DelayedKick", 1000, false, "i", playerid); + return 1; + } + return 0; +} + +forward DelayedKick(playerid); +public DelayedKick(playerid) +{ + Kick(playerid); // 实际执行踢出操作 + return 1; +} +``` + +## 相关函数 + +- [Ban](Ban): 永久封禁玩家 +- [BanEx](BanEx): 自定义封禁原因封禁玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/KillTimer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/KillTimer.md new file mode 100644 index 00000000000..5ed529cc1f3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/KillTimer.md @@ -0,0 +1,58 @@ +--- +title: KillTimer +sidebar_label: KillTimer +description: 终止(停止)正在运行的定时器。 +tags: ["定时器"] +--- + +## 描述 + +终止(停止)正在运行的定时器。 + +## 参数说明 + +| 参数名 | 说明 | +| ------- | --------------------------------------------------- | +| timerid | 要终止的定时器 ID(由 SetTimer 或 SetTimerEx 返回) | + +## 返回值 + +本函数总是返回 0。 + +## 示例代码 + +```c +new gConnectTimer[MAX_PLAYERS] = {0, ...}; // 玩家定时器存储数组 + +public OnPlayerConnect(playerid) +{ + print("启动定时器..."); + // 创建5秒循环定时器 + gConnectTimer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid); + return 1; +} + +public OnPlayerDisconnect(playerid) +{ + // 终止玩家关联的定时器 + KillTimer(gConnectTimer[playerid]); + gConnectTimer[playerid] = 0; // 重置定时器ID + return 1; +} + +forward WelcomeTimer(playerid); +public WelcomeTimer(playerid) +{ + SendClientMessage(playerid, -1, "欢迎加入服务器!"); +} +``` + +## 相关函数 + +- [SetTimer](SetTimer): 创建基础定时器 +- [SetTimerEx](SetTimerEx): 创建带参数的定时器 +- [IsValidTimer](IsValidTimer): 检测定时器有效性 +- [IsRepeatingTimer](IsRepeatingTimer): 检测定时器循环状态 +- [GetTimerInterval](GetTimerInterval): 获取定时器间隔时长 +- [GetTimerRemaining](GetTimerRemaining): 获取定时器剩余时间 +- [CountRunningTimers](CountRunningTimers): 统计运行中的定时器数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LimitGlobalChatRadius.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LimitGlobalChatRadius.md new file mode 100644 index 00000000000..733aba8ca78 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LimitGlobalChatRadius.md @@ -0,0 +1,38 @@ +--- +title: LimitGlobalChatRadius +sidebar_label: LimitGlobalChatRadius +description: 设置聊天信息的可见范围 +tags: [] +--- + +## 描述 + +设置全局聊天信息的可见范围。只有在该距离范围内的玩家才能看到彼此的聊天信息,同时该距离也影响小地图上玩家图标的可见范围。 + +| 参数名 | 说明 | +| ---------------- | ---------------------------------- | +| Float:chatRadius | 聊天信息的可见范围半径(单位:米) | + +## 返回值 + +本函数没有返回值。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + LimitGlobalChatRadius(200.0); + return 1; +} +``` + +## 相关函数 + +- [SetNameTagDrawDistance](SetNameTagDrawDistance): 设置玩家名牌的可见距离 +- [SendPlayerMessageToPlayer](SendPlayerMessageToPlayer): 定向发送玩家聊天信息 +- [SendPlayerMessageToAll](SendPlayerMessageToAll): 全局发送玩家聊天信息 + +## 相关回调 + +- [OnPlayerText](../callbacks/OnPlayerText): 玩家发送聊天信息时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LimitPlayerMarkerRadius.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LimitPlayerMarkerRadius.md new file mode 100644 index 00000000000..691f6cf9f66 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LimitPlayerMarkerRadius.md @@ -0,0 +1,34 @@ +--- +title: LimitPlayerMarkerRadius +sidebar_label: LimitPlayerMarkerRadius +description: 设置玩家标记的显示半径 +tags: ["玩家"] +--- + +## 描述 + +设置玩家在小地图上的标记可见范围。只有在该半径范围内的其他玩家才会显示位置标记。 + +| 参数名 | 说明 | +| ------------------ | ------------ | +| Float:markerRadius | 标记可见半径 | + +## 返回值 + +本函数没有返回值。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + LimitPlayerMarkerRadius(100.0); + return 1; +} +``` + +## 相关函数 + +- [ShowPlayerMarkers](ShowPlayerMarkers): 控制雷达是否显示玩家标记 +- [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): 自定义玩家标记颜色 +- [LimitGlobalChatRadius](LimitGlobalChatRadius): 设置全局聊天可听范围 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LinkVehicleToInterior.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LinkVehicleToInterior.md new file mode 100644 index 00000000000..2fbf210918e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/LinkVehicleToInterior.md @@ -0,0 +1,41 @@ +--- +title: LinkVehicleToInterior +sidebar_label: LinkVehicleToInterior +description: 将车辆与指定室内空间绑定 +tags: ["车辆"] +--- + +## 描述 + +将指定车辆关联到特定室内空间。该车辆仅对处于相同室内空间的玩家可见(需通过[SetPlayerInterior](SetPlayerInterior)设置玩家室内位置)。 + +| 参数名 | 说明 | +| ---------- | ------------------------------------------- | +| vehicleid | 要关联的车辆 ID | +| interiorid | 目标[室内空间 ID](../resources/interiorids) | + +## 返回值 + +**true** - 操作成功执行 + +**false** - 操作执行失败(通常表示车辆不存在) + +## 示例代码 + +```c +public OnGameModeInit() +{ + new vehicleId = AddStaticVehicle(559, 2543.7505, -21.8345, 27.1899, 52.6054, -1, -1); + LinkVehicleToInterior(vehicleId, 6); +} +``` + +## 相关函数 + +- [GetVehicleInterior](GetVehicleInterior): 获取车辆当前关联的室内空间 ID +- [SetVehicleVirtualWorld](SetVehicleVirtualWorld): 设置车辆所属的虚拟世界 +- [SetPlayerInterior](SetPlayerInterior): 设置玩家所在室内空间 + +## 相关资源 + +- [室内空间 ID 对照表](../resources/interiorids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ManualVehicleEngineAndLights.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ManualVehicleEngineAndLights.md new file mode 100644 index 00000000000..33fff735f67 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ManualVehicleEngineAndLights.md @@ -0,0 +1,48 @@ +--- +title: ManualVehicleEngineAndLights +sidebar_label: ManualVehicleEngineAndLights +description: 启用脚本对车辆引擎和灯光的完全控制 +tags: ["车辆"] +--- + +## 描述 + +需在玩家首次连接前(通常在`OnGameModeInit`回调中)调用本函数,通知所有客户端将由脚本完全控制车辆引擎和灯光系统。启用后将阻止游戏自动执行以下行为: + +- 玩家进入/离开车辆时自动开关引擎 +- 环境光线变暗时自动开启车灯 + +## 示例代码 + +```c +public OnGameModeInit() +{ + ManualVehicleEngineAndLights(); + return 1; +} +``` + +## 注意事项 + +:::warning + +- 本功能启用后无法撤销,需在开发初期明确是否使用 +- 必须在首个玩家连接服务器前调用(推荐在游戏模式初始化时设置) + +::: + +:::tip + +可通过服务端配置文件[config.json](../../server/config.json)全局启用/禁用: + +```json +"use_manual_engine_and_lights": true +``` + +::: + +## 相关函数 + +- [SetVehicleParamsEx](SetVehicleParamsEx): 全局设置车辆运行参数 +- [GetVehicleParamsEx](GetVehicleParamsEx): 获取车辆当前参数状态 +- [SetVehicleParamsForPlayer](SetVehicleParamsForPlayer): 为指定玩家设置车辆参数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md new file mode 100644 index 00000000000..719855a1a53 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md @@ -0,0 +1,85 @@ +--- +title: MoveObject +sidebar_label: MoveObject +description: 以指定速度将物体移动到新位置 +tags: ["物体"] +--- + +## 描述 + +用于将物体以指定速度移动到新位置的函数。玩家/车辆将在物体移动时附着其上 + +| 参数 | 说明 | +| --------------- | ------------------------- | +| objectid | 要移动的物体 ID | +| Float:targetX | 目标位置的 X 坐标 | +| Float:targetY | 目标位置的 Y 坐标 | +| Float:targetZ | 目标位置的 Z 坐标 | +| Float:speed | 移动速度(单位:单位/秒) | +| Float:rotationX | 最终 X 轴旋转角度(可选) | +| Float:rotationY | 最终 Y 轴旋转角度(可选) | +| Float:rotationZ | 最终 Z 轴旋转角度(可选) | + +## 返回值 + +物体移动所需的时间(以毫秒为单位) + +## 示例 + +```c +new gAirportGate; // 在脚本顶部定义 + +public OnGameModeInit() +{ + gAirportGate = CreateObject(980, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/moveobject", true) == 0) + { + new + string[64], + moveTime = MoveObject(gAirportGate, 0.0, 0.0, 10.0, 2.00); + + format(string, sizeof(string), "物体将在 %d 毫秒后完成移动", moveTime); + SendClientMessage(playerid, 0xFF0000FF, string); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +- 该函数可用于使物体平滑旋转。但为实现此效果,物体必须同时进行**移动**。指定的旋转角度是物体移动后的最终旋转角度。因此,若物体未发生位移,则不会产生旋转效果。具体示例可参考服务器包中 Kye 制作的 ferriswheel.pwn 滤镜脚本(适用于 SA-MP 0.3d 及以上版本) +- 为充分理解上述说明,可采用(但不限于)将 Z 轴坐标先增加(+0.001)再减少(-0.001)的操作,因为不改变 X、Y 或 Z 坐标将不会触发物体旋转 + +::: + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 检查物体是否有效 +- [IsObjectMoving](IsObjectMoving): 检测物体是否在移动 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体位置 +- [SetObjectRot](SetObjectRot): 设置物体旋转 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 检查玩家物体是否有效 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [IsPlayerObjectMoving](IsPlayerObjectMoving): 检测玩家物体是否移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到其他玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/MovePlayerObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/MovePlayerObject.md new file mode 100644 index 00000000000..8b04fa771e2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/MovePlayerObject.md @@ -0,0 +1,72 @@ +--- +title: MovePlayerObject +sidebar_label: MovePlayerObject +description: 以指定速度移动玩家专属物体 +tags: ["玩家"] +--- + +## 描述 + +用于移动玩家专属物体并支持旋转的函数。玩家/车辆将在物体移动时附着其上 + +| 参数 | 说明 | +| --------------- | ------------------------- | +| playerid | 目标玩家的 ID | +| objectid | 要移动的物体 ID | +| Float:targetX | 目标位置的 X 坐标 | +| Float:targetY | 目标位置的 Y 坐标 | +| Float:targetZ | 目标位置的 Z 坐标 | +| Float:speed | 移动速度(单位:单位/秒) | +| Float:rotationX | 最终 X 轴旋转角度(可选) | +| Float:rotationY | 最终 Y 轴旋转角度(可选) | +| Float:rotationZ | 最终 Z 轴旋转角度(可选) | + +## 返回值 + +物体移动所需的时间(以毫秒为单位) + +## 示例 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + MovePlayerObject(playerid, gPlayerObject[playerid], 2001.195679, 1547.113892, 10.000000, 2.0); + return 1; +} +``` + +## 注意事项 + +:::tip + +当使用旋转参数时,物体必须发生位移(X/Y/Z 坐标变化)。系统将在物体开始移动至停止期间自动插值计算旋转角度 + +::: + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家专属物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [IsObjectMoving](IsObjectMoving): 检测物体是否移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 附加物体到其他玩家 +- [CreateObject](CreateObject): 创建全局物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [IsValidObject](IsValidObject): 验证全局物体有效性 +- [MoveObject](MoveObject): 移动全局物体 +- [StopObject](StopObject): 停止全局物体移动 +- [IsPlayerObjectMoving](IsPlayerObjectMoving): 检测玩家物体移动状态 +- [SetObjectPos](SetObjectPos): 设置全局物体位置 +- [SetObjectRot](SetObjectRot): 设置全局物体旋转 +- [GetObjectPos](GetObjectPos): 获取全局物体坐标 +- [GetObjectRot](GetObjectRot): 获取全局物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 附加全局物体到玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesReceived.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesReceived.md new file mode 100644 index 00000000000..82308424064 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesReceived.md @@ -0,0 +1,48 @@ +--- +title: NetStats_BytesReceived +sidebar_label: NetStats_BytesReceived +description: 获取服务器从玩家接收的数据量(单位:字节) +tags: ["网络监控"] +--- + +## 描述 + +用于获取服务器从指定玩家接收的数据总量(以字节为单位) + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 要获取数据的玩家 ID | + +## 返回值 + +服务器从该玩家接收的字节总数 + +若玩家未连接则返回 0 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/bytesreceived")) + { + new szString[144]; + format(szString, sizeof(szString), "您已向服务器发送了 %i 字节的数据", NetStats_BytesReceived(playerid)); + SendClientMessage(playerid, -1, szString); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器接收的网络消息数量 +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送的网络消息数量 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送的字节总数 +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取每秒接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家丢包率百分比 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家 IP 地址与端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesSent.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesSent.md new file mode 100644 index 00000000000..fe11927a30e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_BytesSent.md @@ -0,0 +1,48 @@ +--- +title: NetStats_BytesSent +sidebar_label: NetStats_BytesSent +description: 获取服务器向玩家发送的数据量(单位:字节) +tags: ["网络监控"] +--- + +## 描述 + +用于获取服务器向指定玩家发送的数据总量(以字节为单位) + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 要获取数据的玩家 ID | + +## 返回值 + +服务器向该玩家发送的字节总数 + +若玩家未连接则返回 0 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/bytes_sent")) + { + new szString[144]; + format(szString, sizeof(szString), "服务器已向您发送了 %i 字节的数据", NetStats_BytesSent(playerid)); + SendClientMessage(playerid, -1, szString); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器接收的网络消息数量 +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送的网络消息数量 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器接收的字节总数 +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取每秒接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家丢包率百分比 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家 IP 地址与端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_ConnectionStatus.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_ConnectionStatus.md new file mode 100644 index 00000000000..1920657dc54 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_ConnectionStatus.md @@ -0,0 +1,71 @@ +--- +title: NetStats_ConnectionStatus +sidebar_label: NetStats_ConnectionStatus +description: 获取玩家当前连接状态 +tags: ["网络监控"] +--- + +## 描述 + +用于获取玩家当前的网络连接状态 + +| 参数 | 说明 | +| -------- | --------------- | +| playerid | 要查询的玩家 ID | + +## 返回值 + +以整数值形式返回玩家的[连接状态](../resources/connectionstatus) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/connectionstatus")) + { + static ConnectionStatuses[9][48] = + { + "无操作", + "立即断开连接", + "静默立即断开", + "无应答时断开", + "已请求连接", + "处理连接请求", + "未验证发送方", + "多包加密模式", + "已连接" + }; + + new connectionStatus = NetStats_ConnectionStatus(playerid); + + new string[144]; + format(string, sizeof(string), "您当前的连接状态: %s", ConnectionStatuses[connectionStatus]); + SendClientMessage(playerid, -1, string); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器接收的网络消息数量 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器接收的字节总数 +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送的网络消息数量 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送的字节总数 +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取每秒接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家丢包率百分比 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家 IP 地址与端口号 +- [IsPlayerConnected](IsPlayerConnected): 检测玩家是否在线 + +## 相关回调 + +- [OnPlayerConnect](../callbacks/OnPlayerConnect): 玩家连接服务器时触发 +- [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect): 玩家断开连接时触发 + +## 相关资源 + +- [连接状态说明](../resources/connectionstatus) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetConnectedTime.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetConnectedTime.md new file mode 100644 index 00000000000..01ada9335f7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetConnectedTime.md @@ -0,0 +1,56 @@ +--- +title: NetStats_GetConnectedTime +sidebar_label: NetStats_GetConnectedTime +description: 获取玩家已连接服务器的持续时间(单位:毫秒) +tags: ["网络监控"] +--- + +## 描述 + +用于获取玩家持续连接服务器的毫秒数 + +| 参数 | 说明 | +| -------- | --------------- | +| playerid | 要查询的玩家 ID | + +## 返回值 + +玩家保持连接的毫秒数 + +若玩家未连接则返回 0 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/connectedtime")) + { + new szString[144]; + format(szString, sizeof(szString), "您已连接服务器达 %i 毫秒", NetStats_GetConnectedTime(playerid)); + SendClientMessage(playerid, -1, szString); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +该返回值在通过 RCON 命令"gmx"切换游戏模式时不会被重置 + +::: + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器接收的网络消息数量 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器接收的字节总数 +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送的网络消息数量 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送的字节总数 +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取每秒接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家丢包率百分比 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家 IP 地址与端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetIpPort.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetIpPort.md new file mode 100644 index 00000000000..4e231bfa73d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_GetIpPort.md @@ -0,0 +1,52 @@ +--- +title: NetStats_GetIpPort +sidebar_label: NetStats_GetIpPort +description: 获取玩家IP地址与端口号 +tags: ["网络监控", "IP地址"] +--- + +## 描述 + +用于获取玩家的 IP 地址与端口信息 + +| 参数 | 说明 | +| ---------------------- | ------------------------------------------ | +| playerid | 目标玩家的 ID | +| output[] | 用于存储 IP 和端口的字符串数组(引用传递) | +| size = sizeof (output) | 缓冲区最大容量。推荐设置为 22 | + +## 返回值 + +玩家的 IP 地址与端口号将存入指定数组 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/ipandport")) + { + new dest[22]; + NetStats_GetIpPort(playerid, dest, sizeof(dest)); + + new szString[144]; + format(szString, sizeof(szString), "您当前的IP与端口:%s", dest); + SendClientMessage(playerid, -1, szString); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerIp](GetPlayerIp): 获取玩家 IP 地址 +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器接收的网络消息数量 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器接收的字节总数 +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送的网络消息数量 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送的字节总数 +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取每秒接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家丢包率百分比 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家连接状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesReceived.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesReceived.md new file mode 100644 index 00000000000..9b45d42f58f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesReceived.md @@ -0,0 +1,48 @@ +--- +title: NetStats_MessagesReceived +sidebar_label: NetStats_MessagesReceived +description: 获取服务器从玩家接收的消息数量 +tags: ["网络监控"] +--- + +## 描述 + +用于获取服务器从指定玩家接收的网络消息总数 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 要获取数据的玩家 ID | + +## 返回值 + +服务器接收自该玩家的网络消息总数 + +若玩家未连接则返回 0 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/msgs")) + { + new szString[144]; + format(szString, sizeof(szString), "您已发送了 %i 条网络消息", NetStats_MessagesReceived(playerid)); + SendClientMessage(playerid, -1, szString); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器接收的字节总数 +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送的网络消息数量 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送的字节总数 +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取每秒接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家丢包率百分比 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家 IP 地址与端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesRecvPerSecond.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesRecvPerSecond.md new file mode 100644 index 00000000000..9eac60bdccc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesRecvPerSecond.md @@ -0,0 +1,46 @@ +--- +title: NetStats_MessagesRecvPerSecond +sidebar_label: NetStats_MessagesRecvPerSecond +description: 获取玩家每秒接收的消息数量 +tags: ["网络监控"] +--- + +## 描述 + +用于获取玩家在过去一秒内接收到的网络消息数量 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 要获取数据的玩家 ID | + +## 返回值 + +玩家最近一秒内接收的网络消息数量 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/msgpersec")) + { + new szString[144]; + format(szString, sizeof(szString), "您在过去一秒内接收到了 %i 条网络消息", NetStats_MessagesRecvPerSecond(playerid)); + SendClientMessage(playerid, -1, szString); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器接收的消息总数 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器接收的字节总数 +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送的消息总数 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送的字节总数 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家丢包率百分比 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家 IP 地址与端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesSent.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesSent.md new file mode 100644 index 00000000000..aba1c9b2a7f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_MessagesSent.md @@ -0,0 +1,46 @@ +--- +title: NetStats_MessagesSent +sidebar_label: NetStats_MessagesSent +description: 获取服务器向玩家发送的消息数量 +tags: ["网络监控"] +--- + +## 描述 + +用于获取服务器向指定玩家发送的网络消息总数 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 要获取数据的玩家 ID | + +## 返回值 + +服务器向该玩家发送的网络消息总数 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/msgsent")) + { + new szString[144]; + format(szString, sizeof(szString), "服务器已向您发送了 %i 条网络消息", NetStats_MessagesSent(playerid)); + SendClientMessage(playerid, -1, szString); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器接收的消息总数 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器接收的字节总数 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送的字节总数 +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取每秒接收的消息数量 +- [NetStats_PacketLossPercent](NetStats_PacketLossPercent): 获取玩家丢包率百分比 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家 IP 地址与端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_PacketLossPercent.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_PacketLossPercent.md new file mode 100644 index 00000000000..ce7f609b334 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NetStats_PacketLossPercent.md @@ -0,0 +1,88 @@ +--- +title: NetStats_PacketLossPercent +sidebar_label: NetStats_PacketLossPercent +description: 获取玩家网络丢包百分比 +tags: ["网络监控"] +--- + +## 描述 + +用于获取玩家的网络丢包百分比。丢包率表示玩家发送至服务器的数据存在丢失(反之亦然) + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 要获取数据的玩家 ID | + +## 返回值 + +以浮点数形式返回丢包百分比,若玩家未连接则返回 0 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/packetloss")) + { + new szString[144]; + format(szString, sizeof(szString), "当前丢包率: %.2f%%", NetStats_PacketLossPercent(playerid)); + SendClientMessage(playerid, -1, szString); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +当前该函数的返回值可能存在偏差,实际结果与客户端显示数据存在差异。建议使用以下更精确的替代方案: + +```c +stock GetPlayerPacketLoss(playerid, &Float:packetLoss) +{ + /* 返回指定玩家的丢包率百分比 - 由Fusez制作 */ + + if(!IsPlayerConnected(playerid)) + { + return 0; + } + + new nstats[400+1], nstats_loss[20], start, end; + GetPlayerNetworkStats(playerid, nstats, sizeof (nstats)); + + start = strfind(nstats, "packetloss", true); + end = strfind(nstats, "%", true, start); + + strmid(nstats_loss, nstats, start+12, end, sizeof (nstats_loss)); + packetLoss = floatstr(nstats_loss); + return 1; +} +``` + +::: + +:::tip + +请注意该函数反映的是服务器的丢包数据。客户端显示的数值**会**有所不同,并非数据错误,而是因为服务器与客户端各自仅能感知自身发送的数据包丢失情况 + +::: + +:::tip + +丢包率高于 0.0%时应当引起注意,超过 1.0%则表明网络状况非常糟糕 + +::: + +## 相关函数 + +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络统计数据并存入字符串 +- [GetNetworkStats](GetNetworkStats): 获取服务器网络统计数据并存入字符串 +- [NetStats_GetConnectedTime](NetStats_GetConnectedTime): 获取玩家持续连接时间 +- [NetStats_MessagesReceived](NetStats_MessagesReceived): 获取服务器接收的消息总数 +- [NetStats_BytesReceived](NetStats_BytesReceived): 获取服务器接收的字节总数 +- [NetStats_MessagesSent](NetStats_MessagesSent): 获取服务器发送的消息总数 +- [NetStats_BytesSent](NetStats_BytesSent): 获取服务器发送的字节总数 +- [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): 获取每秒接收的消息数量 +- [NetStats_ConnectionStatus](NetStats_ConnectionStatus): 获取玩家连接状态 +- [NetStats_GetIpPort](NetStats_GetIpPort): 获取玩家 IP 地址与端口号 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PauseRecordingPlayback.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PauseRecordingPlayback.md new file mode 100644 index 00000000000..6a760cd26e3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PauseRecordingPlayback.md @@ -0,0 +1,14 @@ +--- +title: PauseRecordingPlayback +sidebar_label: PauseRecordingPlayback +description: 暂停录制回放 +tags: [] +--- + +## 描述 + +该函数用于暂停当前正在进行的录制回放 + +## 相关函数 + +- [ResumeRecordingPlayback](../functions/ResumeRecordingPlayback): 恢复已暂停的录制回放 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayAudioStreamForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayAudioStreamForPlayer.md new file mode 100644 index 00000000000..e7648eebe69 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayAudioStreamForPlayer.md @@ -0,0 +1,53 @@ +--- +title: PlayAudioStreamForPlayer +sidebar_label: PlayAudioStreamForPlayer +description: 为玩家播放音频流 +tags: ["玩家"] +--- + +## 描述 + +为指定玩家播放音频流,支持常规音频文件格式(如 MP3) + +| 参数 | 说明 | +| -------------- | ----------------------------------------------------------------- | +| playerid | 目标玩家 ID | +| const url[] | 音频流 URL,支持格式:mp3/ogg/vorbis,.pls 播放列表文件可自动解析 | +| Float:posX | 音源 X 坐标(默认 0.0,需启用位置参数) | +| Float:posY | 音源 Y 坐标(默认 0.0,需启用位置参数) | +| Float:posZ | 音源 Z 坐标(默认 0.0,需启用位置参数) | +| Float:distance | 音频传播距离(需启用位置参数) | +| bool:usepos | 是否启用空间音效(默认关闭) | + +## 返回值 + +**true** - 操作成功执行 + +**false** - 执行失败(玩家不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp("/radio", cmdtext, true) == 0) + { + PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls"); + return 1; + } + if (strcmp("/radiopos", cmdtext, true) == 0) + { + new Float:x, Float:y, Float:z, Float:distance = 5.0; + GetPlayerPos(playerid, x, y, z); + // 在玩家当前位置创建空间化音频 + PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", x, y, z, distance, true); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [StopAudioStreamForPlayer](StopAudioStreamForPlayer): 停止音频流播放 +- [PlayerPlaySound](PlayerPlaySound): 为玩家播放音效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayCrimeReportForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayCrimeReportForPlayer.md new file mode 100644 index 00000000000..a0dcf21397a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayCrimeReportForPlayer.md @@ -0,0 +1,46 @@ +--- +title: PlayCrimeReportForPlayer +sidebar_label: PlayCrimeReportForPlayer +description: 为玩家播放犯罪报告(模拟单机模式警用通报) +tags: ["玩家"] +--- + +## 描述 + +该函数用于为玩家播放犯罪报告,效果类似于《侠盗猎车手》单机模式中 CJ 犯罪时的警用通报 + +| 参数 | 说明 | +| --------- | ------------------------------------------------------------------------------------------------- | +| playerid | 接收犯罪报告的玩家 ID | +| suspectid | 被通缉的嫌疑玩家 ID | +| crime | [犯罪类型 ID](../resources/crimelist),将转换为 10-code 警用代码(例如传入 16 将播放"10-16"代码) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 执行失败(指定玩家不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/suspect")) + { + // 为玩家播放ID 0玩家的16号犯罪报告 + PlayCrimeReportForPlayer(playerid, 0, 16); + SendClientMessage(playerid, 0xFFFFFFFF, "玩家ID 0触发了16号犯罪类型(代码10-16)"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [PlayerPlaySound](PlayerPlaySound): 为玩家播放音效 + +## 相关资源 + +- [犯罪类型 ID 对照表](../resources/crimelist) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneDestroy.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneDestroy.md new file mode 100644 index 00000000000..ddadcee336b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneDestroy.md @@ -0,0 +1,63 @@ +--- +title: PlayerGangZoneDestroy +sidebar_label: PlayerGangZoneDestroy +description: 销毁玩家专属帮派区域 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +用于销毁指定玩家的专属帮派区域 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 目标玩家的 ID | +| zoneid | 要销毁的帮派区域 ID | + +## 返回值 + +**1:** 操作成功执行 + +**0:** 执行失败(指定帮派区域不存在) + +## 示例 + +```c +// 全局变量存储帮派区域ID +new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; + +public OnPlayerConnect(playerid) +{ + // 为玩家创建专属帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); +} + +public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) +{ + // 检测帮派区域有效性后执行销毁 + if (IsValidPlayerGangZone(playerid, gGangZoneID[playerid])) + { + PlayerGangZoneDestroy(playerid, gGangZoneID[playerid]); + gGangZoneID[playerid] = INVALID_GANG_ZONE; // 重置区域标识 + } + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示指定颜色的帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动区域闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止区域闪烁 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取区域基础颜色 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取区域闪烁颜色 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围(最小 X/Y,最大 X/Y) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneFlash.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneFlash.md new file mode 100644 index 00000000000..be0a9638151 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneFlash.md @@ -0,0 +1,59 @@ +--- +title: PlayerGangZoneFlash +sidebar_label: PlayerGangZoneFlash +description: 启动玩家专属帮派区域的闪烁效果 +tags: ["玩家", "帮派区域", "玩家专属帮派区域"] +--- + + + +## 描述 + +用于启动玩家专属帮派区域的闪烁效果 + +| 参数 | 说明 | +| ----------- | ----------------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要闪烁的帮派区域 ID | +| flashColour | 闪烁使用的颜色值(RGBA 格式) | + +## 返回值 + +**1:** 操作成功执行(包括区域已处于闪烁状态的情况) + +**0:** 执行失败(指定帮派区域不存在) + +## 示例 + +```c +// 全局变量存储帮派区域ID +new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + // 向玩家显示帮派区域 + PlayerGangZoneShow(playerid, gGangZoneID[playerid]); + + // 启动半透明青色闪烁效果(RGBA: 0xFF00FFFF) + PlayerGangZoneFlash(playerid, gGangZoneID[playerid], 0xFF00FFFF); +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示指定颜色的帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止闪烁效果 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取区域基础颜色 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围(最小 X/Y,最大 X/Y) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetColour.md new file mode 100644 index 00000000000..fb6487cdcfc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetColour.md @@ -0,0 +1,58 @@ +--- +title: PlayerGangZoneGetColour +sidebar_label: PlayerGangZoneGetColour +description: 获取玩家专属帮派区域的颜色值 +tags: ["玩家", "帮派区域", "玩家专属帮派区域"] +--- + + + +## 描述 + +用于获取玩家专属帮派区域的当前显示颜色 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要查询的帮派区域 ID | + +## 返回值 + +帮派区域的 RGBA 颜色值 + +**0:** 执行失败(区域未显示给玩家或不存在) + +## 示例 + +```c +new gGangZoneID[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + // 以红色半透明显示区域(RGBA: 0xFF0000FF) + PlayerGangZoneShow(playerid, gGangZoneID[playerid], 0xFF0000FF); + + new colour = PlayerGangZoneGetColour(playerid, gGangZoneID[playerid]); + // colour = 0xFF0000FF + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示指定颜色的帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止闪烁 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色值 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围(最小 X/Y,最大 X/Y) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetFlashColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetFlashColour.md new file mode 100644 index 00000000000..124ef468c1e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetFlashColour.md @@ -0,0 +1,62 @@ +--- +title: PlayerGangZoneGetFlashColour +sidebar_label: PlayerGangZoneGetFlashColour +description: 获取玩家专属帮派区域的闪烁颜色值 +tags: ["玩家", "帮派区域", "玩家专属帮派区域"] +--- + + + +## 描述 + +用于获取玩家专属帮派区域的当前闪烁颜色 + +| 参数 | 说明 | +| -------- | ------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要查询的帮派区域 ID | + +## 返回值 + +帮派区域的闪烁 RGBA 颜色值 + +**0:** 执行失败(区域未显示或不存在) + +## 示例 + +```c +new gGangZoneID[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + // 以红色半透明显示区域(RGBA: 0xFF0000FF) + PlayerGangZoneShow(playerid, gGangZoneID[playerid], 0xFF0000FF); + + // 启动蓝绿色闪烁效果(RGBA: 0x45D1ABFF) + PlayerGangZoneFlash(playerid, gGangZoneID[playerid], 0x45D1ABFF); + + // 获取当前闪烁颜色 + new flashColour = PlayerGangZoneGetFlashColour(playerid, gGangZoneID[playerid]); + // flashColour = 0x45D1ABFF + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示指定颜色的帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止闪烁 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取基础颜色值 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围(最小 X/Y,最大 X/Y) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetPos.md new file mode 100644 index 00000000000..3d6f702014b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneGetPos.md @@ -0,0 +1,62 @@ +--- +title: PlayerGangZoneGetPos +sidebar_label: PlayerGangZoneGetPos +description: 获取帮派区域的坐标范围(最小X/Y,最大X/Y) +tags: ["玩家", "帮派区域", "玩家专属帮派区域"] +--- + + + +## 描述 + +用于获取玩家专属帮派区域的坐标范围(西/南/东/北边界) + +| 参数 | 说明 | +| ----------- | --------------------------------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要查询的帮派区域 ID | +| &Float:minX | 用于存储西侧 X 坐标的浮点变量(通过引用传递) | +| &Float:minY | 用于存储南侧 Y 坐标的浮点变量(通过引用传递) | +| &Float:maxX | 用于存储东侧 X 坐标的浮点变量(通过引用传递) | +| &Float:maxY | 用于存储北侧 Y 坐标的浮点变量(通过引用传递) | + +## 返回值 + +该函数始终返回 **true** + +## 示例 + +```c +new gGangZoneID[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域(坐标范围:2236.1475,2424.7266 至 2319.1636,2502.4348) + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + new + Float:minX, + Float:minY, + Float:maxX, + Float:maxY; + + PlayerGangZoneGetPos(playerid, gGangZoneID[playerid], minX, minY, maxX, maxY); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示指定颜色的帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止闪烁 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色值 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取基础颜色值 +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneHide.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneHide.md new file mode 100644 index 00000000000..0ddf365c198 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneHide.md @@ -0,0 +1,63 @@ +--- +title: PlayerGangZoneGetPos +sidebar_label: PlayerGangZoneGetPos +description: 获取帮派区域的坐标范围(最小X/Y,最大X/Y) +tags: ["玩家", "帮派区域", "玩家专属帮派区域"] +--- + + + +## 描述 + +用于获取玩家专属帮派区域的坐标范围(西/南/东/北边界) + +| 参数 | 说明 | +| ----------- | --------------------------------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要查询的帮派区域 ID | +| &Float:minX | 用于存储西侧 X 坐标的浮点变量(通过引用传递) | +| &Float:minY | 用于存储南侧 Y 坐标的浮点变量(通过引用传递) | +| &Float:maxX | 用于存储东侧 X 坐标的浮点变量(通过引用传递) | +| &Float:maxY | 用于存储北侧 Y 坐标的浮点变量(通过引用传递) | + +## 返回值 + +该函数始终返回 **true** + +## 示例 + +```c +new gGangZoneID[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域(坐标范围:2236.1475,2424.7266 至 2319.1636,2502.4348) + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + new + Float:minX, + Float:minY, + Float:maxX, + Float:maxY; + + // 获取区域四至坐标 + PlayerGangZoneGetPos(playerid, gGangZoneID[playerid], minX, minY, maxX, maxY); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示指定颜色的帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止闪烁 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色值 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取基础颜色值 +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneShow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneShow.md new file mode 100644 index 00000000000..43b4999e436 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneShow.md @@ -0,0 +1,56 @@ +--- +title: PlayerGangZoneShow +sidebar_label: PlayerGangZoneShow +description: 以指定颜色显示玩家专属帮派区域 +tags: ["玩家", "帮派区域", "玩家专属帮派区域"] +--- + + + +## 描述 + +用于向指定玩家显示特定颜色的帮派区域 + +| 参数 | 说明 | +| -------- | ---------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要显示的帮派区域 ID | +| colour | 显示使用的 RGBA 颜色值 | + +## 返回值 + +**1:** 操作成功执行(包括区域已显示的情况) + +**0:** 执行失败(指定帮派区域不存在) + +## 示例 + +```c +// 全局变量存储帮派区域ID +new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域(坐标:2236.1475,2424.7266 至 2319.1636,2502.4348) + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + // 以纯白不透明颜色显示区域(RGBA: 0xFFFFFFFF) + PlayerGangZoneShow(playerid, gGangZoneID[playerid], 0xFFFFFFFF); +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止闪烁 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取基础颜色值 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色值 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围(最小 X/Y,最大 X/Y) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneStopFlash.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneStopFlash.md new file mode 100644 index 00000000000..6bfe4a3ced3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerGangZoneStopFlash.md @@ -0,0 +1,67 @@ +--- +title: PlayerGangZoneStopFlash +sidebar_label: PlayerGangZoneStopFlash +description: 停止玩家专属帮派区域的闪烁效果 +tags: ["玩家", "帮派区域", "玩家专属帮派区域"] +--- + + + +## 描述 + +用于停止玩家专属帮派区域的闪烁效果 + +| 参数 | 说明 | +| -------- | ----------------------- | +| playerid | 目标玩家 ID | +| zoneid | 要停止闪烁的帮派区域 ID | + +## 返回值 + +**1:** 操作成功执行(即使区域原本未处于闪烁状态) + +**0:** 执行失败(指定帮派区域不存在) + +## 示例 + +```c +// 全局变量存储帮派区域ID +new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + // 向玩家显示帮派区域 + PlayerGangZoneShow(playerid, gGangZoneID[playerid]); + + // 启动半透明青色闪烁效果(RGBA: 0xFF00FFFF) + PlayerGangZoneFlash(playerid, gGangZoneID[playerid], 0xFF00FFFF); +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 检测区域是否存在及是否处于闪烁状态 + if (IsValidPlayerGangZone(playerid, gGangZoneID[playerid]) && IsPlayerGangZoneFlashing(playerid, gGangZoneID[playerid])) + { + PlayerGangZoneStopFlash(playerid, gGangZoneID[playerid]); + } +} +``` + +## 相关函数 + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示指定颜色的帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动闪烁效果 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取基础颜色值 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色值 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围(最小 X/Y,最大 X/Y) +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见性 +- [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): 检测区域闪烁状态 +- [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): 启用区域进出回调检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerHasClockEnabled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerHasClockEnabled.md new file mode 100644 index 00000000000..7907c53a299 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerHasClockEnabled.md @@ -0,0 +1,49 @@ +--- +title: PlayerHasClockEnabled +sidebar_label: PlayerHasClockEnabled +description: 检测玩家是否启用游戏内时钟 +tags: ["玩家"] +--- + +## 描述 + +用于检测玩家是否启用了游戏内时钟显示(参见[TogglePlayerClock](TogglePlayerClock)) + +| 参数 | 说明 | +| -------- | --------------- | +| playerid | 要检测的玩家 ID | + +## 返回值 + +**true** - 时钟显示已启用 + +**false** - 未启用或指定玩家不存在 + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + TogglePlayerClock(playerid, true); // 显示时钟 + + if (PlayerHasClockEnabled(playerid)) + { + SendClientMessage(playerid, COLOR_WHITE, "已启用游戏时钟显示"); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +玩家时间不会与其他玩家同步!如需同步时间请使用[SetPlayerTime](SetPlayerTime) + +::: + +## 相关函数 + +- [SetPlayerTime](SetPlayerTime): 设置玩家个人时间 +- [SetWorldTime](SetWorldTime): 设置全局服务器时间 +- [TogglePlayerClock](TogglePlayerClock): 切换右上角时钟显示 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerPlaySound.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerPlaySound.md new file mode 100644 index 00000000000..f448cc48f6e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerPlaySound.md @@ -0,0 +1,49 @@ +--- +title: PlayerPlaySound +sidebar_label: PlayerPlaySound +description: 为指定玩家播放特定音效 +tags: ["玩家"] +--- + +## 描述 + +用于为特定玩家播放指定音效 + +| 参数 | 说明 | +| -------- | ----------------------------------------- | +| playerid | 目标玩家 ID | +| soundid | 要播放的[音效 ID](../resources/sound-ids) | +| Float:x | 音源 X 坐标(0.0 表示无位置音效) | +| Float:y | 音源 Y 坐标(0.0 表示无位置音效) | +| Float:z | 音源 Z 坐标(0.0 表示无位置音效) | + +## 返回值 + +**true** - 操作成功执行 + +**false** - 执行失败(玩家未连接) + +## 示例 + +```c +// 播放拳击音效(适用于/slap等命令),因音源位于玩家上方10米处,音量会较小 +PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0); +``` + +## 注意事项 + +:::tip + +仅在需要空间音效时使用坐标参数,若只需普通音效请将坐标全部设为 0.0 + +::: + +## 相关函数 + +- [PlayCrimeReportForPlayer](PlayCrimeReportForPlayer): 为玩家播放犯罪报告 +- [PlayAudioStreamForPlayer](PlayAudioStreamForPlayer): 为玩家播放音频流 +- [StopAudioStreamForPlayer](StopAudioStreamForPlayer): 停止当前音频流 + +## 相关资源 + +- [音效 ID 对照表](../resources/sound-ids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectatePlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectatePlayer.md new file mode 100644 index 00000000000..ca8bebcd8d4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectatePlayer.md @@ -0,0 +1,53 @@ +--- +title: PlayerSpectatePlayer +sidebar_label: PlayerSpectatePlayer +description: 使玩家观战其他玩家 +tags: ["玩家"] +--- + +## 描述 + +该函数用于使指定玩家进入旁观模式并观察另一玩家 + +| 参数 | 说明 | +| ------------------ | -------------------------------------------------------------- | +| playerid | 观战者玩家 ID | +| targetplayerid | 被观战目标玩家 ID | +| SPECTATE_MODE:mode | [旁观模式](../resources/spectatemodes)(可选,默认为普通模式) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 执行失败(目标玩家不存在或参数无效) + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + TogglePlayerSpectating(playerid, 1); // 启用旁观模式 + PlayerSpectatePlayer(playerid, killerid); // 观察击杀者视角 + return 1; +} +``` + +## 注意事项 + +:::warning + +- 调用顺序至关重要!必须先使用 TogglePlayerSpectating 启用旁观模式 +- 观战者与被观战者必须处于相同虚拟世界和室内环境 + +::: + +## 相关函数 + +- [PlayerSpectateVehicle](PlayerSpectateVehicle): 观战车辆 +- [TogglePlayerSpectating](TogglePlayerSpectating): 切换观战状态 +- [GetPlayerSpectateID](GetPlayerSpectateID): 获取当前观战目标 ID +- [GetPlayerSpectateType](GetPlayerSpectateType): 获取观战类型 + +## 相关资源 + +- [旁观模式说明](../resources/spectatemodes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectateVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectateVehicle.md new file mode 100644 index 00000000000..4aea8b253eb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerSpectateVehicle.md @@ -0,0 +1,49 @@ +--- +title: PlayerSpectateVehicle +sidebar_label: PlayerSpectateVehicle +description: 设置玩家观战指定车辆 +tags: ["玩家", "车辆"] +--- + +## 描述 + +使玩家进入旁观模式并附着视角到指定车辆,获得类似驾驶位的观察视角 + +| 参数 | 说明 | +| ------------------ | ---------------------------------------------------------------- | +| playerid | 观战者玩家 ID | +| targetvehicleid | 被观战车辆 ID | +| SPECTATE_MODE:mode | [旁观模式](../resources/spectatemodes)(可选参数,默认普通模式) | + +## 返回值 + +**true** - 指令执行成功(注意:未启用旁观模式时也会返回成功,但实际无效,必须先调用 TogglePlayerSpectating) + +**false** - 执行失败(玩家/车辆不存在或参数无效) + +## 示例 + +```c +TogglePlayerSpectating(playerid, 1); // 激活旁观模式 +PlayerSpectateVehicle(playerid, vehicleid); // 开始观察指定车辆 +``` + +## 注意事项 + +:::warning + +- 调用顺序强制要求:必须先使用 TogglePlayerSpectating 启用观战状态 +- 观战者与被观战车辆必须处于相同室内空间和虚拟世界 + +::: + +## 相关函数 + +- [PlayerSpectatePlayer](PlayerSpectatePlayer): 观战其他玩家 +- [TogglePlayerSpectating](TogglePlayerSpectating): 切换观战状态 +- [GetPlayerSpectateID](GetPlayerSpectateID): 获取当前观战目标 ID +- [GetPlayerSpectateType](GetPlayerSpectateType): 获取观战实体类型 + +## 相关资源 + +- [旁观模式详解](../resources/spectatemodes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawAlignment.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawAlignment.md new file mode 100644 index 00000000000..f27a9383398 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawAlignment.md @@ -0,0 +1,73 @@ +--- +title: PlayerTextDrawAlignment +sidebar_label: PlayerTextDrawAlignment +description: 设置玩家文本绘图的文本对齐方式 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图的文本对齐方式 + +| 参数 | 说明 | +| ------------------------- | ----------------------------------------------------------------------------------------------------------- | +| playerid | 目标玩家 ID | +| PlayerText:textid | 要设置的玩家文本绘图 ID | +| TEXT_DRAW_ALIGN:alignment | 对齐方式:`左对齐(TEXT_DRAW_ALIGN_LEFT)` / `居中(TEXT_DRAW_ALIGN_CENTER)` / `右对齐(TEXT_DRAW_ALIGN_RIGHT)` | + +## 返回值 + +此函数不返回特定值 + +## 示例 + +```c +/* + 可用对齐方式常量: + TEXT_DRAW_ALIGN_LEFT 左对齐 + TEXT_DRAW_ALIGN_CENTER 居中对齐 + TEXT_DRAW_ALIGN_RIGHT 右对齐 +*/ + +new PlayerText:gMyTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 425.0, "示例文本绘图"); + PlayerTextDrawAlignment(playerid, gMyTextdraw[playerid], TEXT_DRAW_ALIGN_CENTER); // 将文本绘图居中对齐 + return 1; +} +``` + +## 注意事项 + +:::warning + +使用居中对齐(TEXT_DRAW_ALIGN_CENTER)时,必须交换[PlayerTextDrawTextSize](PlayerTextDrawTextSize)的 x 和 y 参数值 + +::: + +:::tip + +若文本绘图已对玩家显示,需重新调用[PlayerTextDrawShow](PlayerTextDrawShow)才能使更改生效 + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawGetAlignment](PlayerTextDrawGetAlignment): 获取文本对齐方式 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置文本框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景颜色 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置文本字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置文本框尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 设置文本描边 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置文本阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用等比缩放 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 启用文本框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 更新文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColor.md new file mode 100644 index 00000000000..8f6376d72d9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColor.md @@ -0,0 +1,61 @@ +--- +title: PlayerTextDrawBackgroundColor +sidebar_label: PlayerTextDrawBackgroundColor +description: 调整玩家文本绘图的背景颜色。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +调整玩家文本绘图的背景颜色。 + +| 名称 | 描述 | +| ----------------- | ----------------------------------------- | +| playerid | 要设置背景颜色的玩家文本绘图所属玩家的 ID | +| PlayerText:textid | 要设置背景颜色的玩家文本绘图的 ID | +| backgroundColour | 需要设置的背景颜色数值 | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new PlayerText:gMyTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的OPEN.MP服务器"); + PlayerTextDrawUseBox(playerid, gMyTextdraw[playerid], true); + PlayerTextDrawBackgroundColor(playerid, gMyTextdraw[playerid], 0xFFFFFFFF); // 将gMyTextdraw的背景颜色设置为白色 + return 1; +} +``` + +## 注意事项 + +:::tip + +- 当使用[PlayerTextDrawSetOutline](PlayerTextDrawSetOutline)且尺寸参数>0 时,轮廓颜色将与 PlayerTextDrawBackgroundColor 设置的颜色一致 +- 修改颜色值会影响 PlayerTextDrawColor 函数设置的颜色效果 + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文字颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColour.md new file mode 100644 index 00000000000..7d3499f5800 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBackgroundColour.md @@ -0,0 +1,63 @@ +--- +title: PlayerTextDrawBackgroundColour +sidebar_label: PlayerTextDrawBackgroundColour +description: 调整玩家文本绘图的背景颜色。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +调整玩家文本绘图的背景颜色。 + +| 名称 | 描述 | +| ----------------- | ------------------------------------------------ | +| playerid | 要设置背景颜色的玩家文本绘图所属玩家的 ID | +| PlayerText:textid | 要设置背景颜色的玩家文本绘图的 ID | +| backgroundColour | 需要设置的背景颜色数值(使用十六进制 ARGB 格式) | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new PlayerText:gMyTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的OPEN.MP服务器"); + PlayerTextDrawUseBox(playerid, gMyTextdraw[playerid], true); + PlayerTextDrawBackgroundColour(playerid, gMyTextdraw[playerid], 0xFFFFFFFF); // 将gMyTextdraw的背景颜色设置为白色 + return 1; +} +``` + +## 注意事项 + +:::tip + +- 当使用[PlayerTextDrawSetOutline](PlayerTextDrawSetOutline)且尺寸参数>0 时,轮廓颜色将与 PlayerTextDrawBackgroundColour 设置的颜色一致 +- 修改颜色值会影响 PlayerTextDrawColour 函数设置的颜色效果 + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColour](PlayerTextDrawColour): 设置玩家文本绘图的文字颜色 +- [PlayerTextDrawBoxColour](PlayerTextDrawBoxColour): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColor.md new file mode 100644 index 00000000000..da6a2c5f405 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColor.md @@ -0,0 +1,52 @@ +--- +title: PlayerTextDrawBoxColor +sidebar_label: PlayerTextDrawBoxColor +description: 设置玩家文本绘图方框的颜色(需启用PlayerTextDrawUseBox)。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图方框的颜色(需要先使用 PlayerTextDrawUseBox 启用方框)。 + +| 名称 | 描述 | +| ----------------- | ---------------------------------------------------------- | +| playerid | 要设置方框颜色的玩家文本绘图所属玩家的 ID | +| PlayerText:textid | 要设置方框颜色的玩家文本绘图的 ID | +| boxColour | 需要设置的方框颜色值(支持透明度通道的 ARGB 十六进制格式) | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "示例文本"); + PlayerTextDrawUseBox(playerid, pTextdraw[playerid], true); + PlayerTextDrawBoxColor(playerid, pTextdraw[playerid], 0xFF0000FF); // 设置不透明红色方框 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文字颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColour.md new file mode 100644 index 00000000000..e78db43d982 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawBoxColour.md @@ -0,0 +1,54 @@ +--- +title: PlayerTextDrawBoxColour +sidebar_label: PlayerTextDrawBoxColour +description: 设置玩家文本绘图方框的颜色(需启用PlayerTextDrawUseBox)。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +设置玩家文本绘图方框的颜色(需要先使用 PlayerTextDrawUseBox 启用方框)。 + +| 名称 | 描述 | +| ----------------- | ---------------------------------------------------------- | +| playerid | 要设置方框颜色的玩家文本绘图所属玩家的 ID | +| PlayerText:textid | 要设置方框颜色的玩家文本绘图的 ID | +| boxColour | 需要设置的方框颜色值(支持透明度通道的 ARGB 十六进制格式) | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "示例文本"); + PlayerTextDrawUseBox(playerid, pTextdraw[playerid], true); + PlayerTextDrawBoxColour(playerid, pTextdraw[playerid], 0xFF0000FF); // 设置不透明红色方框 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColour](PlayerTextDrawColour): 设置玩家文本绘图的文字颜色 +- [PlayerTextDrawBackgroundColour](PlayerTextDrawBackgroundColour): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColor.md new file mode 100644 index 00000000000..10b9014c980 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColor.md @@ -0,0 +1,62 @@ +--- +title: PlayerTextDrawColor +sidebar_label: PlayerTextDrawColor +description: 设置玩家文本绘图的文字颜色。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图的文字颜色。 + +| 名称 | 描述 | +| ----------------- | ----------------------------------------- | +| playerid | 要设置文字颜色的玩家文本绘图所属玩家的 ID | +| PlayerText:textid | 要设置文字颜色的玩家文本绘图的 ID | +| textColour | 需要设置的文字颜色数值(十六进制格式) | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "示例文本"); + PlayerTextDrawColor(playerid, pTextdraw[playerid], 0xFF0000FF); // 设置红色文字 + + PlayerTextDrawShow(playerid, pTextdraw[playerid]); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 可在文本内容中使用游戏文本颜色代码(例如 `~r~` 红色、`~g~` 绿色、`~b~` 蓝色) +- 修改颜色后需调用 PlayerTextDrawShow 重新显示文本绘图才能生效 + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColour.md new file mode 100644 index 00000000000..183ed6dc1b8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawColour.md @@ -0,0 +1,64 @@ +--- +title: PlayerTextDrawColour +sidebar_label: PlayerTextDrawColour +description: 设置玩家文本绘图的文字颜色。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +设置玩家文本绘图的文字颜色。 + +| 名称 | 描述 | +| ----------------- | ------------------------------------------- | +| playerid | 要设置文字颜色的玩家文本绘图所属玩家的 ID | +| PlayerText:textid | 要设置文字颜色的玩家文本绘图的 ID | +| textColour | 需要设置的文字颜色数值(ARGB 十六进制格式) | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "示例文本"); + PlayerTextDrawColour(playerid, pTextdraw[playerid], 0xFF0000FF); // 设置不透明红色文字 + + PlayerTextDrawShow(playerid, pTextdraw[playerid]); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 可在文本内容中使用游戏文本颜色代码(例如 `~r~` 红色、`~g~` 绿色、`~b~` 蓝色) +- 修改颜色后需调用 PlayerTextDrawShow 重新显示文本绘图才能生效 + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawBoxColour](PlayerTextDrawBoxColour): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColour](PlayerTextDrawBackgroundColour): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawDestroy.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawDestroy.md new file mode 100644 index 00000000000..2f514d5ae44 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawDestroy.md @@ -0,0 +1,55 @@ +--- +title: PlayerTextDrawDestroy +sidebar_label: PlayerTextDrawDestroy +description: 销毁一个玩家文本绘图。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +销毁一个玩家文本绘图。 + +| 名称 | 描述 | +| ----------------- | --------------------------------- | +| playerid | 要销毁的玩家文本绘图所属玩家的 ID | +| PlayerText:textid | 要销毁的玩家文本绘图的 ID | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "示例文本"); + return 1; +} + +public OnPlayerDisconnect(playerid, reason) +{ + PlayerTextDrawDestroy(playerid, pTextdraw[playerid]); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文字颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawFont.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawFont.md new file mode 100644 index 00000000000..5ae7fa9ffd9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawFont.md @@ -0,0 +1,84 @@ +--- +title: PlayerTextDrawFont +sidebar_label: PlayerTextDrawFont +description: 设置玩家文本绘图的字体样式。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图的字体样式。 + +| 名称 | 描述 | +| ------------------- | ----------------------------------------------------------------------------- | +| playerid | 要设置字体的玩家文本绘图所属玩家的 ID | +| PlayerText:textid | 要设置字体的玩家文本绘图的 ID | +| TEXT_DRAW_FONT:font | 支持以下四种基础字体样式。当设置值>3 时将无法显示,若值>16 会导致客户端崩溃。 | + +可用基础样式: +![可用基础样式](https://assets.open.mp/assets/images/textdraws/Textdraw_font_styles.png) + +扩展字体资源: +![扩展字体资源](https://assets.open.mp/assets/images/textdraws/Textdraw_Fonts.png) + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +/* + TEXT_DRAW_FONT_0 // 经典数字样式 + TEXT_DRAW_FONT_1 // 细线字体 + TEXT_DRAW_FONT_2 // 常规字体 + TEXT_DRAW_FONT_3 // 大写粗体 + TEXT_DRAW_FONT_SPRITE_DRAW // 精灵图模式 + TEXT_DRAW_FONT_MODEL_PREVIEW // 3D模型预览模式 +*/ + +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建基础文本绘图 + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的服务器!"); + + // 将玩家文本绘图的字体设置为样式2(常规字体) + PlayerTextDrawFont(playerid, welcomeText[playerid], TEXT_DRAW_FONT_2); + + // 向玩家显示文本绘图 + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + return 1; +} +``` + +## 注意事项 + +:::tip + +- 使用 TEXT_DRAW_FONT_SPRITE_DRAW 时可加载.txd 精灵图集 +- 设置字体值为 4-16 区间时需配合 PlayerTextDrawSetPreviewModel 使用模型预览功能 +- 字体值超过 16 会导致客户端立即崩溃 + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawGetFont](PlayerTextDrawGetFont): 获取玩家文本绘图的字体样式 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文字颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetAlignment.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetAlignment.md new file mode 100644 index 00000000000..1a1e9c9ffb7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetAlignment.md @@ -0,0 +1,58 @@ +--- +title: PlayerTextDrawGetAlignment +sidebar_label: PlayerTextDrawGetAlignment +description: 获取玩家文本绘图的文本对齐方式。 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的文本对齐方式。 + +| 名称 | 描述 | +| ----------------- | --------------------------------- | +| playerid | 要查询的玩家 ID | +| PlayerText:textid | 要获取对齐方式的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图的文本对齐方式。 + +## 示例 + +```c +new PlayerText:gMyTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 425.0, "这是一个示例文本绘图"); + PlayerTextDrawAlignment(playerid, gMyTextdraw[playerid], TEXT_DRAW_ALIGN_CENTER); + + new TEXT_DRAW_ALIGN:align = PlayerTextDrawGetAlignment(playerid, gMyTextdraw[playerid]); + // align = TEXT_DRAW_ALIGN_CENTER + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文字颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否显示 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 验证玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundCol.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundCol.md new file mode 100644 index 00000000000..b897f786a45 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundCol.md @@ -0,0 +1,57 @@ +--- +title: PlayerTextDrawGetBackgroundCol +sidebar_label: PlayerTextDrawGetBackgroundCol +description: 获取玩家文本绘图的背景颜色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的背景颜色。 + +| 名称 | 描述 | +| ----------------- | --------------------------------- | +| playerid | 要查询的玩家 ID | +| PlayerText:textid | 要获取背景颜色的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图的背景颜色值(ARGB 十六进制格式)。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的OPEN.MP服务器"); + PlayerTextDrawSetOutline(playerid, pTextdraw[playerid], 1); + PlayerTextDrawBackgroundColor(playerid, pTextdraw[playerid], 0x00FF00FF); + PlayerTextDrawShow(playerid, pTextdraw[playerid]); + + new backgroundColor = PlayerTextDrawGetBackgroundCol(playerid, pTextdraw[playerid]); + // backgroundColor = 0x00FF00FF(绿色不透明) + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundColour.md new file mode 100644 index 00000000000..fbb0561b96d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBackgroundColour.md @@ -0,0 +1,57 @@ +--- +title: PlayerTextDrawGetBackgroundColour +sidebar_label: PlayerTextDrawGetBackgroundColour +description: 获取玩家文本绘图的背景颜色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的背景颜色。 + +| 名称 | 描述 | +| ----------------- | --------------------------------- | +| playerid | 要查询的玩家 ID | +| PlayerText:textid | 要获取背景颜色的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图的背景颜色值(ARGB 十六进制格式)。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "示例文本"); + PlayerTextDrawSetOutline(playerid, pTextdraw[playerid], 1); + PlayerTextDrawBackgroundColour(playerid, pTextdraw[playerid], 0x00FF00FF); + PlayerTextDrawShow(playerid, pTextdraw[playerid]); + + new backgroundColour = PlayerTextDrawGetBackgroundColour(playerid, pTextdraw[playerid]); + // backgroundColour = 0x00FF00FF(不透明绿色) + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawBoxColour](PlayerTextDrawBoxColour): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColour](PlayerTextDrawBackgroundColour): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColor.md new file mode 100644 index 00000000000..1a556efbacd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColor.md @@ -0,0 +1,57 @@ +--- +title: PlayerTextDrawGetBoxColor +sidebar_label: PlayerTextDrawGetBoxColor +description: 获取玩家文本绘图方框颜色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图方框的颜色值。 + +| 名称 | 描述 | +| ----------------- | --------------------------------- | +| playerid | 要查询的玩家 ID | +| PlayerText:textid | 要获取方框颜色的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图方框的颜色值(ARGB 十六进制格式)。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的OPEN.MP服务器"); + PlayerTextDrawUseBox(playerid, pTextdraw[playerid], true); + PlayerTextDrawBoxColor(playerid, pTextdraw[playerid], 0xFFFF80FF); + PlayerTextDrawShow(playerid, pTextdraw[playerid]); + + new boxColor = PlayerTextDrawGetBoxColor(playerid, pTextdraw[playerid]); + // boxColor = 0xFFFF80FF(浅黄色不透明) + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColour.md new file mode 100644 index 00000000000..5887f912481 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetBoxColour.md @@ -0,0 +1,57 @@ +--- +title: PlayerTextDrawGetBoxColour +sidebar_label: PlayerTextDrawGetBoxColour +description: 获取玩家文本绘图方框颜色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图方框的颜色值。 + +| 名称 | 描述 | +| ----------------- | --------------------------------- | +| playerid | 要查询的玩家 ID | +| PlayerText:textid | 要获取方框颜色的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图方框的颜色值(ARGB 十六进制格式)。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "欢迎来到我的OPEN.MP服务器"); + PlayerTextDrawUseBox(playerid, pTextdraw[playerid], true); + PlayerTextDrawBoxColour(playerid, pTextdraw[playerid], 0xFFFF80FF); + PlayerTextDrawShow(playerid, pTextdraw[playerid]); + + new boxColour = PlayerTextDrawGetBoxColour(playerid, pTextdraw[playerid]); + // boxColour = 0xFFFF80FF(浅黄色不透明) + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawBoxColour](PlayerTextDrawBoxColour): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColour](PlayerTextDrawBackgroundColour): 设置玩家文本绘图的背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体样式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图方框尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图的轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的文字间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的显示内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColor.md new file mode 100644 index 00000000000..898d075b354 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColor.md @@ -0,0 +1,56 @@ +--- +title: PlayerTextDrawGetColor +sidebar_label: PlayerTextDrawGetColor +description: 获取玩家文本绘图的文本颜色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的文本颜色 + +| 参数名 | 说明 | +| ----------------- | ----------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取颜色的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图的文本颜色。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawColor(playerid, pTextdraw[playerid], 0xFF0000FF); + PlayerTextDrawShow(playerid, pTextdraw[playerid]); + + new color = PlayerTextDrawGetColor(playerid, pTextdraw[playerid]); + // color = 0xFF0000FF + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColour.md new file mode 100644 index 00000000000..beb67e259c8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetColour.md @@ -0,0 +1,56 @@ +--- +title: PlayerTextDrawGetColour +sidebar_label: PlayerTextDrawGetColour +description: 获取玩家文本绘图的文本颜色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的文本颜色 + +| 参数名 | 说明 | +| ----------------- | ----------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取颜色的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图的文本颜色。 + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Example Text"); + PlayerTextDrawColour(playerid, pTextdraw[playerid], 0xFF0000FF); + PlayerTextDrawShow(playerid, pTextdraw[playerid]); + + new colour = PlayerTextDrawGetColour(playerid, pTextdraw[playerid]); + // colour = 0xFF0000FF + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawBoxColour](PlayerTextDrawBoxColour): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColour](PlayerTextDrawBackgroundColour): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetFont.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetFont.md new file mode 100644 index 00000000000..acab5d48dae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetFont.md @@ -0,0 +1,59 @@ +--- +title: PlayerTextDrawGetFont +sidebar_label: PlayerTextDrawGetFont +description: 获取玩家文本绘图的字体 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的字体 + +| 参数名 | 说明 | +| ----------------- | ----------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取字体的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图的字体。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawFont(playerid, welcomeText[playerid], TEXT_DRAW_FONT_2); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + new TEXT_DRAW_FONT:font = PlayerTextDrawGetFont(playerid, welcomeText[playerid]); + printf("Font: %d", font); // Font: 2 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetLetterSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetLetterSize.md new file mode 100644 index 00000000000..c7ecab5c34e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetLetterSize.md @@ -0,0 +1,63 @@ +--- +title: PlayerTextDrawGetLetterSize +sidebar_label: PlayerTextDrawGetLetterSize +description: 获取文本字符的宽度和高度 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取文本字符的宽度和高度 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------ | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取字符尺寸的玩家文本绘图的 ID | +| &Float:width | 用于存储宽度的浮点变量,通过引用传递 | +| &Float:height | 用于存储高度的浮点变量,通过引用传递 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawLetterSize(playerid, welcomeText[playerid], 3.2, 5.1); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + new Float:width, Float:height; + PlayerTextDrawGetLetterSize(playerid, welcomeText[playerid], width, height); + // width = 3.2 + // height = 5.1 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图的字符尺寸 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetOutline.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetOutline.md new file mode 100644 index 00000000000..e3237f23714 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetOutline.md @@ -0,0 +1,58 @@ +--- +title: PlayerTextDrawGetOutline +sidebar_label: PlayerTextDrawGetOutline +description: 获取玩家文本绘图的轮廓大小 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的轮廓大小 + +| 参数名 | 说明 | +| ----------------- | --------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取轮廓大小的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图的轮廓大小。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawSetOutline(playerid, welcomeText[playerid], 1); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + new outline = PlayerTextDrawGetOutline(playerid, welcomeText[playerid]); + // outline = 1 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPos.md new file mode 100644 index 00000000000..b77f85a0fdf --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPos.md @@ -0,0 +1,57 @@ +--- +title: PlayerTextDrawGetPos +sidebar_label: PlayerTextDrawGetPos +description: 获取玩家文本绘图的位置 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的屏幕坐标位置(X 轴和 Y 轴) + +| 参数名 | 说明 | +| ----------------- | --------------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取位置的玩家文本绘图的 ID | +| &Float:x | 用于存储 X 坐标的浮点变量,通过引用传递 | +| &Float:y | 用于存储 Y 坐标的浮点变量,通过引用传递 | + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + new Float:x, Float:y; + PlayerTextDrawGetPos(playerid, welcomeText[playerid], x, y); + // x = 320.0 + // y = 240.0 +} +``` + +## 相关函数 + +- [PlayerTextDrawSetPos](PlayerTextDrawSetPos): 设置玩家文本绘图的位置 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewModel.md new file mode 100644 index 00000000000..6bce55cd141 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewModel.md @@ -0,0 +1,64 @@ +--- +title: PlayerTextDrawGetPreviewModel +sidebar_label: PlayerTextDrawGetPreviewModel +description: 获取3D预览玩家文本绘图的预览模型 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取 3D 预览玩家文本绘图的预览模型 + +| 参数名 | 说明 | +| ----------------- | --------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取预览模型的玩家文本绘图的 ID | + +## 返回值 + +返回 3D 玩家文本绘图的预览模型。 + +## 示例 + +```c +new PlayerText:gTextDraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gTextDraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); + PlayerTextDrawFont(playerid, gTextDraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); + PlayerTextDrawUseBox(playerid, gTextDraw[playerid], true); + PlayerTextDrawBoxColor(playerid, gTextDraw[playerid], 0x000000FF); + PlayerTextDrawTextSize(playerid, gTextDraw[playerid], 40.0, 40.0); + PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 411); + PlayerTextDrawShow(playerid, gTextDraw[playerid]); + + new previewModel = PlayerTextDrawGetPreviewModel(playerid, gTextDraw[playerid]); + // previewModel = 411 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): 设置玩家文本绘图的指定模型 ID 的 3D 预览模型 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewRot.md new file mode 100644 index 00000000000..6b387e46e29 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewRot.md @@ -0,0 +1,57 @@ +--- +title: PlayerTextDrawGetPreviewRot +sidebar_label: PlayerTextDrawGetPreviewRot +description: 获取3D模型预览玩家文本绘图的旋转和缩放参数 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取 3D 模型预览玩家文本绘图的旋转角度和缩放值 + +| 参数名 | 说明 | +| ----------------- | --------------------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取旋转和缩放参数的玩家文本绘图的 ID | +| &Float:rotationX | 用于存储 X 轴旋转角度的浮点变量,通过引用传递 | +| &Float:rotationY | 用于存储 Y 轴旋转角度的浮点变量,通过引用传递 | +| &Float:rotationZ | 用于存储 Z 轴旋转角度的浮点变量,通过引用传递 | +| &Float:zoom | 用于存储缩放值的浮点变量,通过引用传递 | + +## 示例 + +```c +new PlayerText:gMyTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); + PlayerTextDrawFont(playerid, gMyTextdraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); + PlayerTextDrawUseBox(playerid, gMyTextdraw[playerid], 1); + PlayerTextDrawBoxColor(playerid, gMyTextdraw[playerid], 0x000000FF); + PlayerTextDrawTextSize(playerid, gMyTextdraw[playerid], 40.0, 40.0); + PlayerTextDrawSetPreviewModel(playerid, gMyTextdraw[playerid], 411); + PlayerTextDrawSetPreviewRot(playerid, gMyTextdraw[playerid], -10.0, 0.0, -20.0, 1.0); + PlayerTextDrawShow(playerid, gMyTextdraw[playerid]); + + new Float:rotationX, Float:rotationY, Float:rotationZ, Float:zoom; + PlayerTextDrawGetPreviewRot(playerid, gMyTextdraw[playerid], rotationX, rotationY, rotationZ, zoom); + // rotationX = -10.0 + // rotationY = 0.0 + // rotationZ = -20.0 + // zoom = 1.0 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): 设置 3D 玩家文本绘图的预览旋转 +- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): 设置 3D 玩家文本绘图的预览模型 +- [PlayerTextDrawSetPreviewVehCol](PlayerTextDrawSetPreviewVehCol): 设置 3D 玩家文本绘图预览中车辆的颜色 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehCol.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehCol.md new file mode 100644 index 00000000000..d911e5eaafc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehCol.md @@ -0,0 +1,52 @@ +--- +title: PlayerTextDrawGetPreviewVehCol +sidebar_label: PlayerTextDrawGetPreviewVehCol +description: 获取3D预览玩家文本绘图的车辆颜色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取 3D 预览玩家文本绘图的车辆颜色 + +| 参数名 | 说明 | +| ----------------- | ---------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取车辆颜色的玩家文本绘图的 ID | +| &colour1 | 用于存储主颜色的变量,通过引用传递 | +| &colour2 | 用于存储副颜色的变量,通过引用传递 | + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); + PlayerTextDrawFont(playerid, pTextdraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); + PlayerTextDrawUseBox(playerid, pTextdraw[playerid], true); + PlayerTextDrawBoxColor(playerid, pTextdraw[playerid], 0x000000FF); + PlayerTextDrawTextSize(playerid, pTextdraw[playerid], 40.0, 40.0); + PlayerTextDrawSetPreviewModel(playerid, pTextdraw[playerid], 411); + PlayerTextDrawSetPreviewVehCol(playerid, pTextdraw[playerid], 6, 8); + + new colour1, colour2; + PlayerTextDrawGetPreviewVehCol(playerid, pTextdraw[playerid], colour1, colour2); + // colour1 = 6 + // colour2 = 8 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): 设置 3D 玩家文本绘图的预览模型 ID +- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): 设置 3D 玩家文本绘图的预览旋转角度 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 + +## 相关回调 + +- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): 当玩家点击玩家文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md new file mode 100644 index 00000000000..d742f29a832 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetPreviewVehicleColours.md @@ -0,0 +1,52 @@ +--- +title: PlayerTextDrawGetPreviewVehicleColours +sidebar_label: PlayerTextDrawGetPreviewVehicleColours +description: 获取3D预览玩家文本绘图的车辆颜色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取 3D 预览玩家文本绘图的车辆颜色 + +| 参数名 | 说明 | +| ----------------- | ---------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取车辆颜色的玩家文本绘图的 ID | +| &colour1 | 用于存储主颜色的变量,通过引用传递 | +| &colour2 | 用于存储副颜色的变量,通过引用传递 | + +## 示例 + +```c +new PlayerText:pTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + pTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); + PlayerTextDrawFont(playerid, pTextdraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); + PlayerTextDrawUseBox(playerid, pTextdraw[playerid], true); + PlayerTextDrawBoxColor(playerid, pTextdraw[playerid], 0x000000FF); + PlayerTextDrawTextSize(playerid, pTextdraw[playerid], 40.0, 40.0); + PlayerTextDrawSetPreviewModel(playerid, pTextdraw[playerid], 411); + PlayerTextDrawSetPreviewVehicleColours(playerid, pTextdraw[playerid], 6, 8); + + new colour1, colour2; + PlayerTextDrawGetPreviewVehicleColours(playerid, pTextdraw[playerid], colour1, colour2); + // colour1 = 6 + // colour2 = 8 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): 设置 3D 玩家文本绘图的预览模型 ID +- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): 设置 3D 玩家文本绘图的预览旋转角度 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 + +## 相关回调 + +- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): 当玩家点击玩家文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetShadow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetShadow.md new file mode 100644 index 00000000000..c05b36e2188 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetShadow.md @@ -0,0 +1,59 @@ +--- +title: PlayerTextDrawGetShadow +sidebar_label: PlayerTextDrawGetShadow +description: 获取玩家文本绘图的阴影大小 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的阴影大小 + +| 参数名 | 说明 | +| ----------------- | --------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取阴影大小的玩家文本绘图的 ID | + +## 返回值 + +返回玩家文本绘图的阴影大小。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawSetShadow(playerid, welcomeText[playerid], 1); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + new shadow = PlayerTextDrawGetShadow(playerid, welcomeText[playerid]); + // shadow = 1 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetString.md new file mode 100644 index 00000000000..0b658975836 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetString.md @@ -0,0 +1,62 @@ +--- +title: PlayerTextDrawGetString +sidebar_label: PlayerTextDrawGetString +description: 获取玩家文本绘图的文本内容 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图的文本内容 + +| 参数名 | 说明 | +| ---------------------------- | -------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取文本的玩家文本绘图的 ID | +| string[] | 用于存储文本的数组,通过引用传递 | +| stringSize = sizeof (string) | 字符串缓冲区的大小 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Hello World!"); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + new string[16]; + PlayerTextDrawGetString(playerid, welcomeText[playerid], string, sizeof(string)); + // 字符串内容为 "Hello World!" + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 修改玩家文本绘图的文本内容 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 +- [TextDrawGetString](TextDrawGetString): 获取全局文本绘图的文本内容 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetTextSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetTextSize.md new file mode 100644 index 00000000000..fad87f62e5f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawGetTextSize.md @@ -0,0 +1,63 @@ +--- +title: PlayerTextDrawGetTextSize +sidebar_label: PlayerTextDrawGetTextSize +description: 获取玩家文本绘图文本尺寸的X轴和Y轴值 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +获取玩家文本绘图文本尺寸的 X 轴和 Y 轴值 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------ | +| playerid | 玩家的 ID | +| PlayerText:textid | 要获取文本尺寸的玩家文本绘图的 ID | +| &Float:width | 用于存储宽度的浮点变量,通过引用传递 | +| &Float:height | 用于存储高度的浮点变量,通过引用传递 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawTextSize(playerid, welcomeText[playerid], 2.0, 3.6); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + new Float:width, Float:height; + PlayerTextDrawGetTextSize(playerid, welcomeText[playerid], width, height); + // width = 2.0 + // height = 3.6 + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawHide.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawHide.md new file mode 100644 index 00000000000..d3723923d1f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawHide.md @@ -0,0 +1,57 @@ +--- +title: PlayerTextDrawHide +sidebar_label: PlayerTextDrawHide +description: 隐藏为指定玩家创建的玩家文本绘图 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +隐藏为指定玩家创建的玩家文本绘图 + +| 参数名 | 说明 | +| ----------------- | ------------------------- | +| playerid | 要隐藏文本绘图的玩家 ID | +| PlayerText:textid | 要隐藏的玩家文本绘图的 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + PlayerTextDrawHide(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsBox.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsBox.md new file mode 100644 index 00000000000..c747e705b08 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsBox.md @@ -0,0 +1,68 @@ +--- +title: PlayerTextDrawIsBox +sidebar_label: PlayerTextDrawIsBox +description: 检查玩家文本绘图是否启用了方框 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +检查玩家文本绘图是否启用了方框 + +## 参数 + +| 参数名 | 说明 | +| ----------------- | ------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要检查的玩家文本绘图的 ID | + +## 返回值 + +返回 **true** 表示玩家文本绘图已启用方框,否则返回 **false** + +## 示例用法 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 40.0, 140.0, "_~N~Welcome!~N~_"); + PlayerTextDrawUseBox(playerid, welcomeText[playerid], true); // 启用方框 + PlayerTextDrawBoxColor(playerid, welcomeText[playerid], 0x00000066); // 设置方框颜色为半透明黑色 + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + if (PlayerTextDrawIsBox(playerid, welcomeText[playerid])) + { + // 玩家文本绘图已启用方框 + } + else + { + // 玩家文本绘图未启用方框 + } + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsProportional.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsProportional.md new file mode 100644 index 00000000000..81642195322 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsProportional.md @@ -0,0 +1,67 @@ +--- +title: PlayerTextDrawIsProportional +sidebar_label: PlayerTextDrawIsProportional +description: 检查玩家文本绘图是否启用了比例缩放 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +检查玩家文本绘图是否启用了字符间距比例缩放 + +## 参数 + +| 参数名 | 说明 | +| ----------------- | ------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要检查的玩家文本绘图的 ID | + +## 返回值 + +返回 **true** 表示已启用比例缩放,**false** 表示未启用 + +## 示例用法 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawSetProportional(playerid, welcomeText[playerid], true); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + if (PlayerTextDrawIsProportional(playerid, welcomeText[playerid])) + { + // 玩家文本绘图已启用比例缩放 + } + else + { + // 玩家文本绘图未启用比例缩放 + } + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 设置玩家文本绘图的字符间距比例缩放 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsSelectable.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsSelectable.md new file mode 100644 index 00000000000..bc806a08662 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawIsSelectable.md @@ -0,0 +1,69 @@ +--- +title: PlayerTextDrawIsSelectable +sidebar_label: PlayerTextDrawIsSelectable +description: 检查玩家文本绘图是否可被选择 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +检查玩家文本绘图是否可被选择 + +## 参数 + +| 参数名 | 说明 | +| ----------------- | ------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要检查的玩家文本绘图的 ID | + +## 返回值 + +返回 **true** 表示可被选择,**false** 表示不可被选择 + +## 示例用法 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawTextSize(playerid, welcomeText[playerid], 30.0, 10.0); + PlayerTextDrawSetSelectable(playerid, welcomeText[playerid], true); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + if (PlayerTextDrawIsSelectable(playerid, welcomeText[playerid])) + { + // 玩家文本绘图可被选择 + } + else + { + // 玩家文本绘图不可被选择 + } + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawCreate](PlayerTextDrawCreate): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawSetSelectable](PlayerTextDrawSetSelectable): 设置玩家文本绘图的可选状态 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawLetterSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawLetterSize.md new file mode 100644 index 00000000000..d5e19064a6a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawLetterSize.md @@ -0,0 +1,69 @@ +--- +title: PlayerTextDrawLetterSize +sidebar_label: PlayerTextDrawLetterSize +description: 设置玩家文本绘图的字符尺寸 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图中字符的宽度和高度 + +| 参数名 | 说明 | +| ----------------- | --------------------------------- | +| playerid | 要设置字符尺寸的玩家 ID | +| PlayerText:textid | 要修改字符尺寸的玩家文本绘图的 ID | +| Float:width | 字符宽度(浮点型) | +| Float:height | 字符高度(浮点型) | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawLetterSize(playerid, welcomeText[playerid], 3.2, 5.1); + + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 注意事项 + +:::tip + +当仅需要调整文本绘图方框大小时,可将 Y 值乘以 0.135 来获得类似 TextDrawTextSize 的效果 + +::: + +:::tip + +字体显示效果最佳比例为 X:Y = 1:4(例如 X 设为 0.5 时,Y 应设为 2) + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawGetLetterSize](PlayerTextDrawGetLetterSize): 获取字符尺寸 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置字体类型 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置文本区域尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用比例缩放 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 修改文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetOutline.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetOutline.md new file mode 100644 index 00000000000..954a45323ea --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetOutline.md @@ -0,0 +1,54 @@ +--- +title: PlayerTextDrawSetOutline +sidebar_label: PlayerTextDrawSetOutline +description: 设置玩家文本绘图的轮廓 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图的轮廓。轮廓颜色需通过[PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor)进行修改 + +| 参数名 | 说明 | +| ----------------- | -------------------------------------------- | +| playerid | 要设置轮廓的玩家 ID | +| PlayerText:textid | 要设置轮廓的玩家文本绘图的 ID | +| outlineSize | 轮廓的厚度(0 表示无轮廓,数值越大轮廓越粗) | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my server!"); + PlayerTextDrawSetOutline(playerid, welcomeText[playerid], 1); + + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawGetOutline](PlayerTextDrawGetOutline): 获取玩家文本绘图的轮廓大小 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPos.md new file mode 100644 index 00000000000..76ca7bf4eae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPos.md @@ -0,0 +1,55 @@ +--- +title: PlayerTextDrawSetPos +sidebar_label: PlayerTextDrawSetPos +description: 设置玩家文本绘图的位置 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +设置玩家文本绘图的屏幕坐标位置(X 轴和 Y 轴) + +| 参数名 | 说明 | +| ----------------- | ----------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要设置位置的玩家文本绘图的 ID | +| Float:x | X 轴坐标(浮点型) | +| Float:y | Y 轴坐标(浮点型) | + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + PlayerTextDrawShow(playerid, welcomeText[playerid]); + + PlayerTextDrawSetPos(playerid, welcomeText[playerid], 200.0, 250.0); + return 1; +} +``` + +## 相关函数 + +- [PlayerTextDrawGetPos](PlayerTextDrawGetPos): 获取玩家文本绘图的位置 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置玩家文本绘图的文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置玩家文本绘图方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置玩家文本绘图背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置玩家文本绘图对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置玩家文本绘图字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置玩家文本绘图文本尺寸(或 PlayerTextDrawSetSelectable 的可点击区域) +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换玩家文本绘图轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置玩家文本绘图的阴影 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 按比例缩放玩家文本绘图的字符间距 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换玩家文本绘图的方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 设置玩家文本绘图的文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示玩家文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): 检查玩家文本绘图是否对玩家可见 +- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): 检查玩家文本绘图是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewModel.md new file mode 100644 index 00000000000..f5f26679f47 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewModel.md @@ -0,0 +1,63 @@ +--- +title: PlayerTextDrawSetPreviewModel +sidebar_label: PlayerTextDrawSetPreviewModel +description: 设置玩家文本绘图的3D预览模型 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图的指定模型 ID 的 3D 预览模型 + +| 参数名 | 说明 | +| ----------------- | --------------------------------- | +| playerid | 玩家的 ID | +| PlayerText:textid | 要显示 3D 预览的玩家文本绘图的 ID | +| model | 要显示的 GTA SA 或 SA:MP 模型 ID | + +## 返回值 + +**true** - 函数执行成功。如果传入无效模型会返回成功,但会显示为黄/黑问号 + +**false** - 函数执行失败。玩家或文本绘图不存在 + +## 示例 + +```c +new PlayerText:gTextDraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gTextDraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); + PlayerTextDrawFont(playerid, gTextDraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); + PlayerTextDrawUseBox(playerid, gTextDraw[playerid], true); + PlayerTextDrawBoxColor(playerid, gTextDraw[playerid], 0x000000FF); + PlayerTextDrawTextSize(playerid, gTextDraw[playerid], 40.0, 40.0); + + PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 411); // 显示Infernus跑车(模型ID 411) + //PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 0); // 显示模型0(CJ皮肤) + //PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 18646); // 显示模型18646(警灯物体) + + PlayerTextDrawShow(playerid, gTextDraw[playerid]); + return 1; +} +``` + +## 注意事项 + +:::warning + +必须使用字体类型`TEXT_DRAW_FONT_MODEL_PREVIEW`(模型预览字体)才能使此功能生效 + +::: + +## 相关函数 + +- [PlayerTextDrawGetPreviewModel](PlayerTextDrawGetPreviewModel): 获取 3D 预览玩家文本绘图的模型 ID +- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): 设置 3D 预览模型的旋转角度 +- [PlayerTextDrawSetPreviewVehCol](PlayerTextDrawSetPreviewVehCol): 设置 3D 预览车辆的配色 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体类型 + +## 相关回调 + +- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): 当玩家点击玩家文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewRot.md new file mode 100644 index 00000000000..663493266a9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewRot.md @@ -0,0 +1,65 @@ +--- +title: PlayerTextDrawSetPreviewRot +sidebar_label: PlayerTextDrawSetPreviewRot +description: 设置3D模型预览玩家文本绘图的旋转和缩放参数 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置 3D 模型预览玩家文本绘图的旋转角度和缩放值 + +| 参数名 | 说明 | +| ----------------- | -------------------------------------------------- | +| playerid | 要修改的玩家 ID | +| PlayerText:textid | 要修改的玩家文本绘图的 ID | +| Float:rotX | X 轴旋转角度(单位:度) | +| Float:rotY | Y 轴旋转角度(单位:度) | +| Float:rotZ | Z 轴旋转角度(单位:度) | +| Float:zoom | 缩放值(默认 1.0),值越小视角越近,值越大视角越远 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:gMyTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); + PlayerTextDrawFont(playerid, gMyTextdraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); + PlayerTextDrawUseBox(playerid, gMyTextdraw[playerid], 1); + PlayerTextDrawBoxColor(playerid, gMyTextdraw[playerid], 0x000000FF); + PlayerTextDrawTextSize(playerid, gMyTextdraw[playerid], 40.0, 40.0); + PlayerTextDrawSetPreviewModel(playerid, gMyTextdraw[playerid], 411); + PlayerTextDrawSetPreviewRot(playerid, gMyTextdraw[playerid], -10.0, 0.0, -20.0, 1.0); + + PlayerTextDrawShow(playerid, gMyTextdraw[playerid]); + return 1; +} +``` + +## 注意事项 + +:::warning + +必须同时满足以下条件才能生效: + +1. 使用`TEXT_DRAW_FONT_MODEL_PREVIEW`字体类型 +2. 已通过 PlayerTextDrawSetPreviewModel 设置有效模型 + +::: + +## 相关函数 + +- [TextDrawSetPreviewRot](TextDrawSetPreviewRot): 设置全局文本绘图的 3D 预览旋转 +- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): 设置玩家文本绘图的 3D 预览模型 +- [PlayerTextDrawSetPreviewVehCol](PlayerTextDrawSetPreviewVehCol): 设置玩家文本绘图 3D 预览的车辆配色 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体类型 + +## 相关回调 + +- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): 当玩家点击玩家文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehCol.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehCol.md new file mode 100644 index 00000000000..92a16a2245b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehCol.md @@ -0,0 +1,63 @@ +--- +title: PlayerTextDrawSetPreviewVehCol +sidebar_label: PlayerTextDrawSetPreviewVehCol +description: 设置玩家文本绘图3D预览中车辆的配色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图 3D 预览中显示的车辆主副配色(需预览模型为车辆) + +| 参数名 | 说明 | +| ----------------- | ------------------------- | +| playerid | 要修改的玩家 ID | +| PlayerText:textid | 要修改的玩家文本绘图的 ID | +| colour1 | 车辆主颜色 ID | +| colour2 | 车辆副颜色 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:gTextDraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gTextDraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); + PlayerTextDrawFont(playerid, gTextDraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); + PlayerTextDrawUseBox(playerid, gTextDraw[playerid], true); + PlayerTextDrawBoxColor(playerid, gTextDraw[playerid], 0x000000FF); + PlayerTextDrawTextSize(playerid, gTextDraw[playerid], 40.0, 40.0); + + PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 411); // 设置预览模型为Infernus + PlayerTextDrawSetPreviewVehCol(playerid, gTextDraw[playerid], 3, 6); // 主颜色3(亮红),副颜色6(亮蓝) + + PlayerTextDrawShow(playerid, gTextDraw[playerid]); + return 1; +} +``` + +## 注意事项 + +:::warning + +生效条件需同时满足: + +1. 使用`TEXT_DRAW_FONT_MODEL_PREVIEW`字体类型 +2. 已通过 PlayerTextDrawSetPreviewModel 设置车辆模型 + +::: + +## 相关函数 + +- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): 设置玩家文本绘图的 3D 预览模型 +- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): 设置玩家文本绘图的 3D 预览旋转 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体类型 + +## 相关回调 + +- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): 当玩家点击玩家文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md new file mode 100644 index 00000000000..1651c422444 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetPreviewVehicleColours.md @@ -0,0 +1,65 @@ +--- +title: PlayerTextDrawSetPreviewVehicleColours +sidebar_label: PlayerTextDrawSetPreviewVehicleColours +description: 设置玩家文本绘图3D预览中车辆的配色 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + + + +## 描述 + +设置玩家文本绘图 3D 预览中显示的车辆主副配色(需预览模型为车辆) + +| 参数名 | 说明 | +| ----------------- | ------------------------- | +| playerid | 要修改的玩家 ID | +| PlayerText:textid | 要修改的玩家文本绘图的 ID | +| colour1 | 车辆主颜色 ID | +| colour2 | 车辆副颜色 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:gTextDraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gTextDraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); + PlayerTextDrawFont(playerid, gTextDraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); + PlayerTextDrawUseBox(playerid, gTextDraw[playerid], true); + PlayerTextDrawBoxColour(playerid, gTextDraw[playerid], 0x000000FF); + PlayerTextDrawTextSize(playerid, gTextDraw[playerid], 40.0, 40.0); + + PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 411); // 设置预览模型为Infernus + PlayerTextDrawSetPreviewVehicleColours(playerid, gTextDraw[playerid], 3, 6); // 主颜色3(亮红),副颜色6(亮蓝) + + PlayerTextDrawShow(playerid, gTextDraw[playerid]); + return 1; +} +``` + +## 注意事项 + +:::warning + +生效条件需同时满足: + +1. 使用`TEXT_DRAW_FONT_MODEL_PREVIEW`字体类型 +2. 已通过 PlayerTextDrawSetPreviewModel 设置车辆模型 + +::: + +## 相关函数 + +- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): 设置玩家文本绘图的 3D 预览模型 +- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): 设置玩家文本绘图的 3D 预览旋转 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置玩家文本绘图的字体类型 + +## 相关回调 + +- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): 当玩家点击玩家文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetProportional.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetProportional.md new file mode 100644 index 00000000000..bce10339d93 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetProportional.md @@ -0,0 +1,54 @@ +--- +title: PlayerTextDrawSetProportional +sidebar_label: PlayerTextDrawSetProportional +description: 按比例缩放玩家文本绘图的字符间距 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +按比例缩放玩家文本绘图的字符间距。当使用[PlayerTextDrawLetterSize](PlayerTextDrawLetterSize)时,该功能可确保文本字符间距均匀分布 + +| 参数名 | 说明 | +| ----------------- | --------------------------------- | +| playerid | 要设置比例缩放的玩家 ID | +| PlayerText:textid | 要设置比例缩放的玩家文本绘图的 ID | +| bool:proportional | true 启用比例缩放,false 禁用 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my server!"); + PlayerTextDrawSetProportional(playerid, welcomeText[playerid], true); // 启用比例缩放 + + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawIsProportional](PlayerTextDrawIsProportional): 检查比例缩放状态 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置字体类型 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置文本区域尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置阴影效果 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 修改文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetSelectable.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetSelectable.md new file mode 100644 index 00000000000..446aa3cb30c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetSelectable.md @@ -0,0 +1,70 @@ +--- +title: PlayerTextDrawSetSelectable +sidebar_label: PlayerTextDrawSetSelectable +description: 设置玩家文本绘图的可选状态 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图是否可被鼠标选择 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------------------ | +| playerid | 要设置可选状态的玩家 ID | +| PlayerText:textid | 要设置可选状态的玩家文本绘图的 ID | +| bool:selectable | 设置为 true 可被选择,false 不可被选择。默认值为 false | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my server"); + PlayerTextDrawTextSize(playerid, welcomeText[playerid], 30.0, 10.0); + + // 设置文本为可选 + PlayerTextDrawSetSelectable(playerid, welcomeText[playerid], true); + + // 启用玩家选择模式 + SelectTextDraw(playerid, 0xFF0000FF); + + // 向玩家显示文本 + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 注意事项 + +:::tip + +使用[PlayerTextDrawTextSize](PlayerTextDrawTextSize)定义可点击区域尺寸 + +::: + +:::warning + +必须遵循以下调用顺序: + +1. 先调用 PlayerTextDrawSetSelectable 设置可选状态 +2. 再调用 SelectTextDraw 启用选择模式 +3. 最后显示文本绘图 + +::: + +## 相关函数 + +- [PlayerTextDrawIsSelectable](PlayerTextDrawIsSelectable): 检查玩家文本绘图是否可被选择 +- [SelectTextDraw](SelectTextDraw): 启用鼠标选择文本绘图模式 +- [CancelSelectTextDraw](CancelSelectTextDraw): 取消文本绘图选择模式 + +## 相关回调 + +- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): 当玩家点击玩家文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetShadow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetShadow.md new file mode 100644 index 00000000000..fd083ad7974 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetShadow.md @@ -0,0 +1,64 @@ +--- +title: PlayerTextDrawSetShadow +sidebar_label: PlayerTextDrawSetShadow +description: 为玩家文本绘图的文本添加右下角阴影 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +为玩家文本绘图的文本添加右下角阴影效果,阴影的字体样式与文本字体保持一致 + +| 参数名 | 说明 | +| ----------------- | ----------------------------- | +| playerid | 要设置阴影的玩家 ID | +| PlayerText:textid | 要设置阴影的玩家文本绘图的 ID | +| shadowSize | 阴影尺寸(0 为隐藏阴影) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家或文本绘图不存在) + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my server!"); + PlayerTextDrawSetShadow(playerid, welcomeText[playerid], 1); // 设置1单位阴影 + + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 注意事项 + +:::tip + +当阴影尺寸超过文本区域大小时,阴影可能会被方框边界裁剪 + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawGetShadow](PlayerTextDrawGetShadow): 获取阴影尺寸 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置字体类型 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置文本区域尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换轮廓显示 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用比例缩放 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 修改文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetString.md new file mode 100644 index 00000000000..b9c8c0d7ddc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawSetString.md @@ -0,0 +1,101 @@ +--- +title: PlayerTextDrawSetString +sidebar_label: PlayerTextDrawSetString +description: 修改玩家文本绘图的文本内容 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +修改玩家文本绘图的文本内容 + +| 参数名 | 说明 | +| ----------------- | ------------------------------ | +| playerid | 要设置文本的玩家 ID | +| PlayerText:textid | 要修改的玩家文本绘图的 ID | +| const format[] | 新的格式化字符串 | +| OPEN_MP_TAGS:... | 可变参数(支持任意标签的参数) | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:pVehicleHealthTD[MAX_PLAYERS]; +new pVehicleHealthTimer[MAX_PLAYERS]; + +public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) +{ + if (newstate == PLAYER_STATE_DRIVER) // 以驾驶员身份进入车辆 + { + pVehicleHealthTD[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, " "); + PlayerTextDrawShow(playerid, pVehicleHealthTD[playerid]); + + // 设置每秒更新文本绘图的计时器 + pVehicleHealthTimer[playerid] = SetTimerEx("UpdateVehicleHealthTextDraw", 1000, true, "i", playerid); + } + if (oldstate == PLAYER_STATE_DRIVER) // 退出驾驶状态 + { + KillTimer(pVehicleHealthTimer[playerid]); + PlayerTextDrawDestroy(playerid, pVehicleHealthTD[playerid]); + } + return 1; +} + +forward UpdateVehicleHealthTextDraw(playerid); +public UpdateVehicleHealthTextDraw(playerid) +{ + new + string[32], + vehicleid = GetPlayerVehicleID(playerid), + Float:health; + + GetVehicleHealth(vehicleid, health); + + format(string, sizeof(string), "车辆耐久: %.0f", health); + PlayerTextDrawSetString(playerid, pVehicleHealthTD[playerid], string); // <<< 更新显示车辆耐久度 + + // 专业建议:open.mp中可直接使用以下简化写法 + PlayerTextDrawSetString(playerid, pVehicleHealthTD[playerid], "车辆耐久: %.0f", health); + return 1; +} + +/* +注意:本示例仅用于演示目的,实际游戏中使用需进行额外验证和错误处理 +*/ +``` + +## 注意事项 + +:::tip + +修改文本内容后无需重新调用 PlayerTextDrawShow 即可生效 + +::: + +:::warning + +文本字符串长度存在限制,详见[系统限制](../resources/limits) + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawGetString](PlayerTextDrawGetString): 获取文本内容 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置字体类型 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置文本区域尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用比例缩放 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换方框显示 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawShow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawShow.md new file mode 100644 index 00000000000..d10bab10656 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawShow.md @@ -0,0 +1,62 @@ +--- +title: PlayerTextDrawShow +sidebar_label: PlayerTextDrawShow +description: 向指定玩家显示其专属的玩家文本绘图 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +向创建该文本绘图的指定玩家显示其专属的玩家文本绘图 + +| 参数名 | 说明 | +| ----------------- | ------------------------- | +| playerid | 要显示文本绘图的玩家 ID | +| PlayerText:textid | 要显示的玩家文本绘图的 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); + + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 注意事项 + +:::tip + +玩家文本绘图具有玩家专属性: + +1. 每个玩家文本绘图仅对创建时的目标玩家有效 +2. 无法将玩家 A 的文本绘图显示给玩家 B + +::: + +## 相关函数 + +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏玩家文本绘图 +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置字体类型 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置文本区域尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用比例缩放 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 修改文本内容 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawTextSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawTextSize.md new file mode 100644 index 00000000000..3c1f6af08db --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawTextSize.md @@ -0,0 +1,79 @@ +--- +title: PlayerTextDrawTextSize +sidebar_label: PlayerTextDrawTextSize +description: 设置玩家文本绘图的尺寸(方框尺寸或可点击区域) +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +设置玩家文本绘图的尺寸(当启用[PlayerTextDrawUseBox](PlayerTextDrawUseBox)时的方框尺寸,或用于[PlayerTextDrawSetSelectable](PlayerTextDrawSetSelectable)的可点击区域) + +| 参数名 | 说明 | +| ----------------- | --------------------------------------------------------------------- | +| playerid | 要设置尺寸的玩家 ID | +| PlayerText:textid | 要设置尺寸的玩家文本绘图的 ID | +| Float:width | X 轴尺寸(左右方向),遵循与 TextDrawCreate 相同的 640x480 网格坐标系 | +| Float:height | Y 轴尺寸(上下方向),遵循与 TextDrawCreate 相同的 640x480 网格坐标系 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:welcomeText[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my server!"); + PlayerTextDrawTextSize(playerid, welcomeText[playerid], 2.0, 3.6); // 设置尺寸为2.0x3.6 + + PlayerTextDrawShow(playerid, welcomeText[playerid]); + return 1; +} +``` + +## 注意事项 + +:::tip + +坐标含义根据对齐方式变化: + +- 对齐方式 1(左对齐): width/height 表示方框右边界绝对坐标 +- 对齐方式 2(居中): 需交换 width/height 参数,width 表示方框总宽度 +- 对齐方式 3(右对齐): width/height 表示方框左边界起始坐标 + +特殊字体处理: + +- 使用字体类型 4(精灵图)和 5(模型预览)时,width/height 参数将转换为宽高偏移量 + +坐标系原点: + +- 方框坐标系原点位于 TextDrawCreate 坐标点向下 10.0 单位、向右 5.0 单位的位置 + +交互区域定义: + +- 此函数定义的区域将作为[PlayerTextDrawSetSelectable](PlayerTextDrawSetSelectable)的可点击区域 + +::: + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawGetTextSize](PlayerTextDrawGetTextSize): 获取文本尺寸 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置字体类型 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置字符尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用比例缩放 +- [PlayerTextDrawUseBox](PlayerTextDrawUseBox): 切换方框显示 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 修改文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawUseBox.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawUseBox.md new file mode 100644 index 00000000000..59c02ff0b94 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PlayerTextDrawUseBox.md @@ -0,0 +1,53 @@ +--- +title: PlayerTextDrawUseBox +sidebar_label: PlayerTextDrawUseBox +description: 切换玩家文本绘图的方框显示 +tags: ["玩家", "文本绘图", "玩家文本绘图"] +--- + +## 描述 + +切换玩家文本绘图的方框显示状态 + +| 参数名 | 说明 | +| ----------------- | ----------------------------------- | +| playerid | 要操作的玩家 ID | +| PlayerText:textid | 要操作的玩家文本绘图的 ID | +| bool:boxEnabled | **true**启用方框,**false**禁用方框 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new PlayerText:gMyTextdraw[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 40.0, 140.0, "_~N~Example text!~N~_"); + PlayerTextDrawUseBox(playerid, gMyTextdraw[playerid], true); + PlayerTextDrawBoxColor(playerid, gMyTextdraw[playerid], 0x00000066); // 设置半透明黑色方框 + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerTextDraw](CreatePlayerTextDraw): 创建玩家文本绘图 +- [PlayerTextDrawDestroy](PlayerTextDrawDestroy): 销毁玩家文本绘图 +- [PlayerTextDrawIsBox](PlayerTextDrawIsBox): 检查方框状态 +- [PlayerTextDrawColor](PlayerTextDrawColor): 设置文本颜色 +- [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): 设置方框颜色 +- [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): 设置背景颜色 +- [PlayerTextDrawAlignment](PlayerTextDrawAlignment): 设置对齐方式 +- [PlayerTextDrawFont](PlayerTextDrawFont): 设置字体类型 +- [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): 设置字符尺寸 +- [PlayerTextDrawTextSize](PlayerTextDrawTextSize): 设置方框/点击区域尺寸 +- [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): 切换轮廓显示 +- [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): 设置阴影效果 +- [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): 启用比例缩放 +- [PlayerTextDrawSetString](PlayerTextDrawSetString): 修改文本内容 +- [PlayerTextDrawShow](PlayerTextDrawShow): 显示文本绘图 +- [PlayerTextDrawHide](PlayerTextDrawHide): 隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md new file mode 100644 index 00000000000..6c3ad65633d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md @@ -0,0 +1,99 @@ +--- +title: PutPlayerInVehicle +sidebar_label: PutPlayerInVehicle +description: 将玩家放置到车辆中 +tags: ["玩家", "车辆"] +--- + +## 描述 + +将玩家放置到车辆中 + +| 参数名 | 描述 | +| --------- | ----------------- | +| playerid | 需要放置的玩家 ID | +| vehicleid | 目标车辆 ID | +| seatid | 指定座位的 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败。玩家或车辆不存在 + +## 示例 + +```c +// 全局数组用于追踪每位玩家所属的车辆 +// 使用 INVALID_VEHICLE_ID 表示玩家当前无车辆 +static s_PlayerVehicle[MAX_PLAYERS] = { INVALID_VEHICLE_ID, ... }; + +public OnPlayerSpawn(playerid) +{ + // 检查玩家是否已有有效车辆 + if (!IsValidVehicle(s_PlayerVehicle[playerid])) + { + // 若没有则创建新车辆并存储ID + s_PlayerVehicle[playerid] = CreateVehicle(411, 0.0, 0.0, 3.5, 0.0, -1, -1, -1); + } + + // 标记需要在车辆加载完成后放置玩家 + // 避免客户端车辆模型尚未加载完成的情况 + SetPVarInt(playerid, "PutPlayerInVehicle", 1); + + return 1; +} + +public OnVehicleStreamIn(vehicleid, forplayerid) +{ + // 当车辆完成流加载时触发此回调 + // 检查是否为该玩家的车辆且需要放置 + if (vehicleid == s_PlayerVehicle[forplayerid] && GetPVarInt(forplayerid, "PutPlayerInVehicle")) + { + // 将玩家放置至车辆 + PutPlayerInVehicle(forplayerid, vehicleid, 0); + + // 清除标记防止重复放置 + // 例如玩家离开后车辆再次流加载的情况 + DeletePVar(forplayerid, "PutPlayerInVehicle"); + } + + return 1; +} + +``` + +| 座位 ID | 对应位置 | +| ------- | -------------------------- | +| 0 | 驾驶员 | +| 1 | 前排乘客 | +| 2 | 后排左侧乘客 | +| 3 | 后排右侧乘客 | +| 4+ | 额外座位(巴士等大型车辆) | + +## 注意事项 + +:::tip + +可通过循环调用 [GetPlayerVehicleSeat](GetPlayerVehicleSeat) 检查座位占用状态 + +::: + +:::warning + +- 若指定非法座位或座位已被占用,玩家离开车辆时会导致客户端崩溃 +- 将玩家放置到尚未流加载的车辆中可能不可靠,因客户端可能未完成车辆资源加载 +- 此问题同样适用于刚创建的车辆 + +::: + +## 相关函数 + +- [RemovePlayerFromVehicle](RemovePlayerFromVehicle): 强制玩家离开车辆 +- [GetPlayerVehicleID](GetPlayerVehicleID): 获取玩家当前所在车辆 ID +- [GetPlayerVehicleSeat](GetPlayerVehicleSeat): 获取玩家当前座位信息 +- [GetVehicleSeats](GetVehicleSeats): 获取车辆最大座位数 + +## 相关回调 + +- [OnPlayerEnterVehicle](../callbacks/OnPlayerEnterVehicle): 当玩家开始进入车辆时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RedirectDownload.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RedirectDownload.md new file mode 100644 index 00000000000..11c67613e90 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RedirectDownload.md @@ -0,0 +1,71 @@ +--- +title: RedirectDownload +sidebar_label: RedirectDownload +description: 将玩家自定义的AddCharModel或AddSimpleModel模型下载请求重定向到指定的HTTP网页。 +tags: ["自定义模型", "自定义皮肤", "简单模型"] +--- + + + +## 描述 + +将玩家通过 AddCharModel 或 AddSimpleModel 请求的自定义模型下载重定向到指定的 HTTP 网页。 + +## 参数 + +| 参数名 | 说明 | +| ----------- | --------------------------- | +| playerid | 请求下载自定义模型的玩家 ID | +| const url[] | 要重定向下载的 URL 链接 | + +## 返回值 + +**1:** 函数执行成功。 + +**0:** 函数执行失败。 + +## 示例用法(来自 dl_redirect 滤镜脚本) + +```c +new baseurl[] = "https://files.sa-mp.com/server"; + +public OnPlayerRequestDownload(playerid, type, crc) +{ + if (!IsPlayerConnected(playerid)) + { + return 0; + } + + new + fullURL[256], + fileName[64], + foundFileName = 0; + + if (type == DOWNLOAD_REQUEST_TEXTURE_FILE) + { + foundFileName = FindTextureFileNameFromCRC(crc, fileName, sizeof fileName); + } + else if (type == DOWNLOAD_REQUEST_MODEL_FILE) + { + foundFileName = FindModelFileNameFromCRC(crc, fileName, sizeof fileName); + } + + if (foundFileName) + { + format(fullURL, sizeof fullURL, "%s/%s", baseurl, fileName); + RedirectDownload(playerid, fullURL); + } + + return 0; +} +``` + +## 相关函数 + +- [AddCharModel](AddCharModel): 添加一个新的自定义角色模型供下载 +- [AddSimpleModel](AddSimpleModel): 添加一个新的自定义简单物体模型供下载 +- [AddSimpleModelTimed](AddSimpleModelTimed): 添加一个带时限的自定义简单物体模型供下载 + +## 相关回调函数 + +- [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading): 当玩家完成自定义模型下载时调用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md new file mode 100644 index 00000000000..efa993fc3a2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md @@ -0,0 +1,62 @@ +--- +title: RemoveBuildingForPlayer +sidebar_label: RemoveBuildingForPlayer +description: 为单个玩家在指定范围内移除圣安地列斯的标准模型。 +tags: ["玩家"] +--- + +## 描述 + +为单个玩家在指定范围内移除圣安地列斯的标准模型。 + +| 参数名 | 说明 | +| ------------- | ---------------------------------------------- | +| playerid | 需要移除物体的玩家 ID | +| modelid | 要移除的模型 ID | +| Float:centerX | 移除物体范围的 X 轴中心坐标 | +| Float:centerY | 移除物体范围的 Y 轴中心坐标 | +| Float:centerZ | 移除物体范围的 Z 轴中心坐标 | +| Float:radius | 以指定坐标为中心,移除该模型物体的球形半径范围 | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + // 当玩家连接时,在圣安地列斯中心坐标(0.0, 0.0, 0.0)200.0半径范围内移除615号模型物体 + RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0); + return 1; +} + +public OnPlayerConnect(playerid) +{ + // 当玩家连接时,移除6000.0半径范围内的所有地图物体 + RemoveBuildingForPlayer(playerid, -1, 0.0, 0.0, 0.0, 6000.0); + return 1; +} +``` + +## 注意要点 + +:::tip + +可以使用 **-1** 作为 modelid 参数来移除指定半径内的所有物体。 + +::: + +:::warning + +- 存在约 1000 个物体/行的移除限制,目前没有解决方案 +- 重复为玩家移除相同物体会导致崩溃。常见于玩家重连服务器时,服务器在 OnPlayerConnect 回调中执行建筑移除的情况 + +::: + +## 相关函数 + +- [GetPlayerBuildingsRemoved](GetPlayerBuildingsRemoved): 获取玩家已移除的建筑数量 +- [DestroyObject](DestroyObject): 销毁一个全局物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家专属物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerAttachedObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerAttachedObject.md new file mode 100644 index 00000000000..0e0697d69bb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerAttachedObject.md @@ -0,0 +1,44 @@ +--- +title: RemovePlayerAttachedObject +sidebar_label: RemovePlayerAttachedObject +description: 移除玩家身上的附加物体。 +tags: ["玩家", "物体", "附加物"] +--- + +## 描述 + +移除玩家身上已附加的物体。 + +| 参数名 | 说明 | +| -------- | -------------------------------------------------------------------------------- | +| playerid | 需要移除附加物体的玩家 ID | +| index | 要移除物体的索引值(通过[SetPlayerAttachedObject](SetPlayerAttachedObject)设置) | + +## 返回值 + +**1** 表示成功,**0** 表示失败。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/remove", true)) // 移除所有附加物体 + { + for (new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++) + { + if (IsPlayerAttachedObjectSlotUsed(playerid, i)) + { + RemovePlayerAttachedObject(playerid, i); + } + } + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SetPlayerAttachedObject](SetPlayerAttachedObject): 给玩家附加物体 +- [IsPlayerAttachedObjectSlotUsed](IsPlayerAttachedObjectSlotUsed): 检查玩家是否在指定索引使用了附加物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerFromVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerFromVehicle.md new file mode 100644 index 00000000000..c9d4be05651 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerFromVehicle.md @@ -0,0 +1,49 @@ +--- +title: RemovePlayerFromVehicle +sidebar_label: RemovePlayerFromVehicle +description: 将玩家移出所在车辆。 +tags: ["玩家", "车辆"] +--- + +## 描述 + +将玩家强制移出当前所在的车辆。 + +| 参数名 | 说明 | +| ---------- | ------------------------------------- | +| playerid | 需要移出车辆的玩家 ID | +| bool:force | 是否强制立即移出车辆(默认:`false`) | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。通常表示玩家未连接。 + +## 示例 + +```c +// 示例 - 玩家必须拥有10分才能驾驶车辆 +public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) +{ + if (newstate == PLAYER_STATE_DRIVER && GetPlayerScore(playerid) < 10) // PLAYER_STATE_DRIVER = 2 + { + RemovePlayerFromVehicle(playerid); + } + return 1; +} +``` + +## 注意要点 + +:::tip + +- 退出车辆的动画效果不会同步给其他玩家 +- 该函数在[OnPlayerEnterVehicle](../callbacks/OnPlayerEnterVehicle)回调中无效,因为此时玩家尚未进入车辆。请改用[OnPlayerStateChange](../callbacks/OnPlayerStateChange)回调(参见上方示例) +- 如果玩家正在遥控车(RC)中,该函数不会生效(需使用`.force = true`参数或[ClearAnimations](ClearAnimations)函数) + +::: + +## 相关函数 + +- [PutPlayerInVehicle](PutPlayerInVehicle): 将玩家放入指定车辆 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerMapIcon.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerMapIcon.md new file mode 100644 index 00000000000..708e2ee7219 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerMapIcon.md @@ -0,0 +1,34 @@ +--- +title: RemovePlayerMapIcon +sidebar_label: RemovePlayerMapIcon +description: 移除玩家之前通过SetPlayerMapIcon设置的地图图标。 +tags: ["玩家"] +--- + +## 描述 + +移除玩家之前通过 SetPlayerMapIcon 设置的地图图标。 + +| 参数名 | 说明 | +| -------- | ------------------------------------------------------- | +| playerid | 需要移除图标的玩家 ID | +| iconid | 要移除的图标 ID(即 SetPlayerMapIcon 函数的第二个参数) | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。 + +## 示例 + +```c +SetPlayerMapIcon(playerid, 12, 2204.9468, 1986.2877, 16.7380, 52, 0); + +// 之后 +RemovePlayerMapIcon(playerid, 12); +``` + +## 相关函数 + +- [SetPlayerMapIcon](/docs/scripting/functions/SetPlayerMapIcon): 为玩家创建地图图标 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerWeapon.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerWeapon.md new file mode 100644 index 00000000000..fcf1b308d4b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemovePlayerWeapon.md @@ -0,0 +1,40 @@ +--- +title: RemovePlayerWeapon +sidebar_label: RemovePlayerWeapon +description: 移除玩家指定的武器。 +tags: ["玩家"] +--- + + + +## 描述 + +移除玩家指定的武器。 + +| 参数名 | 说明 | +| --------------- | ----------------------------------------- | +| playerid | 需要移除武器的玩家 ID | +| WEAPON:weaponid | 要移除的[武器 ID](../resources/weaponids) | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。通常表示玩家未连接。 + +## 示例 + +```c +RemovePlayerWeapon(playerid, WEAPON_DEAGLE); // 移除玩家的沙漠之鹰手枪 +``` + +## 相关函数 + +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家武器 +- [ResetPlayerWeapons](ResetPlayerWeapons): 移除玩家所有武器 +- [SetPlayerArmedWeapon](SetPlayerArmedWeapon): 设置玩家手持武器 +- [GetPlayerWeapon](GetPlayerWeapon): 获取玩家当前手持武器 + +## 相关资源 + +- [武器 ID 列表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveServerRule.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveServerRule.md new file mode 100644 index 00000000000..e02b36841aa --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveServerRule.md @@ -0,0 +1,31 @@ +--- +title: RemoveServerRule +sidebar_label: RemoveServerRule +description: 移除服务器规则 +tags: ["规则"] +--- + + + +## 描述 + +移除指定的服务器规则。 + +| 参数名 | 说明 | +| ------------ | ---------------------- | +| const rule[] | 要移除的服务器规则名称 | + +## 返回值 + +成功执行返回 true,否则返回 false。 + +## 示例 + +```c +RemoveServerRule("rule"); +``` + +## 相关函数 + +- [AddServerRule](AddServerRule): 添加服务器规则 +- [IsValidServerRule](IsValidServerRule): 验证服务器规则是否有效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveVehicleComponent.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveVehicleComponent.md new file mode 100644 index 00000000000..afebfaa786d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveVehicleComponent.md @@ -0,0 +1,45 @@ +--- +title: RemoveVehicleComponent +sidebar_label: RemoveVehicleComponent +description: 移除车辆的组件 +tags: ["车辆"] +--- + +## 描述 + +从车辆上移除指定组件。 + +| 参数名 | 说明 | +| ---------------------------------------- | --------------- | +| vehicleid | 目标车辆的 ID | +| [component](../resources/carcomponentid) | 要移除的组件 ID | + +## 返回值 + +**true** - 组件成功从车辆移除 + +**false** - 移除失败,通常表示车辆不存在 + +## 示例 + +```c +// 移除玩家车辆的氮气加速组件 +new vehicleid = GetPlayerVehicleID(playerid); +RemoveVehicleComponent(vehicleid, 1010); +``` + +## 相关函数 + +- [AddVehicleComponent](AddVehicleComponent): 为车辆添加组件 +- [GetVehicleComponentInSlot](GetVehicleComponentInSlot): 获取车辆指定槽位的组件 +- [GetVehicleComponentType](GetVehicleComponentType): 通过组件 ID 获取组件类型 +- [VehicleCanHaveComponent](VehicleCanHaveComponent): 验证组件是否适配该车辆 + +## 相关回调 + +- [OnVehicleMod](../callbacks/OnVehicleMod): 当车辆被改装时触发 +- [OnEnterExitModShop](../callbacks/OnEnterExitModShop): 当车辆进入/离开改装店时触发 + +## 相关资源 + +- [车辆组件 ID 列表](../resources/carcomponentid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RepairVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RepairVehicle.md new file mode 100644 index 00000000000..30ad22b6954 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RepairVehicle.md @@ -0,0 +1,46 @@ +--- +title: RepairVehicle +sidebar_label: RepairVehicle +description: 完全修复车辆,包含外观损伤(凹陷、划痕、爆胎等) +tags: ["车辆"] +--- + +## 描述 + +完全修复车辆,包含外观损伤(凹陷、划痕、爆胎等)。 + +| 参数名 | 说明 | +| --------- | ----------------- | +| vehicleid | 需要修复的车辆 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的车辆不存在) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/repair", cmdtext)) + { + if (!IsPlayerInAnyVehicle(playerid)) + { + return SendClientMessage(playerid, 0xFFFFFFFF, "您当前未处于车辆中!"); + } + + RepairVehicle(GetPlayerVehicleID(playerid)); + + SendClientMessage(playerid, 0xFFFFFFFF, "您的车辆已修复完成!"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [SetVehicleHealth](SetVehicleHealth): 设置车辆生命值 +- [GetVehicleHealth](GetVehicleHealth): 获取车辆生命值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerMoney.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerMoney.md new file mode 100644 index 00000000000..5e8238b4c42 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerMoney.md @@ -0,0 +1,36 @@ +--- +title: ResetPlayerMoney +sidebar_label: ResetPlayerMoney +description: 将玩家的金钱重置为$0 +tags: ["玩家"] +--- + +## 描述 + +将玩家的金钱重置为$0。 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要重置金钱的玩家 ID | + +## 返回值 + +**1** - 函数执行成功 + +**0** - 函数执行失败(玩家未连接) + +## 示例代码 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + SendClientMessage(playerid, 0xFFFFFFAA, "您已死亡,所有现金已被清空!"); + ResetPlayerMoney(playerid); + return 1; +} +``` + +## 相关函数 + +- [GetPlayerMoney](GetPlayerMoney): 获取玩家当前金钱数额 +- [GivePlayerMoney](GivePlayerMoney): 给予玩家金钱 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerWeapons.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerWeapons.md new file mode 100644 index 00000000000..7be34cba34a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResetPlayerWeapons.md @@ -0,0 +1,45 @@ +--- +title: ResetPlayerWeapons +sidebar_label: ResetPlayerWeapons +description: 移除玩家所有武器。 +tags: ["玩家"] +--- + +## 描述 + +移除指定玩家的所有武器。 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 需要移除武器的玩家 ID | + +## 返回值 + +**1** - 函数执行成功。 + +**0** - 函数执行失败。通常表示指定玩家不存在。 + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 移除击杀者的所有武器 + ResetPlayerWeapons(killerid); + return 1; +} +``` + +## 注意要点 + +:::tip + +如需移除单个武器,请使用[SetPlayerAmmo](SetPlayerAmmo)将对应武器的弹药量设为 0 + +::: + +## 相关函数 + +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家武器 +- [GetPlayerWeapon](GetPlayerWeapon): 获取玩家当前手持武器 +- [RemovePlayerWeapon](RemovePlayerWeapon): 移除玩家指定武器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResumeRecordingPlayback.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResumeRecordingPlayback.md new file mode 100644 index 00000000000..9fdc93443a7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ResumeRecordingPlayback.md @@ -0,0 +1,14 @@ +--- +title: ResumeRecordingPlayback +sidebar_label: ResumeRecordingPlayback +description: 恢复已暂停的录制回放。 +tags: [] +--- + +## 描述 + +该函数用于恢复之前被暂停的录制回放进程。 + +## 相关函数 + +- [PauseRecordingPlayback](../functions/PauseRecordingPlayback): 如果录制已暂停则恢复播放 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SHA256_PassHash.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SHA256_PassHash.md new file mode 100644 index 00000000000..bb8354aabeb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SHA256_PassHash.md @@ -0,0 +1,65 @@ +--- +title: SHA256_PassHash +sidebar_label: SHA256_PassHash +description: 使用SHA-256算法对密码进行哈希处理。 +tags: ["加密"] +--- + + + +:::warning + +此函数在 open.mp 中已弃用,建议使用[samp-bcrypt](https://github.com/Sreyas-Sreelal/samp-bcrypt)插件进行哈希计算 + +::: + +## 描述 + +使用 SHA-256 哈希算法对密码进行哈希处理(含盐值)。输出固定为 256 位(即 64 个 Pawn 单元长度)。 + +| 参数名 | 说明 | +| ---------------------- | ---------------------------- | +| const password[] | 待哈希的原始密码字符串 | +| const salt[] | 用于哈希计算的盐值 | +| output[] | 输出的大写十六进制哈希字符串 | +| size = sizeof (output) | 输出缓冲区的最大容量 | + +## 返回值 + +生成的哈希值将存储在指定的输出数组中。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + new MyHash[64 + 1]; // +1用于空终止符 + SHA256_PassHash("test", "78sdjs86d2h", MyHash, sizeof MyHash); + printf("生成哈希: %s", MyHash); // 输出: CD16A1C8BF5792B48142FF6B67C9CB5B1BDC7260D8D11AFBA6BCDE0933A3C0AF + return 1; +} +``` + +## 注意事项 + +:::tip + +生成的哈希值可能存在前导零填充(例如可能以 00ABCD123...开头) + +::: + +:::tip + +盐值会附加在密码末尾(如密码'foo'和盐'bar'会组合成'foobar') + +- 盐值应为每个玩家生成随机唯一值 +- 盐值长度建议与哈希值相当 +- 需将盐值与哈希值同时存储于玩家账户数据 + +::: + +:::warning + +本函数不支持二进制安全操作,在密码或盐值中使用二进制数据可能导致意外结果 + +::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SelectObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SelectObject.md new file mode 100644 index 00000000000..bf3bcc58f19 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SelectObject.md @@ -0,0 +1,44 @@ +--- +title: SelectObject +sidebar_label: SelectObject +description: 显示光标并允许玩家选取物体 +tags: [] +--- + +## 描述 + +显示光标并允许玩家选取物体。当玩家选中物体时会触发[OnPlayerSelectObject](../callbacks/OnPlayerSelectObject)回调。 + +| 参数名 | 说明 | +| -------- | --------------------- | +| playerid | 可以选取物体的玩家 ID | + +## 返回值 + +该函数没有特定返回值 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/select", true)) + { + SelectObject(playerid); + SendClientMessage(playerid, 0xFFFFFFFF, "服务器:请选择您要编辑的物体!"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [MoveObject](MoveObject): 移动物体 +- [EditObject](EditObject): 编辑物体 +- [EditPlayerObject](EditPlayerObject): 编辑玩家所属物体 +- [EditAttachedObject](EditAttachedObject): 编辑附加物体 +- [CancelEdit](CancelEdit): 取消物体编辑 +- [OnPlayerSelectObject](../callbacks/OnPlayerSelectObject): 玩家选取物体时触发的回调 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SelectTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SelectTextDraw.md new file mode 100644 index 00000000000..557820faf01 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SelectTextDraw.md @@ -0,0 +1,53 @@ +--- +title: SelectTextDraw +sidebar_label: SelectTextDraw +description: 显示光标并允许玩家选择文本绘图 +tags: ["文本绘图"] +--- + +## 描述 + +显示光标并允许玩家选择文本绘图 + +| 参数名 | 说明 | +| ----------- | ----------------------------------------- | +| playerid | 可进行文本绘图选择的玩家 ID | +| hoverColour | 鼠标悬停时文本绘图的高亮颜色(RGBA 格式) | + +## 返回值 + +该函数没有特定返回值 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/tdselect", true)) + { + SelectTextDraw(playerid, 0x00FF00FF); // 悬停时显示绿色高亮 + SendClientMessage(playerid, 0xFFFFFFFF, "服务器:请选择一个文本绘图!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +悬停时高亮显示的是文本内容而非背景框(如果存在背景框) + +::: + +## 相关函数 + +- [CancelSelectTextDraw](CancelSelectTextDraw): 取消鼠标文本绘图选择模式 +- [TextDrawSetSelectable](TextDrawSetSelectable): 设置文本绘图是否可通过 SelectTextDraw 选择 +- [PlayerTextDrawSetSelectable](PlayerTextDrawSetSelectable): 设置玩家专属文本绘图是否可通过 SelectTextDraw 选择 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 玩家点击文本绘图时触发 +- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): 玩家点击专属文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendChat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendChat.md new file mode 100644 index 00000000000..72d9b654017 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendChat.md @@ -0,0 +1,31 @@ +--- +title: SendChat +sidebar_label: SendChat +description: 允许NPC发送聊天消息,类似于SendPlayerMessageToAll,但专用于NPC脚本。 +tags: [] +--- + +## 描述 + +该函数允许 NPC 发送聊天消息,类似于[SendPlayerMessageToAll](../functions/SendPlayerMessageToAll),但专用于 NPC 脚本内部使用。 + +| 参数名 | 说明 | +| ------ | -------------------- | +| msg[] | NPC 要发送的文本内容 | + +## 示例 + +```c +public OnPlayerDeath(playerid) +{ + new string[80], name[MAX_PLAYER_NAME]; + GetPlayerName(playerid, name, sizeof(name)); + format(string, sizeof(string), "哦不%s!我不想让你就这样死去!", name); + SendChat(string); // 当玩家死亡时发送消息 + return 1; +} +``` + +## 相关函数 + +- [SendCommand](../functions/SendCommand): 以 NPC 身份发送命令 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientCheck.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientCheck.md new file mode 100644 index 00000000000..d5f65f1edf2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientCheck.md @@ -0,0 +1,70 @@ +--- +title: SendClientCheck +sidebar_label: SendClientCheck +description: 在客户端执行内存检查 +tags: [] +--- + +## 描述 + +在客户端执行内存检查 + +| 参数名 | 说明 | +| --------- | --------------------------------------------------- | +| playerid | 需要检查的玩家 ID | +| type | 需要执行的检查类型 [参见此处](../resources/opcodes) | +| memAddr | 检查的基地址 | +| memOffset | 相对于基地址的偏移量 | +| byteCount | 需要检查的字节数 | + +## 返回值 + +1: 函数执行成功 + +0: 函数执行失败(玩家未连接) + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + SendClientCheck(playerid, 0x48, 0, 0, 2); + return 1; +} + +public OnClientCheckResponse(playerid, actionid, memaddr, retndata) +{ + if (actionid == 0x48) // 或72 + { + print("玩家正在使用PC客户端连接。"); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 客户端处理 6 种类型的请求(2、5、69、70、71、72) +- 类型 72 不使用其他参数 [参数 | 偏移量 | 大小] +- arg 参数返回计算机运行时间 + +::: + +:::warning + +**SA:MP 服务器**:该函数仅在滤镜脚本中生效 + +**Open Multiplayer 服务器**:该函数在游戏模式/滤镜脚本中均可正常使用 + +::: + +## 相关函数 + +- [IsPlayerUsingOfficialClient](IsPlayerUsingOfficialClient): 检查玩家是否使用官方 SA-MP 客户端 +- [IsPlayerUsingOmp](IsPlayerUsingOmp): 检查玩家是否使用 open.mp 启动器 + +## 相关回调 + +- [OnClientCheckResponse](../callbacks/OnClientCheckResponse): 当 SendClientCheck 请求完成时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessage.md new file mode 100644 index 00000000000..4045d40a92c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessage.md @@ -0,0 +1,71 @@ +--- +title: SendClientMessage +sidebar_label: SendClientMessage +description: 该函数用于向指定玩家发送带有特定颜色的聊天消息。 +tags: [] +--- + +## 描述 + +该函数向指定玩家的聊天框发送带有设定颜色的消息。聊天框中的整行文字将显示为设定颜色,除非使用了颜色嵌入技术。 + +| 参数名 | 说明 | +| ---------------- | ----------------------------------- | +| playerid | 接收消息的玩家 ID | +| color | 消息颜色(0xRRGGBBAA 十六进制格式) | +| const format[] | 要显示的文本内容(最多 144 个字符) | +| OPEN_MP_TAGS:... | 可变参数列表(支持任意类型参数) | + +## 返回值 + +**true** - 函数执行成功(当文本超过 144 字符时仍返回 true,但实际不会发送) + +**false** - 函数执行失败(通常表示玩家未连接) + +## 示例 + +```c +#define COLOR_RED 0xFF0000FF + +public OnPlayerConnect(playerid) +{ + SendClientMessage(playerid, COLOR_RED, "这段文字显示为红色"); + SendClientMessage(playerid, 0x00FF00FF, "这段文字显示为绿色"); + SendClientMessage(playerid, -1, "这段文字显示为白色"); + return 1; +} + +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + if (killerid != INVALID_PLAYER_ID) + { + new name[MAX_PLAYER_NAME]; + GetPlayerName(killerid, name, sizeof(name)); + + SendClientMessage(playerid, COLOR_RED, "你被玩家 %s 击杀", name); + } + return 1; +} +``` + +## 注意要点 + +:::tip + +- 可使用颜色嵌入技术在一条消息中显示多种颜色 +- 使用-1 作为颜色值时,消息将显示为白色(十六进制表示为 0xFFFFFFFF) + +::: + +:::warning + +- 超过 144 个字符的消息将不会被发送,建议使用截断或多行显示 +- 避免在消息中直接使用百分号%,如需使用请转义为%% + +::: + +## 相关函数 + +- [SendClientMessageToAll](SendClientMessageToAll): 向所有玩家发送消息 +- [SendPlayerMessageToPlayer](SendPlayerMessageToPlayer): 模拟玩家发送私聊消息 +- [SendPlayerMessageToAll](SendPlayerMessageToAll): 模拟玩家发送全局消息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAll.md new file mode 100644 index 00000000000..462b78645b0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAll.md @@ -0,0 +1,61 @@ +--- +title: SendClientMessageToAll +sidebar_label: SendClientMessageToAll +description: 向所有玩家的聊天框发送消息。 +tags: [] +--- + +## 描述 + +该函数向服务器内所有玩家的聊天框发送消息,功能等同于对每个玩家调用[SendClientMessage](SendClientMessage)。 + +| 参数名 | 说明 | +| ---------------- | ----------------------------------- | +| colour | 消息颜色(0xRRGGBBAA 十六进制格式) | +| const format[] | 要显示的文本内容(最多 144 个字符) | +| OPEN_MP_TAGS:... | 可变参数列表(支持任意类型参数) | + +## 返回值 + +该函数始终返回 **true (1)**。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/helloworld", true) == 0) + { + // 向全服玩家发送消息 + SendClientMessageToAll(-1, "你好!"); + return 1; + } + if (strcmp(cmdtext, "/time", true) == 0) + { + new + hours, + minutes, + seconds; + + gettime(hours, minutes, seconds); + + // 向全服发送当前时间 + SendClientMessageToAll(-1, "当前时间为 %02d:%02d:%02d", hours, minutes, seconds); + return 1; + } + return 0; +} +``` + +## 注意要点 + +:::warning + +避免在消息中直接使用未格式化的格式说明符(如%),否则会导致服务器崩溃 + +::: + +## 相关函数 + +- [SendClientMessage](SendClientMessage): 向指定玩家发送消息 +- [SendPlayerMessageToAll](SendPlayerMessageToAll): 模拟玩家发送全服消息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAllf.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAllf.md new file mode 100644 index 00000000000..5158eed5e6b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessageToAllf.md @@ -0,0 +1,47 @@ +--- +title: SendClientMessageToAllf +sidebar_label: SendClientMessageToAllf +description: 向所有玩家发送格式化聊天消息(已弃用)。 +tags: [] +--- + + + +:::warning + +此函数已被弃用 + +[SendClientMessageToAll](SendClientMessageToAll) 现已内置格式化功能! + +::: + +## 描述 + +向所有玩家发送格式化聊天消息(该函数已弃用,请使用 SendClientMessageToAll 替代)。此功能等同于对每个玩家调用 SendClientMessage。 + +| 参数名 | 说明 | +| ----------------- | ---------------------------------------- | +| color | 消息颜色(0xRRGGBBAA 十六进制格式) | +| const message[] | 格式化消息内容(最多 144 字符) | +| \{Float, \_\}:... | 可变参数列表(支持浮点型及其他类型参数) | + +## 返回值 + +该函数始终返回 true (1)。 + +## 示例 + +```c +#define HELLO_WORLD "Hello World" + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/helloworld", true) == 0) + { + // 向所有玩家发送消息 + SendClientMessageToAllf(-1, "%s!", HELLO_WORLD); + return 1; + } + return 0; +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessagef.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessagef.md new file mode 100644 index 00000000000..49c2d113323 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendClientMessagef.md @@ -0,0 +1,76 @@ +--- +title: SendClientMessagef +sidebar_label: SendClientMessagef +description: 向指定玩家发送格式化的彩色聊天信息 +tags: [] +--- + + + +:::warning + +此函数已被弃用 + +[SendClientMessage](SendClientMessage) 函数现已内置格式化功能 + +::: + +## 描述 + +向指定玩家发送格式化的彩色聊天信息。整行文字将使用设定颜色显示,除非使用颜色嵌入功能。 + +| 参数名 | 说明 | +| ----------------- | ----------------------------------- | +| playerid | 接收信息的玩家 ID | +| color | 信息颜色(0xRRGGBBAA 十六进制格式) | +| const message[] | 显示文本(最大 144 字符) | +| \{Float, \_\}:... | 不定数量的任意标签类型参数 | + +## 返回值 + +1: 函数执行成功(超过 144 字符的字符串会返回成功但信息不会被发送) + +0: 函数执行失败(玩家未连接) + +## 格式说明符 + +| 说明符 | 含义 | +| ------ | ------------------------------------- | +| %i | 无符号整数 | +| %d | 有符号整数 | +| %s | 字符串 | +| %f | 浮点数 | +| %c | ASCII 字符 | +| %x | 十六进制数 | +| %b | 二进制数 | +| %% | 百分号字面量 | +| %q | 转义 SQLite 文本(0.3.7 R2 版本新增) | + +## 示例代码 + +```c +#define COLOR_RED 0xFF0000FF + +public OnPlayerConnect(playerid) +{ + new number = 5; + SendClientMessagef(playerid, -1, "上方变量的值为 %i", number); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 可使用颜色嵌入实现多色文本效果 +- 使用-1 作为颜色值时文本将显示为白色(十六进制表示为 0xFFFFFFFF) + +::: + +:::warning + +- 超过 144 字符的信息不会被发送,可使用截断或分多行显示解决 +- SA-MP 官方客户端最大支持 144 字节(包括格式说明符转换后的字符) + +::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendCommand.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendCommand.md new file mode 100644 index 00000000000..13122bb8d82 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendCommand.md @@ -0,0 +1,35 @@ +--- +title: SendCommand +sidebar_label: SendCommand +description: 强制 NPC 执行指定控制台命令。 +tags: [] +--- + +## 描述 + +该函数允许 NPC 模拟执行指定的控制台命令,并产生相应的游戏效果。 + +| 参数名 | 说明 | +| ------------- | -------------------- | +| commandtext[] | NPC 要执行的命令文本 | + +## 示例 + +```c +public OnPlayerText(playerid, text[]) +{ + if (strfind(text, "stupid bot") != -1) + { + new string[80], name[MAX_PLAYER_NAME]; + GetPlayerName(playerid, name, sizeof(name)); + SendCommand("/kill"); // 发送/kill命令 + format(string, sizeof(string), "嘿 %s!你太刻薄了,这让我很伤心!", name); + SendChat(string); + } + return 1; +} +``` + +## 相关函数 + +- [SendChat](../functions/SendChat): 以 NPC 身份发送聊天消息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessage.md new file mode 100644 index 00000000000..aadf0d0b925 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessage.md @@ -0,0 +1,58 @@ +--- +title: SendDeathMessage +sidebar_label: SendDeathMessage +description: 在全屏右侧的击杀信息栏添加死亡记录 +tags: [] +--- + +## 描述 + +在全屏右侧的击杀信息栏添加死亡记录。 + +| 参数名 | 说明 | +| ------ | ----------------------------------------------------------------------------------------------- | +| killer | 凶手玩家 ID(可使用 INVALID_PLAYER_ID 表示无凶手) | +| killee | 死亡玩家的 ID | +| weapon | 死亡原因(不一定是武器 ID),可使用特殊图标(ICON_CONNECT 连接图标和 ICON_DISCONNECT 断开图标) | + +## 返回值 + +该函数始终返回**true**,即使执行失败 + +当玩家 ID 无效时,函数不会显示死亡信息 + +当死亡原因无效时,会显示默认骷髅交叉骨图标 + +killerid 为无效值(`INVALID_PLAYER_ID`)是有效参数 + +## 示例代码 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + SendDeathMessage(killerid, playerid, reason); // 在玩家死亡时自动发送死亡信息 + return 1; +} +``` + +## 注意事项 + +:::tip + +- 使用未连接的有效玩家 ID 可以清除死亡信息 +- 需向单个玩家显示死亡信息时请使用[SendDeathMessageToPlayer](SendDeathMessageToPlayer) +- 可通过 NPC 创建自定义死亡原因 + +::: + +## 相关函数 + +- [SendDeathMessageToPlayer](SendDeathMessageToPlayer): 向指定玩家发送死亡信息 + +## 相关回调 + +- [OnPlayerDeath](../callbacks/OnPlayerDeath): 当玩家死亡时触发 + +## 相关资源 + +- [武器 ID 与死亡原因列表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessageToPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessageToPlayer.md new file mode 100644 index 00000000000..bcd6280b151 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendDeathMessageToPlayer.md @@ -0,0 +1,43 @@ +--- +title: SendDeathMessageToPlayer +sidebar_label: SendDeathMessageToPlayer +description: 向指定玩家屏幕右侧的击杀信息栏添加死亡记录 +tags: ["玩家"] +--- + +## 描述 + +向指定玩家屏幕右侧的击杀信息栏添加死亡记录 + +| 参数名 | 说明 | +| -------- | ----------------------------------------------------------------------------------------------- | +| playerid | 接收死亡信息的玩家 ID | +| killer | 凶手玩家 ID(可使用 INVALID_PLAYER_ID 表示无凶手) | +| killee | 死亡玩家的 ID | +| weapon | 死亡原因(不一定是武器 ID),可使用特殊图标(ICON_CONNECT 连接图标和 ICON_DISCONNECT 断开图标) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常由无效玩家 ID 导致) + +## 示例代码 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 向"playerid"发送死亡信息,显示"killerid"因"reason"击杀了"playerid" + SendDeathMessageToPlayer(playerid, killerid, playerid, reason); + + return 1; +} +``` + +## 相关函数 + +- [SendDeathMessage](SendDeathMessage): 向全体玩家广播死亡信息 + +## 相关回调 + +- [OnPlayerDeath](../callbacks/OnPlayerDeath): 当玩家死亡时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToAll.md new file mode 100644 index 00000000000..864804fc9b3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToAll.md @@ -0,0 +1,53 @@ +--- +title: SendPlayerMessageToAll +sidebar_label: SendPlayerMessageToAll +description: 以玩家名义向服务器全体玩家发送仿冒消息 +tags: ["玩家"] +--- + +## 描述 + +在服务器中以指定玩家身份向所有其他玩家发送仿冒消息。消息将以发送者的名称(使用其颜色)开头,后接白色文本内容。 + +| 参数名 | 说明 | +| ---------------- | ------------------------------------------- | +| senderid | 发送者玩家 ID(无效 ID 将导致消息无法发送) | +| const format[] | 需要发送的消息内容 | +| OPEN_MP_TAGS:... | 不定数量的任意标签类型参数 | + +## 返回值 + +该函数没有特定返回值 + +## 示例代码 + +```c +public OnPlayerText(playerid, text[]) +{ + // 在消息前添加玩家ID前缀 + new string[144]; + format(string, sizeof(string), "(%d): %s", playerid, text); + SendPlayerMessageToAll(playerid, string); + + return 0; // 返回0阻止原始消息发送 + + // 假设玩家ID为0且名为Tenpenny,输出格式为"Tenpenny:(0) <消息内容>" +} +``` + +## 注意事项 + +:::warning + +请勿在未格式化字符串的情况下直接使用格式说明符,否则将导致游戏崩溃 + +::: + +## 相关函数 + +- [SendPlayerMessageToPlayer](SendPlayerMessageToPlayer): 向指定玩家发送仿冒消息 +- [SendClientMessageToAll](SendClientMessageToAll): 向全体玩家发送系统消息 + +## 相关回调 + +- [OnPlayerText](../callbacks/OnPlayerText): 当玩家通过聊天框发送消息时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToPlayer.md new file mode 100644 index 00000000000..4c701ab96e4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendPlayerMessageToPlayer.md @@ -0,0 +1,57 @@ +--- +title: SendPlayerMessageToPlayer +sidebar_label: SendPlayerMessageToPlayer +description: 以玩家名义向指定玩家发送私聊消息。 +tags: ["玩家"] +--- + +## 描述 + +该函数允许以某玩家的名义向指定玩家发送私聊消息。消息会显示在接收者的聊天框,格式为「发送者名称(原色): 白色消息内容」。 + +| 参数名 | 说明 | +| ---------------- | ------------------------------------- | +| playerid | 接收消息的玩家 ID | +| senderid | 消息发送者 ID(若无效则消息不会发送) | +| const format[] | 要发送的消息内容 | +| OPEN_MP_TAGS:... | 可变参数列表(支持任意类型参数) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示玩家不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/hello", true)) + { + // 以执行命令玩家的名义向ID为0的玩家发送消息 + SendPlayerMessageToPlayer(0, playerid, "Hello ID 0!"); + // 假设执行者名为Tenpenny,接收者将看到:"Tenpenny: Hello ID 0!" + return 1; + } + return 0; +} +``` + +## 注意要点 + +:::warning + +避免在消息中直接使用未转义的格式说明符(如%),否则会导致服务器崩溃 + +::: + +## 相关函数 + +- [SendPlayerMessageToAll](SendPlayerMessageToAll): 模拟玩家发送全服消息 +- [SendClientMessage](SendClientMessage): 向指定玩家发送系统消息 +- [SendClientMessageToAll](SendClientMessageToAll): 向全服发送系统消息 + +## 相关回调 + +- [OnPlayerText](../callbacks/OnPlayerText): 当玩家发送聊天消息时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendRconCommand.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendRconCommand.md new file mode 100644 index 00000000000..a3b7aa3703f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SendRconCommand.md @@ -0,0 +1,61 @@ +--- +title: SendRconCommand +sidebar_label: SendRconCommand +description: 发送RCON(远程控制台)命令 +tags: ["管理"] +--- + +## 描述 + +发送 RCON(远程控制台)命令 + +| 参数名 | 说明 | +| ---------------- | -------------------------- | +| const format[] | 需要执行的 RCON 命令 | +| OPEN_MP_TAGS:... | 不定数量的任意标签类型参数 | + +## 返回值 + +该函数始终返回 1 + +## 示例代码 + +```c +SendRconCommand("gmx"); +// 等效于在游戏内输入"/rcon gmx" +// GMX命令将重启游戏模式 + +// 使用format()的示例 +new szMapName[] = "Los Santos"; +new szCmd[64]; +format(szCmd, sizeof(szCmd), "mapname %s", szMapName); +SendRconCommand(szCmd); + +// 专业提示:open.mp中无需使用format +SendRconCommand("game.map %s", szMapName); +``` + +## 注意事项 + +:::warning + +- 因缺少 playerid 参数,不支持登录操作 +- 'password 0'命令将清除服务器已设置的密码 +- 该命令会触发[OnRconCommand](../callbacks/OnRconCommand)回调 + +::: + +:::info + +参见[config.json](../../server/config.json)配置文件 + +::: + +## 相关函数 + +- [IsPlayerAdmin](IsPlayerAdmin): 检查玩家是否具有 RCON 权限 + +## 相关回调 + +- [OnRconCommand](../callbacks/OnRconCommand): RCON 命令执行时触发 +- [OnRconLoginAttempt](../callbacks/OnRconLoginAttempt): RCON 登录尝试时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelDrawDistance.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelDrawDistance.md new file mode 100644 index 00000000000..d0ff6808cbf --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelDrawDistance.md @@ -0,0 +1,37 @@ +--- +title: Set3DTextLabelDrawDistance +sidebar_label: Set3DTextLabelDrawDistance +description: 设置3D文本标签的可视距离 +tags: ["3d文本标签"] +--- + + + +## 描述 + +设置 3D 文本标签的可视渲染距离。 + +| 参数名 | 说明 | +| ------------------ | -------------------------------------------------- | +| Text3D:textid | 要设置的可视距离的 3D 文本标签 ID | +| Float:drawDistance | 能够看到该 3D 文本标签的最远距离(单位:游戏单位) | + +## 返回值 + +该函数始终返回 true。 + +## 示例 + +```c +new Text3D:gMyLabel; + +gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 0, false); + +Set3DTextLabelDrawDistance(gMyLabel, 20.0); +// 可视距离从10.0调整为20.0 +``` + +## 相关函数 + +- [Get3DTextLabelDrawDistance](Get3DTextLabelDrawDistance): 获取 3D 文本标签的可视距离 +- [SetPlayer3DTextLabelDrawDistance](SetPlayer3DTextLabelDrawDistance): 设置玩家视角下的 3D 文本标签可视距离 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelLOS.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelLOS.md new file mode 100644 index 00000000000..71fb5ee9490 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelLOS.md @@ -0,0 +1,33 @@ +--- +title: Set3DTextLabelLOS +sidebar_label: Set3DTextLabelLOS +description: 设置3D文本标签视线检测功能 +tags: ["3D文本标签"] +--- + + + +## 描述 + +设置 3D 文本标签的视线检测功能,控制标签是否会被物体遮挡 + +| 参数名 | 说明 | +| ------------- | ---------------------------------------------------------- | +| Text3D:textid | 需要设置视线检测的 3D 文本标签 ID | +| bool:enable | 启用状态(false=禁用/true=启用)控制标签是否可穿透物体显示 | + +## 示例代码 + +```c +new Text3D:gMyLabel; + +gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, true); + +Set3DTextLabelLOS(gMyLabel, false); +// 视线检测功能从启用状态切换为禁用状态 +``` + +## 相关函数 + +- [Get3DTextLabelLOS](Get3DTextLabelLOS): 获取 3D 文本标签当前视线检测状态 +- [SetPlayer3DTextLabelLOS](SetPlayer3DTextLabelLOS): 设置玩家专属 3D 文本标签的视线检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelVirtualWorld.md new file mode 100644 index 00000000000..d556d5b9a15 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Set3DTextLabelVirtualWorld.md @@ -0,0 +1,33 @@ +--- +title: Set3DTextLabelVirtualWorld +sidebar_label: Set3DTextLabelVirtualWorld +description: 设置3D文本标签的虚拟世界ID。 +tags: ["3D文本标签"] +--- + + + +## 描述 + +设置 3D 文本标签的虚拟世界 ID。 + +| 参数名 | 描述 | +| ------------- | ----------------------------------- | +| Text3D:textid | 要设置虚拟世界 ID 的 3D 文本标签 ID | +| virtualWorld | 可以看见该 3D 文本的虚拟世界 ID | + +## 示例代码 + +```c +new Text3D:gMyLabel; + +gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 20, false); + +Set3DTextLabelVirtualWorld(gMyLabel, 60); +// 虚拟世界ID从'20'更改为'60' +``` + +## 相关函数 + +- [Get3DTextLabelVirtualWorld](Get3DTextLabelVirtualWorld): 获取 3D 文本标签的虚拟世界 ID +- [SetPlayer3DTextLabelVirtualWorld](SetPlayer3DTextLabelVirtualWorld): 设置玩家 3D 文本标签的虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorFacingAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorFacingAngle.md new file mode 100644 index 00000000000..6ec16b4c7fe --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorFacingAngle.md @@ -0,0 +1,57 @@ +--- +title: SetActorFacingAngle +sidebar_label: SetActorFacingAngle +description: 设置角色的朝向角度。 +tags: ["角色"] +--- + + + +## 描述 + +设置角色的朝向角度。 + +| 参数名 | 描述 | +| ----------- | ------------------------------------------------ | +| actorid | 要设置朝向角度的角色 ID,由 CreateActor 函数返回 | +| Float:angle | 要设置的朝向角度值(单位:度) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败。指定的角色不存在 + +## 示例代码 + +```c +new MyActor; + +public OnGameModeInit() +{ + MyActor = CreateActor(38, 0.0, 0.0, 3.0, 90.0); + return 1; +} + +// 其他位置 +SetActorFacingAngle(MyActor, 180.0); +``` + +## 注意事项 + +:::tip + +使用[CreateActor](CreateActor)创建角色时,已经指定了其朝向角度。除非需要后续调整方向,否则无需使用此函数 + +::: + +:::warning + +玩家只有在角色被重新流加载时才能看到朝向角度的变化 + +::: + +## 相关函数 + +- [GetActorFacingAngle](GetActorFacingAngle): 获取角色的朝向角度 +- [SetActorPos](SetActorPos): 设置角色的坐标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorHealth.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorHealth.md new file mode 100644 index 00000000000..f996124f5c3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorHealth.md @@ -0,0 +1,42 @@ +--- +title: SetActorHealth +sidebar_label: SetActorHealth +description: 设置角色的生命值。 +tags: ["角色"] +--- + + + +## 描述 + +设置角色的生命值。 + +| 参数名 | 描述 | +| ------------ | ---------------------------- | +| actorid | 要设置生命值的角色 ID | +| Float:health | 要设置的生命值数值(浮点数) | + +## 返回值 + +**true** - 成功 + +**false** - 失败(指定的角色不存在) + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // 在武器店扮演销售员的角色 + + SetActorHealth(gMyActor, 100.0); + return 1; +} +``` + +## 相关函数 + +- [GetActorHealth](GetActorHealth): 获取角色的生命值 +- [SetActorInvulnerable](SetActorInvulnerable): 设置角色无敌状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorInvulnerable.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorInvulnerable.md new file mode 100644 index 00000000000..6787f0b8e99 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorInvulnerable.md @@ -0,0 +1,48 @@ +--- +title: SetActorInvulnerable +sidebar_label: SetActorInvulnerable +description: 切换角色的无敌状态。 +tags: ["角色"] +--- + + + +## 描述 + +切换角色的无敌状态。 + +| 参数名 | 描述 | +| ----------------- | --------------------------------- | +| actorid | 要设置无敌状态的角色 ID | +| bool:invulnerable | 'false'设为可伤害,'true'设为无敌 | + +## 返回值 + +**true** - 成功 + +**false** - 失败(指定的角色不存在) + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // 在武器店扮演销售员的角色 + SetActorInvulnerable(gMyActor, true); + return 1; +} +``` + +## 注意事项 + +:::warning + +设置为无敌状态后,角色不会触发[OnPlayerGiveDamageActor](OnPlayerGiveDamageActor)回调。玩家只有在角色被重新流加载时才能看到无敌状态的变化。 + +::: + +## 相关函数 + +- [IsActorInvulnerable](IsActorInvulnerable): 检查角色是否无敌 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorPos.md new file mode 100644 index 00000000000..0ba80538b62 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorPos.md @@ -0,0 +1,53 @@ +--- +title: SetActorPos +sidebar_label: SetActorPos +description: 设置角色的坐标位置。 +tags: ["角色"] +--- + + + +## 描述 + +设置角色的坐标位置。 + +| 参数名 | 描述 | +| ------- | ------------------------------------------------ | +| actorid | 要设置坐标位置的角色 ID,由 CreateActor 函数返回 | +| Float:x | X 坐标值 | +| Float:y | Y 坐标值 | +| Float:z | Z 坐标值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的角色不存在) + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(24, 2050.7544, -1920.0621, 13.5485, -180.0); + return 1; +} + +// 其他位置 +SetActorPos(gMyActor, 2062.2332, -1908.1423, 13.5485); +``` + +## 注意事项 + +:::tip + +使用[CreateActor](CreateActor)创建角色时,已经指定了其坐标位置。除非需要后续调整位置,否则无需使用此函数 + +::: + +## 相关函数 + +- [GetActorPos](GetActorPos): 获取角色的坐标位置 +- [CreateActor](CreateActor): 创建角色(静态 NPC) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorSkin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorSkin.md new file mode 100644 index 00000000000..0de5ca60c86 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorSkin.md @@ -0,0 +1,41 @@ +--- +title: SetActorSkin +sidebar_label: SetActorSkin +description: 设置角色的皮肤。 +tags: ["角色"] +--- + + + +## 描述 + +设置角色的皮肤。 + +| 参数名 | 描述 | +| ------- | --------------- | +| actorid | 要设置的角色 ID | +| skin | 要设置的皮肤 ID | + +## 返回值 + +**true** - 成功 + +**false** - 失败(指定的角色不存在或无效) + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + gMyActor = CreateActor(179, 1153.9640, -1772.3915, 16.5920, 0.0000); + SetActorSkin(gMyActor, 270); // 将角色皮肤从179更改为270 + return 1; +} +``` + +## 相关函数 + +- [CreateActor](CreateActor): 创建角色(静态 NPC) +- [GetActorSkin](GetActorSkin): 获取角色的皮肤 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorVirtualWorld.md new file mode 100644 index 00000000000..091252f6782 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetActorVirtualWorld.md @@ -0,0 +1,44 @@ +--- +title: SetActorVirtualWorld +sidebar_label: SetActorVirtualWorld +description: 设置角色的虚拟世界。 +tags: ["角色"] +--- + + + +## 描述 + +设置角色的虚拟世界。只有处于相同虚拟世界的玩家才能看到该角色。 + +| 参数名 | 描述 | +| ------------ | -------------------------------------------------- | +| actorid | 要设置虚拟世界的角色 ID(由 CreateActor 函数返回) | +| virtualWorld | 角色所属的虚拟世界 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的角色不存在) + +## 示例代码 + +```c +new gMyActor; + +public OnGameModeInit() +{ + // 创建角色 + gMyActor = CreateActor(69, 0.0, 0.0, 3.0, 0.0); + + // 设置虚拟世界 + SetActorVirtualWorld(gMyActor, 69); + return 1; +} +``` + +## 相关函数 + +- [GetActorVirtualWorld](GetActorVirtualWorld): 获取角色的虚拟世界 +- [CreateActor](CreateActor): 创建角色(静态 NPC) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetCameraBehindPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetCameraBehindPlayer.md new file mode 100644 index 00000000000..e85382b31ac --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetCameraBehindPlayer.md @@ -0,0 +1,31 @@ +--- +title: SetCameraBehindPlayer +sidebar_label: SetCameraBehindPlayer +description: 将玩家的视角重置到其身后(在使用类似SetPlayerCameraPos的函数后使用)。 +tags: ["玩家", "视角"] +--- + +## 描述 + +在使用类似[SetPlayerCameraPos](SetPlayerCameraPos)的函数后,将玩家的视角重置到其身后。 + +| 参数名 | 描述 | +| -------- | --------------------- | +| playerid | 需要重置视角的玩家 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的玩家不存在) + +## 示例代码 + +```c +SetCameraBehindPlayer(playerid); +``` + +## 相关函数 + +- [SetPlayerCameraPos](SetPlayerCameraPos): 设置玩家的视角位置 +- [SetPlayerCameraLookAt](SetPlayerCameraLookAt): 设置玩家视角的观察点 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetDeathDropAmount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetDeathDropAmount.md new file mode 100644 index 00000000000..5b3595749dc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetDeathDropAmount.md @@ -0,0 +1,51 @@ +--- +title: SetDeathDropAmount +sidebar_label: SetDeathDropAmount +description: 设置玩家死亡时掉落的金额。 +tags: [] +--- + +:::warning + +该函数无效,请使用[CreatePickup](CreatePickup) + +::: + +## 描述 + +设置玩家死亡时掉落的金额。 + +| 参数名 | 描述 | +| ------ | ---------------- | +| amount | 要设置的金额数目 | + +## 返回值 + +该函数不返回任何特定值 + +## 示例代码 + +```c +public OnGameModeInit() +{ + SetDeathDropAmount(5000); + return 1; +} +``` + +## 注意事项 + +:::warning + +该函数在当前 SA:MP 版本中无效! + +::: + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [GivePlayerMoney](GivePlayerMoney): 给予玩家金钱 + +## 相关回调 + +- [OnPlayerDeath](../callbacks/OnPlayerDeath): 当玩家死亡时调用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetGameModeText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetGameModeText.md new file mode 100644 index 00000000000..7eb9a80a6ea --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetGameModeText.md @@ -0,0 +1,46 @@ +--- +title: SetGameModeText +sidebar_label: SetGameModeText +description: 设置游戏模式名称,该名称会显示在服务器浏览器中。 +tags: [] +--- + +## 描述 + +设置游戏模式名称,该名称会显示在服务器浏览器中。 + +| 参数名 | 描述 | +| ---------------- | ---------------------------------- | +| format[] | 要显示的游戏模式名称 | +| OPEN_MP_TAGS:... | 可变参数(支持多种标签类型的参数) | + +## 返回值 + +该函数不返回任何特定值 + +## 示例代码 + +```c +public OnGameModeInit() +{ + SetGameModeText("Team Deathmatch"); + return 1; +} +``` + +
+ +```c +#define GAME_MODE_VERSION "1.5.0" + +public OnGameModeInit() +{ + SetGameModeText("Roleplay v%s", GAME_MODE_VERSION); + return 1; +} +``` + +## 相关函数 + +- [SetGameModeText](../functions/SetGameModeText): 设置服务器浏览器显示的游戏模式名称 +- [GetGameModeText](../functions/GetGameModeText): 获取当前游戏模式名称 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetGravity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetGravity.md new file mode 100644 index 00000000000..dd25b636f9e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetGravity.md @@ -0,0 +1,45 @@ +--- +title: SetGravity +sidebar_label: SetGravity +description: 为所有玩家设置重力值。 +tags: [] +--- + +## 描述 + +设置所有玩家的重力参数。 + +| 参数名 | 描述 | +| ------------- | ----------------------------------------- | +| Float:gravity | 要设置的重力值(有效范围:-50.0 至 50.0) | + +## 返回值 + +该函数总是返回 1,即使重力值超出有效范围(低于-50.0 或高于+50.0)也会返回 1。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + // 设置类似月球的重力 + SetGravity(0.001); + + return 1; +} +``` + +## 注意事项 + +:::warning + +默认重力值为 0.008 + +::: + +## 相关函数 + +- [GetGravity](GetGravity): 获取当前重力值 +- [SetPlayerGravity](SetPlayerGravity): 设置单个玩家的重力值 +- [SetWeather](SetWeather): 设置全局天气 +- [SetWorldTime](SetWorldTime): 设置全局服务器时间 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMenuColumnHeader.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMenuColumnHeader.md new file mode 100644 index 00000000000..aeb66936f36 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMenuColumnHeader.md @@ -0,0 +1,59 @@ +--- +title: SetMenuColumnHeader +sidebar_label: SetMenuColumnHeader +description: 设置菜单列的标题。 +tags: ["菜单"] +--- + +## 描述 + +设置指定菜单列的标题文本。 + +| 参数名 | 描述 | +| ---------------- | ---------------------------------- | +| Menu:menuid | 要修改的菜单 ID | +| column | 要设置的列编号(0 或 1) | +| const text[] | 列标题文本 | +| OPEN_MP_TAGS:... | 可变参数(支持多种标签类型的参数) | + +## 返回值 + +该函数不返回任何特定值 + +## 示例代码 + +```c +new Menu:gTestMenu; + +// 这个菜单有两列 +gTestMenu = CreateMenu("菜单主标题", 2, 200.0, 100.0, 150.0, 150.0); +SetMenuColumnHeader(gTestMenu, 0, "第一列"); +SetMenuColumnHeader(gTestMenu, 1, "第二列"); + +// 添加菜单项 +AddMenuItem(gTestMenu, 0, "第一列项1"); +AddMenuItem(gTestMenu, 1, "第二列项1"); +``` + +## 注意事项 + +:::tip + +传入无效菜单 ID 会导致崩溃 + +::: + +:::warning + +注意通过[AddMenuItem](AddMenuItem)最多只能添加 12 个菜单项。第 13 个菜单项会覆盖通过本函数设置的列标题 + +::: + +## 相关函数 + +- [AddMenuItem](AddMenuItem): 为菜单添加项目 +- [CreateMenu](CreateMenu): 创建新菜单 + +## 相关回调 + +- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): 当玩家选择菜单行时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetModeRestartTime.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetModeRestartTime.md new file mode 100644 index 00000000000..a05c3f344f9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetModeRestartTime.md @@ -0,0 +1,57 @@ +--- +title: SetModeRestartTime +sidebar_label: SetModeRestartTime +description: 设置主脚本加载之间的延迟时间(单位:秒)。 +tags: [] +--- + + + +## 描述 + +设置主脚本加载之间的延迟时间(单位:秒)。 + +## 参数 + +| 参数名 | 描述 | +| ------------- | ---------------------- | +| Float:seconds | 重启延迟秒数(浮点数) | + +## 返回值 + +1 - 函数执行成功 + +0 - 函数执行失败(秒数不能小于 1) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/restart", true)) + { + if (!IsPlayerAdmin(playerid)) + { + return 1; + } + + SetModeRestartTime(5.0); + SendClientMessage(playerid, -1, "[SERVER]: 服务器将在5秒后重启。"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +`seconds`参数为浮点数类型 + +::: + +## 相关函数 + +- [GetModeRestartTime](GetModeRestartTime): 获取主脚本加载之间的延迟时间(单位:秒) +- [GameModeExit](GameModeExit): 结束当前游戏模式 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMyFacingAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMyFacingAngle.md new file mode 100644 index 00000000000..8cb39689f76 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMyFacingAngle.md @@ -0,0 +1,32 @@ +--- +title: SetMyFacingAngle +sidebar_label: SetMyFacingAngle +description: 设置NPC的朝向角度。 +tags: [] +--- + +## 描述 + +设置 NPC 的朝向角度。 + +| 参数名 | 描述 | +| --------- | ---------------------------- | +| Float:ang | 要设置的朝向角度值(浮点数) | + +## 示例代码 + +```c +SetMyFacingAngle(0); // NPC面朝北方 +``` + +```c + 北 (0) + | +(90) 西 - - 东 (270) + | + 南 (180) +``` + +## 相关函数 + +- [GetMyFacingAngle](../functions/GetMyFacingAngle): 获取 NPC 的朝向角度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMyPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMyPos.md new file mode 100644 index 00000000000..8a34cb77242 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetMyPos.md @@ -0,0 +1,30 @@ +--- +title: SetMyPos +sidebar_label: SetMyPos +description: 设置NPC的位置 +tags: ["NPC"] +--- + +## 描述 + +设置 NPC 的坐标位置。 + +| 参数名 | 描述 | +| ------- | ------------------- | +| Float:x | NPC 所在的 X 坐标值 | +| Float:y | NPC 所在的 Y 坐标值 | +| Float:z | NPC 所在的 Z 坐标值 | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例代码 + +```c +SetMyPos(0.0, 0.0, 3.0); // 将NPC放置在坐标(0.0, 0.0, 3.0) +``` + +## 相关函数 + +- [GetMyPos](GetMyPos): 获取 NPC 的当前坐标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetNameTagDrawDistance.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetNameTagDrawDistance.md new file mode 100644 index 00000000000..1ab2c8d567f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetNameTagDrawDistance.md @@ -0,0 +1,38 @@ +--- +title: SetNameTagDrawDistance +sidebar_label: SetNameTagDrawDistance +description: 设置显示玩家名牌的最大距离。 +tags: [] +--- + +## 描述 + +设置显示玩家名牌的最大可见距离。 + +| 参数名 | 描述 | +| -------------- | --------------------------------- | +| Float:distance | 要设置的可见距离(单位:SA 单位) | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例代码 + +```c +SetNameTagDrawDistance(20.0); +``` + +## 注意事项 + +:::tip + +默认可见距离为 70.0 SA 单位 + +::: + +## 相关函数 + +- [LimitGlobalChatRadius](LimitGlobalChatRadius): 限制玩家之间的聊天可见距离 +- [ShowNameTags](ShowNameTags): 控制名牌显示开关 +- [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): 为指定玩家设置名牌可见性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterial.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterial.md new file mode 100644 index 00000000000..e6647af633b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterial.md @@ -0,0 +1,71 @@ +--- +title: SetObjectMaterial +sidebar_label: SetObjectMaterial +description: 用游戏中其他模型的纹理替换物体的材质。 +tags: ["物体"] +--- + +## 描述 + +使用游戏中其他模型的纹理替换指定物体的材质。 + +| 参数名 | 描述 | +| ---------------------- | ------------------------------------------------------------------------ | +| objectid | 要修改的物体 ID | +| materialIndex | 要修改的材质索引(0-15) | +| modelid | 包含替换纹理的模型 ID(0 表示透明通道,-1 表示仅修改材质颜色不改变纹理) | +| const textureLibrary[] | 包含替换纹理的 txd 文件名称(不需要时使用"none") | +| const textureName[] | 要使用的替换纹理名称(不需要时使用"none") | +| materialColour | 要设置的材质颜色(ARGB 格式的整型或十六进制值,0 表示保留原色) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/mycommand", true)) + { + new + Float:x, Float:y, Float:z, + myObject; + + GetPlayerPos(playerid, x, y, z); + myObject = CreateObject(19371, x, y, z+0.5, 0.0, 0.0, 0.0, 300.0); + SetObjectMaterial(myObject, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); + // 用物体19341的纹理替换当前物体的材质 + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +若修改材质颜色,物体的顶点光照效果将消失 + +::: + +:::warning + +必须使用 ARGB 颜色格式(不同于客户端消息使用的 RGBA 格式) + +::: + +## 相关函数 + +- [SetPlayerObjectMaterial](SetPlayerObjectMaterial): 设置玩家专属物体的材质 +- [SetObjectMaterialText](SetObjectMaterialText): 设置物体的材质文本 + +## 高级地图编辑器 + +- [Texture Studio](https://github.com/Pottus/Texture-Studio) 作者:Pottus +- [Ultimate Creator](https://github.com/NexiusTailer/Ultimate-Creator) 作者:Nexius +- [Fusez's Map Editor](https://github.com/fusez/Map-Editor-V3) 作者:RedFusion diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterialText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterialText.md new file mode 100644 index 00000000000..b17a0d27f21 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMaterialText.md @@ -0,0 +1,77 @@ +--- +title: SetObjectMaterialText +sidebar_label: SetObjectMaterialText +description: 用文本替换物体的材质纹理。 +tags: ["物体"] +--- + +## 描述 + +用自定义文本替换指定物体的材质纹理。 + +| 参数名 | 描述 | +| ---------------------------------------- | ------------------------------------------------------------------------------- | +| objectid | 要设置材质文本的物体 ID | +| const text[] | 要显示的文本内容(最大 2048 字符) | +| materialIndex | 要替换的材质索引 | +| OBJECT_MATERIAL_SIZE:materialsize | 材质[尺寸](/docs/scripting/resources/materialtextsizes) | +| const fontFace[] | 使用的字体名称 | +| fontSize | 字体大小(最大 255) | +| bool:bold | 是否加粗(true 为加粗,false 为正常) | +| fontColour | 文本颜色(ARGB 格式) | +| backgroundColour | 背景颜色(ARGB 格式) | +| OBJECT_MATERIAL_TEXT_ALIGN:textAlignment | 文本[对齐方式](/docs/scripting/resources/materialtextalignment)(默认:左对齐) | +| OPEN_MP_TAGS:... | 可变参数(支持多种标签类型的参数) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp("/text", cmdtext, true) == 0) + { + new objectId = CreateObject(19353, 0, 0, 10, 0.0, 0.0, 90.0); // 创建物体 + SetObjectMaterialText(objectId, "SA-MP {FFFFFF}0.{008500}3.{FF8200}DL", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, false, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENT); + // 在物体上显示"SA-MP 0.3.DL"文本,橙色字体黑色背景 + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +可使用颜色嵌入代码实现文本多色效果 + +::: + +:::warning + +必须使用 ARGB 颜色格式(不同于客户端消息使用的 RGBA 格式) +同一物体最多只能应用 16 次材质文本修改 +::: + +## 相关函数 + +- [SetPlayerObjectMaterialText](SetPlayerObjectMaterialText): 设置玩家专属物体的材质文本 +- [SetObjectMaterial](SetObjectMaterial): 用其他模型纹理替换物体材质 + +## 进阶地图编辑器 + +- [Texture Studio](https://github.com/Pottus/Texture-Studio) 作者:Pottus +- [Ultimate Creator](https://github.com/NexiusTailer/Ultimate-Creator) 作者:Nexius +- [Fusez's Map Editor](https://github.com/fusez/Map-Editor-V3) 作者:RedFusion +- [SetObjectMaterialText 编辑器](https://sampforum.blast.hk/showthread.php?tid=614667) 作者:RIDE2DAY + +## 相关资源 + +- [材质文本尺寸](../resources/materialtextsizes) +- [材质文本对齐方式](../resources/materialtextalignment) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMoveSpeed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMoveSpeed.md new file mode 100644 index 00000000000..0849c22a2f4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectMoveSpeed.md @@ -0,0 +1,39 @@ +--- +title: SetObjectMoveSpeed +sidebar_label: SetObjectMoveSpeed +description: 设置物体的移动速度。 +tags: ["物体"] +--- + + + +## 描述 + +设置物体的移动速度。 + +| 参数名 | 描述 | +| ----------- | ------------------------- | +| objectid | 要设置移动速度的物体 ID | +| Float:speed | 物体的移动速度(单位/秒) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定的物体不存在) + +## 示例代码 + +```c +new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); +MoveObject(objectid, 1003.3915, -643.3342, 114.5122, 0.8); + +SetObjectMoveSpeed(objectid, 1.5); +// 移动速度从0.8更改为1.5 +``` + +## 相关函数 + +- [MoveObject](MoveObject): 将物体以指定速度移动到新位置 +- [GetObjectMoveSpeed](GetObjectMoveSpeed): 获取物体的移动速度 +- [SetPlayerObjectMoveSpeed](SetPlayerObjectMoveSpeed): 设置玩家专属物体的移动速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCol.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCol.md new file mode 100644 index 00000000000..4a42dbfe538 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCol.md @@ -0,0 +1,56 @@ +--- +title: SetObjectNoCameraCol +sidebar_label: SetObjectNoCameraCol +description: 禁用玩家视角与指定物体的碰撞检测。 +tags: ["视角"] +--- + + + +## 描述 + +禁用玩家视角与指定物体的碰撞检测。 + +| 参数名 | 描述 | +| -------- | --------------------------- | +| objectid | 要禁用视角碰撞检测的物体 ID | + +## 返回值 + +1 - 函数执行成功 + +0 - 函数执行失败(指定的物体不存在) + +## 示例代码 + +```c +public OnObjectMoved(objectid) +{ + new Float:objX, Float:objY, Float:objZ; + GetObjectPos(objectid, objX, objY, objZ); + if (objX >= 3000.0 || objY >= 3000.0 || objX <= -3000.0 || objY <= -3000.0) + { + SetObjectNoCameraCol(objectid); + } + return 1; +} + +public OnGameModeInit() +{ + // 在地图边界外创建大型物体 + CreateObject(6959, 3100.0, 3100.0, 15.0, 0.0, 0.0, 0.0); + return 1; +} +``` + +## 注意事项 + +:::tip + +该功能仅在地图边界外生效(X/Y 轴超过 ±3000 单位时) + +::: + +## 相关函数 + +- [SetPlayerObjectNoCameraCol](SetPlayerObjectNoCameraCol): 禁用视角与玩家专属物体的碰撞检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCollision.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCollision.md new file mode 100644 index 00000000000..fb0ad199339 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectNoCameraCollision.md @@ -0,0 +1,50 @@ +--- +title: SetObjectNoCameraCollision +sidebar_label: SetObjectNoCameraCollision +description: 禁用玩家视角与指定物体的碰撞检测。 +tags: ["物体", "视角"] +--- + + + +## 描述 + +禁用玩家视角与指定物体的碰撞检测。 + +| 参数名 | 描述 | +| -------- | --------------------------- | +| objectid | 要禁用视角碰撞检测的物体 ID | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定的物体不存在) + +## 示例代码 + +```c +public OnObjectMoved(objectid) +{ + new Float:objX, Float:objY, Float:objZ; + GetObjectPos(objectid, objX, objY, objZ); + if (objX >= 3000.0 || objY >= 3000.0 || objX <= -3000.0 || objY <= -3000.0) + { + SetObjectNoCameraCollision(objectid); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +该功能仅在地图边界外生效(X/Y 轴超过 ±3000 单位时) + +::: + +## 相关函数 + +- [HasObjectCameraCollision](HasObjectCameraCollision): 检查物体是否启用了视角碰撞检测 +- [SetPlayerObjectNoCameraCollision](SetPlayerObjectNoCameraCollision): 禁用视角与玩家专属物体的碰撞检测 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectPos.md new file mode 100644 index 00000000000..b9cb1017d62 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectPos.md @@ -0,0 +1,49 @@ +--- +title: SetObjectPos +sidebar_label: SetObjectPos +description: 设置物体的坐标位置 +tags: ["物体"] +--- + +## 描述 + +设置物体的坐标位置 + +| 参数名 | 描述 | +| -------- | ----------------------------------------------- | +| objectid | 要设置位置的物体 ID(由 CreateObject 函数返回) | +| Float:x | 物体新的 X 坐标值 | +| Float:y | 物体新的 Y 坐标值 | +| Float:z | 物体新的 Z 坐标值 | + +## 返回值 + +该函数总是返回 **true**,即使指定的物体不存在也会返回成功 + +## 示例代码 + +```c +SetObjectPos(objectid, 2001.195679, 1547.113892, 14.283400); +``` + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体是否有效 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectRot](SetObjectRot): 设置物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家身上 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家专属物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家专属物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家专属物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家专属物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家专属物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家专属物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家专属物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家专属物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家专属物体附加到其他玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectRot.md new file mode 100644 index 00000000000..012cd3982e4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectRot.md @@ -0,0 +1,55 @@ +--- +title: SetObjectRot +sidebar_label: SetObjectRot +description: 设置物体在三个轴(X/Y/Z)上的旋转角度 +tags: ["物体"] +--- + +## 描述 + +设置物体在三个轴(X/Y/Z)上的旋转角度。 + +| 参数名 | 描述 | +| --------------- | ------------------------ | +| objectid | 要设置旋转的物体 ID | +| Float:rotationX | X 轴旋转角度(单位:度) | +| Float:rotationY | Y 轴旋转角度(单位:度) | +| Float:rotationZ | Z 轴旋转角度(单位:度) | + +## 返回值 + +该函数总是返回 1,即使指定的物体不存在也会返回成功 + +## 示例代码 + +```c +public OnGameModeInit() +{ + new objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + SetObjectRot(objectid, 0.0, 0.0, 180.0); // 将物体Z轴旋转调整为180度 + return 1; +} +``` + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [StopObject](StopObject): 停止物体移动 +- [SetObjectPos](SetObjectPos): 设置物体坐标位置 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家身上 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家专属物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家专属物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家专属物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家专属物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家专属物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家专属物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家专属物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家专属物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家专属物体附加到其他玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCol.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCol.md new file mode 100644 index 00000000000..413e5c0ed73 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCol.md @@ -0,0 +1,70 @@ +--- +title: SetObjectsDefaultCameraCol +sidebar_label: SetObjectsDefaultCameraCol +description: 设置新创建物体的默认视角碰撞状态 +tags: ["物体", "视角"] +--- + + + +## 描述 + +设置新创建物体的默认视角碰撞状态(是否禁用)。 + +| 参数名 | 描述 | +| ------- | ------------------------------------------------------ | +| disable | 1 表示禁用新创建物体的视角碰撞,0 表示启用(默认启用) | + +## 返回值 + +该函数没有传统意义上的返回值,但会影响后续创建的物体 + +:::tip +此设置仅影响调用函数之后新创建的物体,不会修改已存在物体的视角碰撞状态 +::: + +## 示例代码 + +```c +public OnGameModeInit() +{ + // 禁用新物体的视角碰撞 + SetObjectsDefaultCameraCol(1); + + // 创建地图物体 + CreateObject(...); + CreateObject(...); + CreateObject(...); + CreateObject(...); + + // 上述物体将不会产生视角碰撞 + + // 重新启用视角碰撞 + SetObjectsDefaultCameraCol(0); + + // 创建更多地图物体 + CreateObject(...); + CreateObject(...); + CreateObject(...); + CreateObject(...); + + // 上述物体将保持正常视角碰撞 + + // 注意:之前创建的物体仍保持无碰撞状态 + + return 1; +} +``` + +## 注意事项 + +:::warning + +该功能仅在地图边界外生效(X/Y 轴超过 ±3000 单位时) + +::: + +## 相关函数 + +- [SetObjectNoCameraCol](SetObjectNoCameraCol): 禁用指定物体的视角碰撞 +- [SetPlayerObjectNoCameraCol](SetPlayerObjectNoCameraCol): 禁用玩家专属物体的视角碰撞 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCollision.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCollision.md new file mode 100644 index 00000000000..3a5078c8c18 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetObjectsDefaultCameraCollision.md @@ -0,0 +1,70 @@ +--- +title: SetObjectsDefaultCameraCollision +sidebar_label: SetObjectsDefaultCameraCollision +description: 设置新创建物体的默认视角碰撞状态 +tags: ["物体", "视角"] +--- + + + +## 描述 + +设置新创建物体的默认视角碰撞状态(是否禁用)。 + +| 参数名 | 描述 | +| ------------ | ------------------------------------------------------- | +| bool:disable | `true`禁用新创建物体的视角碰撞,`false`启用(默认启用) | + +## 返回值 + +该函数没有传统意义上的返回值,但会影响后续创建的物体 + +:::tip +此设置仅影响调用函数之后新创建的物体,不会修改已存在物体的视角碰撞状态 +::: + +## 示例代码 + +```c +public OnGameModeInit() +{ + // 禁用新物体的视角碰撞 + SetObjectsDefaultCameraCollision(true); + + // 创建地图物体 + CreateObject(...); + CreateObject(...); + CreateObject(...); + CreateObject(...); + + // 上述物体将不会产生视角碰撞 + + // 重新启用视角碰撞 + SetObjectsDefaultCameraCollision(false); + + // 创建更多地图物体 + CreateObject(...); + CreateObject(...); + CreateObject(...); + CreateObject(...); + + // 上述物体将保持正常视角碰撞 + + // 注意:之前创建的物体仍保持无碰撞状态 + + return 1; +} +``` + +## 注意事项 + +:::warning + +该功能仅在地图边界外生效(X/Y 轴超过 ±3000 单位时) + +::: + +## 相关函数 + +- [SetObjectNoCameraCollision](SetObjectNoCameraCollision): 禁用指定物体的视角碰撞 +- [SetPlayerObjectNoCameraCollision](SetPlayerObjectNoCameraCollision): 禁用玩家专属物体的视角碰撞 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarFloat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarFloat.md new file mode 100644 index 00000000000..531b255d8ae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarFloat.md @@ -0,0 +1,54 @@ +--- +title: SetPVarFloat +sidebar_label: SetPVarFloat +description: 设置浮点型玩家变量的值。 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +设置浮点型玩家变量的值。 + +| 名称 | 说明 | +| ------------ | ------------------- | +| playerid | 要设置变量的玩家 ID | +| const pvar[] | 变量名称 | +| Float:value | 要存储的浮点数值 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。玩家未连接或变量名为空/超过 40 字符。 + +## 示例 + +```c +SavePlayerPos(playerid) +{ + new Float:x, Float:y, Float:z; + GetPlayerPos(playerid, x, y, z); // 获取玩家位置 + + SetPVarFloat(playerid, "Xpos", x); // 将浮点数存入玩家变量 + SetPVarFloat(playerid, "Ypos", y); // 将浮点数存入玩家变量 + SetPVarFloat(playerid, "Zpos", z); // 将浮点数存入玩家变量 + return 1; +} +``` + +## 注意 + +:::tip + +变量在[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)回调后才会重置,因此在断开连接时仍可访问。 + +::: + +## 相关函数 + +- [SetPVarInt](SetPVarInt): 设置整型玩家变量 +- [GetPVarInt](GetPVarInt): 获取整型玩家变量值 +- [SetPVarString](SetPVarString): 设置字符串型玩家变量 +- [GetPVarString](GetPVarString): 获取字符串型玩家变量值 +- [GetPVarFloat](GetPVarFloat): 获取浮点型玩家变量值 +- [DeletePVar](DeletePVar): 删除玩家变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarInt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarInt.md new file mode 100644 index 00000000000..b3e6d738161 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarInt.md @@ -0,0 +1,49 @@ +--- +title: SetPVarInt +sidebar_label: SetPVarInt +description: 设置整数型玩家变量。 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +设置一个整数类型的玩家变量。 + +| 参数名 | 说明 | +| ------------ | -------------------------- | +| playerid | 需要设置变量的玩家 ID | +| const pvar[] | 变量名称(需用双引号包裹) | +| value | 要存储的整数值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接或变量名为空/超过 40 字符) + +## 示例代码 + +```c +// 将玩家当前金钱存储到名为"Money"的变量 +SetPVarInt(playerid, "Money", GetPlayerMoney(playerid)); + +// 打印玩家存储的金钱数值 +printf("当前金钱: %d", GetPVarInt(playerid, "Money")); +``` + +## 注意事项 + +:::tip + +玩家变量在[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)回调触发前不会被重置,因此在该回调中仍可访问变量值。 + +::: + +## 相关函数 + +- [GetPVarInt](GetPVarInt): 获取已存储的整数值 +- [SetPVarString](SetPVarString): 设置字符串型玩家变量 +- [GetPVarString](GetPVarString): 获取已存储的字符串值 +- [SetPVarFloat](SetPVarFloat): 设置浮点型玩家变量 +- [GetPVarFloat](GetPVarFloat): 获取已存储的浮点数值 +- [DeletePVar](DeletePVar): 删除玩家变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarString.md new file mode 100644 index 00000000000..8d45494f86f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPVarString.md @@ -0,0 +1,59 @@ +--- +title: SetPVarString +sidebar_label: SetPVarString +description: 将字符串保存到玩家变量中。 +tags: ["玩家变量", "pvar"] +--- + +## 描述 + +将字符串保存到玩家变量中。 + +| 参数名 | 描述 | +| ---------------- | ---------------------- | +| playerid | 要设置变量的玩家 ID | +| const pvar[] | 玩家变量名称 | +| const value[] | 要保存的字符串值 | +| OPEN_MP_TAGS:... | 不定数量的任意标签参数 | + +## 返回值 + +本函数没有返回值。 + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + new + hours, + minutes, + seconds, + string[46]; + + gettime(hours, minutes, seconds); // 获取当前时间 + format(string, sizeof(string), "连接时间 %02d:%02d:%02d", hours, minutes, seconds); // 创建包含连接时间的字符串 + SetPVarString(playerid, "timeconnected", string); // 将字符串存入玩家变量 + + // 专业建议:open.mp中无需使用format + SetPVarString(playerid, "timeconnected", "连接时间 %02d:%02d:%02d", hours, minutes, seconds); + return 1; +} +``` + +## 重要说明 + +:::tip + +玩家变量在[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)回调完成后才会重置,因此断开连接时仍可访问变量值。 + +::: + +## 相关函数 + +- [SetPVarInt](SetPVarInt): 设置整型玩家变量 +- [GetPVarInt](GetPVarInt): 获取整型玩家变量值 +- [GetPVarString](GetPVarString): 获取字符串玩家变量值 +- [SetPVarFloat](SetPVarFloat): 设置浮点型玩家变量 +- [GetPVarFloat](GetPVarFloat): 获取浮点型玩家变量值 +- [DeletePVar](DeletePVar): 删除玩家变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupForPlayer.md new file mode 100644 index 00000000000..8f0d7b7ac2a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupForPlayer.md @@ -0,0 +1,71 @@ +--- +title: SetPickupForPlayer +sidebar_label: SetPickupForPlayer +description: 为指定玩家调整拾取物的模型、类型和位置。 +tags: ["玩家", "拾取物"] +--- + + + +:::warning + +该函数尚未实现 + +::: + +## 描述 + +为指定玩家调整拾取物的模型、类型和位置。 + +| 参数名 | 描述 | +| -------- | ------------------------------------ | +| playerid | 目标玩家 ID | +| pickupid | 要调整的拾取物 ID | +| model | [模型 ID](../resources/pickupids) | +| type | [拾取类型](../resources/pickuptypes) | +| Float:x | 新的 X 坐标 | +| Float:y | 新的 Y 坐标 | +| Float:z | 新的 Z 坐标 | + +## 返回值 + +该函数始终返回 **true** + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + new Float:x, Float:y, Float:z; + GetPlayerPos(playerid, x, y, z); + SetPickupForPlayer(playerid, g_Pickup, 1210, 2, x + 2.0, y + 2.0, z); + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检查拾取物是否已流加载给玩家 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检查拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物虚拟世界 ID +- [ShowPickupForPlayer](ShowPickupForPlayer): 对玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupModel.md new file mode 100644 index 00000000000..3fbf9b4bfd0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupModel.md @@ -0,0 +1,59 @@ +--- +title: SetPickupModel +sidebar_label: SetPickupModel +description: 设置拾取物的模型。 +tags: ["拾取物"] +--- + + + +## 描述 + +设置拾取物的模型。 + +| 参数名 | 说明 | +| ------------------ | -------------------------------------- | +| pickupid | 要设置的拾取物 ID | +| model | 要设置的[模型](../resources/pickupids) | +| bool:update = true | 是否立即全局更新拾取物(true/false) | + +## 返回值 + +本函数永远返回 **true**。 + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + + SetPickupModel(g_Pickup, 1210); + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测玩家是否加载了拾取物 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 ID +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物虚拟世界 ID +- [ShowPickupForPlayer](ShowPickupForPlayer): 对玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家单独配置拾取物属性 + +``` + +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupPos.md new file mode 100644 index 00000000000..5f9a597aa81 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupPos.md @@ -0,0 +1,57 @@ +--- +title: SetPickupPos +sidebar_label: SetPickupPos +description: 设置拾取物的位置 +tags: ["拾取物"] +--- + + + +## 描述 + +设置拾取物的位置 + +| 参数名 | 说明 | +| ------------------ | --------------------------------------------- | +| pickupid | 要设置的拾取物 ID | +| Float:x | 拾取物新的 X 坐标 | +| Float:y | 拾取物新的 Y 坐标 | +| Float:z | 拾取物新的 Z 坐标 | +| bool:update = true | 是否立即为所有玩家更新拾取物位置 (true/false) | + +## 返回值 + +本函数始终返回 **true** + +## 示例 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + + SetPickupPos(g_Pickup, 1958.5488, 1344.9137, 15.3613); + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建一个拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物是否有效 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检查拾取物是否已为指定玩家流加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检查拾取物是否对指定玩家隐藏 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物的虚拟世界 ID +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物的虚拟世界 ID +- [ShowPickupForPlayer](ShowPickupForPlayer): 为指定玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对指定玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为指定玩家调整拾取物模型、类型和位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupType.md new file mode 100644 index 00000000000..5cb749ae0eb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupType.md @@ -0,0 +1,55 @@ +--- +title: SetPickupType +sidebar_label: SetPickupType +description: 设置拾取物的类型。 +tags: ["拾取物"] +--- + + + +## 描述 + +设置拾取物的类型。 + +| 参数 | 说明 | +| ------------------ | ---------------------------------------------- | +| pickupid | 要设置的拾取物 ID | +| type | 要设置的[拾取物类型](../resources/pickuptypes) | +| bool:update = true | 是否立即为所有人更新拾取物。(true/false) | + +## 返回值 + +该函数总是返回 **true**。 + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + + SetPickupType(g_Pickup, 2); + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建一个拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测拾取物是否已为玩家流加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物虚拟世界 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物虚拟世界 ID +- [ShowPickupForPlayer](ShowPickupForPlayer): 为玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家调整拾取物模型/类型/位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupVirtualWorld.md new file mode 100644 index 00000000000..87a1ed2c620 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPickupVirtualWorld.md @@ -0,0 +1,54 @@ +--- +title: SetPickupVirtualWorld +sidebar_label: SetPickupVirtualWorld +description: 设置拾取物的虚拟世界ID。 +tags: ["拾取物"] +--- + + + +## 描述 + +设置拾取物的虚拟世界 ID。 + +| 参数 | 说明 | +| ------------ | ------------------- | +| pickupid | 要设置的拾取物 ID | +| virtualWorld | 要设置的虚拟世界 ID | + +## 返回值 + +该函数总是返回 **true**。 + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, 20); + + SetPickupVirtualWorld(g_Pickup, 10); + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建一个拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测拾取物是否已为玩家流加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物虚拟世界 ID +- [ShowPickupForPlayer](ShowPickupForPlayer): 为玩家显示拾取物 +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家调整拾取物模型/类型/位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md new file mode 100644 index 00000000000..87d3a82db24 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayer3DTextLabelVirtualWorld.md @@ -0,0 +1,44 @@ +--- +title: SetPlayer3DTextLabelVirtualWorld +sidebar_label: SetPlayer3DTextLabelVirtualWorld +description: 设置玩家3D文本标签的虚拟世界ID +tags: ["玩家", "3D文本标签"] +--- + + + +## 描述 + +设置玩家专属 3D 文本标签的虚拟世界 ID + +| 参数名 | 说明 | +| ------------------- | ----------------------------------- | +| playerid | 要设置的目标玩家 ID | +| PlayerText3D:textid | 要设置的玩家专属 3D 文本标签 ID | +| virtualWorld | 设置该 3D 文本标签可见的虚拟世界 ID | + +## 示例 + +```c +new PlayerText3D:playerTextId; +new Float:X, Float:Y, Float:Z; + +GetPlayerPos(playerid, X, Y, Z); +playerTextId = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, X, Y, Z, 40.0); + +SetPlayer3DTextLabelVirtualWorld(playerid, playerTextId, 60); +``` + +## 注意事项 + +:::warning + +玩家专属 3D 文本标签暂不支持虚拟世界功能 +本函数实际无效且存在底层实现缺陷! + +::: + +## 相关函数 + +- [GetPlayer3DTextLabelVirtualWorld](GetPlayer3DTextLabelVirtualWorld): 获取玩家 3D 文本标签的虚拟世界 ID +- [Set3DTextLabelVirtualWorld](Set3DTextLabelVirtualWorld): 设置全局 3D 文本标签的虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAdmin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAdmin.md new file mode 100644 index 00000000000..bd5c955377b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAdmin.md @@ -0,0 +1,48 @@ +--- +title: SetPlayerAdmin +sidebar_label: SetPlayerAdmin +description: 设置玩家为RCON管理员。 +tags: ["玩家", "rcon", "管理"] +--- + + + +## 描述 + +设置玩家为 RCON 管理员。 + +| 参数名 | 说明 | +| ---------- | --------------------------------------------- | +| playerid | 要设置的玩家 ID | +| bool:admin | **true**设置为 RCON 管理员,**false**移除权限 | + +## 返回值 + +本函数没有返回值。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/admin", true)) + { + SetPlayerAdmin(playerid, true); + SendClientMessage(playerid, -1, "SERVER: You are now RCON admin!"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [IsPlayerAdmin](IsPlayerAdmin): 检测玩家是否为 RCON 管理员 + +## 相关回调 + +- [OnRconLoginAttempt](OnRconLoginAttempt): RCON 登录尝试回调 + +``` + +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAmmo.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAmmo.md new file mode 100644 index 00000000000..9e79705a4ed --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAmmo.md @@ -0,0 +1,48 @@ +--- +title: SetPlayerAmmo +sidebar_label: SetPlayerAmmo +description: 设置玩家武器的弹药量。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家武器的弹药量。 + +| 参数 | 说明 | +| --------------- | --------------------------------------------------- | +| playerid | 要设置武器弹药的玩家 ID | +| WEAPON:weaponid | 要设置弹药的武器 ID(非 SAMP 头文件中的武器槽编号) | +| ammo | 要设置的弹药数量 | + +## 返回值 + +**1** - 函数执行成功。即使指定了无效的武器槽编号(非 0-12 范围)也会返回成功 + +**0** - 函数执行失败。玩家未连接服务器 + +## 示例代码 + +```c +SetPlayerAmmo(playerid, WEAPON_SHOTGUN, 100); // 将霰弹枪弹药设为100发 +``` + +## 注意事项 + +:::tip + +参数 'weaponslot' 在 SA-MP 头文件中是拼写错误,必须使用武器 ID 而非武器槽编号 + +::: + +:::tip + +将弹药设为 0 可移除玩家背包中的武器。注意该武器仍会显示在[GetPlayerWeaponData](GetPlayerWeaponData)中,但弹药量为 0 + +::: + +## 相关函数 + +- [GetPlayerAmmo](GetPlayerAmmo): 获取玩家指定武器槽的弹药量 +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家武器 +- [SetPlayerArmedWeapon](SetPlayerArmedWeapon): 设置玩家当前手持武器 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md new file mode 100644 index 00000000000..eca537bc37e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md @@ -0,0 +1,64 @@ +--- +title: SetPlayerArmedWeapon +sidebar_label: SetPlayerArmedWeapon +description: 设置玩家当前手持的武器(必须是玩家已拥有的武器) +tags: ["玩家"] +--- + +## 描述 + +设置玩家当前手持的武器(必须是玩家已拥有的武器) + +| 参数名 | 说明 | +| --------------- | -------------------------------------------- | +| playerid | 要设置武器的玩家 ID | +| WEAPON:weaponid | 玩家应持有的[武器](../resources/weaponids)ID | + +## 返回值 + +**1** - 函数执行成功。即使玩家未拥有指定武器或武器 ID 无效,仍会返回成功 + +**0** - 函数执行失败。玩家未连接 + +## 示例 + +```c +public OnPlayerUpdate(playerid) +{ + SetPlayerArmedWeapon(playerid, WEAPON_FIST); // 禁用武器 + return 1; +} + +// SMG driveby by [03]Garsino +public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) +{ + if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) + { + new + weapon, + ammo; + + GetPlayerWeaponData(playerid, WEAPON_SLOT_MACHINE_GUN, weapon, ammo); // 获取玩家在第4武器槽位(WEAPON_SLOT_MACHINE_GUN)的冲锋枪 + SetPlayerArmedWeapon(playerid, weapon); // 设置玩家使用冲锋枪进行车载射击 + } + return 1; +} +``` + +## 注意事项 + +:::tip + +该函数仅切换玩家已持有的武器,不会给予新武器。具体给予武器功能请参考 GivePlayerWeapon + +::: + +## 相关函数 + +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家武器 +- [GetPlayerWeapon](GetPlayerWeapon): 获取玩家当前手持武器 + +## 相关资源 + +- [武器 ID](../resources/weaponids) +- [武器槽位](../resources/weaponslots) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmour.md new file mode 100644 index 00000000000..b15b9cda3e0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmour.md @@ -0,0 +1,52 @@ +--- +title: SetPlayerArmour +sidebar_label: SetPlayerArmour +description: 设置玩家的护甲等级。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的护甲等级。 + +| 参数名 | 说明 | +| ------------ | -------------------------------------------------------------------------- | +| playerid | 要设置护甲的玩家 ID | +| Float:armour | 设置的护甲值(浮点数百分比)。超过 100 的值有效,但不会在 HUD 护甲条中显示 | + +## 返回值 + +**1** - 函数执行成功 + +**0** - 函数执行失败(指定的玩家不存在) + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + // 玩家重生时给予满护甲(100%) + SetPlayerArmour(playerid, 100.0); + return 1; +} +``` + +## 注意事项 + +:::tip + +本函数使用英式拼写"armour"而非美式"armor",与 SA-MP 其他函数存在拼写差异 + +::: + +:::warning + +护甲值会被四舍五入为整数:设置 50.15 实际获得 50.0 + +::: + +## 相关函数 + +- [GetPlayerArmour](GetPlayerArmour): 获取玩家护甲值 +- [SetPlayerHealth](SetPlayerHealth): 设置玩家生命值 +- [GetPlayerHealth](GetPlayerHealth): 获取玩家生命值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAttachedObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAttachedObject.md new file mode 100644 index 00000000000..5ad5438562d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerAttachedObject.md @@ -0,0 +1,71 @@ +--- +title: SetPlayerAttachedObject +sidebar_label: SetPlayerAttachedObject +description: 将物体附加到玩家指定骨骼上。 +tags: ["玩家", "物体", "附加物"] +--- + +## 描述 + +将物体附加到玩家指定骨骼上。 + +| 参数名 | 说明 | +| --------------- | ------------------------------------------------- | +| playerid | 目标玩家 ID | +| index | 附加槽位索引(0-9) | +| modelid | 要附加的物体模型 ID | +| bone | 目标[骨骼 ID](../resources/boneid) | +| Float:offsetX | (可选) X 轴位置偏移量 | +| Float:offsetY | (可选) Y 轴位置偏移量 | +| Float:offsetZ | (可选) Z 轴位置偏移量 | +| Float:rotationX | (可选) X 轴旋转角度 | +| Float:rotationY | (可选) Y 轴旋转角度 | +| Float:rotationZ | (可选) Z 轴旋转角度 | +| Float:scaleX | (可选) X 轴缩放比例 | +| Float:scaleY | (可选) Y 轴缩放比例 | +| Float:scaleZ | (可选) Z 轴缩放比例 | +| materialColour1 | (可选) 第一材质颜色(整数或 ARGB 十六进制颜色值) | +| materialColour2 | (可选) 第二材质颜色(整数或 ARGB 十六进制颜色值) | + +## 返回值 + +成功返回 **1**,失败返回 **0**。 + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + SetPlayerAttachedObject(playerid, 3, 1609, 2); // 在槽位3附加乌龟到玩家头部 + + // 带颜色参数的附加示例: + SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1.0, 1.0, 1.0, 0xFF00FF00); + // 给玩家附加白色帽子并染成绿色 + return 1; +} +``` + +## 注意事项 + +:::tip + +本函数与 CreateObject/CreatePlayerObject 物体池相互独立 + +::: + +:::warning + +单个玩家最多附加 10 个物体(槽位 0-9) + +::: + +## 相关函数 + +- [RemovePlayerAttachedObject](RemovePlayerAttachedObject): 移除玩家附加物体 +- [IsPlayerAttachedObjectSlotUsed](IsPlayerAttachedObjectSlotUsed): 检测指定槽位是否被占用 +- [GetPlayerAttachedObject](GetPlayerAttachedObject): 获取指定槽位的附加物体数据 +- [EditAttachedObject](EditAttachedObject): 编辑已附加物体 + +## 相关资源 + +- [骨骼 ID 列表](../resources/boneid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraLookAt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraLookAt.md new file mode 100644 index 00000000000..bd0fa24b07b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraLookAt.md @@ -0,0 +1,50 @@ +--- +title: SetPlayerCameraLookAt +sidebar_label: SetPlayerCameraLookAt +description: 设置玩家视角的观察方向。 +tags: ["玩家", "视角"] +--- + +## 描述 + +设置玩家视角的观察方向。通常需与 SetPlayerCameraPos 配合使用。 + +| 参数名 | 说明 | +| ------------ | --------------------------------------------------------------------------------- | +| playerid | 目标玩家 ID | +| Float:x | 视角观察点的 X 坐标 | +| Float:y | 视角观察点的 Y 坐标 | +| Float:z | 视角观察点的 Z 坐标 | +| CAM_MOVE:cut | [视角切换风格](../resources/cameracutstyles)。可使用 CAMERA_MOVE 实现视角渐变效果 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例代码 + +```c +SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0); +SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35); +``` + +## 注意事项 + +:::warning + +在启用观察者模式后立即使用本函数将无法生效 + +::: + +## 相关函数 + +- [SetPlayerCameraPos](SetPlayerCameraPos): 设置玩家视角位置 +- [SetCameraBehindPlayer](SetCameraBehindPlayer): 重置玩家至默认跟随视角 +- [GetPlayerCameraPos](GetPlayerCameraPos): 获取玩家视角坐标 +- [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): 获取视角前向向量 + +## 相关资源 + +- [视角切换风格列表](../resources/cameracutstyles) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraPos.md new file mode 100644 index 00000000000..ab913bcc9d6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCameraPos.md @@ -0,0 +1,49 @@ +--- +title: SetPlayerCameraPos +sidebar_label: SetPlayerCameraPos +description: 设置玩家的视角到指定位置 +tags: ["玩家", "视角"] +--- + +## 描述 + +设置玩家的视角到指定位置 + +| 参数名 | 说明 | +| -------- | ----------------------------- | +| playerid | 要设置的目标玩家 ID | +| Float:x | 视角设定的 X 坐标(浮点型) | +| Float:y | 视角设定的 Y 坐标(浮点型) | +| Float:z | 视角设定的 Z 坐标(浮点型) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例 + +```c +SetPlayerCameraPos(playerid, 652.23, 457.21, 10.84); +``` + +## 注意事项 + +:::tip + +- 需配合使用 SetPlayerCameraLookAt 以确保功能正常 +- 使用 SetCameraBehindPlayer 可重置视角至玩家身后视角 + +::: + +:::warning + +在启用观战模式后立即调用本函数无效 + +::: + +## 相关函数 + +- [SetPlayerCameraLookAt](SetPlayerCameraLookAt): 设置玩家视角的观察焦点 +- [SetCameraBehindPlayer](SetCameraBehindPlayer): 将视角重置至玩家身后视角 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerChatBubble.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerChatBubble.md new file mode 100644 index 00000000000..14da0d8b495 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerChatBubble.md @@ -0,0 +1,52 @@ +--- +title: SetPlayerChatBubble +sidebar_label: SetPlayerChatBubble +description: 在玩家名牌上方创建聊天气泡。 +tags: ["玩家"] +--- + +## 描述 + +在玩家名牌上方创建聊天气泡。 + +| 参数 | 说明 | +| ------------------ | ------------------------------------------ | +| playerid | 要显示聊天气泡的玩家 ID | +| const text[] | 要显示的文本内容 | +| colour | 文本颜色(RGBA 格式) | +| Float:drawDistance | 其他玩家可见该气泡的距离(单位:游戏单位) | +| expireTime | 气泡显示持续时间(单位:毫秒) | +| OPEN_MP_TAGS:... | 可变参数列表(支持任意标签类型) | + +## 返回值 + +该函数没有特定返回值。 + +## 示例代码 + +```c +public OnPlayerText(playerid, text[]) +{ + SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000); + return 1; +} +``` + +## 注意事项 + +:::tip + +玩家无法看到自己的聊天气泡,此规则同样适用于附加的 3D 文本标签 + +::: + +:::tip + +- 支持在文本中使用颜色嵌入代码实现多色文字效果 +- 使用"-1"作为颜色值将显示为白色(因为-1 的十六进制表示为 0xFFFFFFFF) + +::: + +## 相关函数 + +- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): 为玩家附加 3D 文本标签 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCheckpoint.md new file mode 100644 index 00000000000..7f617eb6ba5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerCheckpoint.md @@ -0,0 +1,76 @@ +--- +title: SetPlayerCheckpoint +sidebar_label: SetPlayerCheckpoint +description: 为玩家设置检查点(红色圆柱体)。 +tags: ["玩家", "检查点"] +--- + +## 描述 + +为玩家设置检查点(红色圆柱体),同时在小地图显示红色标记。当玩家进入检查点时,将触发 OnPlayerEnterCheckpoint 回调并执行相关操作。 + +| 参数名 | 说明 | +| ------------- | --------------------- | +| playerid | 要设置检查点的玩家 ID | +| Float:centreX | 检查点中心 X 坐标 | +| Float:centreY | 检查点中心 Y 坐标 | +| Float:centreZ | 检查点中心 Z 坐标 | +| Float:radius | 检查点范围半径 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例代码 + +```c +// 本示例演示玩家重生时设置检查点 +// 进入检查点后获得$1000并禁用检查点 + +new bool:gOnCheck[MAX_PLAYERS]; + +public OnPlayerSpawn(playerid) +{ + SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); + gOnCheck[playerid] = true; + return 1; +} + +public OnPlayerEnterCheckpoint(playerid) +{ + if (gOnCheck[playerid]) // 检查状态标识 + { + GivePlayerMoney(playerid, 1000); + DisablePlayerCheckpoint(playerid); + gOnCheck[playerid] = false; + } + return 1; +} +``` + +## 注意事项 + +:::warning + +检查点是异步的,同一时间只能显示一个。要实现"流式加载"效果(仅在玩家接近时显示),请使用检查点流式加载器 + +::: + +## 相关函数 + +- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): 禁用玩家当前检查点 +- [GetPlayerCheckpoint](GetPlayerCheckpoint): 获取当前检查点坐标 +- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): 检测玩家是否在检查点内 +- [IsPlayerCheckpointActive](IsPlayerCheckpointActive): 检测玩家是否有激活的检查点 +- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): 设置竞速检查点 +- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): 禁用竞速检查点 +- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): 检测玩家是否在竞速检查点内 + +## 相关回调 + +- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): 玩家进入检查点时触发 +- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): 玩家离开检查点时触发 +- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): 玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): 玩家离开竞速检查点时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerColor.md new file mode 100644 index 00000000000..b8cd9a12098 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerColor.md @@ -0,0 +1,48 @@ +--- +title: SetPlayerColor +sidebar_label: SetPlayerColor +description: 设置玩家的名牌和地图标记(雷达点)颜色 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的名牌和地图标记(雷达点)颜色 + +| 参数名 | 说明 | +| -------- | -------------------------------- | +| playerid | 要设置颜色的玩家 ID | +| colour | 要设置的颜色值(支持透明度通道) | + +## 返回值 + +本函数没有特定返回值 + +## 示例 + +```c +// 红色,使用十六进制表示: +SetPlayerColor(playerid, 0xFF0000FF); + +// 红色,使用十进制表示: +SetPlayerColor(playerid, 4278190335); +``` + +## 注意事项 + +:::tip + +- 本函数将全局修改玩家颜色,即使其他玩家通过 SetPlayerMarkerForPlayer 设置了不同颜色 +- 在 OnPlayerConnect 回调中使用时,被设置玩家在 TAB 列表中将看不到颜色变化 + +::: + +## 相关函数 + +- [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): 设置指定玩家可见的标记颜色 +- [GetPlayerColor](GetPlayerColor): 获取玩家当前颜色 +- [ChangeVehicleColor](ChangeVehicleColor): 设置车辆颜色 + +## 相关资源 + +- [颜色代码表](../resources/colorslist) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerDrunkLevel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerDrunkLevel.md new file mode 100644 index 00000000000..3924817f197 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerDrunkLevel.md @@ -0,0 +1,52 @@ +--- +title: SetPlayerDrunkLevel +sidebar_label: SetPlayerDrunkLevel +description: 设置玩家的醉酒等级,这将导致玩家的视角摇晃且难以控制车辆。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的醉酒等级,这将导致玩家的视角摇晃且难以控制车辆。 + +| 参数 | 说明 | +| -------- | ----------------------- | +| playerid | 要设置醉酒等级的玩家 ID | +| level | 要设置的醉酒等级数值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/drunk", true) == 0) + { + SetPlayerDrunkLevel(playerid, 4000); + SendClientMessage(playerid, 0xFFFFFFAA, "You are now drunk; don't drink and drive!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +- 玩家醉酒等级会基于其帧率(FPS)自动递减(50FPS 的玩家每秒减少 50 等级,可用于检测玩家 FPS) +- 0.3a 版本中醉酒等级递减至 2000 停止 +- 0.3b+版本中醉酒等级会递减至 0 +- 等级超过 2000 时玩家呈现醉酒状态(视角摇晃、车辆操控困难) +- 最大醉酒等级为 50000,当等级超过 5000 时玩家 HUD(雷达等界面)将被隐藏 + +::: + +## 相关函数 + +- [GetPlayerDrunkLevel](GetPlayerDrunkLevel): 获取玩家当前醉酒等级 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md new file mode 100644 index 00000000000..62ef9428f0b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md @@ -0,0 +1,52 @@ +--- +title: SetPlayerFacingAngle +sidebar_label: SetPlayerFacingAngle +description: 设置玩家的朝向角度(Z轴旋转) +tags: ["玩家"] +--- + +## 描述 + +设置玩家的朝向角度(Z 轴旋转) + +| 参数名 | 说明 | +| ----------- | ---------------------------- | +| playerid | 要设置朝向角度的玩家 ID | +| Float:angle | 玩家应朝向的角度值(浮点型) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例 + +```c +SetPlayerFacingAngle(playerid, 0.0); // 玩家面向北方 +``` + +``` + 北方 (0) + | +(90) 西 - - 东 (270) (记忆口诀:Never Eat Shredded Wheat) + | + 南方 (180) +``` + +## 注意事项 + +:::warning + +GTA:SA 中的角度方向与现实世界相反: +- 现实中的 90 度对应东方,但在游戏中对应西方 +- 北方和南方仍保持 0/360 度和 180 度 +转换公式:游戏角度 = 360 - 实际角度 + +::: + +## 相关函数 + +- [GetPlayerFacingAngle](GetPlayerFacingAngle): 获取玩家当前朝向角度 +- [GetPlayerRotationQuat](GetPlayerRotationQuat): 获取玩家的四元数旋转参数 +- [SetPlayerPos](SetPlayerPos): 设置玩家坐标 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFightingStyle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFightingStyle.md new file mode 100644 index 00000000000..93c9ba0d499 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFightingStyle.md @@ -0,0 +1,50 @@ +--- +title: SetPlayerFightingStyle +sidebar_label: SetPlayerFightingStyle +description: 设置玩家的特殊战斗风格。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的特殊战斗风格。需在游戏中瞄准后按下"次要攻击键"(默认 ENTER 键)触发。 + +| 参数名 | 说明 | +| ----------------- | ----------------------------------------------- | +| playerid | 要设置的玩家 ID | +| FIGHT_STYLE:style | 要设置的[战斗风格](../resources/fightingstyles) | + +## 返回值 + +本函数没有返回值。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/boxing", true) == 0) + { + SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING); + SendClientMessage(playerid, 0xFFFFFFAA, "你的战斗风格已切换为拳击模式!"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +此设置仅影响特殊攻击(瞄准+次要攻击键),普通拳击攻击不受影响 + +::: + +## 相关函数 + +- [GetPlayerFightingStyle](GetPlayerFightingStyle): 获取玩家的战斗风格 + +## 相关资源 + +- [战斗风格列表](../resources/fightingstyles) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerGravity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerGravity.md new file mode 100644 index 00000000000..a24beccd3d1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerGravity.md @@ -0,0 +1,49 @@ +--- +title: SetPlayerGravity +sidebar_label: SetPlayerGravity +description: 设置玩家的重力。 +tags: ["玩家"] +--- + + + +## 描述 + +设置玩家的重力参数。 + +| 参数 | 说明 | +| ------------- | ------------------------------------- | +| playerid | 要设置重力的玩家 ID | +| Float:gravity | 要设置的重力值(有效范围:-50 至 50) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + // 设置月球般的低重力环境 + SetPlayerGravity(playerid, 0.001); + + return 1; +} +``` + +## 注意事项 + +:::warning + +默认重力值为 0.008 + +::: + +## 相关函数 + +- [GetPlayerGravity](GetPlayerGravity): 获取玩家的重力参数 +- [SetGravity](SetGravity): 设置全局重力参数 +- [GetGravity](GetGravity): 获取当前全局重力参数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHealth.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHealth.md new file mode 100644 index 00000000000..d0a8c55d55a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHealth.md @@ -0,0 +1,63 @@ +--- +title: SetPlayerHealth +sidebar_label: SetPlayerHealth +description: 设置玩家的生命值 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的生命值 + +| 参数名 | 说明 | +| ------------ | ---------------------------------------------------------------- | +| playerid | 要设置生命值的玩家 ID | +| Float:health | 要设置的生命值。游戏界面显示的最大生命值为 100,但可设置更高数值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/heal", cmdtext, true)) + { + // 将玩家生命值恢复至满 + SetPlayerHealth(playerid, 100.0); + return 1; + } + if (!strcmp("/kill", cmdtext, true)) + { + // 使玩家死亡 + SetPlayerHealth(playerid, 0.0); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +- 当生命值设为 0.0 或负数时,玩家会立即死亡 +- 当生命值低于 10.0 或超过 98303.0 时,生命值条会闪烁 + +::: + +:::warning + +实际获取的生命值会被取整:设置 50.15 将得到 50.0 + +::: + +## 相关函数 + +- [GetPlayerHealth](GetPlayerHealth): 获取玩家当前生命值 +- [GetPlayerArmour](GetPlayerArmour): 获取玩家护甲值 +- [SetPlayerArmour](SetPlayerArmour): 设置玩家护甲值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHoldingObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHoldingObject.md new file mode 100644 index 00000000000..34f1770f8de --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerHoldingObject.md @@ -0,0 +1,54 @@ +--- +title: SetPlayerHoldingObject +sidebar_label: SetPlayerHoldingObject +description: 将物体附加到骨骼上。 +tags: ["玩家"] +--- + +## 描述 + +将物体附加到骨骼上。 + +| 参数名 | 说明 | +| -------- | ---------------------------------- | +| playerid | 要附加物体的玩家 ID | +| modelid | 使用的物体模型 ID | +| bone | 目标[骨骼 ID](../resources/boneid) | +| fOffsetX | (可选) X 轴位置偏移量 | +| fOffsetY | (可选) Y 轴位置偏移量 | +| fOffsetZ | (可选) Z 轴位置偏移量 | +| fRotX | (可选) X 轴旋转角度 | +| fRotY | (可选) Y 轴旋转角度 | +| fRotZ | (可选) Z 轴旋转角度 | + +## 返回值 + +成功返回 **1**,失败返回 **0**。 + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + SetPlayerHoldingObject(playerid, 1609, 2); // 将乌龟附加到玩家头部 + return 1; +} +``` + +## 注意事项 + +:::tip + +每个玩家只能附加一个物体。本函数与 CreateObject/CreatePlayerObject 物体池相互独立 + +::: + +:::warning + +该函数已在 SA-MP 0.3c 版本移除,请使用[SetPlayerAttachedObject](SetPlayerAttachedObject) + +::: + +## 相关函数 + +- [StopPlayerHoldingObject](StopPlayerHoldingObject): 移除附加物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerInterior.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerInterior.md new file mode 100644 index 00000000000..f0ad77026c2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerInterior.md @@ -0,0 +1,38 @@ +--- +title: SetPlayerInterior +sidebar_label: SetPlayerInterior +description: 设置玩家的室内场景。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的室内场景。当前已知室内场景及其坐标的完整列表可在此处查看。 + +| 参数 | 说明 | +| ---------- | ------------------------------------------- | +| playerid | 要设置室内场景的玩家 ID | +| interiorid | 要设置的[场景 ID](../resources/interiorids) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +## 示例代码 + +```c +// 将玩家设为默认室内场景(室外) +SetPlayerInterior(playerid, 0); +``` + +## 相关函数 + +- [GetPlayerInterior](GetPlayerInterior): 获取玩家当前室内场景 +- [LinkVehicleToInterior](LinkVehicleToInterior): 设置车辆关联的室内场景 +- [OnPlayerInteriorChange](../callbacks/OnPlayerInteriorChange): 玩家切换室内场景时触发 + +## 相关资源 + +- [场景 ID 列表](../resources/interiorids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMapIcon.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMapIcon.md new file mode 100644 index 00000000000..5441786d24c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMapIcon.md @@ -0,0 +1,64 @@ +--- +title: SetPlayerMapIcon +sidebar_label: SetPlayerMapIcon +description: 在玩家地图上放置图标/标记。 +tags: ["玩家"] +--- + +## 描述 + +在玩家地图上放置图标/标记。可用于标记银行、医院等重要位置。 + +| 参数名 | 说明 | +| ------------- | ---------------------------------------------------------------------------------------------- | +| playerid | 目标玩家 ID | +| iconid | 图标 ID(0-99),单个玩家最多 100 个图标。可通过[RemovePlayerMapIcon](RemovePlayerMapIcon)移除 | +| Float:x | 图标 X 坐标 | +| Float:y | 图标 Y 坐标 | +| Float:z | 图标 Z 坐标 | +| markerType | 要设置的[图标类型](../resources/mapicons) | +| colour | 图标颜色(RGBA 格式整数或十六进制),仅适用于方形图标(ID:0) | +| MAPICON:style | 图标[显示样式](../resources/mapiconstyles) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +## 示例代码 + +```c +public OnPlayerConnect(playerid) +{ + // 在拉斯维加斯的24/7商店顶部创建美元图标 + // 新玩家连接时显示取款位置 + SetPlayerMapIcon(playerid, 12, 2204.9468, 1986.2877, 16.7380, 52, 0, MAPICON_LOCAL); +} +``` + +## 注意事项 + +:::tip + +- 使用无效图标类型将默认显示 ID1 白方块 ![](https://assets.open.mp/assets/images/mapIcons/icon1.gif) +- 重复使用相同图标 ID 会覆盖已有图标 + +::: + +:::warning + +- 突破 100 图标限制需使用[streamer 插件](https://github.com/samp-incognito/samp-streamer-plugin) +- 启用地图图例时,类型 1/2/4/56 图标会导致游戏崩溃 + +::: + +## 相关函数 + +- [RemovePlayerMapIcon](RemovePlayerMapIcon): 移除指定地图图标 +- [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): 设置玩家标记 + +## 相关资源 + +- [地图图标列表](../resources/mapicons): 可用图标类型参考 +- [图标样式列表](../resources/mapiconstyles): 图标显示样式说明 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMarkerForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMarkerForPlayer.md new file mode 100644 index 00000000000..ce23e418bd1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerMarkerForPlayer.md @@ -0,0 +1,44 @@ +--- +title: SetPlayerMarkerForPlayer +sidebar_label: SetPlayerMarkerForPlayer +description: 为特定玩家修改另一玩家的名牌颜色与雷达标记颜色。 +tags: ["玩家"] +--- + +## 描述 + +修改指定玩家视角中另一玩家的名牌颜色与雷达标记颜色。 + +| 参数 | 说明 | +| -------- | ----------------------------- | +| playerid | 将看到颜色变化的观察者玩家 ID | +| targetid | 要修改其标记颜色的目标玩家 ID | +| colour | 新颜色值(支持 RGBA 透明度) | + +## 返回值 + +该函数没有特定返回值。 + +## 示例代码 + +```c +// 使玩家42看到玩家1的标记为红色 +SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF); + +// 设置半透明白色标记(聊天文字保持白色但标记不可见) +SetPlayerMarkerForPlayer(42, 1, 0xFFFFFF00); + +// 保持聊天颜色不变,仅隐藏标记(需配合SetPlayerColor使用) +SetPlayerMarkerForPlayer(42, 1, (GetPlayerColor(1) & 0xFFFFFF00)); + +// 设置不透明标记同时保留聊天颜色(需配合SetPlayerColor使用) +SetPlayerMarkerForPlayer(42, 1, (GetPlayerColor(1) | 0x000000FF)); +``` + +## 相关函数 + +- [ShowPlayerMarkers](ShowPlayerMarkers): 控制服务器是否显示雷达标记 +- [LimitPlayerMarkerRadius](LimitPlayerMarkerRadius): 限制玩家标记显示半径 +- [SetPlayerColor](SetPlayerColor): 设置玩家全局颜色 +- [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): 控制特定玩家名牌的可见性 +- [GetPlayerMarkerForPlayer](GetPlayerMarkerForPlayer): 获取玩家间的标记颜色配置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerName.md new file mode 100644 index 00000000000..7541eba9ed5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerName.md @@ -0,0 +1,72 @@ +--- +title: SetPlayerName +sidebar_label: SetPlayerName +description: 设置玩家的昵称 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的昵称 + +| 参数名 | 说明 | +| ------------ | --------------------------------------------------------------------------------------- | +| playerid | 要设置昵称的玩家 ID | +| const name[] | 新昵称。长度需为 1-24 个字符,且仅包含有效字符(0-9, a-z, A-Z, [], (), \$ @ . \_ 和 =) | + +## 返回值 + +**1** - 昵称修改成功 + +**0** - 玩家未连接或昵称已被占用 + +**-1** - 昵称不合法(长度不足 3 字符、过长或包含无效字符) + +## 示例 + +```c +// 简单示例:无条件将玩家昵称设置为'Superman'(无错误检查) +if (strcmp(cmdtext, "/superman", true) == 0) +{ + SetPlayerName(playerid, "Superman"); + return 1; +} + +// 完整示例:带错误处理的昵称修改 +if (strcmp(cmdtext, "/superman", true) == 0) +{ + switch (SetPlayerName(playerid, "Superman")) + { + case -1: + { + SendClientMessage(playerid, 0xFF0000FF, "昵称包含非法字符或长度不符合要求"); + } + case 0: + { + SendClientMessage(playerid, 0xFF0000FF, "昵称修改失败,'Superman'已被其他玩家使用"); + } + case 1: + { + SendClientMessage(playerid, 0x00FF00FF, "您已成功更名为'Superman'"); + } + } + return 1; +} +``` + +## 注意事项 + +:::warning + +- 仅修改大小写的昵称变更无效(如"John"改为"JOHN") +- 在 [OnPlayerConnect](../callbacks/OnPlayerConnect) 回调中使用时,新昵称对连接中的玩家不可见 +- 传递空字符串作为新昵称会导致服务器崩溃(open.mp 版本已修复) +- 通过本函数最多可设置 24 字符昵称,但玩家通过 SA-MP 服务器浏览器加入时昵称不得超过 20 字符 + +::: + +## 相关函数 + +- [GetPlayerName](GetPlayerName): 获取玩家当前昵称 +- [IsValidNickName](IsValidNickName): 验证昵称合法性 +- [AllowNickNameCharacter](AllowNickNameCharacter): 允许特殊字符用于玩家昵称 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterial.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterial.md new file mode 100644 index 00000000000..1e275f6d575 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterial.md @@ -0,0 +1,69 @@ +--- +title: SetPlayerObjectMaterial +sidebar_label: SetPlayerObjectMaterial +description: 替换玩家专属物体的纹理为游戏内其他模型的纹理 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +将玩家专属物体的纹理替换为游戏内其他模型的纹理 + +| 参数名 | 说明 | +| ---------------------- | ---------------------------------------------------------------------- | +| playerid | 所属玩家 ID | +| objectid | 要替换纹理的物体 ID | +| materialIndex | 要修改的材质索引(0-15) | +| modelid | 目标纹理所在的模型 ID。0 表示透明通道,-1 表示仅修改材质颜色不改变纹理 | +| const textureLibrary[] | 包含替换纹理的 txd 文件名称(若无需求使用"none") | +| const textureName[] | 要使用的替换纹理名称(若无需求使用"none") | +| materialColour | 材质颜色(ARGB 格式整型或十六进制)。0 表示保留原色 | + +## 返回值 + +本函数没有特定返回值 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/objmat", true)) + { + new + Float:x, Float:y, Float:z, + myObject; + + GetPlayerPos(playerid, x, y, z); + myObject = CreatePlayerObject(playerid, 19371, x, y, z+0.5, 0.0, 0.0, 0.0, 300.0); + SetPlayerObjectMaterial(playerid, myObject, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF); + // 将玩家专属物体的纹理替换为模型19341的纹理 + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +修改材质颜色会导致物体顶点光照效果消失 + +::: + +:::warning + +必须使用 ARGB 颜色格式,而非客户端消息中常用的 RGBA 格式 + +::: + +## 相关函数 + +- [SetObjectMaterial](SetObjectMaterial): 替换全局物体的纹理 + +## 高级地图编辑器 + +- [Texture Studio](https://github.com/Pottus/Texture-Studio) 作者:Pottus +- [Ultimate Creator](https://github.com/NexiusTailer/Ultimate-Creator) 作者:Nexius +- [Fusez's Map Editor](https://github.com/fusez/Map-Editor-V3) 作者:RedFusion diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterialText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterialText.md new file mode 100644 index 00000000000..d5ff20de482 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMaterialText.md @@ -0,0 +1,64 @@ +--- +title: SetPlayerObjectMaterialText +sidebar_label: SetPlayerObjectMaterialText +description: 将玩家物体的材质替换为文本。 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +将玩家物体的材质替换为文本。 + +| 参数名 | 说明 | +| ---------------------------------------- | -------------------------------------------------------------- | +| playerid | 目标玩家 ID | +| objectid | 要设置文本的物体 ID | +| text[] | 要显示的文本内容 | +| materialIndex | 材质索引(默认:0) | +| OBJECT_MATERIAL_SIZE:materialSize | 材质[尺寸](../resources/materialtextsizes)(默认:256x128) | +| const fontFace[] | 字体名称(默认:Arial) | +| fontSize | 字体大小(默认:24)(最大值 255) | +| bool:bold | 粗体显示(1 启用/0 禁用,默认:1) | +| fontColour | 字体颜色(默认:白色) | +| backgroundColour | 背景颜色(默认:透明) | +| OBJECT_MATERIAL_TEXT_ALIGN:textAlignment | 文本[对齐方式](../resources/materialtextsizes)(默认:左对齐) | +| OPEN_MP_TAGS:... | 不定数量的任意标签参数 | + +## 返回值 + +本函数没有返回值。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp("/text", cmdtext, true) == 0) + { + new myObject = CreatePlayerObject(playerid, 19353, 0.0, 0.0, 10.0, 0.0, 0.0, 90.0); // 创建物体 + SetPlayerObjectMaterialText(playerid, myObject, "SA-MP {FFFFFF}0.{008500}3.{FF8200}DL", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER); + // 在物体上显示"SA-MP 0.3.DL",橙色字体配黑色背景 + return 1; + } + return 1; +} +``` + +## 注意事项 + +:::tip + +可使用颜色嵌入语法实现多色文本效果 + +::: + +## 相关函数 + +- [SetObjectMaterialText](SetObjectMaterialText): 替换全局物体的材质文本 +- [SetPlayerObjectMaterial](SetPlayerObjectMaterial): 替换玩家物体的游戏内材质 + +## 高级地图编辑器 + +- [Texture Studio](https://github.com/Pottus/Texture-Studio) 作者:Pottus +- [Ultimate Creator](https://github.com/NexiusTailer/Ultimate-Creator) 作者:Nexius +- [Fusez's Map Editor](https://github.com/fusez/Map-Editor-V3) 作者:RedFusion diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMoveSpeed.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMoveSpeed.md new file mode 100644 index 00000000000..74f61f57a5b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectMoveSpeed.md @@ -0,0 +1,40 @@ +--- +title: SetPlayerObjectMoveSpeed +sidebar_label: SetPlayerObjectMoveSpeed +description: 设置玩家物体的移动速度。 +tags: ["玩家", "物体", "玩家物体"] +--- + + + +## 描述 + +设置玩家物体的移动速度。 + +| 参数 | 说明 | +| ----------- | ----------------------------------- | +| playerid | 所属玩家的 ID | +| objectid | 要设置移动速度的玩家物体 ID | +| Float:speed | 物体的移动速度(单位:游戏单位/秒) | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +new playerobjectid = CreatePlayerObject(playerid, 985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); +MovePlayerObject(playerid, playerobjectid, 1003.3915, -643.3342, 114.5122, 0.8); + +SetPlayerObjectMoveSpeed(playerid, playerobjectid, 1.5); +// 移动速度从0.8调整为1.5 +``` + +## 相关函数 + +- [MovePlayerObject](MovePlayerObject): 以指定速度移动玩家物体至新坐标 +- [GetPlayerObjectMoveSpeed](GetPlayerObjectMoveSpeed): 获取玩家物体的当前移动速度 +- [SetObjectMoveSpeed](SetObjectMoveSpeed): 设置全局物体的移动速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCol.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCol.md new file mode 100644 index 00000000000..0af523797e1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCol.md @@ -0,0 +1,50 @@ +--- +title: 设置玩家物体无视角碰撞 +sidebar_label: SetPlayerObjectNoCameraCol +description: 切换玩家物体的视角碰撞状态 +tags: ["玩家"] +--- + + + +## 描述 + +启用或禁用玩家专属物体的视角碰撞检测功能 + +| 参数名 | 说明 | +| -------- | ------------------- | +| playerid | 物体所属的玩家 ID | +| objectid | 要设置的目标物体 ID | + +## 返回值 + +**1** - 函数执行成功 + +**0** - 函数执行失败(物体不存在) + +## 示例 + +```c +public OnPlayerObjectMoved(playerid, objectid) +{ + new Float:objX, Float:objY, Float:objZ; + GetPlayerObjectPos(playerid, objectid, objX, objY, objZ); + if (objX >= 3000.0 && objY >= 3000.0) + { + SetPlayerObjectNoCameraCol(playerid, objectid); // 对移动到3000单位外的物体禁用视角碰撞 + } + return 1; +} +``` + +## 注意事项 + +:::tip + +在正常圣安地列斯地图边界内此功能无效 + +::: + +## 相关函数 + +- [SetObjectNoCameraCol](SetObjectNoCameraCol): 设置全局物体无视角碰撞 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCollision.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCollision.md new file mode 100644 index 00000000000..1c695ca348a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectNoCameraCollision.md @@ -0,0 +1,50 @@ +--- +title: SetPlayerObjectNoCameraCollision +sidebar_label: SetPlayerObjectNoCameraCollision +description: 切换玩家物体的视角碰撞状态。 +tags: ["玩家"] +--- + + + +## 描述 + +切换玩家物体的视角碰撞状态。 + +| 参数 | 说明 | +| -------- | ----------------------- | +| playerid | 所属玩家的 ID | +| objectid | 要切换碰撞状态的物体 ID | + +## 返回值 + +`true` - 函数执行成功 + +`false` - 函数执行失败(指定物体不存在) + +## 示例代码 + +```c +public OnPlayerObjectMoved(playerid, objectid) +{ + new Float:objX, Float:objY, Float:objZ; + GetPlayerObjectPos(playerid, objectid, objX, objY, objZ); + if (objX >= 3000.0 && objY >= 3000.0) + { + SetPlayerObjectNoCameraCollision(playerid, objectid); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +注意:在正常 SA 地图边界内此功能无效 + +::: + +## 相关函数 + +- [SetObjectNoCameraCollision](SetObjectNoCameraCollision): 禁用物体与视角之间的碰撞 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectPos.md new file mode 100644 index 00000000000..1c569cec899 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectPos.md @@ -0,0 +1,61 @@ +--- +title: SetPlayerObjectPos +sidebar_label: SetPlayerObjectPos +description: 设置玩家物体到指定坐标位置。 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +设置玩家物体到指定坐标位置。 + +| 参数名 | 说明 | +| -------- | ----------------------------------------- | +| playerid | 目标玩家 ID | +| objectid | 玩家物体 ID(由 CreatePlayerObject 创建) | +| Float:x | 目标位置 X 坐标 | +| Float:y | 目标位置 Y 坐标 | +| Float:z | 目标位置 Z 坐标 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家或物体不存在) + +## 示例代码 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + return 1; +} + +// 后续操作 +SetPlayerObjectPos(playerid, gPlayerObject[playerid], 2001.195679, 1547.113892, 14.283400); +``` + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家 +- [CreateObject](CreateObject): 创建全局物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [IsValidObject](IsValidObject): 验证全局物体有效性 +- [MoveObject](MoveObject): 移动全局物体 +- [StopObject](StopObject): 停止全局物体移动 +- [SetObjectPos](SetObjectPos): 设置全局物体坐标 +- [SetObjectRot](SetObjectRot): 设置全局物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取全局物体坐标 +- [GetObjectRot](GetObjectRot): 获取全局物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将全局物体附加到玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectRot.md new file mode 100644 index 00000000000..bd35a501691 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerObjectRot.md @@ -0,0 +1,68 @@ +--- +title: SetPlayerObjectRot +sidebar_label: SetPlayerObjectRot +description: 设置物体在X、Y和Z轴上的旋转角度。 +tags: ["玩家", "物体", "玩家物体"] +--- + +## 描述 + +设置物体在 X、Y 和 Z 轴上的旋转角度。 + +| 参数名 | 描述 | +| --------------- | --------------------------- | +| playerid | 需要旋转其玩家物体的玩家 ID | +| objectid | 需要旋转的玩家物体 ID | +| Float:rotationX | 要设置的 X 轴旋转角度 | +| Float:rotationY | 要设置的 Y 轴旋转角度 | +| Float:rotationZ | 要设置的 Z 轴旋转角度 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败 + +## 示例 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + SetPlayerObjectRot(playerid, gPlayerObject[playerid], 0.0, 0.0, 180.0); + return 1; +} +``` + +## 要点提示 + +:::tip + +要实现平滑旋转效果,请参考[MovePlayerObject](MovePlayerObject)。 + +::: + +## 相关函数 + +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家身上 +- [CreateObject](CreateObject): 创建全局物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [IsValidObject](IsValidObject): 验证全局物体有效性 +- [MoveObject](MoveObject): 移动全局物体 +- [StopObject](StopObject): 停止全局物体移动 +- [SetObjectPos](SetObjectPos): 设置全局物体位置 +- [SetObjectRot](SetObjectRot): 设置全局物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取全局物体坐标 +- [GetObjectRot](GetObjectRot): 获取全局物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将全局物体附加到玩家身上 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupModel.md new file mode 100644 index 00000000000..4b248235ecf --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupModel.md @@ -0,0 +1,51 @@ +--- +title: SetPlayerPickupModel +sidebar_label: SetPlayerPickupModel +description: 设置玩家拾取物的模型。 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +设置玩家拾取物的模型。 + +| 名称 | 说明 | +| ------------------ | -------------------------------------- | +| playerid | 玩家的 ID。 | +| pickupid | 玩家拾取物的 ID。 | +| model | 要设置的[模型](../resources/pickupids) | +| bool:update = true | 是否立即为玩家更新拾取物(true/false) | + +## 返回值 + +本函数总是返回 **true**。 + +## 示例 + +```c +new PlayerPickup[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1242, 2, 2010.0979, 1222.0642, 10.8206, -1); + + SetPlayerPickupModel(playerid, PlayerPickup[playerid], 1210); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建仅对单个玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 检查玩家拾取物是否有效 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检查玩家拾取物是否已为玩家流加载 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家拾取物的坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家拾取物的坐标 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家拾取物的模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家拾取物的类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家拾取物的类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家拾取物的虚拟世界 ID +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家拾取物的虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupPos.md new file mode 100644 index 00000000000..0bd483690b7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupPos.md @@ -0,0 +1,55 @@ +--- +title: SetPlayerPickupPos +sidebar_label: SetPlayerPickupPos +description: 设置玩家专属拾取物的位置。 +tags: ["玩家", "拾取物", "玩家专属拾取物"] +--- + + + +## 描述 + +设置玩家专属拾取物的位置。 + +| 参数名 | 说明 | +| ------------------ | ----------------------------------------- | +| playerid | 玩家的 ID | +| pickupid | 玩家专属拾取物的 ID | +| Float:x | 拾取物所在的 X 坐标 | +| Float:y | 拾取物所在的 Y 坐标 | +| Float:z | 拾取物所在的 Z 坐标 | +| bool:update = true | 是否立即为玩家更新拾取物显示 (true/false) | + +## 返回值 + +本函数总是返回 **true**。 + +## 示例代码 + +```c +new PlayerPickup[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属拾取物 + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1242, 2, 2010.0979, 1222.0642, 10.8206, -1); + + // 设置拾取物新坐标 + SetPlayerPickupPos(playerid, PlayerPickup[playerid], 1958.5488, 1344.9137, 15.3613); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建一个仅对特定玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家专属拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家专属拾取物是否有效 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检测玩家专属拾取物是否已流加载 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家专属拾取物的坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家专属拾取物的模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家专属拾取物的模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家专属拾取物的类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家专属拾取物的类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家专属拾取物的虚拟世界 ID +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家专属拾取物的虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupType.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupType.md new file mode 100644 index 00000000000..63ae8736fdd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupType.md @@ -0,0 +1,51 @@ +--- +title: SetPlayerPickupType +sidebar_label: SetPlayerPickupType +description: 设置玩家专属拾取物的类型。 +tags: ["玩家", "拾取物", "玩家拾取物"] +--- + + + +## 描述 + +设置玩家专属拾取物的类型。 + +| 参数名 | 描述 | +| ------------------ | -------------------------------------------- | +| playerid | 玩家 ID | +| pickupid | 玩家拾取物 ID | +| type | 要设置的[拾取类型](../resources/pickuptypes) | +| bool:update = true | 是否立即更新显示给玩家(true/false) | + +## 返回值 + +本函数始终返回 **true**。 + +## 示例 + +```c +new PlayerPickup[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1242, 1, 2010.0979, 1222.0642, 10.8206, -1); + + SetPlayerPickupType(playerid, PlayerPickup[playerid], 2); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建仅对单个玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家专属拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家拾取物有效性 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检测玩家是否已流加载该拾取物 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家拾取物坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家拾取物位置 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家拾取物模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家拾取物模型 ID +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家拾取物类型 +- [SetPlayerPickupVirtualWorld](SetPlayerPickupVirtualWorld): 设置玩家拾取物所属虚拟世界 +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家拾取物的虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupVirtualWorld.md new file mode 100644 index 00000000000..66dfb550bf6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPickupVirtualWorld.md @@ -0,0 +1,52 @@ +--- +title: SetPlayerPickupVirtualWorld +sidebar_label: SetPlayerPickupVirtualWorld +description: 设置玩家专属拾取物的虚拟世界ID。 +tags: ["玩家", "拾取物", "玩家专属拾取物"] +--- + + + +## 描述 + +设置玩家专属拾取物的虚拟世界 ID。 + +| 参数名 | 说明 | +| ------------ | ------------------- | +| playerid | 玩家的 ID | +| pickupid | 玩家专属拾取物的 ID | +| virtualWorld | 要设置的虚拟世界 ID | + +## 返回值 + +本函数总是返回 **true**。 + +## 示例代码 + +```c +new PlayerPickup[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属拾取物 + PlayerPickup[playerid] = CreatePlayerPickup(playerid, 1242, 1, 2010.0979, 1222.0642, 10.8206, 20); + + // 设置拾取物的虚拟世界 + SetPlayerPickupVirtualWorld(playerid, PlayerPickup[playerid], 10); + return 1; +} +``` + +## 相关函数 + +- [CreatePlayerPickup](CreatePlayerPickup): 创建一个仅对特定玩家可见的拾取物 +- [DestroyPlayerPickup](DestroyPlayerPickup): 销毁玩家专属拾取物 +- [IsValidPlayerPickup](IsValidPlayerPickup): 验证玩家专属拾取物是否有效 +- [IsPlayerPickupStreamedIn](IsPlayerPickupStreamedIn): 检测玩家专属拾取物是否已流加载 +- [SetPlayerPickupPos](SetPlayerPickupPos): 设置玩家专属拾取物的坐标 +- [GetPlayerPickupPos](GetPlayerPickupPos): 获取玩家专属拾取物的坐标 +- [SetPlayerPickupModel](SetPlayerPickupModel): 设置玩家专属拾取物的模型 +- [GetPlayerPickupModel](GetPlayerPickupModel): 获取玩家专属拾取物的模型 ID +- [SetPlayerPickupType](SetPlayerPickupType): 设置玩家专属拾取物的类型 +- [GetPlayerPickupType](GetPlayerPickupType): 获取玩家专属拾取物的类型 +- [GetPlayerPickupVirtualWorld](GetPlayerPickupVirtualWorld): 获取玩家专属拾取物的虚拟世界 ID diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPos.md new file mode 100644 index 00000000000..f477c1dfafd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPos.md @@ -0,0 +1,59 @@ +--- +title: SetPlayerPos +sidebar_label: SetPlayerPos +description: 设置玩家的位置。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的位置。 + +| 名称 | 说明 | +| -------- | --------------------- | +| playerid | 要设置位置的玩家 ID。 | +| Float:x | 玩家位置的 X 坐标。 | +| Float:y | 玩家位置的 Y 坐标。 | +| Float:z | 玩家位置的 Z 坐标。 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。指定的玩家不存在。 + +## 示例 + +```c +public OnPlayerCommandText(playerid,cmdtext[]) +{ + if (!strcmp(cmdtext, "/middle", true)) + { + // 当玩家输入/middle时传送至圣安地列斯中心 + SetPlayerPos(playerid, 0.0, 0.0, 3.0); + return 1; + } + return 0; +} +``` + +## 注意 + +:::tip + +对车辆中的玩家使用此函数会立即将其移出车辆。可用于快速弹出玩家。 + +::: + +:::tip + +设置玩家位置至室内时,必须同时设置其室内环境。 + +::: + +## 相关函数 + +- [SetPlayerPosFindZ](SetPlayerPosFindZ): 设置玩家位置并寻找地面高度 +- [GetPlayerPos](GetPlayerPos): 获取玩家位置 +- [SetVehiclePos](SetVehiclePos): 设置车辆位置 +- [GetVehiclePos](GetVehiclePos): 获取车辆位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPosFindZ.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPosFindZ.md new file mode 100644 index 00000000000..5fb9863865d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerPosFindZ.md @@ -0,0 +1,45 @@ +--- +title: SetPlayerPosFindZ +sidebar_label: SetPlayerPosFindZ +description: 设置玩家坐标并自动寻找地面高度。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家坐标后,自动将玩家的 Z 轴坐标调整至该位置下方最近的实体地面高度。 + +| 参数名 | 说明 | +| -------- | ----------------------------------------- | +| playerid | 需要设置坐标的玩家 ID | +| Float:x | 玩家所处的 X 坐标 | +| Float:y | 玩家所处的 Y 坐标 | +| Float:z | 玩家所处的初始 Z 坐标(将自动校准到地面) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示指定玩家不存在) + +## 示例代码 + +```c +SetPlayerPosFindZ(playerid, 1234.5, 1234.5, 1000.0); +``` + +## 注意事项 + +:::warning + +当新坐标距离玩家当前位置过远时,此函数可能失效。此时 Z 轴高度会被设为 0,可能导致玩家陷入地下。建议改用 [MapAndreas](https://github.com/philip1337/samp-plugin-mapandreas) 或 [ColAndreas](https://github.com/Pottus/ColAndreas) 插件进行地面高度检测。 + +::: + +## 相关函数 + +- [SetPlayerPos](SetPlayerPos): 直接设置玩家三维坐标 + +## 相关回调函数 + +- [OnPlayerClickMap](../callbacks/OnPlayerClickMap): 当玩家在暂停菜单地图上设置路径点时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerRaceCheckpoint.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerRaceCheckpoint.md new file mode 100644 index 00000000000..9142003cfc5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerRaceCheckpoint.md @@ -0,0 +1,88 @@ +--- +title: SetPlayerRaceCheckpoint +sidebar_label: SetPlayerRaceCheckpoint +description: 创建竞速检查点。 +tags: ["玩家", "检查点", "竞速检查点"] +--- + +## 描述 + +创建竞速检查点。当玩家进入时,将触发 OnPlayerEnterRaceCheckpoint 回调。 + +| 名称 | 说明 | +| ------------- | ---------------------------------------------------- | +| playerid | 要设置检查点的玩家 ID | +| CP_TYPE:type | [竞速检查点类型](../resources/race-checkpoint-types) | +| Float:centreX | X 坐标 | +| Float:centreY | Y 坐标 | +| Float:centreZ | Z 坐标 | +| Float:nextX | 箭头指向的下个点 X 坐标 | +| Float:nextY | 箭头指向的下个点 Y 坐标 | +| Float:nextZ | 箭头指向的下个点 Z 坐标 | +| Float:radius | 检查点的大小(直径) | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。指定的玩家不存在。 + +## 示例 + +```c +SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_NORMAL, 644.3091, 1767.0223, 4.9970, 650.6734, 1812.0367, 4.9970, 3.0); +``` + +另一个示例: + +```c +// 来自Yagu的竞速滤镜脚本,版权所有:Yagu +public SetRaceCheckpoint(playerid, Airrace, target, next) +{ + if (next == -1 && Airrace == 0) + { + SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_FINISH, RaceCheckpoints[target][0], RaceCheckpoints[target][1], RaceCheckpoints[target][2], 0.0, 0.0, 0.0, CPsize); + } + else if (next == -1 && Airrace == 1) + { + SetPlayerRaceCheckpoint(playerid, CP_TYPE_AIR_FINISH, RaceCheckpoints[target][0], RaceCheckpoints[target][1], RaceCheckpoints[target][2], 0.0, 0.0, 0.0, CPsize); + } + else if (Airrace == 1) + { + SetPlayerRaceCheckpoint(playerid, CP_TYPE_AIR_NORMAL, RaceCheckpoints[target][0], RaceCheckpoints[target][1], RaceCheckpoints[target][2], RaceCheckpoints[next][0], RaceCheckpoints[next][1], RaceCheckpoints[next][2], CPsize); + } + else + { + SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_NORMAL, RaceCheckpoints[target][0], RaceCheckpoints[target][1], RaceCheckpoints[target][2], RaceCheckpoints[next][0], RaceCheckpoints[next][1], RaceCheckpoints[next][2], CPsize); + } +} +``` + +## 注意 + +:::warning + +竞速检查点是异步的,同一时间只能显示一个。要实现"流加载"效果(仅在玩家接近时显示),请使用竞速检查点流加载器。 + +::: + +## 相关函数 + +- [SetPlayerCheckpoint](SetPlayerCheckpoint): 为玩家创建普通检查点 +- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): 禁用玩家的当前检查点 +- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): 检测玩家是否处于检查点内 +- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): 禁用玩家的当前竞速检查点 +- [GetPlayerRaceCheckpoint](GetPlayerRaceCheckpoint): 获取当前竞速检查点位置 +- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): 检测玩家是否处于竞速检查点内 +- [IsPlayerRaceCheckpointActive](IsPlayerRaceCheckpointActive): 检测玩家当前是否有可见的竞速检查点 + +## 相关回调 + +- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): 玩家进入检查点时触发 +- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): 玩家离开检查点时触发 +- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): 玩家进入竞速检查点时触发 +- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): 玩家离开竞速检查点时触发 + +## 相关资源 + +- [竞速检查点类型](../resources/race-checkpoint-types) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerScore.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerScore.md new file mode 100644 index 00000000000..824f452a6e2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerScore.md @@ -0,0 +1,39 @@ +--- +title: SetPlayerScore +sidebar_label: SetPlayerScore +description: 设置玩家的分数。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的分数。玩家的分数会显示在积分板中(通过按住 TAB 键查看)。 + +| 参数名 | 描述 | +| -------- | ------------------- | +| playerid | 要设置分数的玩家 ID | +| score | 要设置的分数值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的玩家不存在) + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + // 给击杀者的分数加1。需先验证有效性 + if (killerid != INVALID_PLAYER_ID) + { + SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); + } + return 1; +} +``` + +## 相关函数 + +- [GetPlayerScore](GetPlayerScore): 获取玩家的分数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerShopName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerShopName.md new file mode 100644 index 00000000000..191988c21d4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerShopName.md @@ -0,0 +1,53 @@ +--- +title: SetPlayerShopName +sidebar_label: SetPlayerShopName +description: 加载或卸载玩家的室内脚本(例如武器店菜单)。 +tags: ["玩家"] +--- + +## 描述 + +加载或卸载玩家的室内脚本(例如武器店菜单)。 + +| 名称 | 说明 | +| ---------------- | ------------------------------------------------------------------ | +| playerid | 要加载室内脚本的玩家 ID | +| const shopname[] | 要加载的[商店脚本](../resources/shopnames)。留空("")可卸载当前脚本 | + +## 返回值 + +本函数不返回任何特定值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/enter", cmdtext)) + { + SetPlayerInterior(playerid, 5); + SetPlayerPos(playerid, 372.5565, -131.3607, 1001.4922); + SetPlayerShopName(playerid, "FDPIZA"); + SendClientMessage(playerid, 0xFFFFFFFF, "欢迎来到披萨栈!"); + return 1; + } + return 0; +} +``` + +## 注意 + +:::tip + +本函数不支持赌场脚本。 + +::: + +## 相关函数 + +- [DisableInteriorEnterExits](DisableInteriorEnterExits): 禁用黄色门框标记 +- [SetPlayerInterior](SetPlayerInterior): 设置玩家室内环境 + +## 相关资源 + +- [商店脚本列表](../resources/shopnames) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkillLevel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkillLevel.md new file mode 100644 index 00000000000..f0b6482eca4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkillLevel.md @@ -0,0 +1,49 @@ +--- +title: SetPlayerSkillLevel +sidebar_label: SetPlayerSkillLevel +description: 设置玩家特定武器类型的技能等级。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家特定武器类型的技能等级。 + +| 参数名 | 描述 | +| ----------------- | ------------------------------------------------- | +| playerid | 要设置武器技能的玩家 ID | +| WEAPONSKILL:skill | 要设置的[武器技能类型](../resources/weaponskills) | +| level | 技能等级值(0-999),超出范围的数值会自动取极值 | + +## 返回值 + +本函数没有返回值。 + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + // 使玩家使用单手持短管霰弹枪 + SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1); + return 1; +} +``` + +## 重要说明 + +:::warning + +skill 参数不是武器 ID,而是技能类型。[点击此处](../resources/weaponskills)查看技能类型列表。 + +::: + +## 相关函数 + +- [GetPlayerSkillLevel](GetPlayerSkillLevel): 获取玩家武器技能等级 +- [SetPlayerArmedWeapon](SetPlayerArmedWeapon): 设置玩家手持武器 +- [GivePlayerWeapon](GivePlayerWeapon): 给予玩家武器 + +## 相关信息 + +- [武器技能系统](../resources/weaponskills#skill-levels): 用于设置玩家技能等级的武器技能列表 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md new file mode 100644 index 00000000000..25e4eca3ec3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md @@ -0,0 +1,108 @@ +--- +title: SetPlayerSkin +sidebar_label: SetPlayerSkin +description: 设置玩家的皮肤(角色模型)。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的皮肤。玩家的皮肤即其角色模型。 + +| 参数名 | 说明 | +| -------- | ------------------------------------- | +| playerid | 需要设置皮肤的玩家 ID | +| skinid | 要使用的[皮肤 ID](../resources/skins) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示指定玩家不存在) + +注意:即使使用无效皮肤 ID(非 0-311 或 74 号皮肤),也会返回"成功",此时皮肤会被强制设为 0 号(CJ 默认模型)。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/fireman", true) == 0) + { + // 将玩家皮肤设置为ID 277(消防员模型) + SetPlayerSkin(playerid, 277); + return 1; + } + return 0; +} + +SetPlayerSkinFix(playerid, skinid) +{ + if (!IsPlayerConnected(playerid)) + { + return 0; + } + + // 过滤无效皮肤ID(0-311范围外或74号无效皮肤) + if (0 > skinid > 311 || skinid == 74) + { + return 0; + } + + new + Float:tmpPos[4], + vehicleid = GetPlayerVehicleID(playerid), + seatid = GetPlayerVehicleSeat(playerid); + + GetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]); + GetPlayerFacingAngle(playerid, tmpPos[3]); + + if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK) + { + SetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]); + SetPlayerFacingAngle(playerid, tmpPos[3]); + TogglePlayerControllable(playerid, true); // 防止角色冻结(可选) + return SetPlayerSkin(playerid, skinid); + } + else if (IsPlayerInAnyVehicle(playerid)) + { + new + tmp; + + RemovePlayerFromVehicle(playerid); + SetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]); + SetPlayerFacingAngle(playerid, tmpPos[3]); + TogglePlayerControllable(playerid, true); // 必须解除控制,防止上下车动画导致冻结 + tmp = SetPlayerSkin(playerid, skinid); + PutPlayerInVehicle(playerid, vehicleid, (seatid == 128) ? 0 : seatid); + return tmp; + } + else + { + return SetPlayerSkin(playerid, skinid); + } +} +``` + +## 注意事项 + +:::warning + +已知问题: + +- 当玩家处于下蹲、车辆内或特定动画状态时切换皮肤会导致角色冻结/异常,可通过[TogglePlayerControllable](TogglePlayerControllable)解除 +- 使用[GetPlayerSpecialAction](GetPlayerSpecialAction)检测 SPECIAL_ACTION_DUCK 状态可判断玩家是否下蹲 +- 玩家在车辆内切换皮肤可能导致周围玩家客户端崩溃 +- 玩家死亡时切换皮肤可能引发周围玩家崩溃 +- 会中断自行车乘坐状态 + +::: + +## 相关函数 + +- [GetPlayerSkin](GetPlayerSkin): 获取玩家当前皮肤 +- [SetSpawnInfo](SetSpawnInfo): 设置玩家重生信息 + +## 相关资源 + +- [皮肤 ID 列表](../resources/skins) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSpecialAction.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSpecialAction.md new file mode 100644 index 00000000000..326eecd49f0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSpecialAction.md @@ -0,0 +1,57 @@ +--- +title: SetPlayerSpecialAction +sidebar_label: SetPlayerSpecialAction +description: 设置玩家执行特殊动作。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家执行特殊动作。 + +| 参数名 | 描述 | +| ----------------------- | --------------------------------------------------- | +| playerid | 要执行特殊动作的玩家 ID | +| SPECIAL_ACTION:actionid | 要执行的[特殊动作类型](../resources/specialactions) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/handsup", true) == 0) + { + SetPlayerSpecialAction(playerid, SPECIAL_ACTION_HANDSUP); + return 1; + } + if (strcmp(cmdtext, "/drink", true) == 0) + { + SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE); + return 1; + } + return 0; +} +``` + +## 重要说明 + +:::tip + +通过设置特殊动作类型为`SPECIAL_ACTION_NONE`(无动作)来移除喷气背包时,喷射音效会持续到玩家死亡。解决方法是对玩家应用随机动画即可正确移除喷气背包。 + +::: + +## 相关函数 + +- [GetPlayerSpecialAction](GetPlayerSpecialAction): 获取玩家当前特殊动作 +- [ApplyAnimation](ApplyAnimation): 应用动画到玩家 + +## 相关资源 + +- [特殊动作 ID 列表](../resources/specialactions) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTeam.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTeam.md new file mode 100644 index 00000000000..0f0d7b87caa --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTeam.md @@ -0,0 +1,46 @@ +--- +title: SetPlayerTeam +sidebar_label: SetPlayerTeam +description: 设置玩家所属的队伍。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家所属的队伍。 + +| 参数名 | 说明 | +| -------- | ------------------------------------------------- | +| playerid | 需要设置队伍的玩家 ID | +| teamid | 目标队伍编号。使用 NO_TEAM 可移除玩家当前队伍归属 | + +## 返回值 + +本函数没有特定返回值。 + +## 示例代码 + +```c +public OnPlayerSpawn(playerid) +{ + // 玩家生成时将其队伍设为4 + SetPlayerTeam(playerid, 4); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 同队伍玩家之间无法造成伤害(使用割喉刀除外) +- 同队伍玩家驾驶的车辆默认免疫友方伤害,可通过[EnableVehicleFriendlyFire](EnableVehicleFriendlyFire)启用 +- 默认无队伍状态使用 255(或 NO_TEAM),而非 0 号队伍 + +::: + +## 相关函数 + +- [GetPlayerTeam](GetPlayerTeam): 获取玩家当前所属队伍 +- [SetTeamCount](SetTeamCount): 设置服务器队伍总数 +- [EnableVehicleFriendlyFire](EnableVehicleFriendlyFire): 启用车辆友军伤害功能 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTime.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTime.md new file mode 100644 index 00000000000..fd9b1caea5c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerTime.md @@ -0,0 +1,55 @@ +--- +title: SetPlayerTime +sidebar_label: SetPlayerTime +description: 设置玩家的游戏时间。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的游戏时间。若玩家时钟已启用([TogglePlayerClock](TogglePlayerClock)),其显示的时间将自动更新。 + +| 名称 | 说明 | +| -------- | ----------------------- | +| playerid | 要设置游戏时间的玩家 ID | +| hour | 小时值 (0-23) | +| minute | 分钟值 (0-59) | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。指定的玩家不存在。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/noon", true)) + { + SetPlayerTime(playerid, 12, 0); // 正午 + return 1; + } + if (!strcmp(cmdtext, "/midnight", true)) + { + SetPlayerTime(playerid, 0, 0); // 午夜 + return 1; + } + return 0; +} +``` + +## 注意 + +:::warning + +在[OnPlayerConnect](../callbacks/OnPlayerConnect)回调中使用此函数无效。 + +::: + +## 相关函数 + +- [SetWorldTime](SetWorldTime): 设置全局服务器时间 +- [GetPlayerTime](GetPlayerTime): 获取玩家时间 +- [TogglePlayerClock](TogglePlayerClock): 切换玩家时钟显示 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVelocity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVelocity.md new file mode 100644 index 00000000000..5532f43aeb0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVelocity.md @@ -0,0 +1,43 @@ +--- +title: SetPlayerVelocity +sidebar_label: SetPlayerVelocity +description: 在X、Y、Z轴上设置玩家的速度。 +tags: ["玩家"] +--- + +## 描述 + +在 X、Y、Z 轴上设置玩家的速度。 + +| 名称 | 说明 | +| -------- | ------------------- | +| playerid | 要设置速度的玩家 ID | +| Float:x | X 轴方向的速度 | +| Float:y | Y 轴方向的速度 | +| Float:z | Z 轴方向的速度 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。玩家未连接。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/jump", cmdtext)) + { + SetPlayerVelocity(playerid, 0.0, 0.0, 0.2); // 强制玩家跳跃(Z轴速度+0.2) + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerVelocity](GetPlayerVelocity): 获取玩家速度 +- [SetVehicleVelocity](SetVehicleVelocity): 设置车辆速度 +- [GetVehicleVelocity](GetVehicleVelocity): 获取车辆速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVirtualWorld.md new file mode 100644 index 00000000000..d49bc70c36d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerVirtualWorld.md @@ -0,0 +1,49 @@ +--- +title: SetPlayerVirtualWorld +sidebar_label: SetPlayerVirtualWorld +description: 设置玩家所在的虚拟世界。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家所在的虚拟世界。玩家只能看到同属该虚拟世界的其他玩家和车辆。 + +| 参数名 | 说明 | +| ------------ | ------------------------- | +| playerid | 需要设置虚拟世界的玩家 ID | +| virtualWorld | 目标虚拟世界 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示玩家未连接) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/world3", true) == 0) + { + // 将玩家切换到3号虚拟世界 + SetPlayerVirtualWorld(playerid, 3); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +默认虚拟世界 ID 为 0。 + +::: + +## 相关函数 + +- [GetPlayerVirtualWorld](GetPlayerVirtualWorld): 获取玩家当前所在的虚拟世界 +- [SetVehicleVirtualWorld](SetVehicleVirtualWorld): 设置车辆所在的虚拟世界 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWantedLevel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWantedLevel.md new file mode 100644 index 00000000000..ea365524ba0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWantedLevel.md @@ -0,0 +1,41 @@ +--- +title: SetPlayerWantedLevel +sidebar_label: SetPlayerWantedLevel +description: 设置玩家的通缉等级(HUD下方显示6颗棕色通缉星)。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的通缉等级(HUD 下方显示 6 颗棕色通缉星)。 + +| 参数名 | 描述 | +| -------- | ----------------------- | +| playerid | 要设置通缉等级的玩家 ID | +| level | 要设置的通缉等级(0-6) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的玩家不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/turnuptheheat", true) == 0) + { + SetPlayerWantedLevel(playerid, 6); + SendClientMessage(playerid, 0xFF0000FF, "通缉等级:6"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerWantedLevel](GetPlayerWantedLevel): 获取玩家的通缉等级 +- [PlayCrimeReportForPlayer](PlayCrimeReportForPlayer): 为玩家播放犯罪通告 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWeather.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWeather.md new file mode 100644 index 00000000000..8c9ac98554e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWeather.md @@ -0,0 +1,52 @@ +--- +title: SetPlayerWeather +sidebar_label: SetPlayerWeather +description: 设置玩家的天气。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的天气。 + +| 名称 | 说明 | +| -------- | -------------------------------------- | +| playerid | 要设置天气的玩家 ID | +| weather | 要设置的[天气](../resources/weatherid) | + +## 返回值 + +本函数不返回任何特定值。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/storm", true)) + { + SetPlayerWeather(playerid, 8); + return 1; + } + return 0; +} +``` + +## 注意 + +:::tip + +- 若已启用[TogglePlayerClock](TogglePlayerClock),天气会逐渐变化而非立即切换 +- 游戏实际仅有 21 个有效天气 ID(0-20),但系统不会进行范围校验 + +::: + +## 相关函数 + +- [GetPlayerWeather](GetPlayerWeather): 获取玩家的天气 +- [SetWeather](SetWeather): 设置全局天气 +- [SetGravity](SetGravity): 设置全局重力 + +## 相关资源 + +- [天气 ID 列表](../resources/weatherid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWorldBounds.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWorldBounds.md new file mode 100644 index 00000000000..be2bf3b0432 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerWorldBounds.md @@ -0,0 +1,64 @@ +--- +title: SetPlayerWorldBounds +sidebar_label: SetPlayerWorldBounds +description: 设置玩家的世界边界。 +tags: ["玩家"] +--- + +## 描述 + +设置玩家的世界边界。玩家无法越出边界(越界时将被推回)。 + +| 名称 | 说明 | +| ---------- | ----------------------- | +| playerid | 要设置边界的玩家 ID | +| Float:maxX | 玩家可到达的最大 X 坐标 | +| Float:minX | 玩家可到达的最小 X 坐标 | +| Float:maxY | 玩家可到达的最大 Y 坐标 | +| Float:minY | 玩家可到达的最小 Y 坐标 | + +## 返回值 + +本函数不返回任何特定值。 + +## 示例 + +```c +public OnPlayerSpawn(playerid) +{ + SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0); + return 1; +} +``` + +``` + (北) + ymax + |----------| + | | +(西) xmin | | xmax (东) + | | + |----------| + ymin + (南) +``` + +## 注意 + +:::tip + +可通过设置边界为 20000.0000, -20000.0000, 20000.0000, -20000.0000 来重置默认值,或使用 [ClearPlayerWorldBounds](ClearPlayerWorldBounds)。 + +::: + +:::warning + +本函数在室内环境中无效! + +::: + +## 相关函数 + +- [ClearPlayerWorldBounds](ClearPlayerWorldBounds): 重置玩家的世界边界至默认值 +- [GetPlayerWorldBounds](GetPlayerWorldBounds): 获取玩家的世界边界 +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarFloat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarFloat.md new file mode 100644 index 00000000000..d131dd208b2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarFloat.md @@ -0,0 +1,42 @@ +--- +title: SetSVarFloat +sidebar_label: SetSVarFloat +description: 设置浮点型服务器变量。 +tags: ["服务器变量", "svar"] +--- + + + +## 描述 + +设置浮点型服务器变量。 + +| 参数名 | 说明 | +| ------------ | ---------------- | +| const svar[] | 服务器变量名称 | +| Float:value | 要设置的浮点数值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(变量名为空或超过 40 字符) + +## 示例代码 + +```c +// 设置版本号 +SetSVarFloat("Version", 0.37); + +// 打印服务器版本号 +printf("当前版本: %.2f", GetSVarFloat("Version")); +``` + +## 相关函数 + +- [SetSVarInt](SetSVarInt): 设置整型服务器变量 +- [GetSVarInt](GetSVarInt): 获取服务器变量的整数值 +- [SetSVarString](SetSVarString): 设置字符串型服务器变量 +- [GetSVarString](GetSVarString): 获取服务器变量的字符串值 +- [GetSVarFloat](GetSVarFloat): 获取服务器变量的浮点数值 +- [DeleteSVar](DeleteSVar): 删除服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarInt.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarInt.md new file mode 100644 index 00000000000..4d70e8b4f30 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarInt.md @@ -0,0 +1,42 @@ +--- +title: SetSVarInt +sidebar_label: SetSVarInt +description: 设置整型服务器变量。 +tags: ["服务器变量", "svar"] +--- + + + +## 描述 + +设置整型服务器变量。 + +| 参数名 | 描述 | +| ------------ | -------------- | +| const svar[] | 服务器变量名称 | +| value | 要设置的整数值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(变量名为空或超过 40 字符) + +## 示例 + +```c +// 设置版本号 +SetSVarInt("Version", 37); + +// 打印服务器当前版本 +printf("版本号: %d", GetSVarInt("Version")); +``` + +## 相关函数 + +- [GetSVarInt](GetSVarInt): 获取整型服务器变量值 +- [SetSVarString](SetSVarString): 设置字符串类型服务器变量 +- [GetSVarString](GetSVarString): 获取字符串类型服务器变量值 +- [SetSVarFloat](SetSVarFloat): 设置浮点型服务器变量 +- [GetSVarFloat](GetSVarFloat): 获取浮点型服务器变量值 +- [DeleteSVar](DeleteSVar): 删除服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarString.md new file mode 100644 index 00000000000..f2b90fe6a97 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSVarString.md @@ -0,0 +1,45 @@ +--- +title: SetSVarString +sidebar_label: SetSVarString +description: 设置字符串型服务器变量。 +tags: ["服务器变量", "svar"] +--- + + + +## 描述 + +设置字符串型服务器变量。 + +| 名称 | 说明 | +| ---------------- | -------------------------- | +| const svar[] | 服务器变量名称 | +| const value[] | 要设置的字符串值 | +| OPEN_MP_TAGS:... | 不定数量的任意标签类型参数 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。变量名为空或超过 40 字符。 + +## 示例 + +```c +// 设置版本号 +SetSVarString("Version", "0.3.7"); + +// 打印服务器版本 +new string[5 + 1]; +GetSVarString("Version", string, sizeof(string)); +printf("版本号: %s", string); +``` + +## 相关函数 + +- [SetSVarInt](SetSVarInt): 设置整型服务器变量 +- [GetSVarInt](GetSVarInt): 获取整型服务器变量值 +- [GetSVarString](GetSVarString): 获取字符串型服务器变量值 +- [SetSVarFloat](SetSVarFloat): 设置浮点型服务器变量 +- [GetSVarFloat](GetSVarFloat): 获取浮点型服务器变量值 +- [DeleteSVar](DeleteSVar): 删除服务器变量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRule.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRule.md new file mode 100644 index 00000000000..f487add2712 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRule.md @@ -0,0 +1,47 @@ +--- +title: SetServerRule +sidebar_label: SetServerRule +description: 添加服务器规则。 +tags: ["规则"] +--- + + + +## 描述 + +添加服务器规则。 + +## 参数 + +| 名称 | 说明 | +| ---------------- | -------------------------- | +| const rule[] | 要添加的服务器规则名称 | +| const format[] | 服务器规则的值 | +| OPEN_MP_TAGS:... | 任意标签类型的不定数量参数 | + +## 返回值 + +函数执行成功返回 true,否则返回 false。 + +## 示例 + +```c +public OnGameModeInit() +{ + SetServerRule("discord", "discord.gg/samp"); + return 1; +} +``` + +## 注意 + +:::tip + +本函数与[AddServerRule](AddServerRule)功能相同。 + +::: + +## 相关函数 + +- [RemoveServerRule](RemoveServerRule): 移除服务器规则 +- [IsValidServerRule](IsValidServerRule): 检查服务器规则有效性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRuleFlags.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRuleFlags.md new file mode 100644 index 00000000000..716c7a481f3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetServerRuleFlags.md @@ -0,0 +1,47 @@ +--- +title: SetServerRuleFlags +sidebar_label: SetServerRuleFlags +description: 设置服务器规则的标志。 +tags: ["规则"] +--- + + + +:::warning + +该函数暂未实现。 + +::: + +## 描述 + +设置服务器规则的标志。 + +## 参数 + +| 参数名 | 描述 | +| ------------------------- | -------------- | +| const rule[] | 服务器规则名称 | +| E_SERVER_RULE_FLAGS:flags | 要设置的标志位 | + +## 返回值 + +函数执行成功返回 **true**,否则返回 **false**。 + +## 示例 + +```c +public OnGameModeInit() +{ + AddServerRule("discord", "discord.gg/samp"); + SetServerRuleFlags("discord", 1); + return 1; +} +``` + +## 相关函数 + +- [AddServerRule](AddServerRule): 添加服务器规则 +- [RemoveServerRule](RemoveServerRule): 移除服务器规则 +- [IsValidServerRule](IsValidServerRule): 验证服务器规则有效性 +- [GetServerRuleFlags](GetServerRuleFlags): 获取服务器规则标志位 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSpawnInfo.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSpawnInfo.md new file mode 100644 index 00000000000..bb93a3d43e7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetSpawnInfo.md @@ -0,0 +1,62 @@ +--- +title: SetSpawnInfo +sidebar_label: SetSpawnInfo +description: 设置指定玩家的生成信息。 +tags: ["玩家"] +--- + +## 描述 + +该函数用于设置指定玩家的生成信息,可配置生成时的武器、队伍、皮肤及坐标。适用于迷你游戏或自动生成系统,相比在[OnPlayerSpawn](../callbacks/OnPlayerSpawn)或[OnPlayerRequestClass](../callbacks/OnPlayerRequestClass)中使用[SetPlayerSkin](SetPlayerSkin)更稳定。 + +| 参数名 | 说明 | +| -------------- | ----------------------------------------- | +| playerid | 需要设置生成信息的玩家 ID | +| team | 玩家所属队伍 ID | +| skin | 生成时使用的[皮肤 ID](../resources/skins) | +| Float:spawnX | 生成点的 X 坐标 | +| Float:spawnY | 生成点的 Y 坐标 | +| Float:spawnZ | 生成点的 Z 坐标 | +| Float:angle | 生成后的面朝方向(角度制) | +| WEAPON:weapon1 | 第一主武器 ID | +| ammo1 | 第一主武器弹药量 | +| WEAPON:weapon2 | 第二副武器 ID | +| ammo2 | 第二副武器弹药量 | +| WEAPON:weapon3 | 第三近战武器 ID | +| ammo3 | 第三近战武器弹药量 | + +## 返回值 + +本函数没有特定返回值。 + +## 示例代码 + +```c +public OnPlayerRequestClass(playerid, classid) +{ + // 设置玩家生成信息:CJ皮肤(0号),拉斯云祖华坐标 + // 携带36发短管霰弹枪(WEAPON_SAWEDOFF)和150发乌兹冲锋枪(WEAPON_UZI) + SetSpawnInfo(playerid, NO_TEAM, 0, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); +} +``` + +## 注意事项 + +:::warning + +- 若不需要队伍归属,请将 team 参数设为`NO_TEAM`(255) +- open.mp 中 0 号队伍为有效队伍(与 SA-MP 存在差异) + +::: + +## 相关函数 + +- [GetSpawnInfo](GetSpawnInfo): 获取玩家当前生成配置 +- [SetPlayerSkin](SetPlayerSkin): 设置玩家皮肤 +- [SetPlayerTeam](SetPlayerTeam): 设置玩家队伍 +- [SpawnPlayer](SpawnPlayer): 强制玩家生成 + +## 相关资源 + +- [皮肤 ID 列表](../resources/skins) +- [武器 ID 列表](../resources/weaponids) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTeamCount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTeamCount.md new file mode 100644 index 00000000000..9c772ce4a49 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTeamCount.md @@ -0,0 +1,34 @@ +--- +title: SetTeamCount +sidebar_label: SetTeamCount +description: 该函数用于设置游戏模式中使用的队伍数量。 +tags: [] +--- + +## 描述 + +该函数用于设置游戏模式中使用的队伍数量。虽然无实际效果,但可用于优化内部队伍管理机制。应仅在 OnGameModeInit 回调函数中使用。重要提示:可传入任意数值(如 20 亿),本函数不会产生任何实际影响。 + +| 参数名 | 描述 | +| ------ | -------------------- | +| count | 游戏模式预设队伍数量 | + +## 返回值 + +本函数没有返回值。 + +## 示例 + +```c +public OnGameModeInit( ) +{ + // 我们在此团队死斗模式中使用18个队伍,进行定义 + SetTeamCount(18); + return 1; +} +``` + +## 相关函数 + +- [GetPlayerTeam](GetPlayerTeam): 检查玩家所在队伍 +- [SetPlayerTeam](SetPlayerTeam): 设置玩家所属队伍 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md new file mode 100644 index 00000000000..3146a981e6f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md @@ -0,0 +1,78 @@ +--- +title: SetTimer +sidebar_label: SetTimer +description: 设置定时器在指定时间后调用函数。 +tags: ["定时器"] +--- + +## 描述 + +设置定时器在指定时间间隔后触发函数调用,可配置是否重复执行。 + +| 参数名 | 说明 | +| -------------------- | ------------------------------------------------------------ | +| const functionName[] | 要调用的公共函数名称(需预先声明)。空字符串会导致服务器崩溃 | +| interval | 触发间隔(毫秒) | +| bool:repeating | 是否重复执行(true=重复,false=单次) | + +## 返回值 + +返回已启动定时器的 ID(从**1**开始顺序分配) + +## 示例代码 + +```c +public OnGameModeInit() +{ + print("启动定时器..."); + SetTimer("OneSecondTimer", 1000, true); // 设置1秒重复定时器 +} + +forward OneSecondTimer(); +public OneSecondTimer() +{ + print("已过去1秒钟"); +} +``` + +## 注意事项 + +:::warning + +SA-MP 存在定时器精度问题(误差约 25%),可参考以下修复方案: + +- [精度修复方案 1](https://sampforum.blast.hk/showthread.php?tid=289675) +- [精度修复方案 2](https://sampforum.blast.hk/showthread.php?tid=650736) + (open.mp 已修复此问题) + +::: + +:::warning + +大量使用定时器会增加服务器 CPU/内存消耗 + +::: + +:::tip + +- 定时器 ID 具有全局唯一性,不会重复使用 +- 可通过[KillTimer](KillTimer)安全终止任意定时器(无论是否运行) +- 目标函数必须声明为`public`且预先`forward` + +::: + +## 定义常量 + +| 常量名称 | 值 | +| ------------- | --- | +| INVALID_TIMER | 0 | + +## 相关函数 + +- [SetTimerEx](SetTimerEx): 设置带参数的定时器 +- [KillTimer](KillTimer): 终止定时器 +- [IsValidTimer](IsValidTimer): 验证定时器是否有效 +- [IsRepeatingTimer](IsRepeatingTimer): 检测定时器是否重复执行 +- [GetTimerInterval](GetTimerInterval): 获取定时器间隔设置 +- [GetTimerRemaining](GetTimerRemaining): 获取定时器剩余时间 +- [CountRunningTimers](CountRunningTimers): 统计运行中的定时器数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimerEx.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimerEx.md new file mode 100644 index 00000000000..db615d562af --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimerEx.md @@ -0,0 +1,92 @@ +--- +title: SetTimerEx +sidebar_label: SetTimerEx +description: 设置定时器以在指定间隔后调用函数,并可传递参数。 +tags: ["定时器"] +--- + +## 描述 + +设置定时器以在指定间隔后调用函数。此变体 ('Ex') 可向目标函数传递参数(如玩家 ID)。 + +| 名称 | 说明 | +| -------------------- | ---------------------------------------------------------------------------------------- | +| const functionName[] | 定时器到期时调用的公共函数名称 | +| interval | 时间间隔(单位:毫秒,1 秒=1000 毫秒) | +| bool:repeating | 布尔值(true/false 或 1/0),决定定时器是否重复执行(仅能通过 KillTimer 停止)或单次执行 | +| const specifiers[] | 特殊格式说明符,用于指示传递参数的类型 | +| OPEN_MP_TAGS:... | 不定数量参数(需符合前参数指定的格式) | + +## 返回值 + +返回已启动定时器的 ID。定时器 ID 从 1 开始且永不重复。系统不会校验参数合法性(如负值间隔),推荐使用 Y_Less 的'fixes2'插件增强校验精度及数组/字符串传递功能。 + +## 示例 + +```c +SetTimerEx("EndAntiSpawnKill", 5000, false, "i", playerid); +// EndAntiSpawnKill - 将要调用的函数 +// 5000 - 5000毫秒(5秒)时间间隔 +// false - 非重复执行,仅触发一次 +// "i" - i代表整型,此处传递玩家ID +// playerid - 要传递的整型值(玩家ID) +``` + +
+ +```c +// 在玩家生成事件中启动定时器 +public OnPlayerSpawn(playerid) +{ + // 反重生点击杀保护(5秒) + SetPlayerHealth(playerid, 999999.0); + SendClientMessage(playerid, -1, "你已获得5秒重生保护"); + + // 启动5秒定时器 + SetTimerEx("EndAntiSpawnKill", 5000, false, "i", playerid); +} + +// 声明公共函数 +forward EndAntiSpawnKill(playerid); +public EndAntiSpawnKill(playerid) +{ + // 5秒后恢复生命值 + SetPlayerHealth(playerid, 100.0); + SendClientMessage(playerid, -1, "重生保护已失效"); + return 1; +} +``` + +## 注意 + +:::warning + +SA-MP 中定时器精度存在约 25%偏差,可通过[此修复](https://sampforum.blast.hk/showthread.php?tid=289675)或[此方案](https://sampforum.blast.hk/showthread.php?tid=650736)优化。open.mp 已修复此问题。 + +::: + +:::tip + +- 定时器 ID 变量建议用完后重置为 0,避免误操作终止新定时器 +- 目标函数必须声明为 public 并通过 forward 预声明 +- `-1`并非无效 ID,实际无效 ID 为 0 + +::: + +## 定义值 + +| 定义值 | 值 | +| ------------- | --- | +| INVALID_TIMER | 0 | + +## 相关函数 + +- [SetTimer](SetTimer): 创建基础定时器 +- [KillTimer](KillTimer): 终止定时器 +- [IsValidTimer](IsValidTimer): 校验定时器有效性 +- [IsRepeatingTimer](IsRepeatingTimer): 检测定时器是否循环 +- [GetTimerInterval](GetTimerInterval): 获取定时器间隔 +- [GetTimerRemaining](GetTimerRemaining): 获取定时器剩余时间 +- [CountRunningTimers](CountRunningTimers): 统计运行中定时器 +- [CallLocalFunction](CallLocalFunction): 调用脚本内函数 +- [CallRemoteFunction](CallRemoteFunction): 跨脚本调用函数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleAngularVelocity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleAngularVelocity.md new file mode 100644 index 00000000000..125c25054b2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleAngularVelocity.md @@ -0,0 +1,58 @@ +--- +title: SetVehicleAngularVelocity +sidebar_label: SetVehicleAngularVelocity +description: 设置车辆在X、Y、Z轴上的角速度。 +tags: ["车辆"] +--- + +:::info + +本函数基于世界坐标系而非局部坐标系。如需进行局部坐标系角速度调整,必须基于[车辆旋转四元数](GetVehicleRotationQuat)应用旋转矩阵。 + +::: + +## 描述 + +设置车辆在 X、Y、Z 轴上的角速度 + +| 名称 | 说明 | +| --------- | --------------------- | +| vehicleid | 要设置角速度的车辆 ID | +| Float:x | X 轴方向的角速度量 | +| Float:y | Y 轴方向的角速度量 | +| Float:z | Z 轴方向的角速度量 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。车辆不存在。 + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/spin", cmdtext)) + { + if (IsPlayerInAnyVehicle(playerid)) + { + SetVehicleAngularVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 2.0); + } + return 1; + } +} +``` + +## 注意 + +:::warning + +本函数对无人车辆无效且不影响火车。 + +::: + +## 相关函数 + +- [SetVehicleVelocity](SetVehicleVelocity): 设置车辆线速度 +- [GetVehicleVelocity](GetVehicleVelocity): 获取车辆线速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleBeenOccupied.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleBeenOccupied.md new file mode 100644 index 00000000000..a6f6a2d1e21 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleBeenOccupied.md @@ -0,0 +1,36 @@ +--- +title: SetVehicleBeenOccupied +sidebar_label: SetVehicleBeenOccupied +description: 设置车辆的占用状态。 +tags: ["车辆"] +--- + + + +:::warning + +该功能在当前版本中尚未实现 + +::: + +## 描述 + +设置车辆的占用状态标记。 + +## 参数说明 + +| 参数名 | 说明 | +| ------------- | ---------------------------------------- | +| vehicleid | 目标车辆的 ID | +| bool:occupied | **true**标记为占用 **false**清除占用标记 | + +## 示例代码 + +```c +// 将指定车辆标记为已被占用 +SetVehicleBeenOccupied(vehicleid, true); +``` + +## 相关函数 + +- [HasVehicleBeenOccupied](HasVehicleBeenOccupied): 检测车辆是否被标记为占用状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleDead.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleDead.md new file mode 100644 index 00000000000..5b1b385476c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleDead.md @@ -0,0 +1,35 @@ +--- +title: SetVehicleDead +sidebar_label: SetVehicleDead +description: 设置车辆为损毁状态。 +tags: ["车辆"] +--- + + + +:::warning + +该函数暂未实现。 + +::: + +## 描述 + +设置车辆为损毁状态。 + +## 参数 + +| 参数名 | 描述 | +| --------- | ------------------------------------------- | +| vehicleid | 要设置的车辆 ID | +| bool:dead | **true**表示损毁状态,**false**表示正常状态 | + +## 示例 + +```c +SetVehicleDead(vehicleid, true); +``` + +## 相关函数 + +- [IsVehicleDead](IsVehicleDead): 检查车辆是否处于损毁状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleHealth.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleHealth.md new file mode 100644 index 00000000000..c98a825bf6c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleHealth.md @@ -0,0 +1,65 @@ +--- +title: SetVehicleHealth +sidebar_label: SetVehicleHealth +description: 设置车辆的生命值。 +tags: ["车辆"] +--- + + + +## 描述 + +设置车辆的生命值。当生命值降低时,引擎会先冒烟,当生命值低于 250(25%)时会出现火焰。 + +| 参数名 | 说明 | +| ------------ | ---------------------- | +| vehicleid | 要设置生命值的车辆 ID | +| Float:health | 以浮点数值表示的生命值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示车辆不存在) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp("/fixengine", cmdtext, true) == 0) + { + new + vehicleid = GetPlayerVehicleID(playerid); + + // 完全修复车辆引擎 + SetVehicleHealth(vehicleid, 1000.0); + SendClientMessage(playerid, -1, "车辆引擎已完全修复"); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +- 车辆满血状态为 1000.0,允许设置更高数值 +- 详细生命值参数说明请参考[此文档](../resources/vehiclehealth) + +::: + +## 相关函数 + +- [GetVehicleHealth](GetVehicleHealth): 获取车辆当前生命值 +- [RepairVehicle](RepairVehicle): 完全修复车辆 +- [SetPlayerHealth](SetPlayerHealth): 设置玩家生命值 + +## 相关回调函数 + +- [OnVehicleDeath](../callbacks/OnVehicleDeath): 车辆被摧毁时触发 + +## 相关资源 + +- [车辆生命值参数说明](../resources/vehiclehealth) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleNumberPlate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleNumberPlate.md new file mode 100644 index 00000000000..90f9e76e73d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleNumberPlate.md @@ -0,0 +1,55 @@ +--- +title: SetVehicleNumberPlate +sidebar_label: SetVehicleNumberPlate +description: 设置车辆车牌。 +tags: ["车辆"] +--- + +## 描述 + +设置车辆的车牌。 + +| 名称 | 说明 | +| ------------------- | -------------------- | +| vehicleid | 要设置车牌的车辆 ID | +| const numberPlate[] | 要在车牌上显示的文本 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。车辆不存在。 + +## 示例 + +```c +new + vehicleid = CreateVehicle(542, 2074.73, 1089.89, 10.51, 0.0, -1, -1, -1); // 创建Comet跑车 +SetVehicleNumberPlate(vehicleid, "ABCD 123"); // 设置车牌号为ABCD 123 +``` + +## 注意 + +:::tip + +- 本函数不会进行内置错误校验 +- 请勿为无车牌车辆(船只、飞机等)设置自定义车牌,这会导致不必要的客户端处理 +- 需重新生成或重新流加载车辆才能使更改生效 +- 车牌文本最大支持 32 字符(含颜色代码) +- 可视区域仅显示约 9-10 个字符,超长文本会自动换行 +- 部分车辆模型(如 Boxville 498)使用倒置车牌,可用 Boxburg 609 替代 + +::: + +:::tip + +车牌文本支持颜色代码嵌入 + +::: + +## 相关函数 + +- [GetVehicleNumberPlate](GetVehicleNumberPlate): 获取车辆车牌 +- [SetVehicleToRespawn](SetVehicleToRespawn): 重置车辆状态 +- [ChangeVehicleColor](ChangeVehicleColor): 修改车辆颜色 +- [ChangeVehiclePaintjob](ChangeVehiclePaintjob): 更换车辆涂装 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleOccupiedTick.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleOccupiedTick.md new file mode 100644 index 00000000000..6da05b2550f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleOccupiedTick.md @@ -0,0 +1,47 @@ +--- +title: SetVehicleOccupiedTick +sidebar_label: SetVehicleOccupiedTick +description: 设置车辆的占用时间戳。 +tags: ["车辆"] +--- + + + +:::warning + +该函数暂未实现。 + +::: + +## 描述 + +设置车辆的占用时间戳。 + +## 参数 + +| 参数名 | 描述 | +| --------- | ------------------ | +| vehicleid | 要设置的车辆 ID | +| ticks | 要设置的时间戳数值 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败 + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + SetVehicleOccupiedTick(vehicleid, 300); + return 1; +} +``` + +## 相关函数 + +- [GetVehicleOccupiedTick](GetVehicleOccupiedTick): 获取车辆的占用时间戳 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarDoors.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarDoors.md new file mode 100644 index 00000000000..7e6db4edc0e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarDoors.md @@ -0,0 +1,32 @@ +--- +title: SetVehicleParamsCarDoors +sidebar_label: SetVehicleParamsCarDoors +description: 控制车辆车门的开关状态。 +tags: ["车辆"] +--- + + + +## 描述 + +控制车辆车门的开关状态。 + +| 参数名 | 描述 | +| --------------- | --------------------------------------- | +| vehicleid | 要设置车门状态的车辆 ID | +| bool:frontLeft | 驾驶座车门状态(1 开启/0 关闭) | +| bool:frontRight | 副驾驶车门状态(1 开启/0 关闭) | +| bool:rearLeft | 左后车门状态(若存在)(1 开启/0 关闭) | +| bool:rearRight | 右后车门状态(若存在)(1 开启/0 关闭) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的车辆不存在) + +## 相关函数 + +- [GetVehicleParamsCarDoors](GetVehicleParamsCarDoors): 获取当前车辆车门状态 +- [SetVehicleParamsCarWindows](SetVehicleParamsCarWindows): 控制车辆车窗开关状态 +- [GetVehicleParamsCarWindows](GetVehicleParamsCarWindows): 获取当前车辆车窗状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarWindows.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarWindows.md new file mode 100644 index 00000000000..8b8f2ee9cc4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsCarWindows.md @@ -0,0 +1,32 @@ +--- +title: SetVehicleParamsCarWindows +sidebar_label: SetVehicleParamsCarWindows +description: 允许开关车辆的车窗。 +tags: ["车辆"] +--- + + + +## 描述 + +控制车辆车窗的开关状态。 + +| 名称 | 说明 | +| --------------- | -------------------------------------- | +| vehicleid | 要设置车窗的车辆 ID | +| bool:frontLeft | 驾驶座车窗状态(0=开启,1=关闭) | +| bool:frontRight | 副驾驶座车窗状态(0=开启,1=关闭) | +| bool:rearLeft | 左后车窗状态(若存在,0=开启,1=关闭) | +| bool:rearRight | 右后车窗状态(若存在,0=开启,1=关闭) | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。车辆不存在。 + +## 相关函数 + +- [SetVehicleParamsCarDoors](SetVehicleParamsCarDoors): 控制车辆车门开关 +- [GetVehicleParamsCarDoors](GetVehicleParamsCarDoors): 获取车辆车门状态 +- [GetVehicleParamsCarWindows](GetVehicleParamsCarWindows): 获取车辆车窗状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md new file mode 100644 index 00000000000..8c66dce9ad8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md @@ -0,0 +1,92 @@ +--- +title: SetVehicleParamsEx +sidebar_label: SetVehicleParamsEx +description: 为所有玩家设置车辆的参数。 +tags: ["车辆"] +--- + +## 描述 + +设置车辆的全局参数,对所有玩家生效。 + +| 参数名 | 说明 | +| -------------- | ------------------------------ | +| vehicleid | 目标车辆的 ID | +| bool:engine | 引擎状态(0=关闭,1=启动) | +| bool:lights | 车灯状态(0=关闭,1=开启) | +| bool:alarm | 警报状态(1=触发警报声) | +| bool:doors | 车门锁状态(0=解锁,1=上锁) | +| bool:bonnet | 引擎盖状态(0=关闭,1=开启) | +| bool:boot | 行李箱状态(0=关闭,1=开启) | +| bool:objective | 目标箭头显示(0=隐藏,1=显示) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示车辆不存在) + +## 示例代码 + +```c +// 全局变量声明 +new + gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; + +// 修改单个参数时需先获取当前状态 +new + bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective; + +// 创建车辆时的设置 +GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); +SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); // 仅修改引擎状态 + +// 带警报自动关闭的增强函数 +SetVehicleParamsEx_Fixed(vehicleid, &bool:engine, &bool:lights, &bool:alarm, &bool:doors, &bool:bonnet, &bool:boot, &bool:objective) +{ + SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); + if (alarm) + { + // 重置定时器实现20秒后自动关闭警报 + KillTimer(gVehicleAlarmTimer[vehicleid]); + gVehicleAlarmTimer[vehicleid] = 0; + gVehicleAlarmTimer[vehicleid] = SetTimerEx("DisableVehicleAlarm", 20000, false, "d", vehicleid); + } +} + +forward DisableVehicleAlarm(vehicleid); +public DisableVehicleAlarm(vehicleid) +{ + new + bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective; + + GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); + if (alarm == VEHICLE_PARAMS_ON) + { + SetVehicleParamsEx(vehicleid, engine, lights, VEHICLE_PARAMS_OFF, doors, bonnet, boot, objective); + } + + gVehicleAlarmTimer[vehicleid] = 0; +} +``` + +## 定义常量 + +- `VEHICLE_PARAMS_UNSET` (-1) 未设置 +- `VEHICLE_PARAMS_OFF` (0) 关闭 +- `VEHICLE_PARAMS_ON` (1) 开启 + +## 注意事项 + +:::tip + +- 警报触发后不会自动停止,需手动调用本函数关闭 +- 启用[ManualVehicleEngineAndLights](ManualVehicleEngineAndLights)后,车灯在白天也会保持开启状态 + +::: + +## 相关函数 + +- [GetVehicleParamsEx](GetVehicleParamsEx): 获取车辆参数状态 +- [SetVehicleParamsForPlayer](SetVehicleParamsForPlayer): 设置玩家专属车辆参数 +- [UpdateVehicleDamageStatus](UpdateVehicleDamageStatus): 更新车辆损坏状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md new file mode 100644 index 00000000000..3c34995b1e1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md @@ -0,0 +1,121 @@ +--- +title: SetVehicleParamsForPlayer +sidebar_label: SetVehicleParamsForPlayer +description: 为特定玩家设置车辆的参数。 +tags: ["玩家", "车辆"] +--- + +## 描述 + +为指定玩家设置车辆的专属参数。 + +| 参数名 | 说明 | +| ---------------- | ------------------------------------------------- | +| vehicle | 目标车辆的 ID | +| playerid | 需要设置参数的玩家 ID | +| bool:objective | 目标箭头显示(true=显示黄色浮动箭头,false=隐藏) | +| bool:doorslocked | 车门锁定状态(true=上锁,false=解锁) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家或车辆不存在) + +## 示例代码 + +```c +// 初始化时设置玩家专属车辆 +SetVehicleParamsForPlayer(iPlayerVehicle, iPlayerID, true, false); + +// 需要重置车辆时获取当前参数 +new + bool:iEngine, bool:iLights, bool:iAlarm, + bool:iDoors, bool:iBonnet, bool:iBoot, + bool:iObjective; + +GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); +SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, false); + +// 锁定自己车辆(排除自己) +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/lock", true)) + { + if (!IsPlayerInAnyVehicle(playerid)) + { + return SendClientMessage(playerid,0xFFFFFFAA,"请进入车辆后使用此命令"); + } + + for (new i = 0; i < MAX_PLAYERS; i++) + { + if (i == playerid) continue; + SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, false, true); + } + return 1; + } + return 0; +} + +// 0.3a+版本流加载处理示例 +new bool:iVehicleObjective[MAX_VEHICLES][2]; + +public OnGameModeInit() +{ + new temp = AddStaticVehicleEx(400, 0.0, 0.0, 5.0, 0.0, 0, 0, -1); // 创建车辆ID 1 + iVehicleObjective[temp][0] = true; // 默认显示箭头 + iVehicleObjective[temp][1] = false; // 默认解锁车门 + return 1; +} + +stock SetVehicleParamsForPlayerEx(vehicleid, playerid, bool:objective, bool:doorslocked) +{ + SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked); + iVehicleObjective[vehicleid][0] = objective; + iVehicleObjective[vehicleid][1] = doorslocked; +} + +public OnVehicleStreamIn(vehicleid, forplayerid) +{ + // 车辆流加载时重新应用参数 + SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); +} + +// 标记特定车辆示例 +new myMarkedCar; + +public OnGameModeInit() +{ + myMarkedCar = AddStaticVehicleEx(400, 0.0, 0.0, 5.0, 0.0, 0, 0, -1); // 创建标记车辆 + return 1; +} + +public OnVehicleStreamIn(vehicleid, forplayerid) +{ + if (vehicleid == myMarkedCar) + { + // 流加载时显示目标箭头 + SetVehicleParamsForPlayer(myMarkedCar, forplayerid, true, false); + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 需要重置车辆(Respawn)才能完全移除目标箭头 +- 必须通过[OnVehicleStreamIn](../callbacks/OnVehicleStreamIn)回调重新应用参数设置 + +::: + +:::warning + +参数设置在车辆流加载时需要重新应用 + +::: + +## 相关函数 + +- [SetVehicleParamsEx](SetVehicleParamsEx): 设置全局车辆参数(对所有玩家生效) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsSirenState.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsSirenState.md new file mode 100644 index 00000000000..52955c00454 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsSirenState.md @@ -0,0 +1,31 @@ +--- +title: SetVehicleParamsSirenState +sidebar_label: SetVehicleParamsSirenState +description: 控制车辆警笛的开启与关闭状态。 +tags: ["车辆"] +--- + + + +## 描述 + +控制车辆警笛的开启与关闭状态。 + +## 参数 + +| 参数名 | 描述 | +| ------------ | ------------------------------------------- | +| vehicleid | 要操作的车辆 ID | +| bool:enabled | **true**表示开启警笛,**false**表示关闭警笛 | + +## 示例 + +```c +SetVehicleParamsSirenState(vehicleid, true); +``` + +## 相关函数 + +- [GetVehicleParamsSirenState](GetVehicleParamsSirenState): 获取车辆警笛状态 +- [GetVehicleSirenState](GetVehicleSirenState): 获取车辆警笛激活状态 +- [GetPlayerSirenState](GetPlayerSirenState): 获取玩家车辆警笛状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehiclePos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehiclePos.md new file mode 100644 index 00000000000..15d139e153a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehiclePos.md @@ -0,0 +1,47 @@ +--- +title: SetVehiclePos +sidebar_label: SetVehiclePos +description: 设置车辆坐标。 +tags: ["车辆"] +--- + +## 描述 + +设置车辆的位置。 + +| 名称 | 说明 | +| --------- | ------------------- | +| vehicleid | 要设置位置的车辆 ID | +| Float:x | 车辆位置的 X 坐标 | +| Float:y | 车辆位置的 Y 坐标 | +| Float:z | 车辆位置的 Z 坐标 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。指定的车辆不存在。 + +## 示例 + +```c +// 将玩家的车辆传送至坐标0.0, 0.0, 3.0(圣安地列斯中心) +new vehicleid = GetPlayerVehicleID(playerid); +SetVehiclePos(vehicleid, 0.0, 0.0, 3.0); +``` + +## 注意 + +:::warning + +已知问题: + +- 空车辆被传送至高空时不会自然下坠! + +::: + +## 相关函数 + +- [SetPlayerPos](SetPlayerPos): 设置玩家位置 +- [GetVehiclePos](GetVehiclePos): 获取车辆坐标 +- [SetVehicleZAngle](SetVehicleZAngle): 设置车辆朝向角度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnDelay.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnDelay.md new file mode 100644 index 00000000000..254a685f5cd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnDelay.md @@ -0,0 +1,37 @@ +--- +title: SetVehicleRespawnDelay +sidebar_label: SetVehicleRespawnDelay +description: 设置车辆的重生延迟时间。 +tags: ["车辆"] +--- + + + +## 描述 + +设置车辆被销毁后的重生延迟时间。 + +## 参数说明 + +| 参数名 | 说明 | +| ------------ | -------------------------------- | +| vehicleid | 目标车辆的 ID | +| respawnDelay | 要设置的重生延迟时间(单位:秒) | + +## 示例代码 + +```c +public OnGameModeInit() +{ + // 创建车辆并设置其重生延迟 + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + // 设置120秒(2分钟)后自动重生 + SetVehicleRespawnDelay(vehicleid, 120); + return 1; +} +``` + +## 相关函数 + +- [GetVehicleRespawnDelay](GetVehicleRespawnDelay): 获取车辆当前的重生延迟时间 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnTick.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnTick.md new file mode 100644 index 00000000000..07167be658b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleRespawnTick.md @@ -0,0 +1,47 @@ +--- +title: SetVehicleRespawnTick +sidebar_label: SetVehicleRespawnTick +description: 设置车辆的重生滴答数。 +tags: ["车辆"] +--- + + + +:::warning + +本函数暂未实现。 + +::: + +## 描述 + +设置车辆的重生滴答数。 + +## 参数 + +| 名称 | 说明 | +| --------- | -------------- | +| vehicleid | 目标车辆 ID | +| ticks | 要设置的滴答数 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。 + +## 示例 + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); // 创建Sultan车辆 + + SetVehicleRespawnTick(vehicleid, 300); // 设置300滴答后重生 + return 1; +} +``` + +## 相关函数 + +- [GetVehicleRespawnTick](GetVehicleRespawnTick): 获取车辆的重生滴答数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleSpawnInfo.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleSpawnInfo.md new file mode 100644 index 00000000000..273966eeabe --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleSpawnInfo.md @@ -0,0 +1,45 @@ +--- +title: SetVehicleSpawnInfo +sidebar_label: SetVehicleSpawnInfo +description: 设置车辆重生参数(模型、坐标、颜色、重生延迟及所属室内空间)。 +tags: ["车辆"] +--- + + + +## 描述 + +配置车辆重生相关参数,包括模型、生成坐标、颜色配置、重生延迟时间及所属室内空间。 + +## 参数 + +| 参数名 | 描述 | +| ----------------- | --------------------------------------------- | +| vehicleid | 要配置的车辆 ID | +| modelid | 要设置的[车辆模型 ID](../resources/vehicleid) | +| Float:spawnX | 重生 X 坐标 | +| Float:spawnY | 重生 Y 坐标 | +| Float:spawnZ | 重生 Z 坐标 | +| Float:angle | 重生朝向角度 | +| colour1 | 主[车辆颜色](../resources/vehiclecolorid) | +| colour2 | 副[车辆颜色](../resources/vehiclecolorid) | +| respawnDelay = -2 | 重生延迟时间(秒),-2 表示保持原设置 | +| interior = -2 | 所属室内空间 ID,-2 表示保持原设置 | + +## 示例 + +```c +public OnGameModeInit() +{ + // 创建初始车辆 + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + + // 重新配置重生参数 + SetVehicleSpawnInfo(vehicleid, 522, 2096.0417, -1314.1062, 24.0078, 0.0000, 1, 7); + return 1; +} +``` + +## 相关函数 + +- [GetVehicleSpawnInfo](GetVehicleSpawnInfo): 获取车辆重生参数配置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleToRespawn.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleToRespawn.md new file mode 100644 index 00000000000..8bfff9af9f7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleToRespawn.md @@ -0,0 +1,35 @@ +--- +title: SetVehicleToRespawn +sidebar_label: SetVehicleToRespawn +description: 将车辆重置到其初始创建位置。 +tags: ["车辆"] +--- + +## 描述 + +将车辆重置到其创建时的位置。 + +| 名称 | 说明 | +| --------- | --------------- | +| vehicleid | 要重置的车辆 ID | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。车辆不存在。 + +## 示例 + +```c +// 重置所有车辆 +for (new i = 1; i < MAX_VEHICLES; i++) +{ + SetVehicleToRespawn(i); +} +``` + +## 相关函数 + +- [CreateVehicle](CreateVehicle): 创建车辆 +- [DestroyVehicle](DestroyVehicle): 销毁车辆 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVelocity.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVelocity.md new file mode 100644 index 00000000000..13d637287f4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVelocity.md @@ -0,0 +1,53 @@ +--- +title: SetVehicleVelocity +sidebar_label: SetVehicleVelocity +description: 设置车辆在三维空间中的运动速度。 +tags: ["车辆"] +--- + +## 描述 + +设置车辆在 X、Y、Z 三个坐标轴方向的瞬时运动速度。 + +| 参数名 | 说明 | +| --------- | ----------------------------------- | +| vehicleid | 目标车辆的 ID | +| Float:x | X 轴方向的速度(单位:游戏单位/秒) | +| Float:y | Y 轴方向的速度(单位:游戏单位/秒) | +| Float:z | Z 轴方向的速度(单位:游戏单位/秒) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示车辆不存在) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/jump", cmdtext)) // 检测"/jump"指令 + { + if (IsPlayerInAnyVehicle(playerid)) // 确认玩家在车辆内 + { + // 给车辆垂直方向施加速度实现跳跃效果 + SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.2); + } + return 1; + } +} +``` + +## 注意事项 + +:::warning + +- 本函数仅对玩家驾驶的车辆有效 +- 无法作用于火车类车辆 + +::: + +## 相关函数 + +- [GetVehicleVelocity](GetVehicleVelocity): 获取车辆当前的三轴速度 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVirtualWorld.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVirtualWorld.md new file mode 100644 index 00000000000..836f9d84b98 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleVirtualWorld.md @@ -0,0 +1,32 @@ +--- +title: SetVehicleVirtualWorld +sidebar_label: SetVehicleVirtualWorld +description: 设置车辆所属的虚拟世界。 +tags: ["车辆"] +--- + +## 描述 + +设置车辆所属的虚拟世界。玩家仅能看见与其处于同一虚拟世界中的车辆。 + +| 参数名 | 描述 | +| ------------ | ----------------------- | +| vehicleid | 要设置虚拟世界的车辆 ID | +| virtualWorld | 要设置的虚拟世界 ID | + +## 返回值 + +本函数没有返回值。 + +## 示例 + +```c +// 将玩家及其车辆置于虚拟世界10 +SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 10); +SetPlayerVirtualWorld(playerid, 10); +``` + +## 相关函数 + +- [GetVehicleVirtualWorld](GetVehicleVirtualWorld): 获取车辆所在虚拟世界 +- [SetPlayerVirtualWorld](SetPlayerVirtualWorld): 设置玩家所属虚拟世界 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleZAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleZAngle.md new file mode 100644 index 00000000000..12af4ac391b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleZAngle.md @@ -0,0 +1,58 @@ +--- +title: SetVehicleZAngle +sidebar_label: SetVehicleZAngle +description: 设置车辆Z轴旋转角度(偏航角)。 +tags: ["车辆"] +--- + +## 描述 + +设置车辆 Z 轴旋转角度(偏航角)。 + +| 参数名 | 描述 | +| ----------- | --------------------------------- | +| vehicleid | 要设置旋转角度的车辆 ID | +| Float:angle | 要设置的 Z 轴旋转角度(单位:度) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的车辆不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/flip", true) == 0) + { + new + vehicleid, + Float:angle; + + vehicleid = GetPlayerVehicleID(playerid); + GetVehicleZAngle(vehicleid, angle); + SetVehicleZAngle(vehicleid, angle); + + SendClientMessage(playerid, 0xFFFFFFFF, "您的车辆已复位角度"); + return 1; + } + return 0; +} +``` + +## 重要说明 + +:::tip + +- 使用本函数将重置车辆的 X/Y 轴旋转(俯仰和横滚) +- X/Y 轴旋转角度不可通过本函数设置 +- 本函数对无人驾驶的车辆无效(GTA 引擎原生限制) + +::: + +## 相关函数 + +- [GetVehicleZAngle](GetVehicleZAngle): 获取车辆当前 Z 轴角度 +- [SetVehiclePos](SetVehiclePos): 设置车辆坐标位置 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetWeather.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetWeather.md new file mode 100644 index 00000000000..593f1425ffd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetWeather.md @@ -0,0 +1,51 @@ +--- +title: SetWeather +sidebar_label: SetWeather +description: 为所有玩家设置世界天气。 +tags: [] +--- + +## 描述 + +为所有玩家设置全局天气效果。 + +| 参数名 | 说明 | +| --------- | ----------------------------------------- | +| weatherid | 要设置的[天气 ID](../resources/weatherid) | + +## 返回值 + +本函数没有特定返回值。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/sandstorm", true)) // 检测沙尘暴指令 + { + SetWeather(19); // 设置19号沙尘暴天气 + return 1; + } + return 1; +} +``` + +## 注意事项 + +:::tip + +- 启用[TogglePlayerClock](TogglePlayerClock)后天气会渐变切换,而非立即生效 +- 游戏仅支持 0-20 共 21 种天气 ID,但未做范围校验 + +::: + +## 相关函数 + +- [GetWeather](GetWeather): 获取当前全局天气 +- [SetPlayerWeather](SetPlayerWeather): 设置玩家独立天气 +- [SetGravity](SetGravity): 设置全局重力参数 + +## 相关资源 + +- [天气 ID 对照表](../resources/weatherid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetWorldTime.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetWorldTime.md new file mode 100644 index 00000000000..e2e03238ead --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetWorldTime.md @@ -0,0 +1,46 @@ +--- +title: SetWorldTime +sidebar_label: SetWorldTime +description: 为所有玩家设置全局时间至指定小时。 +tags: ["全局时间"] +--- + +## 描述 + +为所有玩家设置全局时间至指定小时。 + +| 名称 | 说明 | +| ---- | ---------------------- | +| hour | 要设置的小时值(0-23) | + +## 返回值 + +本函数不返回任何特定值。 + +## 示例 + +```c +// 设置时间为12点(正午) +SetWorldTime(12); +``` + +## 注意 + +:::tip + +本函数仅对未启用动态时钟的玩家生效(参见[TogglePlayerClock](TogglePlayerClock))。 + +::: + +:::tip + +如需设置分钟或单独设置玩家时间,请参阅[SetPlayerTime](SetPlayerTime)。 + +::: + +## 相关函数 + +- [GetWorldTime](GetWorldTime): 获取当前全局时间 +- [SetPlayerTime](SetPlayerTime): 设置玩家时间 +- [SetWeather](SetWeather): 设置全局天气 +- [SetGravity](SetGravity): 设置全局重力 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowMenuForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowMenuForPlayer.md new file mode 100644 index 00000000000..4a4e4ccb95d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowMenuForPlayer.md @@ -0,0 +1,65 @@ +--- +title: ShowMenuForPlayer +sidebar_label: ShowMenuForPlayer +description: 向指定玩家显示已创建的菜单界面。 +tags: ["玩家", "菜单"] +--- + +## 描述 + +向指定玩家显示已创建的菜单界面。 + +| 参数名 | 描述 | +| ----------- | --------------------------------------- | +| Menu:menuid | 要显示的菜单 ID(通过 CreateMenu 创建) | +| playerid | 目标玩家 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(菜单或玩家不存在) + +## 示例 + +```c +new Menu:exampleMenu; + +public OnGameModeInit() +{ + // 创建双列菜单 + exampleMenu = CreateMenu("示例菜单", 2, 200.0, 100.0, 150.0, 150.0); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/menu", true) == 0) + { + // 显示菜单给玩家 + ShowMenuForPlayer(exampleMenu, playerid); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +传入无效的菜单 ID 将导致服务端与客户端同时崩溃! + +::: + +## 相关函数 + +- [CreateMenu](CreateMenu): 创建新菜单 +- [AddMenuItem](AddMenuItem): 添加菜单选项 +- [SetMenuColumnHeader](SetMenuColumnHeader): 设置菜单列标题 +- [DestroyMenu](DestroyMenu): 销毁菜单 + +## 相关回调 + +- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): 玩家选择菜单项时触发 +- [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu): 玩家退出菜单时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowNameTags.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowNameTags.md new file mode 100644 index 00000000000..8cae7a650d9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowNameTags.md @@ -0,0 +1,53 @@ +--- +title: ShowNameTags +sidebar_label: ShowNameTags +description: 切换玩家头顶名称标签、血条和护甲条的显示。 +tags: [] +--- + +## 描述 + +控制是否显示玩家头顶的名称标签、生命值条和护甲条。 + +| 名称 | 说明 | +| --------- | ------------------------------------------- | +| bool:显示 | 'false'禁用显示,'true'启用显示(默认启用) | + +## 返回值 + +本函数不返回任何特定值。 + +## 示例 + +```c +public OnGameModeInit() +{ + // 这将完全禁用所有玩家的名称标签 + //(包括血条和护甲条) + ShowNameTags(false); +} +``` + +## 注意 + +:::warning + +本函数只能在[OnGameModeInit](OnGameModeInit)回调中使用。其他场景请使用[ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer)。 + +::: + +:::tip + +也可通过[config.json](../../server/config.json)配置文件全局设置: + +```json +"use_nametags": false, +``` + +::: + +## 相关函数 + +- [DisableNameTagLOS](DisableNameTagLOS): 禁用名称标签的视线检测 +- [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): 显示/隐藏指定玩家的名称标签 +- [ShowPlayerMarkers](ShowPlayerMarkers): 控制玩家雷达标记的显示 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowObjectForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowObjectForPlayer.md new file mode 100644 index 00000000000..26eecdb64c5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowObjectForPlayer.md @@ -0,0 +1,55 @@ +--- +title: ShowObjectForPlayer +sidebar_label: ShowObjectForPlayer +description: 向玩家显示一个被隐藏的物体。 +tags: ["玩家", "物体"] +--- + + + +## 描述 + +向玩家显示一个通过 [HideObjectForPlayer](HideObjectForPlayer) 函数隐藏的物体。 + +## 参数 + +| 名称 | 说明 | +| -------- | ----------------------- | +| playerid | 玩家的 ID。 | +| objectid | 要显示给玩家的物体 ID。 | + +## 返回值 + +`true` - 函数执行成功。 + +`false` - 函数执行失败。指定的 playerid 或 objectid 不存在。 + +## 示例 + +```c +new gObject; + +public OnGameModeInit() +{ + gObject = CreateObject(1431, 921.12201, -1206.78613, 16.52670, 0.00000, 0.00000, 90.00000); + return 1; +} + +public OnPlayerConnect(playerid) +{ + HideObjectForPlayer(playerid, gObject); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + ShowObjectForPlayer(playerid, gObject); + return 1; +} +``` + +## 相关函数 + +- [HideObjectForPlayer](HideObjectForPlayer): 对玩家隐藏物体 +- [IsObjectHiddenForPlayer](IsObjectHiddenForPlayer): 检查物体是否对玩家隐藏 +- [CreateObject](CreateObject): 创建物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPickupForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPickupForPlayer.md new file mode 100644 index 00000000000..63d231eff97 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPickupForPlayer.md @@ -0,0 +1,58 @@ +--- +title: ShowPickupForPlayer +sidebar_label: ShowPickupForPlayer +description: 为特定玩家显示一个拾取物。 +tags: ["玩家", "拾取物"] +--- + + + +## 描述 + +为特定玩家显示一个拾取物。 + +| 参数 | 说明 | +| -------- | ------------------------- | +| playerid | 玩家的 ID | +| pickupid | 要为该玩家显示的拾取物 ID | + +## 返回值 + +本函数始终返回 **true**。 + +## 示例代码 + +```c +new g_Pickup; + +public OnGameModeInit() +{ + g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + ShowPickupForPlayer(playerid, g_Pickup); + return 1; +} +``` + +## 相关函数 + +- [CreatePickup](CreatePickup): 创建拾取物 +- [AddStaticPickup](AddStaticPickup): 添加静态拾取物 +- [DestroyPickup](DestroyPickup): 销毁拾取物 +- [IsValidPickup](IsValidPickup): 验证拾取物有效性 +- [IsPickupStreamedIn](IsPickupStreamedIn): 检测拾取物是否已为玩家流加载 +- [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): 检测拾取物是否对玩家隐藏 +- [SetPickupPos](SetPickupPos): 设置拾取物坐标 +- [GetPickupPos](GetPickupPos): 获取拾取物坐标 +- [SetPickupModel](SetPickupModel): 设置拾取物模型 +- [GetPickupModel](GetPickupModel): 获取拾取物模型 ID +- [SetPickupType](SetPickupType): 设置拾取物类型 +- [GetPickupType](GetPickupType): 获取拾取物类型 +- [SetPickupVirtualWorld](SetPickupVirtualWorld): 设置拾取物的虚拟世界 ID +- [GetPickupVirtualWorld](GetPickupVirtualWorld): 获取拾取物的虚拟世界 ID +- [HidePickupForPlayer](HidePickupForPlayer): 对玩家隐藏拾取物 +- [SetPickupForPlayer](SetPickupForPlayer): 为玩家调整拾取物模型、类型和坐标 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerDialog.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerDialog.md new file mode 100644 index 00000000000..fdec80e24a3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerDialog.md @@ -0,0 +1,97 @@ +--- +title: ShowPlayerDialog +sidebar_label: ShowPlayerDialog +description: 向玩家显示同步对话框(同一时间只能显示一个)。 +tags: ["玩家", "对话框"] +--- + +## 描述 + +向玩家显示同步对话框(同一时间只能显示一个)。 + +| 参数名称 | 说明 | +| ------------------ | ------------------------------------------------------------------------------------------- | +| playerid | 要显示对话框的玩家 ID | +| dialogid | 分配给该对话框的标识 ID(最大值 32767),用于后续处理响应。使用负值将关闭所有已打开的对话框 | +| DIALOG_STYLE:style | 对话框的[显示样式](../resources/dialogstyles) | +| const title[] | 对话框顶部标题。标题长度超过 64 字符会被截断 | +| const body[] | 对话框主体文本。使用\n 换行,\t 进行制表 | +| const button1[] | 左侧按钮文本 | +| const button2[] | 右侧按钮文本。留空("")可隐藏此按钮 | +| OPEN_MP_TAGS:... | 任意数量的可变参数 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +## 示例代码 + +```c +// 使用枚举定义对话框ID: +enum +{ + DIALOG_NULL, + DIALOG_LOGIN, + DIALOG_WELCOME, + DIALOG_WEAPONS +} + +// 或使用宏定义: +#define DIALOG_NULL 0 +#define DIALOG_LOGIN 1 +#define DIALOG_WELCOME 2 +#define DIALOG_WEAPONS 3 + +// 推荐使用枚举,可以避免ID管理问题。但枚举会占用内存存储,而宏定义在预处理器阶段处理。 + +// DIALOG_STYLE_MSGBOX 样式示例: +ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "通知", "你已成功连接服务器", "关闭", ""); + +// DIALOG_STYLE_INPUT 样式示例: +ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "登录", "请在下方输入密码:", "登录", "取消"); + +// DIALOG_STYLE_LIST 样式示例: +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "武器库", "AK47\nM4\n狙击步枪", "选项1", "选项2"); + +// DIALOG_STYLE_PASSWORD 样式示例: +ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "登录", "请在下方输入密码:", "登录", "取消"); + +// DIALOG_STYLE_TABLIST 样式示例: +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "购买武器", "沙鹰\t$5000\t100\n短管霰弹枪\t$5000\t100\n手枪\t$1000\t50", "选择", "取消"); + +// DIALOG_STYLE_TABLIST_HEADERS 样式示例: +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "购买武器", "武器\t价格\t弹药\n沙鹰\t$5000\t100\n短管霰弹枪\t$5000\t100\n手枪\t$1000\t50", "选择", "取消"); +``` + +## 注意事项 + +:::tip + +建议使用枚举(如上例)或宏定义来管理对话框 ID,避免直接使用数字造成混乱 + +::: + +:::tip + +- 可使用颜色嵌入代码实现多色文本 +- 使用**-1**作为 dialogid 可关闭客户端当前显示的所有对话框,也可使用[HidePlayerDialog](HidePlayerDialog)函数 + +::: + +## 相关函数 + +- [GetPlayerDialogID](GetPlayerDialogID): 获取玩家当前显示的对话框 ID +- [GetPlayerDialogData](GetPlayerDialogData): 获取玩家当前对话框数据 +- [HidePlayerDialog](HidePlayerDialog): 隐藏玩家当前显示的对话框 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示文本绘图 + +## 相关回调 + +- [OnDialogResponse](../callbacks/OnDialogResponse): 当玩家响应对话框时触发 + +## 相关资源 + +- [对话框样式](../resources/dialogstyles) +- [转义代码](../resources/escapecodes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerMarkers.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerMarkers.md new file mode 100644 index 00000000000..23e01b750d4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerMarkers.md @@ -0,0 +1,55 @@ +--- +title: ShowPlayerMarkers +sidebar_label: ShowPlayerMarkers +description: 切换玩家雷达标记(小地图上的光点显示状态)。 +tags: ["玩家"] +--- + +## 描述 + +切换玩家雷达标记(小地图上的光点显示状态)。必须在服务器启动时调用(OnGameModeInit 回调中)。如需运行时控制,请使用[SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer)。 + +| 参数名称 | 说明 | +| ------------------------ | -------------------------------------------------------------------------------- | +| PLAYER_MARKERS_MODE:mode | 使用的[标记模式](../resources/markermodes)。支持流式加载模式,仅对附近玩家可见。 | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + // 玩家标记仅对附近玩家可见 + ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED); +} +``` + +## 标记模式对照表 + +| ID | 模式标识符 | +| --- | ---------------------------------------- | +| 0 | PLAYER_MARKERS_MODE_OFF(禁用标记) | +| 1 | PLAYER_MARKERS_MODE_GLOBAL(全局显示) | +| 2 | PLAYER_MARKERS_MODE_STREAMED(流式加载) | + +## 注意事项 + +:::tip + +通过设置玩家颜色为完全透明(无 Alpha 通道值),可实现按玩家单独控制标记显示。此方法支持基于玩家的个性化标记显示方案。 + +::: + +## 相关函数 + +- [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): 为指定玩家设置标记显示 +- [LimitPlayerMarkerRadius](LimitPlayerMarkerRadius): 限制玩家标记可见范围 +- [ShowNameTags](ShowNameTags): 控制玩家名牌显示 +- [SetPlayerColor](SetPlayerColor): 设置玩家标识颜色 + +## 相关资源 + +- [标记模式说明](../resources/markermodes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerNameTagForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerNameTagForPlayer.md new file mode 100644 index 00000000000..e14a8814b6e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowPlayerNameTagForPlayer.md @@ -0,0 +1,55 @@ +--- +title: ShowPlayerNameTagForPlayer +sidebar_label: ShowPlayerNameTagForPlayer +description: 此函数允许您切换玩家头顶显示的玩家名称标签、生命条和护甲条的绘制。 +tags: ["玩家"] +--- + +## 描述 + +此函数允许您切换玩家头顶显示的玩家名称标签、生命条和护甲条的绘制。若需全局控制类似功能,请使用[ShowNameTags](ShowNameTags)函数。 + +| 参数 | 说明 | +| --------- | ------------------------------------- | +| playerid | 将看到此函数生效结果的观察者玩家 ID | +| targetid | 需要显示/隐藏名称标签的目标玩家 ID | +| bool:show | true 显示名称标签,false 隐藏名称标签 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + // 输入/nameoff的玩家将无法看到其他玩家的名称标签 + if (strcmp("/nameoff", cmdtext, true) == 0) + { + for (new i = 0; i < MAX_PLAYERS; i++) + { + ShowPlayerNameTagForPlayer(playerid, i, false); + } + GameTextForPlayer(playerid, "~W~名称标签 ~R~已关闭", 5000, 5); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::tip + +需先通过[ShowNameTags](ShowNameTags)启用全局名称标签显示,本函数才能生效。建议在玩家流加载时([OnPlayerStreamIn](../callbacks/OnPlayerStreamIn)回调)预先设置 ShowPlayerNameTagForPlayer(forplayerid, playerid, 0)。 + +::: + +## 相关函数 + +- [ShowNameTags](ShowNameTags): 设置名称标签显示开关 +- [DisableNameTagLOS](DisableNameTagLOS): 禁用名称标签的视线检测 +- [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): 设置玩家地图标记 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowVehicle.md new file mode 100644 index 00000000000..b22cfd2949f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ShowVehicle.md @@ -0,0 +1,55 @@ +--- +title: ShowVehicle +sidebar_label: ShowVehicle +description: 显示被隐藏的车辆。 +tags: ["车辆"] +--- + + + +:::warning + +警告:此功能尚未实现。 + +::: + +## 描述 + +显示被隐藏的车辆。 + +## 参数 + +| 名称 | 说明 | +| --------- | ----------------- | +| vehicleid | 要显示的车辆 ID。 | + +## 示例 + +```c +new g_Vehicle; + +public OnGameModeInit() +{ + g_Vehicle = CreateVehicle(536, 2496.5034, 5.6658, 27.2247, 180.0000, -1, -1, 60); + HideVehicle(g_Vehicle); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/showvehicle", true)) + { + if (IsVehicleHidden(g_Vehicle)) + { + ShowVehicle(g_Vehicle); + } + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [HideVehicle](HideVehicle): 从游戏中隐藏车辆 +- [IsVehicleHidden](IsVehicleHidden): 检查车辆是否被隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SpawnPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SpawnPlayer.md new file mode 100644 index 00000000000..466b38a2521 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SpawnPlayer.md @@ -0,0 +1,54 @@ +--- +title: SpawnPlayer +sidebar_label: SpawnPlayer +description: 生成或重新生成玩家。 +tags: ["玩家"] +--- + +## 描述 + +生成或重新生成玩家。 + +| 参数名称 | 说明 | +| -------- | ------------------- | +| playerid | 要生成的目标玩家 ID | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家未连接) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/spawn", true) == 0) + { + SpawnPlayer(playerid); + return 1; + } + return 0; +} +``` + +## 注意事项 + +:::warning + +已知问题: + +- 若玩家处于车辆中执行生成,会导致玩家手持瓶子异常(该问题已在 open.mp 修复) + +::: + +## 相关函数 + +- [IsPlayerSpawned](IsPlayerSpawned): 检测玩家是否处于生成状态 +- [SetSpawnInfo](SetSpawnInfo): 配置玩家生成参数 +- [AddPlayerClass](AddPlayerClass): 添加角色职业模板 + +## 相关回调 + +- [OnPlayerSpawn](../callbacks/OnPlayerSpawn): 玩家生成完成时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayback.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayback.md new file mode 100644 index 00000000000..0aa31e608c0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayback.md @@ -0,0 +1,28 @@ +--- +title: StartRecordingPlayback +sidebar_label: StartRecordingPlayback +description: 加载并运行存储在npcmodes/recordings目录下的.rec文件。这些录制文件允许NPC执行特定动作,可通过手动录制生成。更多信息请参考相关函数。 +tags: [] +--- + +## 描述 + +加载并运行存储在 npcmodes/recordings 目录下的.rec 文件。这些录制文件允许 NPC 执行特定动作,可通过手动录制生成。更多信息请参考相关函数。 + +| 名称 | 说明 | +| ------------ | -------------------------------------------- | +| playbacktype | 要加载的录制[类型](../resources/recordtypes) | +| recordname[] | 要加载的文件名(无需包含.rec 扩展名) | + +## 示例 + +```c +public OnNPCEnterVehicle(vehicleid, seatid) +{ + StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER, "at400_lv_to_sf_x1"); +} +``` + +## 相关函数 + +- [StopRecordingPlayback](../functions/StopRecordingPlayback): 停止回放.rec 文件 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayerData.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayerData.md new file mode 100644 index 00000000000..2dfa135fedc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StartRecordingPlayerData.md @@ -0,0 +1,46 @@ +--- +title: StartRecordingPlayerData +sidebar_label: StartRecordingPlayerData +description: 开始将玩家移动轨迹录制到文件,该文件后续可供NPC回放使用。 +tags: ["玩家"] +--- + +## 描述 + +开始将玩家移动轨迹录制到文件,该文件后续可供 NPC 回放使用。 + +| 参数 | 说明 | +| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| playerid | 待录制的玩家 ID | +| PLAYER_RECORDING_TYPE:recordType | [录制类型](../resources/recordtypes) | +| const recordFile[] | 存储录制数据的文件名。文件将保存至 scriptfiles 目录(自动添加.rec 扩展名),使用时需将文件移动至 npcmodes/recordings 目录进行回放。 | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +if (!strcmp("/recordme", cmdtext)) +{ + if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) + { + StartRecordingPlayerData(playerid, PLAYER_RECORDING_TYPE_ONFOOT, "MyFile"); + } + else if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) + { + StartRecordingPlayerData(playerid, PLAYER_RECORDING_TYPE_DRIVER, "MyFile"); + } + SendClientMessage(playerid, 0xFFFFFFFF, "您的所有移动轨迹正在被录制!"); + return 1; +} +``` + +## 相关函数 + +- [StopRecordingPlayerData](StopRecordingPlayerData): 停止录制玩家数据 + +## 相关资源 + +- [录制类型](../resources/recordtypes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopAudioStreamForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopAudioStreamForPlayer.md new file mode 100644 index 00000000000..d3b2f7626d3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopAudioStreamForPlayer.md @@ -0,0 +1,39 @@ +--- +title: 停止玩家音频流 +sidebar_label: StopAudioStreamForPlayer +description: 停止玩家当前正在播放的音频流。 +tags: ["玩家"] +--- + +## 描述 + +停止玩家当前正在播放的音频流。 + +## 参数 + +| 名称 | 说明 | +| -------- | ----------------------- | +| playerid | 要停止音频流的玩家 ID。 | + +## 返回值 + +此函数不返回任何特定值。 + +## 示例 + +```c +public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) +{ + // 当玩家离开车辆时 + if (oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) + { + StopAudioStreamForPlayer(playerid); // 停止音频流 + } + return 1; +} +``` + +## 相关函数 + +- [PlayAudioStreamForPlayer](PlayAudioStreamForPlayer): 为玩家播放音频流 +- [PlayerPlaySound](PlayerPlaySound): 为玩家播放音效 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopObject.md new file mode 100644 index 00000000000..3d88b9791fd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopObject.md @@ -0,0 +1,68 @@ +--- +title: StopObject +sidebar_label: StopObject +description: 停止通过MoveObject移动的物体。 +tags: ["物体"] +--- + +## 描述 + +停止通过[MoveObject](MoveObject)移动的物体。 + +| 参数名称 | 说明 | +| -------- | ------------------- | +| objectid | 要停止移动的物体 ID | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new gAirportGate; + +public OnGameModeInit() +{ + gAirportGate = CreateObject(980, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + + MoveObject(gAirportGate, 0.0, 0.0, 15.0, 1.00); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/stopobject", true) == 0) + { + StopObject(gAirportGate); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [CreateObject](CreateObject): 创建物体 +- [DestroyObject](DestroyObject): 销毁物体 +- [IsValidObject](IsValidObject): 验证物体有效性 +- [MoveObject](MoveObject): 移动物体 +- [SetObjectPos](SetObjectPos): 设置物体坐标 +- [SetObjectRot](SetObjectRot): 设置物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取物体坐标 +- [GetObjectRot](GetObjectRot): 获取物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将物体附加到玩家 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家专属物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [MovePlayerObject](MovePlayerObject): 移动玩家专属物体 +- [StopPlayerObject](StopPlayerObject): 停止玩家物体移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体坐标 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 附加玩家物体到玩家 + +## 相关回调 + +- [OnObjectMoved](../callbacks/OnObjectMoved): 物体停止移动时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerHoldingObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerHoldingObject.md new file mode 100644 index 00000000000..c8434a931f4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerHoldingObject.md @@ -0,0 +1,43 @@ +--- +title: StopPlayerHoldingObject +sidebar_label: StopPlayerHoldingObject +description: 移除附加物体 +tags: ["玩家"] +--- + +## 描述 + +移除玩家已附加的物体。 + +| 参数 | 说明 | +| -------- | --------------------- | +| playerid | 需要移除物体的玩家 ID | + +## 返回值 + +成功返回 1,失败返回 0 + +## 示例代码 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + if (IsPlayerHoldingObject(playerid)) + { + StopPlayerHoldingObject(playerid); + } + return 1; +} +``` + +## 注意事项 + +:::warning + +该函数已在 SA-MP 0.3c 版本中移除。请使用[RemovePlayerAttachedObject](RemovePlayerAttachedObject) + +::: + +## 相关函数 + +- [SetPlayerHoldingObject](SetPlayerHoldingObject): 将物体附加到骨骼 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerObject.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerObject.md new file mode 100644 index 00000000000..ee40eae031f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopPlayerObject.md @@ -0,0 +1,69 @@ +--- +title: StopPlayerObject +sidebar_label: StopPlayerObject +description: 停止正在移动的玩家物体(需配合MovePlayerObject使用后生效)。 +tags: ["玩家"] +--- + +## 描述 + +停止通过 MovePlayerObject 移动的玩家物体。 + +## 参数 + +| 名称 | 说明 | +| -------- | ------------------------- | +| playerid | 目标玩家的 ID。 | +| objectid | 要停止移动的玩家物体 ID。 | + +## 返回值 + +此函数不返回任何特定值。 + +## 示例 + +```c +new gPlayerObject[MAX_PLAYERS]; + +public OnPlayerConnect(playerid) +{ + gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); + + MovePlayerObject(playerid, gPlayerObject[playerid], 2001.195679, 1547.113892, 10.000000, 2.0); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (strcmp(cmdtext, "/stopobject", true) == 0) + { + StopPlayerObject(playerid, gPlayerObject[playerid]); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [MovePlayerObject](MovePlayerObject): 移动玩家物体 +- [CreatePlayerObject](CreatePlayerObject): 创建玩家专属物体 +- [DestroyPlayerObject](DestroyPlayerObject): 销毁玩家物体 +- [IsValidPlayerObject](IsValidPlayerObject): 验证玩家物体有效性 +- [IsPlayerObjectMoving](IsPlayerObjectMoving): 检测玩家物体是否在移动 +- [SetPlayerObjectPos](SetPlayerObjectPos): 设置玩家物体位置 +- [SetPlayerObjectRot](SetPlayerObjectRot): 设置玩家物体旋转角度 +- [GetPlayerObjectPos](GetPlayerObjectPos): 获取玩家物体坐标 +- [GetPlayerObjectRot](GetPlayerObjectRot): 获取玩家物体旋转角度 +- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): 将玩家物体附加到玩家 +- [CreateObject](CreateObject): 创建全局可见物体 +- [DestroyObject](DestroyObject): 销毁全局物体 +- [IsValidObject](IsValidObject): 验证全局物体有效性 +- [MoveObject](MoveObject): 移动全局物体 +- [IsObjectMoving](IsObjectMoving): 检测全局物体是否在移动 +- [StopObject](StopObject): 停止全局物体移动 +- [SetObjectPos](SetObjectPos): 设置全局物体位置 +- [SetObjectRot](SetObjectRot): 设置全局物体旋转角度 +- [GetObjectPos](GetObjectPos): 获取全局物体坐标 +- [GetObjectRot](GetObjectRot): 获取全局物体旋转角度 +- [AttachObjectToPlayer](AttachObjectToPlayer): 将全局物体附加到玩家 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayback.MD b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayback.MD new file mode 100644 index 00000000000..fff622e542f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayback.MD @@ -0,0 +1,23 @@ +--- +title: StopRecordingPlayback +sidebar_label: StopRecordingPlayback +description: 停止NPC当前正在运行的.rec文件,使其保持空闲状态直到接收到其他指令。 +tags: [] +--- + +## 描述 + +停止 NPC 当前正在运行的.rec 文件,使其保持空闲状态直到接收到其他指令。 + +## 示例代码 + +```c +public OnNPCExitVehicle(vehicleid, seatid) +{ + StopRecordingPlayback(); +} +``` + +## 相关函数 + +- [StartRecordingPlayback](../functions/StartRecordingPlayback): 开始播放.rec 文件 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayerData.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayerData.md new file mode 100644 index 00000000000..bad11347248 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/StopRecordingPlayerData.md @@ -0,0 +1,36 @@ +--- +title: StopRecordingPlayerData +sidebar_label: StopRecordingPlayerData +description: 停止指定玩家通过StartRecordingPlayerData开始的所有数据录制。 +tags: ["玩家"] +--- + +## 描述 + +停止指定玩家通过[StartRecordingPlayerData](StartRecordingPlayerData)开始的所有数据录制。 + +| 参数名称 | 说明 | +| -------- | ----------------------------- | +| playerid | 需要停止数据录制的目标玩家 ID | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp("/stoprecording", cmdtext)) + { + StopRecordingPlayerData(playerid); + SendClientMessage(playerid, 0xFFFFFFFF, "您的录制文件已保存至scriptfiles目录!"); + return 1; + } +} +``` + +## 相关函数 + +- [StartRecordingPlayerData](StartRecordingPlayerData): 开始录制玩家数据 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawAlignment.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawAlignment.md new file mode 100644 index 00000000000..b5cd062f728 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawAlignment.md @@ -0,0 +1,76 @@ +--- +title: TextDrawAlignment +sidebar_label: TextDrawAlignment +description: 设置文本绘图中文字的对齐方式。 +tags: ["文本绘图"] +--- + +## 描述 + +设置文本绘图中文字内容的对齐方式。 + +| 参数名称 | 说明 | +| ------------------------- | --------------------------------------------------------------------------------------------------------------- | +| Text:textid | 需要设置对齐方式的文本绘图 ID | +| TEXT_DRAW_ALIGN:alignment | 对齐模式:`TEXT_DRAW_ALIGN_LEFT`(左对齐)/ `TEXT_DRAW_ALIGN_CENTER`(居中)/ `TEXT_DRAW_ALIGN_RIGHT`(右对齐) | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +/* + TEXT_DRAW_ALIGN_LEFT + TEXT_DRAW_ALIGN_CENTER + TEXT_DRAW_ALIGN_RIGHT +*/ + +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 425.0, "这是一个示例文本绘图"); + TextDrawAlignment(gMyTextdraw, TEXT_DRAW_ALIGN_CENTER); // 设置文本内容居中对齐 + return 1; +} +``` + +## 注意事项 + +:::warning + +使用`TEXT_DRAW_ALIGN_CENTER`居中对齐时: + +- 必须交换[TextDrawTextSize](TextDrawTextSize)参数的 x/y 坐标值 +- 文本绘图的坐标定位点将变为中心点而非左上角 + +::: + +:::tip + +若文本绘图已处于显示状态,修改对齐方式后需重新调用显示函数([TextDrawShowForAll](TextDrawShowForAll)/[TextDrawShowForPlayer](TextDrawShowForPlayer))才能生效 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawGetAlignment](TextDrawGetAlignment): 获取当前对齐方式 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置边框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景色 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置绘制区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用边框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColor.md new file mode 100644 index 00000000000..a2af986c4a5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColor.md @@ -0,0 +1,68 @@ +--- +title: TextDrawBackgroundColor +sidebar_label: TextDrawBackgroundColor +description: 调整文本绘图区域的背景颜色(轮廓/阴影部分,非盒子背景。盒子颜色请使用[TextDrawBoxColor](TextDrawBoxColor)) +tags: ["文本绘图"] +--- + +## 描述 + +调整文本绘图区域的背景颜色(仅影响轮廓/阴影部分,盒子背景颜色需使用[TextDrawBoxColor](TextDrawBoxColor))。 + +| 参数 | 说明 | +| ---------------- | --------------------------- | +| Text:textid | 要设置背景颜色的文本绘图 ID | +| backgroundColour | 目标背景颜色值(ARGB 格式) | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 425.0, "示例文本绘图"); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBackgroundColor(gMyTextdraw, 0xFFFFFFFF); // 将文本绘图背景设为白色 + return 1; +} +``` + +## 注意事项 + +:::tip + +- 当使用[TextDrawSetOutline](TextDrawSetOutline)且尺寸>0 时,轮廓颜色将与本函数设置的颜色一致 +- 修改颜色值会影响[TextDrawColor](TextDrawColor)的文本颜色表现 + +::: + +:::tip + +已显示的文本绘图修改后无需重建,使用[TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll)即可刷新显示 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置盒子背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本轮廓 +- [TextDrawSetShadow](TextDrawSetShadow): 控制阴影显示 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColour.md new file mode 100644 index 00000000000..d9f63234808 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBackgroundColour.md @@ -0,0 +1,71 @@ +--- +title: TextDrawBackgroundColour +sidebar_label: TextDrawBackgroundColour +description: 设置文本绘图的背景颜色(轮廓/阴影颜色,非文本框颜色)。 +tags: ["文本绘图"] +--- + + + +## 描述 + +设置文本绘图元素的背景颜色(此颜色影响文本轮廓和阴影,若要设置文本框颜色请使用 [TextDrawBoxColour](TextDrawBoxColour))。 + +## 参数 + +| 名称 | 说明 | +| ---------------- | -------------------------- | +| Text:textid | 目标文本绘图的 ID | +| backgroundColour | 要设置的背景颜色值(RGBA) | + +## 返回值 + +此函数不返回任何特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 425.0, "示例文本绘图"); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBackgroundColour(gMyTextdraw, 0xFFFFFFFF); // 设置白色背景 + return 1; +} +``` + +## 注意事项 + +:::tip + +当使用 [TextDrawSetOutline](TextDrawSetOutline) 且轮廓尺寸大于 0 时,轮廓颜色将继承此背景颜色设置。修改此颜色值会影响 [TextDrawColour](TextDrawColour) 的最终显示效果。 + +::: + +:::tip + +修改已显示的文本绘图背景颜色时,无需重新创建元素。只需调用 [TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll) 重新显示即可立即生效。 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawColour](TextDrawColour): 设置文本字体颜色 +- [TextDrawBoxColour](TextDrawBoxColour): 设置文本框颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本轮廓 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColor.md new file mode 100644 index 00000000000..87fdc942b55 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColor.md @@ -0,0 +1,61 @@ +--- +title: TextDrawBoxColor +sidebar_label: TextDrawBoxColor +description: 调整文本框颜色(仅在TextDrawUseBox的'use'参数为1时生效)。 +tags: ["文本绘图"] +--- + +## 描述 + +调整文本框颜色(仅在 TextDrawUseBox 的'use'参数为'true'时生效)。 + +| 名称 | 说明 | +| ----------- | --------------------------------------------------------------------------------------------------------------- | +| Text:textid | 需要修改的文本绘图 | +| boxColour | 颜色值。透明度由颜色的 alpha 通道决定(例如 0x000000FF 表示完全不透明的黑色,而 0x000000AA 表示半透明的黑色)。 | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "Example"); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColor(gMyTextdraw, 0xFFFFFFFF); + return 1; +} +``` + +## 注意事项 + +:::tip + +如果您想更改已显示的文本绘图的框颜色,无需重新创建。只需在修改后使用[TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll)即可立即生效。 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawColor](TextDrawColor): 设置文本绘图字体颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置文本绘图背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置文本字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边效果 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例文本间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 对所有玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 对所有玩家隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColour.md new file mode 100644 index 00000000000..46cb5ba58c9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawBoxColour.md @@ -0,0 +1,63 @@ +--- +title: TextDrawBoxColour +sidebar_label: TextDrawBoxColour +description: 调整文本绘图的方框颜色(仅在 TextDrawUseBox 的 'enableBox' 参数为 'true' 时生效)。 +tags: ["文本绘图"] +--- + + + +## 描述 + +调整文本绘图的方框颜色(仅在 TextDrawUseBox 的 'enableBox' 参数设置为 'true' 时生效)。 + +| 参数名 | 说明 | +| ----------- | ---------------------------------------------------------------------------------------------------------------------- | +| Text:textid | 需要修改的文本绘图 | +| boxColour | 方框颜色。透明度由颜色的 alpha 通道决定(例如 0x000000FF 表示完全不透明的黑色方框,0x000000AA 表示半透明的黑色方框)。 | + +## 返回值 + +该函数没有特定返回值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "Example"); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColour(gMyTextdraw, 0xFFFFFFFF); + return 1; +} +``` + +## 注意事项 + +:::tip + +若要修改已显示的文本绘图的方框颜色,无需重新创建。只需在修改后使用[TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll)即可立即生效。 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 新建一个文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 删除指定文本绘图 +- [TextDrawColour](TextDrawColour): 调整文本绘图的文字颜色 +- [TextDrawBackgroundColour](TextDrawBackgroundColour): 修改文本绘图的背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 调整文本绘图的文字对齐方式 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 调节文本绘图的字符大小 +- [TextDrawTextSize](TextDrawTextSize): 定义文本绘图方框的尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本轮廓的显示状态 +- [TextDrawSetShadow](TextDrawSetShadow): 切换文本阴影的启用状态 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本字符的比例间距 +- [TextDrawUseBox](TextDrawUseBox): 控制文本绘图方框的显示开关 +- [TextDrawSetString](TextDrawSetString): 修改现有文本绘图的文字内容 +- [玩家文本绘图显示](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawShowForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏指定文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColor.md new file mode 100644 index 00000000000..0b851583864 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColor.md @@ -0,0 +1,60 @@ +--- +title: TextDrawColor +sidebar_label: TextDrawColor +description: 设置文本绘图的文字颜色 +tags: ["文本绘图"] +--- + +## 描述 + +设置文本绘图的文字颜色 + +| 参数名 | 说明 | +| ----------- | ------------------------------- | +| Text:textid | 需要修改颜色的文本绘图 ID | +| textColour | 要设置的文字颜色值(RGBA 格式) | + +## 返回值 + +该函数不返回任何特定值 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "示例文字"); + TextDrawColor(gMyTextdraw, 0x000000FF); + return 1; +} +``` + +## 注意事项 + +:::tip + +若文本绘图已显示,必须重新显示([TextDrawShowForAll](TextDrawShowForAll)/[TextDrawShowForPlayer](TextDrawShowForPlayer))才能使本函数修改生效 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本绘图方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置文本绘图背景色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本绘图字体 +- [TextDrawLetterSize](TextDrawLetterSize): 设置文本字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本绘图区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边效果 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文字比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换文本方框显示状态 +- [TextDrawSetString](TextDrawSetString): 更新文本绘图内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 为全体玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 为全体玩家隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColour.md new file mode 100644 index 00000000000..308a14edfe2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawColour.md @@ -0,0 +1,62 @@ +--- +title: TextDrawColour +sidebar_label: TextDrawColour +description: 设置文本绘图的文字颜色 +tags: ["文本绘图"] +--- + + + +## 描述 + +设置文本绘图的文字颜色 + +| 参数名 | 说明 | +| ----------- | ------------------------------- | +| Text:textid | 需要修改颜色的文本绘图 ID | +| textColour | 要设置的文字颜色值(RGBA 格式) | + +## 返回值 + +该函数不返回任何特定值 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "示例文字"); + TextDrawColour(gMyTextdraw, 0x000000FF); + return 1; +} +``` + +## 注意事项 + +:::tip + +若文本绘图已显示,必须重新显示([TextDrawShowForAll](TextDrawShowForAll)/[TextDrawShowForPlayer](TextDrawShowForPlayer))才能使本函数修改生效 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawBoxColour](TextDrawBoxColour): 设置文本绘图方框颜色 +- [TextDrawBackgroundColour](TextDrawBackgroundColour): 设置文本绘图背景色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本绘图字体 +- [TextDrawLetterSize](TextDrawLetterSize): 设置文本字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本绘图区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边效果 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文字比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换文本方框显示状态 +- [TextDrawSetString](TextDrawSetString): 更新文本绘图内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 为全体玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 为全体玩家隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md new file mode 100644 index 00000000000..30754e623bb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md @@ -0,0 +1,107 @@ +--- +title: TextDrawCreate +sidebar_label: TextDrawCreate +description: 创建文本绘图 +tags: ["文本绘图"] +--- + +## 描述 + +创建文本绘图。文本绘图(正如其名)是绘制在玩家屏幕上的文字元素(主要形式),也可包含方框、精灵和模型预览(皮肤/车辆/武器/物体等)。详见[文本绘图专题页面](../resources/textdrawsprites)获取详细信息。 + +| 参数名 | 说明 | +| ---------------- | --------------------------------------------- | +| Float:x | 文本绘图的横向坐标(基于 640x480 基准坐标系) | +| Float:y | 文本绘图的纵向坐标(基于 640x480 基准坐标系) | +| const format[] | 文本绘图的显示内容(支持格式化字符串) | +| OPEN_MP_TAGS:... | 不定数量的参数(支持任意标签类型) | + +## 返回值 + +创建的文本绘图 ID(从**0**开始递增) + +## 示例 + +```c +// 此变量用于存储文本绘图ID +// 以便在脚本中全局使用 +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + // 创建文本绘图 + // 注意:此示例创建无格式化的基础文本 + gMyTextdraw = TextDrawCreate(240.0, 580.0, "欢迎来到我的OPEN.MP服务器"); + return 1; +} + +public OnPlayerConnect(playerid) +{ + // 当玩家连接时显示文本绘图 + TextDrawShowForPlayer(playerid, gMyTextdraw); + return 1; +} +``` + +## 注意事项 + +:::tip + +- `x, y`坐标基于 640x480 虚拟画布定位(与屏幕分辨率无关),表示文本区域左上角坐标 +- 若使用[TextDrawAlignment](TextDrawAlignment)设置右对齐(`TEXT_DRAW_ALIGN_RIGHT`),`x, y`将作为文本区域的右上角坐标 +- 本函数仅创建文本绘图,需调用[TextDrawShowForPlayer](TextDrawShowForPlayer)或[TextDrawShowForAll](TextDrawShowForAll)方可显示 +- 建议使用整数值而非小数坐标,以确保不同分辨率下的显示兼容性 + +::: + +:::warning + +键盘按键映射代码(如~k~~VEHICLE_ENTER_EXIT~)在第 255 个字符后失效 + +::: + +## 相关函数 + +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 +- [IsTextDrawVisibleForPlayer](IsTextDrawVisibleForPlayer): 检测可见性 +- [IsValidTextDraw](IsValidTextDraw): 验证有效性 +- [TextDrawGetAlignment](TextDrawGetAlignment): 获取对齐方式 +- [TextDrawGetBackgroundColour](TextDrawGetBackgroundColour): 获取背景色 +- [TextDrawGetBoxColour](TextDrawGetBoxColour): 获取方框颜色 +- [TextDrawGetColour](TextDrawGetColour): 获取文本颜色 +- [TextDrawGetFont](TextDrawGetFont): 获取字体类型 +- [TextDrawGetLetterSize](TextDrawGetLetterSize): 获取字符尺寸 +- [TextDrawGetOutline](TextDrawGetOutline): 获取描边厚度 +- [TextDrawGetPos](TextDrawGetPos): 获取坐标位置 +- [TextDrawGetPreviewModel](TextDrawGetPreviewModel): 获取 3D 预览模型 +- [TextDrawGetPreviewRot](TextDrawGetPreviewRot): 获取 3D 模型旋转参数 +- [TextDrawGetPreviewVehCol](TextDrawGetPreviewVehCol): 获取车辆预览颜色 +- [TextDrawGetPreviewVehicleColours](TextDrawGetPreviewVehicleColours): 获取车辆配色方案 +- [TextDrawGetShadow](TextDrawGetShadow): 获取阴影尺寸 +- [TextDrawGetString](TextDrawGetString): 获取文本内容 +- [TextDrawGetTextSize](TextDrawGetTextSize): 获取文本区域尺寸 +- [TextDrawIsBox](TextDrawIsBox): 检测方框状态 +- [TextDrawIsProportional](TextDrawIsProportional): 检测比例间距 +- [TextDrawIsSelectable](TextDrawIsSelectable): 检测可选状态 +- [TextDrawSetPos](TextDrawSetPos): 设置坐标位置 +- [TextDrawSetStringForPlayer](TextDrawSetStringForPlayer): 玩家专属文本更新 + +## 相关资源 + +- [文本绘图精灵使用指南](../resources/textdrawsprites) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawDestroy.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawDestroy.md new file mode 100644 index 00000000000..9fcd67720e4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawDestroy.md @@ -0,0 +1,56 @@ +--- +title: TextDrawDestroy +sidebar_label: TextDrawDestroy +description: 销毁先前创建的文本绘图。 +tags: ["文本绘图"] +--- + +## 描述 + +销毁先前创建的文本绘图。 + +| 名称 | 说明 | +| ----------- | --------------------------------------------- | +| Text:textid | 需要销毁的文本绘图 ID,由 TextDrawCreate 返回 | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(240.0, 580.0, "欢迎来到我的OPEN.MP服务器"); + return 1; +} + +public OnGameModeExit() +{ + TextDrawDestroy(gMyTextdraw); + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawColor](TextDrawColor): 设置文本字体颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawFont.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawFont.md new file mode 100644 index 00000000000..abb997c37f9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawFont.md @@ -0,0 +1,76 @@ +--- +title: TextDrawFont +sidebar_label: TextDrawFont +description: 更改文本字体 +tags: ["文本绘图"] +--- + +## 描述 + +更改文本绘图的字体样式 + +| 参数名 | 说明 | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Text:textid | 需要修改的文本绘图 ID | +| TEXT_DRAW_FONT:font | SA-MP 提供四种字体样式选择机制:1. ​**字体值 4** 表示使用 txd 精灵图字体 2. ​**字体值 5** 用于 3D 模型预览显示功能 3. ​**字体值 >5** 时文本内容将不可见 4. ​**字体值 >16** 会导致客户端程序崩溃 | + +可用样式预览: +![可用样式](https://assets.open.mp/assets/images/textdraws/Textdraw_font_styles.png) + +字体效果展示: +![字体效果](https://assets.open.mp/assets/images/textdraws/Textdraw_Fonts.png) + +## 返回值 + +该函数不返回任何特定值 + +## 示例 + +```c +/* + TEXT_DRAW_FONT_0 + TEXT_DRAW_FONT_1 + TEXT_DRAW_FONT_2 + TEXT_DRAW_FONT_3 + TEXT_DRAW_FONT_SPRITE_DRAW + TEXT_DRAW_FONT_MODEL_PREVIEW +*/ + +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 425.0, "示例文本绘图"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_2); + return 1; +} +``` + +## 注意事项 + +:::tip + +修改已显示的文本绘图字体后,无需重新创建,只需调用[TextDrawShowForPlayer](TextDrawShowForPlayer)或[TextDrawShowForAll](TextDrawShowForAll)即可刷新显示效果 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawGetFont](TextDrawGetFont): 获取文本字体 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetAlignment.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetAlignment.md new file mode 100644 index 00000000000..7ebb14b280d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetAlignment.md @@ -0,0 +1,56 @@ +--- +title: TextDrawGetAlignment +sidebar_label: TextDrawGetAlignment +description: 获取文本绘图的文本对齐方式。 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图的文本对齐方式。 + +| 名称 | 说明 | +| ----------- | ----------------------------- | +| Text:textid | 需要获取对齐方式的文本绘图 ID | + +## 返回值 + +返回文本绘图的文本对齐方式。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 425.0, "这是一个示例文本绘图"); + TextDrawAlignment(gMyTextdraw, TEXT_DRAW_ALIGN_CENTER); + + new TEXT_DRAW_ALIGN:align = TextDrawGetAlignment(gMyTextdraw); + // align = TEXT_DRAW_ALIGN_CENTER + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawColor](TextDrawColor): 设置文本字体颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColor.md new file mode 100644 index 00000000000..684d08ea11e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColor.md @@ -0,0 +1,57 @@ +--- +title: TextDrawGetBackgroundColor +sidebar_label: TextDrawGetBackgroundColor +description: 获取文本绘图的背景颜色 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取指定文本绘图的背景颜色 + +| 参数名 | 说明 | +| ----------- | ----------------------------- | +| Text:textid | 需要获取背景颜色的文本绘图 ID | + +## 返回值 + +返回文本绘图的背景颜色值(RGBA 格式) + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "Example"); + TextDrawSetOutline(gMyTextdraw, 1); + TextDrawBackgroundColor(gMyTextdraw, 0xFF0000FF); + + new backgroundColor = TextDrawGetBackgroundColor(gMyTextdraw); + // backgroundColor = 0xFF0000FF + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 新建一个文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 删除指定文本绘图 +- [TextDrawBoxColor](TextDrawBoxColor): 调整文本绘图的背景方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 修改文本绘图的背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 调整文本绘图的文字对齐方式 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 调节文本绘图的字符大小 +- [TextDrawTextSize](TextDrawTextSize): 定义文本绘图方框的尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本轮廓的显示状态 +- [TextDrawSetShadow](TextDrawSetShadow): 切换文本阴影的启用状态 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本字符的比例间距 +- [TextDrawUseBox](TextDrawUseBox): 控制文本绘图方框的显示开关 +- [TextDrawSetString](TextDrawSetString): 修改现有文本绘图的文字内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏指定文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColour.md new file mode 100644 index 00000000000..918846d2010 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBackgroundColour.md @@ -0,0 +1,57 @@ +--- +title: TextDrawGetBackgroundColour +sidebar_label: TextDrawGetBackgroundColour +description: 获取文本绘图的背景颜色 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取指定文本绘图的背景颜色 + +| 参数名 | 说明 | +| ----------- | ----------------------------- | +| Text:textid | 需要获取背景颜色的文本绘图 ID | + +## 返回值 + +返回文本绘图的背景颜色值(RGBA 格式) + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "Example"); + TextDrawSetOutline(gMyTextdraw, 1); + TextDrawBackgroundColour(gMyTextdraw, 0xFF0000FF); + + new backgroundColour = TextDrawGetBackgroundColour(gMyTextdraw); + // backgroundColour = 0xFF0000FF + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 新建一个文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 删除指定文本绘图 +- [TextDrawBoxColour](TextDrawBoxColour): 调整文本绘图的背景方框颜色 +- [TextDrawBackgroundColour](TextDrawBackgroundColour): 修改文本绘图的背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 调整文本绘图的文字对齐方式 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 调节文本绘图的字符大小 +- [TextDrawTextSize](TextDrawTextSize): 定义文本绘图方框的尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本轮廓的显示状态 +- [TextDrawSetShadow](TextDrawSetShadow): 切换文本阴影的启用状态 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本字符的比例间距 +- [TextDrawUseBox](TextDrawUseBox): 控制文本绘图方框的显示开关 +- [TextDrawSetString](TextDrawSetString): 修改现有文本绘图的文字内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏指定文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColor.md new file mode 100644 index 00000000000..6b33c68a164 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColor.md @@ -0,0 +1,57 @@ +--- +title: TextDrawGetBoxColor +sidebar_label: TextDrawGetBoxColor +description: 获取文本绘图的文本框颜色。 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图的文本框颜色。 + +| 名称 | 说明 | +| ----------- | ------------------------- | +| Text:textid | 需要获取颜色的文本绘图 ID | + +## 返回值 + +返回文本绘图的文本框颜色。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "示例"); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColor(gMyTextdraw, 0xAA0000FF); + + new boxColor = TextDrawGetBoxColor(gMyTextdraw); + // boxColor = 0xAA0000FF + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColour.md new file mode 100644 index 00000000000..4c047bf4540 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetBoxColour.md @@ -0,0 +1,57 @@ +--- +title: TextDrawGetBoxColour +sidebar_label: TextDrawGetBoxColour +description: 获取文本绘图方框颜色 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图方框的颜色值 + +| 参数名 | 说明 | +| ----------- | ----------------------------- | +| Text:textid | 需要获取方框颜色的文本绘图 ID | + +## 返回值 + +返回文本绘图的方框颜色值(RGBA 格式) + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "示例文本"); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColour(gMyTextdraw, 0xAA0000FF); + + new boxColour = TextDrawGetBoxColour(gMyTextdraw); + // boxColour = 0xAA0000FF + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawBoxColour](TextDrawBoxColour): 设置方框颜色 +- [TextDrawBackgroundColour](TextDrawBackgroundColour): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColor.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColor.md new file mode 100644 index 00000000000..091d883f887 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColor.md @@ -0,0 +1,56 @@ +--- +title: TextDrawGetColor +sidebar_label: TextDrawGetColor +description: 获取文本绘图的字体颜色。 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图的字体颜色。 + +| 名称 | 说明 | +| ----------- | ------------------------- | +| Text:textid | 需要获取颜色的文本绘图 ID | + +## 返回值 + +返回文本绘图的字体颜色。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "示例"); + TextDrawColor(gMyTextdraw, 0xFF0000FF); + + new color = TextDrawGetColor(gMyTextdraw); + // color = 0xFF0000FF + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColour.md new file mode 100644 index 00000000000..f325428b143 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetColour.md @@ -0,0 +1,56 @@ +--- +title: TextDrawGetColour +sidebar_label: TextDrawGetColour +description: 获取文本绘图的文字颜色 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取指定文本绘图的文字颜色 + +| 参数名 | 说明 | +| ----------- | ----------------------------- | +| Text:textid | 需要获取文字颜色的文本绘图 ID | + +## 返回值 + +返回文本绘图的文字颜色值(RGBA 格式) + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "Example"); + TextDrawColour(gMyTextdraw, 0xFF0000FF); + + new colour = TextDrawGetColour(gMyTextdraw); + // colour = 0xFF0000FF + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 新建一个文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 删除指定文本绘图 +- [TextDrawBoxColour](TextDrawBoxColour): 调整文本绘图的背景方框颜色 +- [TextDrawBackgroundColour](TextDrawBackgroundColour): 修改文本绘图的背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 调整文本绘图的文字对齐方式 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 调节文本绘图的字符大小 +- [TextDrawTextSize](TextDrawTextSize): 定义文本绘图方框的尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本轮廓的显示状态 +- [TextDrawSetShadow](TextDrawSetShadow): 切换文本阴影的启用状态 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本字符的比例间距 +- [TextDrawUseBox](TextDrawUseBox): 控制文本绘图方框的显示开关 +- [TextDrawSetString](TextDrawSetString): 修改现有文本绘图的文字内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏指定文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetFont.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetFont.md new file mode 100644 index 00000000000..8ae1a4546a8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetFont.md @@ -0,0 +1,57 @@ +--- +title: TextDrawGetFont +sidebar_label: TextDrawGetFont +description: 获取文本绘图字体 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图的字体样式 + +| 参数名 | 说明 | +| ----------- | ------------------------- | +| Text:textid | 需要获取字体的文本绘图 ID | + +## 返回值 + +返回文本绘图的字体值 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 425.0, "示例文本绘图"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_2); + + new TEXT_DRAW_FONT:font = TextDrawGetFont(gMyTextdraw); + printf("当前字体: %d", font); // 输出:当前字体: 2 + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetLetterSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetLetterSize.md new file mode 100644 index 00000000000..40234fe04c7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetLetterSize.md @@ -0,0 +1,60 @@ +--- +title: TextDrawGetLetterSize +sidebar_label: TextDrawGetLetterSize +description: 获取字符的宽度和高度。 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取字符的宽度和高度。 + +| 名称 | 说明 | +| ------------- | ------------------------------------ | +| Text:textid | 需要获取字符尺寸的文本绘图 ID | +| &Float:width | 用于存储宽度的浮点变量(按引用传递) | +| &Float:height | 用于存储高度的浮点变量(按引用传递) | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0,"示例文本绘图"); + TextDrawLetterSize(gMyTextdraw, 3.2, 5.1); + + new Float:width, Float:height; + TextDrawGetLetterSize(gMyTextdraw, width, height); + // 此时`width`将为3.2,`height`将为5.1 + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawColor](TextDrawColor): 设置字体颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetOutline.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetOutline.md new file mode 100644 index 00000000000..19c50c44113 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetOutline.md @@ -0,0 +1,57 @@ +--- +title: TextDrawGetOutline +sidebar_label: TextDrawGetOutline +description: 获取文本绘图文字描边厚度 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图文字描边的厚度值 + +| 参数名 | 说明 | +| ----------- | ----------------------------- | +| Text:textid | 需要获取描边厚度的文本绘图 ID | + +## 返回值 + +返回文本绘图的描边厚度值(整数型) + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawSetOutline(gMyTextdraw, 1); + + new outline = TextDrawGetOutline(gMyTextdraw); + // outline = 1 + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文本绘图描边厚度 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPos.md new file mode 100644 index 00000000000..cf8fe736867 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPos.md @@ -0,0 +1,55 @@ +--- +title: TextDrawGetPos +sidebar_label: TextDrawGetPos +description: 获取文本绘图的位置 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图在屏幕中的坐标位置(X 轴与 Y 轴) + +| 参数名 | 说明 | +| ----------- | --------------------------------------- | +| Text:textid | 需要获取位置的文本绘图 ID | +| &Float:x | 用于存储 X 坐标的浮点变量(按引用传递) | +| &Float:y | 用于存储 Y 坐标的浮点变量(按引用传递) | + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "Example TextDraw"); + + new Float:x, Float:y; + TextDrawGetPos(gMyTextdraw, x, y); + // x的值将为100.0,y的值将为33.0 + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 新建一个文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 删除指定文本绘图 +- [TextDrawSetPos](TextDrawSetPos): 调整文本绘图的屏幕坐标 +- [TextDrawColor](TextDrawColor): 调整文本绘图的文字颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 修改文本绘图的背景方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 修改文本绘图的背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 调整文本绘图的文字对齐方式 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 调节文本绘图的字符大小 +- [TextDrawTextSize](TextDrawTextSize): 定义文本绘图方框的尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本轮廓的显示状态 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本字符的比例间距 +- [TextDrawUseBox](TextDrawUseBox): 控制文本绘图方框的显示开关 +- [TextDrawSetString](TextDrawSetString): 修改现有文本绘图的文字内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏指定文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewModel.md new file mode 100644 index 00000000000..1e4d5306d63 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewModel.md @@ -0,0 +1,61 @@ +--- +title: TextDrawGetPreviewModel +sidebar_label: TextDrawGetPreviewModel +description: 获取3D预览文本绘图的展示模型 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取 3D 预览文本绘图所使用的模型 ID + +| 参数名 | 说明 | +| ----------- | --------------------------------- | +| Text:textid | 需要获取模型的 3D 预览文本绘图 ID | + +## 返回值 + +返回 3D 文本绘图的预览模型 ID + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColor(gMyTextdraw, 0x000000FF); + TextDrawTextSize(gMyTextdraw, 40.0, 40.0); + TextDrawSetPreviewModel(gMyTextdraw, 411); + + new previewModel = TextDrawGetPreviewModel(gMyTextdraw); + // previewModel = 411(Infernus车辆模型ID) + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawSetPreviewModel](TextDrawSetPreviewModel): 设置 3D 预览模型 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewRot.md new file mode 100644 index 00000000000..602741b49df --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewRot.md @@ -0,0 +1,57 @@ +--- +title: TextDrawGetPreviewRot +sidebar_label: TextDrawGetPreviewRot +description: 获取3D模型预览文本绘图的旋转参数与缩放值 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取 3D 模型预览文本绘图的旋转角度与缩放比例 + +| 参数名 | 说明 | +| ---------------- | ----------------------------------------- | +| Text:textid | 需要获取参数的 3D 模型预览文本绘图 ID | +| &Float:rotationX | 存储 X 轴旋转角度的浮点变量(按引用传递) | +| &Float:rotationY | 存储 Y 轴旋转角度的浮点变量(按引用传递) | +| &Float:rotationZ | 存储 Z 轴旋转角度的浮点变量(按引用传递) | +| &Float:zoom | 存储缩放比例的浮点变量(按引用传递) | + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColor(gMyTextdraw, 0x000000FF); + TextDrawTextSize(gMyTextdraw, 40.0, 40.0); + TextDrawSetPreviewModel(gMyTextdraw, 411); + TextDrawSetPreviewRot(gMyTextdraw, -10.0, 0.0, -20.0, 1.0); + + new Float:rotationX, Float:rotationY, Float:rotationZ, Float:zoom; + TextDrawGetPreviewRot(gMyTextdraw, rotationX, rotationY, rotationZ, zoom); + // rotationX的值为-10.0 + // rotationY的值为0.0 + // rotationZ的值为-20.0 + // zoom的值为1.0 + return 1; +} +``` + +## 相关函数 + +- [TextDrawSetPreviewRot](TextDrawSetPreviewRot): 设置 3D 模型预览文本绘图的旋转与缩放 +- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): 设置玩家专属 3D 文本绘图的预览旋转 +- [TextDrawSetPreviewModel](TextDrawSetPreviewModel): 定义文本绘图显示的 3D 预览模型 +- [TextDrawSetPreviewVehCol](TextDrawSetPreviewVehCol): 调整 3D 预览中车辆的配色方案 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehCol.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehCol.md new file mode 100644 index 00000000000..819ef82ac5e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehCol.md @@ -0,0 +1,51 @@ +--- +title: TextDrawGetPreviewVehCol +sidebar_label: TextDrawGetPreviewVehCol +description: 获取3D预览文本绘图的车辆颜色。 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取 3D 预览文本绘图的车辆颜色。 + +| 名称 | 说明 | +| ----------- | ---------------------------------- | +| Text:textid | 需要获取车辆颜色的文本绘图 ID | +| &colour1 | 用于存储主颜色的变量(按引用传递) | +| &colour2 | 用于存储副颜色的变量(按引用传递) | + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColor(gMyTextdraw, 0x000000FF); + TextDrawTextSize(gMyTextdraw, 40.0, 40.0); + TextDrawSetPreviewModel(gMyTextdraw, 411); + TextDrawSetPreviewVehCol(gMyTextdraw, 6, 8); + + new colour1, colour2; + TextDrawGetPreviewVehCol(gMyTextdraw, colour1, colour2); + // colour1 = 6 + // colour2 = 8 + return 1; +} +``` + +## 相关函数 + +- [TextDrawSetPreviewModel](TextDrawSetPreviewModel): 设置文本绘图的 3D 预览模型 +- [TextDrawSetPreviewRot](TextDrawSetPreviewRot): 设置 3D 预览的旋转参数 +- [TextDrawFont](TextDrawFont): 设置文本绘图字体样式 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehicleColours.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehicleColours.md new file mode 100644 index 00000000000..e338958dbec --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetPreviewVehicleColours.md @@ -0,0 +1,51 @@ +--- +title: TextDrawGetPreviewVehicleColours +sidebar_label: TextDrawGetPreviewVehicleColours +description: 获取3D预览文本绘图的车辆配色方案 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取 3D 预览文本绘图所使用的车辆颜色参数 + +| 参数名 | 说明 | +| ----------- | ------------------------------------ | +| Text:textid | 需要获取配色的 3D 预览文本绘图 ID | +| &colour1 | 用于存储车辆主色的变量(按引用传递) | +| &colour2 | 用于存储车辆次色的变量(按引用传递) | + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColour(gMyTextdraw, 0x000000FF); + TextDrawTextSize(gMyTextdraw, 40.0, 40.0); + TextDrawSetPreviewModel(gMyTextdraw, 411); + TextDrawSetPreviewVehicleColours(gMyTextdraw, 6, 8); + + new colour1, colour2; + TextDrawGetPreviewVehicleColours(gMyTextdraw, colour1, colour2); + // colour1 = 6(车辆主色) + // colour2 = 8(车辆次色) + return 1; +} +``` + +## 相关函数 + +- [TextDrawSetPreviewModel](TextDrawSetPreviewModel): 设置 3D 预览模型 +- [TextDrawSetPreviewRot](TextDrawSetPreviewRot): 设置 3D 模型旋转参数 +- [TextDrawFont](TextDrawFont): 设置字体类型 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetShadow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetShadow.md new file mode 100644 index 00000000000..f27285c3ff9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetShadow.md @@ -0,0 +1,57 @@ +--- +title: TextDrawGetShadow +sidebar_label: TextDrawGetShadow +description: 获取文本绘图阴影尺寸 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图文字的阴影尺寸 + +| 参数名 | 说明 | +| ----------- | ----------------------------- | +| Text:textid | 需要获取阴影尺寸的文本绘图 ID | + +## 返回值 + +返回文本绘图的阴影尺寸值(整数型) + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawSetShadow(gMyTextdraw, 1); + + new shadow = TextDrawGetShadow(gMyTextdraw); + // shadow = 1 + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetString.md new file mode 100644 index 00000000000..c484a459f02 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetString.md @@ -0,0 +1,60 @@ +--- +title: TextDrawGetString +sidebar_label: TextDrawGetString +description: 获取文本绘图的文字内容 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取指定文本绘图的文字内容 + +| 参数名 | 说明 | +| ---------------------------- | ------------------------------------ | +| Text:textid | 需要获取文字的文本绘图 ID | +| string[] | 存储文本内容的字符数组(按引用传递) | +| stringSize = sizeof (string) | 数组容量上限 | + +## 返回值 + +该函数没有特定返回值 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "Hello World!"); + + new string[16]; + TextDrawGetString(gMyTextdraw, string, sizeof(string)); + // string数组现在存储着'Hello World!' + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 新建一个文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 删除指定文本绘图 +- [TextDrawColor](TextDrawColor): 调整文本绘图的文字颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 修改文本绘图的背景方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 修改文本绘图的背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 调整文本绘图的文字对齐方式 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 调节文本绘图的字符大小 +- [TextDrawTextSize](TextDrawTextSize): 定义文本绘图方框的尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本轮廓的显示状态 +- [TextDrawSetShadow](TextDrawSetShadow): 切换文本阴影的启用状态 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本字符的比例间距 +- [TextDrawUseBox](TextDrawUseBox): 控制文本绘图方框的显示开关 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏指定文本绘图 +- [TextDrawSetString](TextDrawSetString): 修改文本绘图的文字内容 +- [PlayerTextDrawGetString](PlayerTextDrawGetString): 获取玩家专属文本绘图的文字 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetTextSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetTextSize.md new file mode 100644 index 00000000000..3d380660acc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawGetTextSize.md @@ -0,0 +1,60 @@ +--- +title: TextDrawGetTextSize +sidebar_label: TextDrawGetTextSize +description: 获取文本绘图的X轴和Y轴尺寸。 +tags: ["文本绘图"] +--- + + + +## 描述 + +获取文本绘图的 X 轴和 Y 轴尺寸。 + +| 名称 | 说明 | +| ------------- | ------------------------------------ | +| Text:textid | 需要获取尺寸的文本绘图 ID | +| &Float:width | 用于存储宽度的浮点变量(按引用传递) | +| &Float:height | 用于存储高度的浮点变量(按引用传递) | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawTextSize(gMyTextdraw, 2.0, 3.6); + + new Float:width, Float:height; + TextDrawGetTextSize(gMyTextdraw, width, height); + // 此时`width`将为2.0,`height`将为3.6 + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawColor](TextDrawColor): 设置字体颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForAll.md new file mode 100644 index 00000000000..375799f7594 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForAll.md @@ -0,0 +1,51 @@ +--- +title: TextDrawHideForAll +sidebar_label: TextDrawHideForAll +description: 隐藏所有玩家可见的文本绘图 +tags: ["文本绘图"] +--- + +## 描述 + +隐藏指定文本绘图对所有玩家的显示 + +| 参数名 | 说明 | +| ----------- | ------------------------------------------------------------------------- | +| Text:textid | 需要隐藏的文本绘图 ID
该 ID 由[创建文本绘图](TextDrawCreate)函数返回 | + +## 返回值 + +该函数没有特定返回值 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(240.0, 580.0, "示例文本"); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/showtd", true)) + { + TextDrawShowForAll(gMyTextdraw); + return 1; + } + if (!strcmp(cmdtext, "/hidetd", true)) + { + TextDrawHideForAll(gMyTextdraw); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForPlayer.md new file mode 100644 index 00000000000..66ec0507f9a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawHideForPlayer.md @@ -0,0 +1,56 @@ +--- +title: TextDrawHideForPlayer +sidebar_label: TextDrawHideForPlayer +description: 对指定玩家隐藏文本绘图。 +tags: ["玩家", "文本绘图"] +--- + +## 描述 + +对指定玩家隐藏文本绘图。 + +| 名称 | 说明 | +| ----------- | ------------------------- | +| playerid | 需要隐藏文本绘图的玩家 ID | +| Text:textid | 需要隐藏的文本绘图 ID | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(123.0, 123.0, "示例"); + return 1; +} + +public OnGameModeExit() +{ + TextDrawDestroy(gMyTextdraw); + return 1; +} + +public OnPlayerSpawn(playerid) +{ + TextDrawShowForPlayer(playerid, gMyTextdraw); + return 1; +} + +public OnPlayerDeath(playerid, reason) +{ + TextDrawHideForPlayer(playerid, gMyTextdraw); + return 1; +} +``` + +## 相关函数 + +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本绘图 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本绘图 +- [IsTextDrawVisibleForPlayer](IsTextDrawVisibleForPlayer): 检测文本绘图是否对玩家可见 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsBox.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsBox.md new file mode 100644 index 00000000000..9187f2429a7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsBox.md @@ -0,0 +1,65 @@ +--- +title: TextDrawIsBox +sidebar_label: TextDrawIsBox +description: 检测文本绘图是否启用方框 +tags: ["文本绘图"] +--- + + + +## 描述 + +检测文本绘图是否启用了方框显示 + +## 参数 + +| 参数名 | 说明 | +| ----------- | --------------------- | +| Text:textid | 需要检测的文本绘图 ID | + +## 返回值 + +若文本绘图启用了方框返回**true**,否则返回**false** + +## 示例用法 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawUseBox(gMyTextdraw, true); // 启用方框显示 + + if (TextDrawIsBox(gMyTextdraw)) + { + // 文本绘图已启用方框 + } + else + { + // 文本绘图未启用方框 + } + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示状态 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsProportional.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsProportional.md new file mode 100644 index 00000000000..d2bc9e78af6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsProportional.md @@ -0,0 +1,65 @@ +--- +title: TextDrawIsProportional +sidebar_label: TextDrawIsProportional +description: 检查文本绘图是否启用等比例间距。 +tags: ["文本绘图"] +--- + + + +## 描述 + +检查文本绘图是否启用等比例间距。 + +## 参数 + +| 名称 | 说明 | +| ----------- | --------------------- | +| Text:textid | 需要检查的文本绘图 ID | + +## 返回值 + +返回**true**表示已启用等比例间距,否则返回**false**。 + +## 示例用法 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawSetProportional(gMyTextdraw, true); + + if (TextDrawIsProportional(gMyTextdraw)) + { + // 文本绘图已启用等比例间距 + } + else + { + // 文本绘图未启用等比例间距 + } + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawColor](TextDrawColor): 设置字体颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 启用文本描边 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsSelectable.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsSelectable.md new file mode 100644 index 00000000000..f6a0c731494 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawIsSelectable.md @@ -0,0 +1,67 @@ +--- +title: TextDrawIsSelectable +sidebar_label: TextDrawIsSelectable +description: 检测文本绘图是否处于可选状态 +tags: ["文本绘图"] +--- + + + +## 描述 + +检测文本绘图是否支持玩家点击交互 + +## 参数说明 + +| 参数名 | 说明 | +| ----------- | --------------------- | +| Text:textid | 需要检测的文本绘图 ID | + +## 返回值 + +若文本绘图处于可选状态返回 true,否则返回 false + +## 示例用法 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawTextSize(gMyTextdraw, 30.0, 10.0); + TextDrawSetSelectable(gMyTextdraw, true); + + if (TextDrawIsSelectable(gMyTextdraw)) + { + // 文本绘图处于可选状态 + } + else + { + // 文本绘图不可交互 + } + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 新建一个文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 删除指定文本绘图 +- [TextDrawSetSelectable](TextDrawSetSelectable): 控制文本绘图的点击交互功能 +- [TextDrawColor](TextDrawColor): 调整文本绘图的文字颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 修改文本绘图的背景方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 修改文本绘图的背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 调整文本绘图的文字对齐方式 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 调节文本绘图的字符大小 +- [TextDrawTextSize](TextDrawTextSize): 定义文本绘图方框的尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本轮廓的显示状态 +- [TextDrawSetShadow](TextDrawSetShadow): 切换文本阴影的启用状态 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本字符的比例间距 +- [TextDrawUseBox](TextDrawUseBox): 控制文本绘图方框的显示开关 +- [TextDrawSetString](TextDrawSetString): 修改现有文本绘图的文字内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏指定文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawLetterSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawLetterSize.md new file mode 100644 index 00000000000..6d551c9760b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawLetterSize.md @@ -0,0 +1,71 @@ +--- +title: TextDrawLetterSize +sidebar_label: TextDrawLetterSize +description: 设置文本字符的宽高比例 +tags: ["文本绘图"] +--- + +## 描述 + +设置文本绘图中字符的宽度和高度比例 + +| 参数名 | 说明 | +| ------------ | --------------------- | +| Text:textid | 需要修改的文本绘图 ID | +| Float:width | 单个字符的宽度比例 | +| Float:height | 单个字符的高度比例 | + +## 返回值 + +该函数不返回任何特定值 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0,"示例文本绘图"); + TextDrawLetterSize(gMyTextdraw, 3.2, 5.1); + return 1; +} +``` + +## 注意事项 + +:::tip + +当需要仅调整文本绘图的方框尺寸时,可将 height 参数乘以 0.135 来获得类似 TextDrawTextSize 的尺寸效果。 + +技巧:对于纯方框型文本绘图,建议使用**LD_SPAC:white**精灵配合 TextDrawTextSize 函数,可获得更精准的尺寸控制。 + +::: + +:::tip + +- 修改已显示的文本绘图字符尺寸后,无需重新创建,调用[TextDrawShowForPlayer](TextDrawShowForPlayer)或[TextDrawShowForAll](TextDrawShowForAll)即可刷新显示 +- 最佳视觉效果通常需要保持宽度与高度的 1:4 比例(例如宽度 0.5 对应高度 2.0) + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawGetLetterSize](TextDrawGetLetterSize): 获取文本字符尺寸 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawTextSize](TextDrawTextSize): 设置文本区域尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文字描边 +- [TextDrawSetShadow](TextDrawSetShadow): 设置阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换方框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 为玩家隐藏 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetOutline.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetOutline.md new file mode 100644 index 00000000000..e394cbf7f09 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetOutline.md @@ -0,0 +1,61 @@ +--- +title: TextDrawSetOutline +sidebar_label: TextDrawSetOutline +description: 设置文本绘图文本的描边粗细。 +tags: ["文本绘图"] +--- + +## 描述 + +设置文本绘图文本的描边粗细。可通过 TextDrawBackgroundColor 修改描边颜色。 + +| 名称 | 说明 | +| ----------- | ---------------------------------- | +| Text:textid | 需要设置描边的文本绘图 ID | +| outlineSize | 描边粗细(整数形式),0 表示无描边 | + +## 返回值 + +该函数不返回任何特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawSetOutline(gMyTextdraw, 1); + return 1; +} +``` + +## 注意事项 + +:::tip + +若需修改已显示文本绘图的描边,无需重新创建。修改后使用[TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll)即可立即生效。 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawGetOutline](TextDrawGetOutline): 获取文本绘图的描边粗细 +- [TextDrawColor](TextDrawColor): 设置文本字体颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetShadow](TextDrawSetShadow): 启用文本阴影 +- [TextDrawSetProportional](TextDrawSetProportional): 启用等比例间距 +- [TextDrawUseBox](TextDrawUseBox): 启用文本框显示 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 对玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPos.md new file mode 100644 index 00000000000..3532ad70d02 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPos.md @@ -0,0 +1,53 @@ +--- +title: TextDrawSetPos +sidebar_label: TextDrawSetPos +description: 设置文本绘图的位置 +tags: ["文本绘图"] +--- + + + +## 描述 + +设置文本绘图在屏幕中的坐标位置(X 轴与 Y 轴) + +| 参数名 | 说明 | +| ----------- | ------------------------- | +| Text:textid | 需要设置位置的文本绘图 ID | +| Float:x | 浮点型 X 坐标值 | +| Float:y | 浮点型 Y 坐标值 | + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + + TextDrawSetPos(gMyTextdraw, 200.0, 50.0); + return 1; +} +``` + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 新建一个文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 删除指定文本绘图 +- [TextDrawGetPos](TextDrawGetPos): 查询文本绘图的当前坐标 +- [TextDrawColor](TextDrawColor): 调整文本绘图的文字颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 修改文本绘图的背景方框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 修改文本绘图的背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 调整文本绘图的文字对齐方式 +- [TextDrawFont](TextDrawFont): 更改文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 调节文本绘图的字符大小 +- [TextDrawTextSize](TextDrawTextSize): 定义文本绘图方框的尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本轮廓的显示状态 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本字符的比例间距 +- [TextDrawUseBox](TextDrawUseBox): 控制文本绘图方框的显示开关 +- [TextDrawSetString](TextDrawSetString): 修改现有文本绘图的文字内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 向指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有在线玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏指定文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewModel.md new file mode 100644 index 00000000000..5b048bb0e7d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewModel.md @@ -0,0 +1,67 @@ +--- +title: TextDrawSetPreviewModel +sidebar_label: TextDrawSetPreviewModel +description: 设置文本绘图的模型预览。 +tags: ["文本绘图"] +--- + +## 描述 + +设置用于文本绘图模型预览的 3D 模型。 + +| 名称 | 描述 | +| ----------- | ---------------------------------- | +| Text:textid | 需要显示 3D 预览的文本绘图 ID。 | +| model | 要显示的 GTA SA 或 SA:MP 模型 ID。 | + +## 返回值 + +此函数不返回特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColor(gMyTextdraw, 0x000000FF); + TextDrawTextSize(gMyTextdraw, 40.0, 40.0); + + TextDrawSetPreviewModel(gMyTextdraw, 411); // 显示模型411(Infernus) + // TextDrawSetPreviewModel(gMyTextdraw, 1); // 显示模型1(CJ皮肤) + // TextDrawSetPreviewModel(gMyTextdraw, 18646); // 显示模型18646(警灯物体) + + // 仍需使用TextDrawShowForAll/TextDrawShowForPlayer使文本绘图可见 + return 1; +} +``` + +## 注意事项 + +:::tip + +使用[TextDrawBackgroundColor](TextDrawBackgroundColor)设置模型背后的背景颜色。 + +::: + +:::warning + +文本绘图必须使用`TEXT_DRAW_FONT_MODEL_PREVIEW`字体类型才能使本函数生效。 + +::: + +## 相关函数 + +- [TextDrawGetPreviewModel](TextDrawGetPreviewModel): 获取 3D 预览文本绘图的模型 ID +- [TextDrawSetPreviewRot](TextDrawSetPreviewRot): 设置 3D 文本绘图预览的旋转角度 +- [TextDrawSetPreviewVehCol](TextDrawSetPreviewVehCol): 设置 3D 文本绘图预览中车辆的颜色 +- [TextDrawFont](TextDrawFont): 设置文本绘图的字体类型 +- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): 设置玩家专属 3D 文本绘图的预览模型 ID + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewRot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewRot.md new file mode 100644 index 00000000000..c3dd057d420 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewRot.md @@ -0,0 +1,62 @@ +--- +title: TextDrawSetPreviewRot +sidebar_label: TextDrawSetPreviewRot +description: 设置3D模型预览文本绘图的旋转角度和缩放比例。 +tags: ["文本绘图"] +--- + +## 描述 + +设置 3D 模型预览文本绘图的旋转角度和缩放比例。 + +| 名称 | 描述 | +| --------------- | -------------------------------------------------------------------------------------- | +| Text:textid | 要更改的文本绘图 ID | +| Float:rotationX | X 轴旋转角度值 | +| Float:rotationY | Y 轴旋转角度值 | +| Float:rotationZ | Z 轴旋转角度值 | +| Float:zoom | 缩放值(默认 1.0),小于 1.0 的值会使视角更靠近模型,大于 1.0 的值会使视角远离模型 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColor(gMyTextdraw, 0x000000FF); + TextDrawTextSize(gMyTextdraw, 40.0, 40.0); + TextDrawSetPreviewModel(gMyTextdraw, 411); + TextDrawSetPreviewRot(gMyTextdraw, -10.0, 0.0, -20.0, 1.0); + + // 仍需使用TextDrawShowForAll/TextDrawShowForPlayer使文本绘图可见 + return 1; +} +``` + +## 注意事项 + +:::warning + +文本绘图必须使用`TEXT_DRAW_FONT_MODEL_PREVIEW`字体类型且已设置预览模型,该函数才能生效。 + +::: + +## 相关函数 + +- [TextDrawGetPreviewRot](TextDrawGetPreviewRot): 获取 3D 模型预览文本绘图的旋转参数 +- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): 设置玩家 3D 文本绘图预览的旋转参数 +- [TextDrawSetPreviewModel](TextDrawSetPreviewModel): 设置文本绘图的 3D 预览模型 +- [TextDrawSetPreviewVehCol](TextDrawSetPreviewVehCol): 设置文本绘图预览中车辆的配色方案 +- [TextDrawFont](TextDrawFont): 设置文本绘图的字体样式 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehCol.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehCol.md new file mode 100644 index 00000000000..f7e1e102a77 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehCol.md @@ -0,0 +1,58 @@ +--- +title: TextDrawSetPreviewVehCol +sidebar_label: TextDrawSetPreviewVehCol +description: 若在3D预览文本绘图中使用车辆模型,本函数用于设置该车辆的两个颜色值。 +tags: ["文本绘图"] +--- + +## 描述 + +若在 3D 预览文本绘图中使用车辆模型,本函数用于设置该车辆的两个颜色值。 + +| 参数名 | 说明 | +| ----------- | ----------------------------------------- | +| Text:textid | 已设置为显示 3D 车辆模型预览的文本绘图 ID | +| colour1 | 车辆主颜色 ID | +| colour2 | 车辆副颜色 ID | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); + TextDrawUseBox(gMyTextdraw, true); + TextDrawBoxColor(gMyTextdraw, 0x000000FF); + TextDrawTextSize(gMyTextdraw, 40.0, 40.0); + TextDrawSetPreviewModel(gMyTextdraw, 411); // 显示模型411(灵车) + TextDrawSetPreviewVehCol(gMyTextdraw, 6, 6); // 设置灵车主副颜色为6号(黄色) + + // 仍需使用TextDrawShowForAll/TextDrawShowForPlayer使文本绘图可见 + return 1; +} +``` + +## 注意事项 + +:::warning + +文本绘图必须使用字体类型`TEXT_DRAW_FONT_MODEL_PREVIEW`,否则本函数将无效。 + +::: + +## 相关函数 + +- [TextDrawSetPreviewModel](TextDrawSetPreviewModel): 设置文本绘图的 3D 预览模型。 +- [TextDrawSetPreviewRot](TextDrawSetPreviewRot): 设置 3D 文本绘图预览的旋转角度。 +- [TextDrawFont](TextDrawFont): 设置文本绘图的字体样式。 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时调用。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehicleColours.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehicleColours.md new file mode 100644 index 00000000000..4ccf2416c15 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetPreviewVehicleColours.md @@ -0,0 +1,60 @@ +--- +title: TextDrawSetPreviewVehicleColours +sidebar_label: TextDrawSetPreviewVehicleColours +description: 当3D预览文本绘图使用车辆模型时,设置该车辆的两个颜色值。 +tags: ["文本绘图"] +--- + + + +## 描述 + +当 3D 预览文本绘图使用车辆模型时,设置该车辆的两个颜色值。 + +| 名称 | 描述 | +| ----------- | ----------------------------------------- | +| Text:textid | 已设置为显示 3D 车辆模型预览的文本绘图 ID | +| colour1 | 要设置的主颜色 ID | +| colour2 | 要设置的副颜色 ID | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); + TextDrawUseBox(gMyTextdraw, 1); + TextDrawBoxColor(gMyTextdraw, 0x000000FF); + TextDrawTextSize(gMyTextdraw, 40.0, 40.0); + TextDrawSetPreviewModel(gMyTextdraw, 411); // 显示411号模型(Infernus) + TextDrawSetPreviewVehicleColours(gMyTextdraw, 6, 6); // 将Infernus的主副颜色设为6号(黄色) + + // 仍需使用TextDrawShowForAll/TextDrawShowForPlayer使文本绘图可见 + return 1; +} +``` + +## 注意事项 + +:::warning + +文本绘图必须使用`TEXT_DRAW_FONT_MODEL_PREVIEW`字体类型,该函数才能生效。 + +::: + +## 相关函数 + +- [TextDrawSetPreviewModel](TextDrawSetPreviewModel): 设置文本绘图的 3D 预览模型 +- [TextDrawSetPreviewRot](TextDrawSetPreviewRot): 设置 3D 文本绘图预览的旋转参数 +- [TextDrawFont](TextDrawFont): 设置文本绘图的字体样式 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetProportional.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetProportional.md new file mode 100644 index 00000000000..b1e1e8ae5db --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetProportional.md @@ -0,0 +1,62 @@ +--- +title: TextDrawSetProportional +sidebar_label: TextDrawSetProportional +description: 该函数用于将文本间距按比例缩放。 +tags: ["文本绘图"] +--- + +## 描述 + +该函数用于将文本间距按比例缩放。当使用 TextDrawLetterSize 时特别有用,可确保字符间距均匀分布。 + +| 参数名 | 说明 | +| ----------------- | ----------------------------------- | +| Text:textid | 需要设置比例缩放的文本绘图 ID | +| bool:proportional | 设为'true'启用比例缩放,'false'禁用 | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawSetProportional(gMyTextdraw, true); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 比例缩放默认启用(设为**true**),若不需要禁用可跳过本函数 +- 修改已显示的文本绘图比例时无需重建,只需通过[TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll)刷新即可生效 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawIsProportional](TextDrawIsProportional): 检测文本绘图是否启用比例缩放 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置文本背景色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置文本字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文本描边效果 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影效果 +- [TextDrawUseBox](TextDrawUseBox): 切换文本框显示状态 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为指定玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetSelectable.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetSelectable.md new file mode 100644 index 00000000000..10c3146bc8e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetSelectable.md @@ -0,0 +1,57 @@ +--- +title: TextDrawSetSelectable +sidebar_label: TextDrawSetSelectable +description: 设置文本绘图是否可被选中(点击)。 +tags: ["文本绘图"] +--- + +## 描述 + +设置文本绘图是否可被选中(点击) + +| 名称 | 描述 | +| --------------- | --------------------------------------- | +| Text:textid | 需要设置可选中状态的文本绘图 ID。 | +| bool:selectable | 'true'表示可选中,'false'表示不可选中。 | + +## 返回值 + +此函数不返回特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawTextSize(gMyTextdraw, 30.0, 10.0); + TextDrawSetSelectable(gMyTextdraw, true); // true表示可选中 + return 1; +} +``` + +## 注意事项 + +:::tip + +使用[TextDrawTextSize](TextDrawTextSize)定义可点击区域的范围。 + +::: + +:::warning + +必须在文本绘图显示给玩家前调用 TextDrawSetSelectable 才能生效。 + +::: + +## 相关函数 + +- [TextDrawIsSelectable](TextDrawIsSelectable): 检查文本绘图是否可选中 +- [SelectTextDraw](SelectTextDraw): 启用鼠标选择功能 +- [CancelSelectTextDraw](CancelSelectTextDraw): 取消文本绘图的鼠标选择状态 + +## 相关回调 + +- [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): 当玩家点击文本绘图时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetShadow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetShadow.md new file mode 100644 index 00000000000..9a8e2c7a5c0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetShadow.md @@ -0,0 +1,69 @@ +--- +title: TextDrawSetShadow +sidebar_label: TextDrawSetShadow +description: 设置文本绘图中文本阴影的大小。 +tags: ["文本绘图"] +--- + +## 描述 + +设置文本绘图中文本阴影的大小。 + +| 名称 | 描述 | +| ----------- | ------------------------------------------------------- | +| Text:textid | 要设置阴影大小的文本绘图 ID | +| shadowSize | 阴影的大小。通常 1 表示标准阴影尺寸,0 表示完全禁用阴影 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。文本绘图不存在。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawSetShadow(gMyTextdraw, 1); + return 1; +} +``` + +## 注意事项 + +:::tip + +如果阴影尺寸设置过大超出区域范围,可能会被文本框区域截断。 + +::: + +:::tip + +若要修改已显示文本绘图的阴影参数,无需重新创建。只需在修改后使用[TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll)即可实时更新显示效果。 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawGetShadow](TextDrawGetShadow): 获取文本绘图的阴影尺寸 +- [TextDrawColor](TextDrawColor): 设置文本绘图的字体颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本绘图的边框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置文本绘图的背景色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本绘图的对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本绘图的字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置文本绘图的字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本绘图的文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 控制文本绘图的轮廓显示 +- [TextDrawSetProportional](TextDrawSetProportional): 启用文本绘图的等比间距 +- [TextDrawUseBox](TextDrawUseBox): 切换文本绘图的边框显示状态 +- [TextDrawSetString](TextDrawSetString): 更新文本绘图的显示内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为指定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向全体玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 隐藏全体玩家的文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetString.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetString.md new file mode 100644 index 00000000000..80f50782164 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetString.md @@ -0,0 +1,80 @@ +--- +title: TextDrawSetString +sidebar_label: TextDrawSetString +description: 修改文本绘图中的文字内容。 +tags: ["文本绘图"] +--- + +## 描述 + +修改文本绘图中的文字内容。 + +| 名称 | 描述 | +| ---------------- | ---------------------------------- | +| Text:textid | 需要修改的文本绘图 ID | +| const format[] | 新的字符串内容 | +| OPEN_MP_TAGS:... | 不定数量的参数(支持任意标签类型) | + +## 返回值 + +此函数不返回特定值。 + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(1.0, 5.6, "你好,最近怎么样?"); + return 1; +} + +public OnPlayerConnect(playerid) +{ + new + string[64], + playerName[MAX_PLAYER_NAME]; + + GetPlayerName(playerid, playerName, sizeof playerName); + + format(string, sizeof(string), "欢迎 %s!", playerName); + TextDrawSetString(gMyTextdraw, string); + + // 专业提示:在open.mp中无需使用`format`函数 + TextDrawSetString(gMyTextdraw, "欢迎 %s!", playerName); + + TextDrawShowForPlayer(playerid, gMyTextdraw); + return 1; +} +``` + +## 注意事项 + +:::warning + +文本绘图字符串存在长度限制 - 详见[此处](../resources/limits)获取更多信息。 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawSetStringForPlayer](TextDrawSetStringForPlayer): 为特定玩家修改文本内容 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置背景颜色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置字体类型 +- [TextDrawLetterSize](TextDrawLetterSize): 设置字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文本描边效果 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例间距 +- [TextDrawUseBox](TextDrawUseBox): 切换文本框显示状态 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向所有玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 对所有玩家隐藏文本绘图 +- [TextDrawGetString](TextDrawGetString): 获取文本内容 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetStringForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetStringForPlayer.md new file mode 100644 index 00000000000..115243d40bb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawSetStringForPlayer.md @@ -0,0 +1,91 @@ +--- +title: TextDrawSetStringForPlayer +sidebar_label: TextDrawSetStringForPlayer +description: 为特定玩家更改文本绘图中的文字内容 +tags: ["文本绘图"] +--- + + + +## 描述 + +为特定玩家动态修改文本绘图显示内容。 + +| 参数名 | 说明 | +| ---------------- | ---------------------- | +| Text:textid | 需修改的文本绘图 ID | +| playerid | 目标玩家 ID | +| const format[] | 格式化字符串内容 | +| OPEN_MP_TAGS:... | 不定数量的任意类型参数 | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(317.799987, 331.475006, "你好,最近怎么样?"); + TextDrawLetterSize(gMyTextdraw, 0.238997, 1.250000); + TextDrawTextSize(gMyTextdraw, 505.000000, 202.000000); + TextDrawAlignment(gMyTextdraw, TEXT_DRAW_ALIGN_CENTER); + TextDrawColor(gMyTextdraw, 0xFFFFFFFF); + TextDrawSetShadow(gMyTextdraw, 0); + TextDrawSetOutline(gMyTextdraw, 1); + TextDrawBackgroundColor(gMyTextdraw, 255); + TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_1); + TextDrawSetProportional(gMyTextdraw, true); + return 1; +} + +public OnPlayerConnect(playerid) +{ + new playerName[MAX_PLAYER_NAME]; + GetPlayerName(playerid, playerName, sizeof playerName); + + TextDrawShowForPlayer(playerid, gMyTextdraw); + + TextDrawSetStringForPlayer(gMyTextdraw, playerid, "欢迎%s!", playerName); + return 1; +} + +public OnPlayerRequestClass(playerid, classid) +{ + TextDrawSetStringForPlayer(gMyTextdraw, playerid, "您选择了%d号职业", classid); + return 1; +} +``` + +## 注意事项 + +:::warning + +文本字符串存在长度限制,详细信息请参阅[此处](../resources/limits) + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawSetString](TextDrawSetString): 全局修改文本内容 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置文本背景色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置文本字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文本描边效果 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例缩放 +- [TextDrawUseBox](TextDrawUseBox): 切换文本框显示状态 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 +- [TextDrawGetString](TextDrawGetString): 获取文本内容 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForAll.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForAll.md new file mode 100644 index 00000000000..877e89b3f3e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForAll.md @@ -0,0 +1,48 @@ +--- +title: TextDrawShowForAll +sidebar_label: TextDrawShowForAll +description: 为所有玩家显示文本绘图。 +tags: ["文本绘图"] +--- + +## 描述 + +为所有玩家显示指定的文本绘图。 + +| 名称 | 描述 | +| ----------- | ----------------------------------------------------------------------------- | +| Text:textid | 需要显示的文本绘图 ID
由[TextDrawCreate](TextDrawCreate)函数创建时返回。 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的文本绘图不存在) + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(240.0, 580.0, "示例文本"); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/showtd", true)) + { + TextDrawShowForAll(gMyTextdraw); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为特定玩家显示文本绘图 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 对所有玩家隐藏文本绘图 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForPlayer.md new file mode 100644 index 00000000000..55f58f8522b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawShowForPlayer.md @@ -0,0 +1,54 @@ +--- +title: TextDrawShowForPlayer +sidebar_label: TextDrawShowForPlayer +description: 为特定玩家显示文本绘图。 +tags: ["玩家", "文本绘图"] +--- + +## 描述 + +为特定玩家显示文本绘图。 + +| 名称 | 描述 | +| ----------- | ------------------------------------------------------------------- | +| playerid | 要显示文本绘图的玩家 ID | +| Text:textid | 要显示的文本绘图 ID
由[TextDrawCreate](TextDrawCreate)创建返回 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定的玩家或文本绘图不存在) + +## 示例 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 100.0, "欢迎!"); + return 1; +} + +public OnPlayerConnect(playerid) +{ + TextDrawShowForPlayer(playerid, gMyTextdraw); + return 1; +} +``` + +## 注意事项 + +:::tip + +若只需单个玩家查看文本绘图,建议使用玩家专属文本绘图(PlayerTextDraw)。这种方式也适用于需要展示玩家个性化信息的场景。 + +::: + +## 相关函数 + +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对指定玩家隐藏文本绘图 +- [TextDrawShowForAll](TextDrawShowForAll): 向全体玩家显示文本绘图 +- [TextDrawHideForAll](TextDrawHideForAll): 隐藏全体玩家的文本绘图 +- [IsTextDrawVisibleForPlayer](IsTextDrawVisibleForPlayer): 检测文本绘图对玩家是否可见 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawTextSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawTextSize.md new file mode 100644 index 00000000000..98377969072 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawTextSize.md @@ -0,0 +1,77 @@ +--- +title: TextDrawTextSize +sidebar_label: TextDrawTextSize +description: 调整文本绘图的尺寸(当启用TextDrawUseBox时控制文本框大小,或配合TextDrawSetSelectable定义可点击区域) +tags: ["文本绘图"] +--- + +## 描述 + +调整文本绘图的尺寸(当启用[TextDrawUseBox](TextDrawUseBox)时控制文本框大小,或配合[TextDrawSetSelectable](TextDrawSetSelectable)定义可点击区域)。 + +| 参数名 | 说明 | +| ------------ | --------------------------------------------------------------------- | +| Text:textid | 需要调整尺寸的文本绘图 ID | +| Float:width | X 轴尺寸(左右方向),使用与 TextDrawCreate 相同的 640x480 网格坐标系 | +| Float:height | Y 轴尺寸(上下方向),使用与 TextDrawCreate 相同的 640x480 网格坐标系 | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawTextSize(gMyTextdraw, 2.0, 3.6); + return 1; +} +``` + +## 注意事项 + +:::tip + +- 不同 TextDrawAlignment 值对坐标系的解释差异: +1(左对齐):参数值为文本框右侧边界的绝对坐标 +2(居中对齐):需交换 X/Y 参数顺序,X 值代表整体宽度 +3(右对齐):参数值为文本框左侧边界的绝对坐标 + +- 使用 4 号字体(精灵)和 5 号字体(模型预览)时,本函数参数将转换为宽高偏移量 + +- 文本框坐标系原点(TextDrawCreate 设定坐标)向左偏移 5.0 单位,向上偏移 10.0 单位 + +- 本函数定义的可点击区域在启用 TextDrawSetSelectable 时生效,无论是否显示文本框 + +::: + +:::tip + +- 修改已显示的文本绘图尺寸时无需重建,通过[TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll)刷新即可立即生效 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawGetTextSize](TextDrawGetTextSize): 获取文本绘图尺寸数据 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置文本背景色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置文本字符尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文本描边效果 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例缩放 +- [TextDrawUseBox](TextDrawUseBox): 切换文本框显示状态 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawUseBox.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawUseBox.md new file mode 100644 index 00000000000..78e8c5d0dae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawUseBox.md @@ -0,0 +1,63 @@ +--- +title: TextDrawUseBox +sidebar_label: TextDrawUseBox +description: 切换文本框显示状态 +tags: ["文本绘图"] +--- + +## 描述 + +控制文本绘图是否显示背景文本框。 + +| 参数名 | 说明 | +| -------------- | --------------------------------- | +| Text:textid | 需操作的文本绘图 ID | +| bool:enableBox | 设为'true'启用文本框,'false'禁用 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示指定文本绘图不存在) + +## 示例代码 + +```c +new Text:gMyTextdraw; + +public OnGameModeInit() +{ + gMyTextdraw = TextDrawCreate(100.0, 33.0, "示例文本绘图"); + TextDrawUseBox(gMyTextdraw, true); // 启用文本框 + return 1; +} +``` + +## 注意事项 + +:::tip + +若文本绘图已处于显示状态,需通过[TextDrawShowForAll](TextDrawShowForAll)/[TextDrawShowForPlayer](TextDrawShowForPlayer)重新显示才能使变更生效 + +::: + +## 相关函数 + +- [TextDrawCreate](TextDrawCreate): 创建文本绘图 +- [TextDrawDestroy](TextDrawDestroy): 销毁文本绘图 +- [TextDrawIsBox](TextDrawIsBox): 检测文本框状态 +- [TextDrawColor](TextDrawColor): 设置文本颜色 +- [TextDrawBoxColor](TextDrawBoxColor): 设置文本框颜色 +- [TextDrawBackgroundColor](TextDrawBackgroundColor): 设置文本背景色 +- [TextDrawAlignment](TextDrawAlignment): 设置文本对齐方式 +- [TextDrawFont](TextDrawFont): 设置文本字体样式 +- [TextDrawLetterSize](TextDrawLetterSize): 设置文本字符尺寸 +- [TextDrawTextSize](TextDrawTextSize): 设置文本框尺寸 +- [TextDrawSetOutline](TextDrawSetOutline): 设置文本描边效果 +- [TextDrawSetShadow](TextDrawSetShadow): 设置文本阴影效果 +- [TextDrawSetProportional](TextDrawSetProportional): 启用比例缩放 +- [TextDrawSetString](TextDrawSetString): 更新文本内容 +- [TextDrawShowForPlayer](TextDrawShowForPlayer): 为玩家显示文本 +- [TextDrawHideForPlayer](TextDrawHideForPlayer): 对玩家隐藏文本 +- [TextDrawShowForAll](TextDrawShowForAll): 全局显示文本 +- [TextDrawHideForAll](TextDrawHideForAll): 全局隐藏文本 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Tickcount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Tickcount.md new file mode 100644 index 00000000000..2ff179b7c47 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Tickcount.md @@ -0,0 +1,24 @@ +--- +title: tickcount +sidebar_label: tickcount +description: 该函数可作为GetTickCount的替代方案,返回服务器启动至今经过的毫秒数。 +tags: ["时间"] +--- + + + +## 描述 + +该函数可作为 GetTickCount 的替代方案,返回服务器启动至今经过的毫秒数。 + +| 名称 | 描述 | +| -------------- | -------------------------------------------------------------------------------- | +| &granularity=0 | 该引用参数返回时将被赋值为系统内部时钟每秒的滴答数,用于指示函数返回值的时间精度 | + +## 返回值 + +系统启动后经过的毫秒数。对于 32 位存储单元,该计数器在连续运行约 24 天后会溢出。 + +## 相关函数 + +- [GetTickCount](GetTickCount): 返回一个每毫秒递增的时间戳数值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ToggleChatTextReplacement.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ToggleChatTextReplacement.md new file mode 100644 index 00000000000..925cd44b518 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ToggleChatTextReplacement.md @@ -0,0 +1,48 @@ +--- +title: ToggleChatTextReplacement +sidebar_label: ToggleChatTextReplacement +description: 切换聊天输入过滤器的开关状态。 +tags: [] +--- + + + +## 描述 + +切换聊天输入过滤器的开关状态。 + +禁用后可允许在聊天中使用%等特殊字符。 + +| 名称 | 描述 | +| ----------- | ----------------------------------- | +| bool:enable | 'true'启用过滤器,'false'禁用过滤器 | + +## 返回值 + +此函数不返回任何特定值。 + +## 示例 + +```c +public OnGameModeInit() +{ + ToggleChatTextReplacement(false); // 切换聊天输入过滤器 + return 1; +} +``` + +## 注意事项 + +:::tip + +可通过 config.json 配置文件设置初始状态: + +```json +"chat_input_filter": true, +``` + +::: + +## 相关函数 + +- [ChatTextReplacementToggled](ChatTextReplacementToggled): 检测聊天输入过滤器是否启用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerClock.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerClock.md new file mode 100644 index 00000000000..54b7eed2ddb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerClock.md @@ -0,0 +1,46 @@ +--- +title: TogglePlayerClock +sidebar_label: TogglePlayerClock +description: 切换指定玩家的游戏内时钟显示(位于右上角)。 +tags: ["玩家"] +--- + +## 描述 + +切换指定玩家的游戏内时钟显示(位于右上角)。启用后,游戏时间将以每分钟对应现实一秒的速度推进。使用[SetWeather](SetWeather)/[SetPlayerWeather](SetPlayerWeather)设置天气时,天气效果将呈现渐变过渡。 + +| 名称 | 描述 | +| ----------- | ----------------------------------------------- | +| playerid | 需要启用/禁用时钟的玩家 ID | +| bool:toggle | 显示时钟设为'true',隐藏设为'false'(默认隐藏) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例 + +```c +public OnPlayerConnect(playerid) +{ + TogglePlayerClock(playerid, true); // 显示时钟 + return 1; +} +``` + +## 注意事项 + +:::tip + +- 玩家时间不会自动同步!需使用[SetPlayerTime](SetPlayerTime)实现时间同步 +- 玩家死亡时,时间将自动推进 6 小时 + +::: + +## 相关函数 + +- [GetPlayerTime](GetPlayerTime): 获取玩家的当前时间 +- [SetPlayerTime](SetPlayerTime): 设置玩家的个性化时间 +- [SetWorldTime](SetWorldTime): 设置服务器全局时间 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerControllable.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerControllable.md new file mode 100644 index 00000000000..c29e5773acb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerControllable.md @@ -0,0 +1,46 @@ +--- +title: TogglePlayerControllable +sidebar_label: TogglePlayerControllable +description: 切换玩家角色控制状态 +tags: ["玩家"] +--- + +## 描述 + +切换玩家是否能够控制其角色。该操作同时会禁用视角转动功能。 + +| 名称 | 描述 | +| ----------------- | ------------------------------- | +| playerid | 需要设置控制状态的玩家 ID | +| bool:controllable | 'false'禁用控制,'true'启用控制 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定玩家不存在) + +## 示例 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + // 当玩家输入/freezeme时冻结玩家 + if (strcmp(cmdtext, "/freezeme", true) == 0) + { + TogglePlayerControllable(playerid, false); + return 1; + } + // 当玩家输入/unfreezeme时解冻玩家 + if (strcmp(cmdtext, "/unfreezeme", true) == 0) + { + TogglePlayerControllable(playerid, true); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [IsPlayerControllable](IsPlayerControllable): 检测玩家是否处于可控状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerGhostMode.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerGhostMode.md new file mode 100644 index 00000000000..56977d4d8e2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerGhostMode.md @@ -0,0 +1,40 @@ +--- +title: TogglePlayerGhostMode +sidebar_label: TogglePlayerGhostMode +description: 切换玩家的幽灵模式。幽灵模式将禁用玩家模型之间的碰撞。 +tags: ["玩家"] +--- + + + +## 描述 + +切换玩家的幽灵模式状态。该模式启用后将禁用玩家模型之间的物理碰撞。 + +| 参数名 | 说明 | +| ----------- | ----------------------------------- | +| playerid | 需切换模式的玩家 ID | +| bool:toggle | 设为'true'启用幽灵模式,'false'禁用 | + +## 返回值 + +本函数始终返回 true(真值)。 + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/幽灵模式", true)) + { + TogglePlayerGhostMode(playerid, true); + SendClientMessage(playerid, -1, "服务器:你已启用幽灵模式!"); + return 1; + } + return 0; +} +``` + +## 相关函数 + +- [GetPlayerGhostMode](GetPlayerGhostMode): 获取玩家当前幽灵模式状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerSpectating.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerSpectating.md new file mode 100644 index 00000000000..34af42eb444 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerSpectating.md @@ -0,0 +1,57 @@ +--- +title: TogglePlayerSpectating +sidebar_label: TogglePlayerSpectating +description: 切换玩家观察者模式状态 +tags: ["玩家"] +--- + +## 描述 + +切换玩家是否处于观察者模式。在该模式下可观察其他玩家或车辆,使用后需配合[PlayerSpectatePlayer](PlayerSpectatePlayer)或[PlayerSpectateVehicle](PlayerSpectateVehicle)实现观察功能。 + +| 名称 | 描述 | +| ----------- | ------------------------------- | +| playerid | 需要设置观察模式的玩家 ID | +| bool:toggle | 'true'启用观察模式,'false'禁用 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(玩家不存在) + +## 示例 + +```c +public OnPlayerDeath(playerid, killerid, WEAPON:reason) +{ + TogglePlayerSpectating(playerid, true); // 开启观察模式 + PlayerSpectatePlayer(playerid, killerid); // 观察击杀者视角 + return 1; +} +``` + +## 注意事项 + +:::tip + +禁用观察模式时会自动触发 OnPlayerSpawn 回调。若需恢复玩家原始状态,需在 OnPlayerSpawn 中处理。注意玩家可能通过 F4 进入选角界面,且观察模式中可能因漏洞导致死亡。 + +::: + +:::tip + +观察模式下会隐藏 HUD 界面,适合需要纯净视角控制的场景。玩家视角附近的物体会自动流加载,适用于视角插值功能。 + +::: + +:::warning + +如果玩家在关闭观察模式前未加载完毕,连接可能会意外关闭。 + +::: + +## 相关函数 + +- [PlayerSpectatePlayer](PlayerSpectatePlayer): 观察指定玩家 +- [PlayerSpectateVehicle](PlayerSpectateVehicle): 观察指定车辆 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerWidescreen.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerWidescreen.md new file mode 100644 index 00000000000..fe282d96644 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/TogglePlayerWidescreen.md @@ -0,0 +1,52 @@ +--- +title: TogglePlayerWidescreen +sidebar_label: TogglePlayerWidescreen +description: 切换玩家的宽屏显示模式 +tags: ["玩家"] +--- + + + +## 描述 + +动态切换玩家的宽屏显示状态,控制游戏画面比例。 + +| 参数名 | 说明 | +| --------- | ----------------------------------------------- | +| playerid | 需操作的玩家 ID | +| bool:wide | 设为**true**启用宽屏模式,**false**恢复默认比例 | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(通常表示指定玩家不存在) + +## 示例代码 + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/宽屏模式", true)) + { + TogglePlayerWidescreen(playerid, true); + SendClientMessage(playerid, -1, "服务器:你已启用宽屏显示!"); + return 1; + } + return 0; +} +``` + +
+ +**宽屏启用效果:** + +![](https://i.ibb.co/Zcc2qmD/widescreen-on.png) + +**宽屏禁用效果:** + +![](https://i.ibb.co/jb1YcQS/widescreen-off.png) + +## 相关函数 + +- [IsPlayerWidescreenToggled](IsPlayerWidescreenToggled): 检测玩家当前宽屏状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ToggleVehicleSirenEnabled.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ToggleVehicleSirenEnabled.md new file mode 100644 index 00000000000..deb4a8dd021 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ToggleVehicleSirenEnabled.md @@ -0,0 +1,30 @@ +--- +title: ToggleVehicleSirenEnabled +sidebar_label: ToggleVehicleSirenEnabled +description: 切换车辆警笛的启用状态。 +tags: ["车辆"] +--- + + + +## 描述 + +切换车辆警笛的启用状态。 + +## 参数 + +| 名称 | 描述 | +| ------------ | -------------------------------- | +| vehicleid | 目标车辆的 ID | +| bool:enabled | **true**: 启用 - **false**: 禁用 | + +## 示例 + +```c +ToggleVehicleSirenEnabled(vehicleid, true); +``` + +## 相关函数 + +- [GetVehicleSirenState](GetVehicleSirenState): 获取车辆的警笛状态 +- [GetPlayerSirenState](GetPlayerSirenState): 获取玩家所在车辆的警笛状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UnBlockIpAddress.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UnBlockIpAddress.md new file mode 100644 index 00000000000..333f14cf45f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UnBlockIpAddress.md @@ -0,0 +1,37 @@ +--- +title: UnBlockIpAddress +sidebar_label: UnBlockIpAddress +description: 解除通过BlockIpAddress封禁的IP地址。 +tags: ["管理", "IP地址"] +--- + +## 描述 + +解除通过[BlockIpAddress](BlockIpAddress)封禁的 IP 地址。 + +| 名称 | 描述 | +| ----------------- | ---------------------- | +| const ipAddress[] | 需要解除封禁的 IP 地址 | + +## 返回值 + +此函数不返回特定值。 + +## 示例 + +```c +public OnGameModeInit() +{ + UnBlockIpAddress("127.0.0.1"); // 解除本地IP地址的封禁 + return 1; +} +``` + +## 相关函数 + +- [BlockIpAddress](BlockIpAddress): 封禁 IP 地址禁止连接服务器 +- [IsBanned](IsBanned): 检测指定 IP 是否被封禁 + +## 相关回调 + +- [OnIncomingConnection](../callbacks/OnIncomingConnection): 当玩家尝试连接服务器时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Update3DTextLabelText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Update3DTextLabelText.md new file mode 100644 index 00000000000..dda6452e330 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/Update3DTextLabelText.md @@ -0,0 +1,55 @@ +--- +title: Update3DTextLabelText +sidebar_label: Update3DTextLabelText +description: 更新3D文本标签的文本内容及颜色 +tags: ["3D文本标签"] +--- + +## 描述 + +动态修改已创建的 3D 文本标签显示内容及颜色配置。 + +| 参数名 | 说明 | +| ---------------- | ------------------------------------ | +| Text3D:textid | 需要更新的 3D 文本标签 ID | +| colour | 新的 ARGB 颜色值(格式:0xAARRGGBB) | +| const text[] | 支持格式化的新文本内容 | +| OPEN_MP_TAGS:... | 不定数量的格式化参数 | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new Text3D:mylabel; + +public OnGameModeInit() +{ + mylabel = Create3DTextLabel("当前坐标:\n30.0,40.0,50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); + + Update3DTextLabelText(mylabel, 0xFF0000FF, "坐标已更新"); // 修改为红色文字 + return 1; +} +``` + +## 注意事项 + +:::warning + +在旧版 SA-MP 中,若文本内容为空可能导致客户端崩溃(open.mp 版本已修复此问题) + +::: + +## 相关函数 + +- [Create3DTextLabel](Create3DTextLabel): 创建 3D 文本标签 +- [Delete3DTextLabel](Delete3DTextLabel): 删除 3D 文本标签 +- [Get3DTextLabelText](Get3DTextLabelText): 获取 3D 文本标签内容 +- [Get3DTextLabelColour](Get3DTextLabelColour): 获取 3D 文本标签颜色值 +- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): 将 3D 文本标签附加到玩家 +- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): 将 3D 文本标签附加到车辆 +- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): 创建玩家专属 3D 文本标签 +- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): 删除玩家专属标签 +- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): 更新玩家专属标签内容 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UpdatePlayer3DTextLabelText.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UpdatePlayer3DTextLabelText.md new file mode 100644 index 00000000000..e0928ae3e8c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UpdatePlayer3DTextLabelText.md @@ -0,0 +1,38 @@ +--- +title: UpdatePlayer3DTextLabelText +sidebar_label: UpdatePlayer3DTextLabelText +description: 更新玩家3D文本标签的文本内容及颜色。 +tags: ["玩家", "3D文本标签"] +--- + +## 描述 + +更新指定玩家 3D 文本标签的文本内容及颜色。 + +| 名称 | 描述 | +| ------------------- | -------------------------------------------- | +| playerid | 创建该 3D 文本标签的玩家 ID | +| PlayerText3D:textid | 需要更新的 3D 文本标签 ID | +| colour | 3D 文本标签的新颜色值(十六进制格式) | +| const text[] | 3D 文本标签的新文本内容 | +| OPEN_MP_TAGS:... | 用于格式化文本的可变参数(类似 printf 语法) | + +## 返回值 + +该函数不返回特定值。 + +## 注意事项 + +:::warning + +若 text[]为空字符串,原版 SA-MP 中附近客户端/服务端可能崩溃!(该问题在 open.mp 中已修复) + +::: + +## 相关函数 + +- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): 为指定玩家创建 3D 文本标签 +- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): 删除玩家的 3D 文本标签 +- [GetPlayer3DTextLabelText](GetPlayer3DTextLabelText): 获取玩家 3D 文本标签的文本内容 +- [GetPlayer3DTextLabelColour](GetPlayer3DTextLabelColour): 获取玩家 3D 文本标签的颜色值 +- [Update3DTextLabelText](Update3DTextLabelText): 更新全局 3D 文本标签的显示内容 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UpdateVehicleDamageStatus.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UpdateVehicleDamageStatus.md new file mode 100644 index 00000000000..20415cb3d17 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UpdateVehicleDamageStatus.md @@ -0,0 +1,66 @@ +--- +title: UpdateVehicleDamageStatus +sidebar_label: UpdateVehicleDamageStatus +description: 设置车辆的各类视觉损坏状态,包括爆胎、车灯破损和车身面板损伤。 +tags: ["车辆"] +--- + +:::tip + +关于处理车辆损坏值的实用函数,请参阅[损坏状态](../resources/damagestatus)。 + +::: + +## 描述 + +设置车辆的各类视觉损坏状态,包括爆胎、车灯破损和车身面板损伤。 + +| 名称 | 描述 | +| --------------------------- | ------------------------- | +| vehicleid | 需要设置损坏状态的车辆 ID | +| VEHICLE_PANEL_STATUS:panels | 包含面板损坏状态的位集合 | +| VEHICLE_DOOR_STATUS:doors | 包含车门损坏状态的位集合 | +| VEHICLE_LIGHT_STATUS:lights | 包含车灯损坏状态的位集合 | +| VEHICLE_TIRE_STATUS:tires | 包含轮胎损坏状态的位集合 | + +## 返回值 + +此函数不返回特定值。 + +## 示例 + +```c +new + VEHICLE_PANEL_STATUS:panels, + VEHICLE_DOOR_STATUS:doors, + VEHICLE_LIGHT_STATUS:lights, + VEHICLE_TIRE_STATUS:tires; + +GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); + +tires = VEHICLE_TIRE_STATUS:15; // 将轮胎状态设为15会使所有轮胎爆裂 + +// 或使用位运算方式: +tires = (VEHICLE_TIRE_STATUS_FRONT_LEFT_POPPED | VEHICLE_TIRE_STATUS_FRONT_RIGHT_POPPED | VEHICLE_TIRE_STATUS_REAR_LEFT_POPPED | VEHICLE_TIRE_STATUS_REAR_RIGHT_POPPED); + +UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); +``` + +## 相关函数 + +- [SetVehicleHealth](SetVehicleHealth): 设置车辆耐久值 +- [GetVehicleHealth](GetVehicleHealth): 获取车辆耐久值 +- [RepairVehicle](RepairVehicle): 完全修复车辆 +- [GetVehicleDamageStatus](GetVehicleDamageStatus): 获取车辆各部件损坏状态 + +## 相关回调 + +- [OnVehicleDamageStatusUpdate](../callbacks/OnVehicleDamageStatusUpdate): 车辆损坏状态变化时触发 + +## 相关资源 + +- [损坏状态](../resources/damagestatus) +- [车辆面板状态](../resources/vehicle-panel-status) +- [车辆车门状态](../resources/vehicle-door-status) +- [车辆车灯状态](../resources/vehicle-light-status) +- [车辆轮胎状态](../resources/vehicle-tire-status) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UseGangZoneCheck.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UseGangZoneCheck.md new file mode 100644 index 00000000000..08d1db1a700 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UseGangZoneCheck.md @@ -0,0 +1,84 @@ +--- +title: UseGangZoneCheck +sidebar_label: UseGangZoneCheck +description: 启用当玩家进入/离开该区域时的回调触发 +tags: ["玩家", "帮派区域"] +--- + + + +## 描述 + +启用当玩家进入/离开指定帮派区域时的回调触发功能。 + +| 名称 | 描述 | +| ----------- | ---------------------------------------------- | +| zoneid | 需要启用区域检测的帮派区域 ID | +| bool:enable | 是否启用区域检测功能(`true`启用/`false`停用) | + +## 返回值 + +**1:** 函数执行成功 + +**0:** 函数执行失败(指定的帮派区域不存在) + +## 示例 + +```c +new gGangZoneID = INVALID_GANG_ZONE; + +public OnGameModeInit() +{ + gGangZoneID = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); + + // 启用该区域的进出检测回调 + UseGangZoneCheck(gGangZoneID, true); +} + +public OnPlayerEnterGangZone(playerid, zoneid) +{ + if (zoneid == gGangZoneID) + { + new string[64]; + format(string, sizeof(string), "你正在进入帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + } + return 1; +} + +public OnPlayerLeaveGangZone(playerid, zoneid) +{ + if (zoneid == gGangZoneID) + { + new string[64]; + format(string, sizeof(string), "你正在离开帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + } + return 1; +} +``` + +## 相关回调 + +以下回调函数与本文档功能相关: + +- [OnPlayerEnterGangZone](../callbacks/OnPlayerEnterGangZone): 当玩家进入帮派区域时触发 +- [OnPlayerLeaveGangZone](../callbacks/OnPlayerLeaveGangZone): 当玩家离开帮派区域时触发 + +## 相关函数 + +以下函数与本文档功能相关: + +- [GangZoneCreate](GangZoneCreate): 创建帮派区域 +- [GangZoneDestroy](GangZoneDestroy): 销毁帮派区域 +- [GangZoneShowForPlayer](GangZoneShowForPlayer): 为玩家显示帮派区域 +- [GangZoneShowForAll](GangZoneShowForAll): 全体显示帮派区域 +- [GangZoneHideForPlayer](GangZoneHideForPlayer): 对玩家隐藏帮派区域 +- [GangZoneHideForAll](GangZoneHideForAll): 全体隐藏帮派区域 +- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): 为玩家闪烁显示区域 +- [GangZoneFlashForAll](GangZoneFlashForAll): 全体闪烁显示区域 +- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): 停止玩家区域闪烁 +- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): 停止全体区域闪烁 +- [IsValidGangZone](IsValidGangZone): 验证帮派区域有效性 +- [IsPlayerInGangZone](IsPlayerInGangZone): 检测玩家是否在区域内 +- [IsGangZoneVisibleForPlayer](IsGangZoneVisibleForPlayer): 检测区域对玩家可见性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerGangZoneCheck.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerGangZoneCheck.md new file mode 100644 index 00000000000..42f8dcf7d47 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerGangZoneCheck.md @@ -0,0 +1,87 @@ +--- +title: UsePlayerGangZoneCheck +sidebar_label: UsePlayerGangZoneCheck +description: 启用玩家进出区域时的回调触发 +tags: ["玩家", "帮派区域", "玩家专属帮派区域"] +--- + + + +## 描述 + +启用当玩家进入/离开指定区域时的回调触发。 + +| 名称 | 描述 | +| ----------- | --------------------------------- | +| playerid | 需要启用区域检测的玩家 ID | +| zoneid | 需要启用检测的玩家专属帮派区域 ID | +| bool:enable | 是否启用区域检测(true/false) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(指定帮派区域不存在) + +## 示例 + +```c +// 该变量用于存储玩家专属帮派区域ID +// 以便在脚本中全局使用 +new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...}; + +public OnPlayerConnect(playerid) +{ + // 创建玩家专属帮派区域 + gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); + + // 启用玩家进出该区域时的回调 + UsePlayerGangZoneCheck(playerid, gGangZoneID[playerid], true); +} + +public OnPlayerEnterPlayerGangZone(playerid, zoneid) +{ + if (zoneid == gGangZoneID[playerid]) + { + new string[64]; + format(string, sizeof(string), "您正在进入玩家专属帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + } + return 1; +} + +public OnPlayerLeavePlayerGangZone(playerid, zoneid) +{ + if (zoneid == gGangZoneID[playerid]) + { + new string[64]; + format(string, sizeof(string), "您正在离开玩家专属帮派区域 %i", zoneid); + SendClientMessage(playerid, 0xFFFFFFFF, string); + } + return 1; +} +``` + +## 相关回调 + +以下回调函数与此功能相关: + +- [OnPlayerEnterPlayerGangZone](../callbacks/OnPlayerEnterPlayerGangZone): 玩家进入专属帮派区域时触发 +- [OnPlayerLeavePlayerGangZone](../callbacks/OnPlayerLeavePlayerGangZone): 玩家离开专属帮派区域时触发 + +## 相关函数 + +以下函数与此功能相关: + +- [CreatePlayerGangZone](CreatePlayerGangZone): 创建玩家专属帮派区域 +- [PlayerGangZoneDestroy](PlayerGangZoneDestroy): 销毁玩家专属帮派区域 +- [PlayerGangZoneShow](PlayerGangZoneShow): 显示玩家专属帮派区域 +- [PlayerGangZoneHide](PlayerGangZoneHide): 隐藏玩家专属帮派区域 +- [PlayerGangZoneFlash](PlayerGangZoneFlash): 启动帮派区域闪烁效果 +- [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): 停止闪烁效果 +- [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): 获取闪烁颜色值 +- [PlayerGangZoneGetColour](PlayerGangZoneGetColour): 获取基础颜色值 +- [PlayerGangZoneGetPos](PlayerGangZoneGetPos): 获取区域坐标范围 +- [IsValidPlayerGangZone](IsValidPlayerGangZone): 验证帮派区域有效性 +- [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): 检测玩家是否在区域内 +- [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): 检测区域可见状态 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md new file mode 100644 index 00000000000..b49275e2729 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md @@ -0,0 +1,44 @@ +--- +title: UsePlayerPedAnims +sidebar_label: UsePlayerPedAnims +description: 强制所有玩家使用标准骨骼动画(CJ角色动画),覆盖皮肤专属动画(如滑板皮肤的滑行动作) +tags: ["玩家"] +--- + +## 描述 + +启用全局标准角色动画系统,所有玩家将统一使用 CJ 模型的骨骼动画,覆盖各皮肤自带的特殊动画(例如滑板皮肤将禁用滑行动作)。 + +## 示例代码 + +```c +public OnGameModeInit() +{ + UsePlayerPedAnims(); // 在游戏模式初始化时启用标准动画 + return 1; +} +``` + +## 注意事项 + +:::tip + +- 本函数必须置于[OnGameModeInit](../callbacks/OnGameModeInit)回调中才能生效 +- 未启用时,部分双手持武器(非双持武器)可能错误显示为单手持握状态 + +::: + +:::tip + +可通过[config.json](../../server/config.json)配置文件全局启用标准动画: + +```json +"use_player_ped_anims": true, // 启用标准骨骼动画系统 +``` + +::: + +## 相关函数 + +- [ApplyAnimation](ApplyAnimation): 为玩家应用特定动画 +- [ClearAnimations](ClearAnimations): 清除玩家的当前动画 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VectorSize.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VectorSize.md new file mode 100644 index 00000000000..6f5ba94bdc1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VectorSize.md @@ -0,0 +1,35 @@ +--- +title: VectorSize +sidebar_label: VectorSize +description: 返回指定向量的范数(长度)。 +tags: ["数学"] +--- + +## 描述 + +返回指定向量的范数(长度)。 + +| 名称 | 说明 | +| ------- | ------------------- | +| Float:x | 向量在 X 轴的分量值 | +| Float:y | 向量在 Y 轴的分量值 | +| Float:z | 向量在 Z 轴的分量值 | + +## 返回值 + +以浮点数形式返回指定向量的范数(长度)。 + +## 示例 + +```c +stock Float:GetDistanceBetweenPoints(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2) +{ + return VectorSize(x1-x2, y1-y2, z1-z2); +} +``` + +## 相关函数 + +- [GetPlayerDistanceFromPoint](GetPlayerDistanceFromPoint): 获取玩家与坐标点之间的距离 +- [GetVehicleDistanceFromPoint](GetVehicleDistanceFromPoint): 获取车辆与坐标点之间的距离 +- [floatsqroot](floatsqroot): 计算浮点数的平方根 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VehicleCanHaveComponent.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VehicleCanHaveComponent.md new file mode 100644 index 00000000000..42c9debcff1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VehicleCanHaveComponent.md @@ -0,0 +1,49 @@ +--- +title: VehicleCanHaveComponent +sidebar_label: VehicleCanHaveComponent +description: 检测指定组件是否可合法安装在特定车辆模型上 +tags: ["车辆"] +--- + + + +## 描述 + +检测指定车辆组件是否可合法安装在特定车辆模型上。 + +| 参数名 | 说明 | +| ---------------------------------------- | --------------- | +| [modelid](../resources/vehicleid) | 车辆模型 ID | +| [component](../resources/carcomponentid) | 待检测的组件 ID | + +## 返回值 + +**true** - 组件可合法安装 + +**false** - 组件不可合法安装 + +## 示例代码 + +```c +new vehicleid = GetPlayerVehicleID(playerid); + +if (VehicleCanHaveComponent(GetVehicleModel(vehicleid), 1010)) +{ + SendClientMessage(playerid, 0x00FF00FF, "氮气加速组件可合法安装于本车型"); +} +else +{ + SendClientMessage(playerid, 0xFF0000FF, "当前车型禁止安装氮气加速组件"); +} +``` + +## 相关函数 + +- [AddVehicleComponent](AddVehicleComponent): 为车辆添加组件 +- [RemoveVehicleComponent](RemoveVehicleComponent): 移除车辆组件 +- [GetVehicleComponentInSlot](GetVehicleComponentInSlot): 获取指定插槽组件 +- [GetVehicleComponentType](GetVehicleComponentType): 通过组件 ID 获取类型 + +## 相关资源 + +- [车辆组件 ID 对照表](../resources/carcomponentid) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VehicleColourIndexToColour.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VehicleColourIndexToColour.md new file mode 100644 index 00000000000..bf93d718245 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/VehicleColourIndexToColour.md @@ -0,0 +1,30 @@ +--- +title: VehicleColourIndexToColour +sidebar_label: VehicleColourIndexToColour +description: 将车辆颜色索引转换为HEX格式颜色值(RGBA)。 +tags: ["车辆"] +--- + + + +## 描述 + +将车辆颜色索引转换为 HEX 格式颜色值(RGBA)。 + +## 参数 + +| 名称 | 描述 | +| ------------ | ------------------------------------------- | +| index | [车辆颜色索引](../resources/vehiclecolorid) | +| alpha = 0xFF | Alpha 通道(默认值为 0xFF) | + +## 示例 + +```c +new colour = VehicleColourIndexToColour(3, 0xFF); // 将索引3转换为不透明度FF的HEX颜色 +``` + +## 相关函数 + +- [GetRandomVehicleColourPair](GetRandomVehicleColourPair): 获取指定车辆模型的随机有效颜色索引组合 +- [GetVehicleColours](GetVehicleColours): 获取车辆的主副颜色索引 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/acos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/acos.md new file mode 100644 index 00000000000..d359c5c7f05 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/acos.md @@ -0,0 +1,44 @@ +--- +title: acos +sidebar_label: acos +description: 获取余弦值的反函数角度(以度为单位) +tags: ["数学"] +--- + + + +## 描述 + +获取余弦值的反函数角度(以度为单位)。在三角函数中,反余弦是余弦的逆运算。 + +| 参数名 | 说明 | +| ----------- | ----------------------------------------- | +| Float:value | 需要计算反余弦的数值,取值范围为[-1,+1]。 | + +## 返回值 + +以度为单位的角度值,取值范围[0.0,180.0]。 + +## 示例 + +```c +// 数值0.500000的反余弦值为60.000000度 + +public OnGameModeInit() +{ + new Float:param, Float:result; + param = 0.5; + result = acos(param); + printf("数值%f的反余弦值为%f度", param, result); + return 1; +} +``` + +## 相关函数 + +- [floatsin](floatsin): 获取指定角度的正弦值 +- [floatcos](floatcos): 获取指定角度的余弦值 +- [floattan](floattan): 获取指定角度的正切值 +- [asin](asin): 获取正弦值的反函数角度(以度为单位) +- [atan](atan): 获取正切值的反函数角度(以度为单位) +- [atan2](atan2): 获取多值正切的反函数角度(以度为单位) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argcount.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argcount.md new file mode 100644 index 00000000000..b5772f17c0d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argcount.md @@ -0,0 +1,20 @@ +--- +title: argcount +sidebar_label: argcount +description: 获取传递给脚本的参数数量(在--之后传递的参数) +tags: ["参数", "命令行参数"] +--- + +## 描述 + +获取通过命令行双破折号(--)传递给脚本的参数数量。 + +## 返回值 + +直接传递给脚本的参数数量(整数)。 + +## 相关函数 + +- [argindex](argindex): 获取指定索引位置的参数名称 +- [argstr](argstr): 通过参数名获取字符串值 +- [argvalue](argvalue): 获取命令行参数的数值形式 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argindex.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argindex.md new file mode 100644 index 00000000000..e16223d5a0c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argindex.md @@ -0,0 +1,33 @@ +--- +title: argindex +sidebar_label: argindex +description: 获取在--之后指定索引位置的参数名称 +tags: ["参数", "命令行参数"] +--- + +## 描述 + +获取通过双破折号(--)传递的指定索引位置的参数名称。 + +| 参数名 | 说明 | +| --------------------- | --------------------------------- | +| index | 基于零的偏移索引(从 0 开始计数) | +| value[] | 用于存储参数名称的字符串缓冲区 | +| size = sizeof (value) | 目标缓冲区的大小 | +| bool:pack = false | 是否对返回值进行打包 | + +## 返回值 + +**true** - 参数存在,**false** - 参数不存在。 + +## 注意事项 + +独立参数同样计入索引计数。例如: + +在 `--load test --run` 中,参数 `--run` 的索引值为 `2`。 + +## 相关函数 + +- [argcount](argcount): 获取命令行参数数量 +- [argstr](argstr): 通过参数名获取字符串值 +- [argvalue](argvalue): 获取命令行参数的数值形式 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argstr.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argstr.md new file mode 100644 index 00000000000..d427e7b34da --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argstr.md @@ -0,0 +1,30 @@ +--- +title: argstr +sidebar_label: argstr +description: 通过参数名称获取字符串值 +tags: ["参数", "命令行参数"] +--- + +## 描述 + +根据参数名称获取对应的字符串值。 + +| 参数名 | 说明 | +| --------------------- | -------------------------------- | +| skip = 0 | 需要跳过的同名参数数量(默认 0) | +| const argument[] = "" | 参数名称(包含`-`或`/`前缀) | +| value[] = "" | 存储参数值的字符串缓冲区 | +| size = sizeof (value) | 目标缓冲区容量 | +| bool:pack = false | 是否对返回值进行打包 | + +## 返回值 + +**true** - 参数存在 + +**false** - 参数不存在 + +## 相关函数 + +- [argcount](参数数量): 获取命令行参数总数 +- [argindex](参数索引): 通过索引获取参数名称 +- [argvalue](参数数值): 获取参数的数值类型值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argvalue.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argvalue.md new file mode 100644 index 00000000000..afb39d61d12 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/argvalue.md @@ -0,0 +1,36 @@ +--- +title: argvalue +sidebar_label: argvalue +description: 获取命令行参数的数值类型值 +tags: ["参数", "命令行参数"] +--- + +## 描述 + +获取通过双破折号(--)传递的数值类型参数值。 + +| 参数名 | 说明 | +| --------------------- | ------------------------------------------------- | +| skip = 0 | 需要跳过的同名参数数量(默认 0) | +| const argument[] = "" | 参数名称(包含`-`或`/`前缀) | +| &value = cellmin | 存储参数值的整型变量(默认 cellmin 表示未初始化) | + +## 返回值 + +**true** - 成功找到带数值的参数 + +**false** - 参数不存在或未包含数值 + +## 注意事项 + +:::tip + +参数索引计算包含所有独立参数。例如: + +在 `--load test --run` 中,参数 `--run` 的索引值为 `2`。 + +## 相关函数 + +- [argcount](参数数量): 获取命令行参数总数 +- [argindex](参数索引): 通过索引获取参数名称 +- [argstr](参数字符串): 获取参数的字符串类型值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/asin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/asin.md new file mode 100644 index 00000000000..6dcff8a77a9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/asin.md @@ -0,0 +1,44 @@ +--- +title: asin +sidebar_label: asin +description: 获取正弦值的反正弦角度(以度为单位) +tags: ["数学"] +--- + + + +## 描述 + +计算指定正弦值的反正弦角度(以度为单位)。在三角函数中,反正弦是正弦的逆运算。 + +| 参数名 | 说明 | +| ----------- | ---------------------------------------- | +| Float:value | 需要计算反正弦值的数值,取值范围[-1, +1] | + +## 返回值 + +以度为单位的反正弦角度,取值范围[-90.0, +90.0]。 + +## 示例 + +```c +// 数值0.500000的反正弦值为30.000000度 + +public OnGameModeInit() +{ + new Float:param, Float:result; + param = 0.5; + result = asin(param); + printf("数值%f的反正弦值为%f度", param, result); + return 1; +} +``` + +## 相关函数 + +- [floatsin](floatsin): 获取指定角度的正弦值 +- [floatcos](floatcos): 获取指定角度的余弦值 +- [floattan](floattan): 获取指定角度的正切值 +- [acos](acos): 计算反余弦角度值 +- [atan](atan): 计算反正切角度值 +- [atan2](atan2): 计算多值反正切角度值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/atan.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/atan.md new file mode 100644 index 00000000000..fae0bbf2a02 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/atan.md @@ -0,0 +1,44 @@ +--- +title: atan +sidebar_label: atan +description: 计算单值反正切角度(以度为单位) +tags: ["数学"] +--- + + + +## 描述 + +计算指定正切值的单值反正切角度(以度为单位)。在三角函数中,反正切是正切的逆运算。注意由于符号歧义,本函数无法单独确定角度所在象限。建议需要精确判断时使用[atan2](多值反正切)函数。 + +| 参数名 | 说明 | +| ----------- | ---------------------- | +| Float:value | 需要计算反正切值的数值 | + +## 返回值 + +以度为单位的反正切角度,取值范围[-90.0, +90.0]。 + +## 示例 + +```c +// 数值1.000000的反正切值为45.000000度 + +public OnGameModeInit() +{ + new Float:param, Float:result; + param = 1.0; + result = atan(param); + printf("数值%f的反正切值为%f度", param, result); + return 1; +} +``` + +## 相关函数 + +- [floatsin](正弦): 获取指定角度的正弦值 +- [floatcos](余弦): 获取指定角度的余弦值 +- [floattan](正切): 获取指定角度的正切值 +- [asin](反正弦): 计算反正弦角度值 +- [acos](反余弦): 计算反余弦角度值 +- [atan2](多值反正切): 计算精确象限的多值反正切 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/atan2.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/atan2.md new file mode 100644 index 00000000000..7c8e40978c7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/atan2.md @@ -0,0 +1,52 @@ +--- +title: atan2 +sidebar_label: atan2 +description: 计算多值反正切角度(以度为单位) +tags: ["数学"] +--- + + + +:::warning + +注意参数顺序为 y 值在前,x 值在后。这是为了符合数学中 y/x 的运算顺序惯例。 + +::: + +## 描述 + +计算基于两个坐标值的多值反正切角度(以度为单位)。本函数通过考虑 x 和 y 的符号来精确判断角度所在的象限。 + +| 参数名 | 说明 | +| ------- | --------------------- | +| Float:y | 表示 y 坐标比例的数值 | +| Float:x | 表示 x 坐标比例的数值 | + +## 返回值 + +以度为单位的反正切角度,取值范围[-180.0, +180.0]。 + +## 示例 + +```c +// 坐标(x=-10.000000, y=10.000000)的反正切值为135.000000度 + +public OnGameModeInit() +{ + new Float:x, Float:y, Float:result; + x = -10.0; + y = 10.0; + result = atan2(y, x); + printf("坐标(x=%f, y=%f)的反正切值为%f度", x, y, result); + return 1; +} +``` + +## 相关函数 + +- [floatsin](正弦): 获取指定角度的正弦值 +- [floatcos](余弦): 获取指定角度的余弦值 +- [floattan](正切): 获取指定角度的正切值 +- [asin](反正弦): 计算反正弦角度值 +- [acos](反余弦): 计算反余弦角度值 +- [atan](反正切): 计算单值反正切角度值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/clamp.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/clamp.md new file mode 100644 index 00000000000..342f3d522f3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/clamp.md @@ -0,0 +1,37 @@ +--- +title: clamp +sidebar_label: clamp +description: 将数值强制限制在指定范围内 +tags: ["核心功能"] +--- + + + +## 描述 + +将输入的数值强制限制在指定的区间范围内 + +| 参数名 | 说明 | +| ------ | --------------------------------------- | +| value | 需要限制范围的数值 | +| min | 区间下限值(可选参数,默认值:cellmin) | +| max | 区间上限值(可选参数,默认值:cellmax) | + +## 返回值 + +- 当数值在 min~max 区间时,返回原值 +- 当数值小于 min 时,返回 min +- 当数值大于 max 时,返回 max + +## 示例代码 + +```c +new + valueA = 3, + valueB = 7, + valueC = 100 +; +printf("计算结果:%d", clamp(valueA, 5, 10)); // 输出:"计算结果:5"(3小于下限5) +printf("计算结果:%d", clamp(valueB, 5, 10)); // 输出:"计算结果:7"(7在5~10区间) +printf("计算结果:%d", clamp(valueC, 5, 10)); // 输出:"计算结果:10"(100超过上限10) +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_close.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_close.md new file mode 100644 index 00000000000..fbc0cfb02f7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_close.md @@ -0,0 +1,120 @@ +--- +title: db_close +sidebar_label: db_close +description: 关闭通过`db_open`打开的SQLite数据库连接。 +keywords: + - sqlite +tags: ["sqlite"] +--- + + + +## 描述 + +关闭通过[db_open](db_open)建立的 SQLite 数据库连接。 + +| 参数名 | 说明 | +| ------ | -------------------------------------------------- | +| DB:db | 要关闭的数据库连接句柄(由[db_open](db_open)返回) | + +## 返回值 + +**true** - 函数执行成功 + +**false** - 函数执行失败(可能由于数据库连接句柄无效) + +## 示例 + +```c +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 创建数据库连接 + gDBConnectionHandle = db_open("example.db"); + + // 检测数据库连接状态 + if (gDBConnectionHandle) + { + // 成功建立连接 + print("成功连接数据库 \"example.db\""); + } + else + { + // 连接失败 + print("无法连接数据库 \"example.db\""); + } + + // ... + + return 1; +} + +public OnGameModeExit() +{ + // 关闭已存在的数据库连接 + if (db_close(gDBConnectionHandle)) + { + // 清理句柄 + gDBConnectionHandle = DB:0; + } + + // ... + + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非零的无效句柄将导致服务器崩溃!请始终使用[db_open](db_open)获取有效数据库连接句柄 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库连接内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试用-获取已打开数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试用-获取已打开查询结果数 + +## 现代 SQLite 函数 + +- [DB_Open](DB_Open): 建立 SQLite 数据库连接 +- [DB_Close](DB_Close): 关闭 SQLite 数据库连接 +- [DB_ExecuteQuery](DB_ExecuteQuery): 执行 SQL 查询语句 +- [DB_FreeResultSet](DB_FreeResultSet): 释放查询结果集内存 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 选择下一行数据 +- [DB_GetFieldCount](DB_GetFieldCount): 获取结果集字段数量 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过字段索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过字段名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过字段索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过字段名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过字段索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过字段名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库连接内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果内存句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-获取数据库连接数 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-获取结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openfiles.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openfiles.md new file mode 100644 index 00000000000..ad98ce50177 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openfiles.md @@ -0,0 +1,36 @@ +--- +title: db_debug_openfiles +sidebar_label: db_debug_openfiles +description: 调试用-获取已打开的数据库连接数量。 +keywords: + - sqlite +--- + + + +## 描述 + +此函数用于调试目的,获取当前已打开的数据库连接数量。 + +| 参数名 | 说明 | +| ------ | ---- | + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库连接内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openresults](db_debug_openresults): 调试用-获取已打开的查询结果数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openresults.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openresults.md new file mode 100644 index 00000000000..a3227f3139f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_debug_openresults.md @@ -0,0 +1,36 @@ +--- +title: db_debug_openresults +sidebar_label: db_debug_openresults +description: 调试用-获取已打开的数据库查询结果数量 +keywords: + - sqlite +--- + + + +## 描述 + +此函数用于调试目的,获取当前已打开的数据库查询结果数量。 + +| 参数名 | 说明 | +| ------ | ---- | + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库连接内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试用-获取已打开的数据库连接数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_field_name.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_field_name.md new file mode 100644 index 00000000000..22e28111df7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_field_name.md @@ -0,0 +1,109 @@ +--- +title: db_field_name +sidebar_label: db_field_name +description: 返回指定索引处的字段名称。 +keywords: + - sqlite +--- + + + +## 描述 + +通过字段索引获取查询结果中的字段名称。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | +| field | 要获取的字段索引(从 0 开始) | +| result[] | 存储字段名称的字符数组 | +| maxlength | 字段名称的最大存储长度 | + +## 返回值 + +- **1** - 结果集句柄有效且操作成功 +- **0** - 结果集句柄无效或操作失败 + +## 示例 + +```c +static DB:gDBConnectionHandle; + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + // 从'join_log'表中选择第一条记录 + new DBResult:db_result_set = db_query(gDBConnectionHandle, "SELECT * FROM `join_log` LIMIT 1"); + + if (db_result_set) + { + // 获取结果集字段总数 + new columns = db_num_fields(db_result_set); + + // 预分配字段名称存储空间 + new field_name[32]; + + // 遍历所有字段索引 + for (new index; index < columns; index++) + { + // 将第index个字段名称存入field_name + db_field_name(db_result_set, index, field_name, sizeof(field_name)); + + // 输出字段信息 + printf("字段索引 %d 名称: \"%s\"", index, field_name); + } + + // 释放结果集 + db_free_result(db_result_set); + } + } + else + { + print("无法连接数据库 \"example.db\""); + } +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立数据库连接 +- [db_close](db_close): 关闭数据库连接 +- [db_query](db_query): 执行 SQL 查询 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行 +- [db_num_fields](db_num_fields): 获取字段总数 +- [db_get_field](db_get_field): 通过索引获取字段值 +- [db_get_field_assoc](db_get_field_assoc): 通过名称获取字段值 +- [db_get_field_int](db_get_field_int): 获取整数字段值(索引) +- [db_get_field_assoc_int](db_get_field_assoc_int): 获取整数字段值(名称) +- [db_get_field_float](db_get_field_float): 获取浮点字段值(索引) +- [db_get_field_assoc_float](db_get_field_assoc_float): 获取浮点字段值(名称) +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_free_result.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_free_result.md new file mode 100644 index 00000000000..df5b2ee05c7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_free_result.md @@ -0,0 +1,111 @@ +--- +title: db_free_result +sidebar_label: db_free_result +description: 释放由db_query分配的查询结果内存。 +keywords: + - sqlite +--- + + + +## 描述 + +释放由[db_query](db_query)分配的查询结果内存。 + +| 参数名 | 说明 | +| ----------------- | -------------------------------------------------- | +| DBResult:dbresult | 要释放的查询结果句柄(由[db_query](db_query)分配) | + +## 返回值 + +- **1** - 结果集句柄有效且操作成功 +- **0** - 结果集句柄无效或操作失败 + +## 示例 + +```c +// 实体存储模块 + +EntityStorage_SpawnAll(DB:connectionHandle) +{ + // 从"entities"表中选择所有条目 + new DBResult:db_result_set = db_query(connectionHandle, "SELECT * FROM `entities`"); + + // 验证结果集有效性 + if (db_result_set) + { + // 执行相关操作... + + // 释放结果集内存 + db_free_result(db_result_set); + } +} +``` + +```c +// 游戏模式主文件 + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + EntityStorage_SpawnAll(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field.md new file mode 100644 index 00000000000..2694de26cdb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field.md @@ -0,0 +1,161 @@ +--- +title: db_get_field +sidebar_label: db_get_field +description: 从db_query结果中获取字段内容 +keywords: + - sqlite +--- + + + +## 描述 + +从[db_query](db_query)结果集中获取指定字段的内容。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | +| field | 目标字段索引 | +| result[] | 存储结果的字符数组 | +| maxlength | 结果的最大存储长度 | + +## 返回值 + +- **1** - 结果集句柄有效且字段存在 +- **0** - 结果集句柄无效或字段不存在 + +## 示例 + +```c +// 示例模块 + +// ... + +static FindFieldIndexByName(DBResult:dbResultSet, const fieldName[]) +{ + // 默认返回-1表示未找到 + new ret = -1; + + // 获取字段总数 + new field_count = db_num_fields(dbResultSet); + + // 当前字段名称缓存 + new current_field_name[32]; + + // 遍历所有字段索引 + for (new field_index; field_index < field_count; field_index++) + { + // 获取字段名称 + if (db_field_name(dbResultSet, field_index, current_field_name, sizeof current_field_name)) + { + // 匹配目标字段名称 + if (!strcmp(fieldName, current_field_name)) + { + ret = field_index; // 记录匹配的索引 + break; // 提前退出循环 + } + } + } + + return ret; +} + +Examples_ListNames(DB:dbConnectionHandle) +{ + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `name` FROM `examples`"); + + if (db_result_set) + { + // 获取"name"字段的索引 + new target_field_index = FindFieldIndexByName(db_result_set, "name"); + + if (target_field_index >= 0) + { + // 预分配结果存储空间 + new result[256]; + + // 遍历结果集 + do + { + // 获取目标字段内容 + db_get_field(db_result_set, target_field_index, result, sizeof(result)); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + } + + // 释放结果集 + db_free_result(db_result_set); + } +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + Examples_ListNames(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc.md new file mode 100644 index 00000000000..edc6777ffcc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc.md @@ -0,0 +1,126 @@ +--- +title: db_get_field_assoc +sidebar_label: db_get_field_assoc +description: 通过字段名称获取当前结果行的字符串内容。 +keywords: + - sqlite +--- + + + +## 描述 + +通过字段名称获取当前结果行的字符串内容。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | +| field[] | 目标字段名称 | +| result[] | 存储结果的字符数组 | +| maxlength | 结果的最大存储长度 | + +## 返回值 + +- **1** - 结果集句柄有效且字段存在 +- **0** - 结果集句柄无效或字段不存在 + +## 示例 + +```c +// 示例模块 + +// ... + +Examples_ListNames(DB:dbConnectionHandle) +{ + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `name` FROM `examples`"); + + if (db_result_set) + { + // 预分配结果存储空间 + new result[256]; + + // 遍历结果集 + do + { + // 获取'name'字段内容 + db_get_field_assoc(db_result_set, "name", result, sizeof(result)); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + + // 释放结果集 + db_free_result(db_result_set); + } +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + Examples_ListNames(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_float.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_float.md new file mode 100644 index 00000000000..e6d51b0fdf4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_float.md @@ -0,0 +1,125 @@ +--- +title: db_get_field_assoc_float +sidebar_label: db_get_field_assoc_float +description: 通过字段名称获取当前结果行的浮点数值。 +keywords: + - sqlite +--- + + + +## 描述 + +通过字段名称从当前结果行中获取浮点数值。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | +| field[] | 目标字段名称 | + +## 返回值 + +以浮点数形式返回获取的字段值。 + +## 示例 + +```c +// 示例模块 + +// ... + +Float:Examples_CalculateSum(DB:dbConnectionHandle) +{ + // 返回值变量 + new Float:ret; + + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 遍历结果集 + do + { + // 将'value'字段的浮点数值累加到返回值 + ret += db_get_field_assoc_float(db_result_set, "value"); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + + // 释放结果集 + db_free_result(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %f", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_int.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_int.md new file mode 100644 index 00000000000..7f39d91b57f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_assoc_int.md @@ -0,0 +1,125 @@ +--- +title: db_get_field_assoc_int +sidebar_label: db_get_field_assoc_int +description: 通过字段名称获取当前结果行的整数值。 +keywords: + - sqlite +--- + + + +## 描述 + +通过字段名称从当前结果行中获取整数值。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | +| field[] | 目标字段名称 | + +## 返回值 + +以整数形式返回获取的字段值。 + +## 示例 + +```c +// 示例模块 + +// ... + +Examples_CalculateSum(DB:dbConnectionHandle) +{ + // 返回值变量 + new ret; + + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 遍历结果集 + do + { + // 将'value'字段的整数值累加到返回值 + ret += db_get_field_assoc_int(db_result_set, "value"); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + + // 释放结果集 + db_free_result(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %d", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_float.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_float.md new file mode 100644 index 00000000000..919c3243325 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_float.md @@ -0,0 +1,159 @@ +--- +title: db_get_field_float +sidebar_label: db_get_field_float +description: 通过字段索引获取当前结果行的浮点数值。 +keywords: + - sqlite +--- + + + +## 描述 + +通过字段索引从当前结果行中获取浮点数值。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | +| field = 0 | 目标字段索引(默认 0) | + +## 返回值 + +以浮点数形式返回获取的字段值。 + +## 示例 + +```c +// 示例模块 + +// ... + +static FindFieldIndexByName(DBResult:dbResultSet, const fieldName[]) +{ + // 默认返回-1表示未找到 + new ret = -1; + + // 获取字段总数 + new field_count = db_num_fields(dbResultSet); + + // 当前字段名称缓存 + new current_field_name[32]; + + // 遍历所有字段索引 + for (new field_index; field_index < field_count; field_index++) + { + // 获取字段名称 + if (db_field_name(dbResultSet, field_index, current_field_name, sizeof current_field_name)) + { + // 匹配目标字段名称 + if (!strcmp(fieldName, current_field_name)) + { + ret = field_index; // 记录匹配的索引 + break; // 提前退出循环 + } + } + } + + return ret; +} + +Float:Examples_CalculateSum(DB:dbConnectionHandle) +{ + new Float:ret; + + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 获取"value"字段的索引 + new target_field_index = FindFieldIndexByName(db_result_set, "value"); + + if (target_field_index >= 0) + { + // 遍历结果集 + do + { + // 累加浮点数值 + ret += db_get_field_float(db_result_set, target_field_index); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + } + + // 释放结果集 + db_free_result(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %f", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_int.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_int.md new file mode 100644 index 00000000000..15a08f2a3b3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_field_int.md @@ -0,0 +1,159 @@ +--- +title: db_get_field_int +sidebar_label: db_get_field_int +description: 通过字段索引从db_query结果中获取整数值。 +keywords: + - sqlite +--- + + + +## 描述 + +通过字段索引从[db_query](db_query)结果中获取整数值。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | +| field = 0 | 目标字段索引(默认 0) | + +## 返回值 + +以整数形式返回获取的字段值。 + +## 示例 + +```c +// 示例模块 + +// ... + +static FindFieldIndexByName(DBResult:dbResultSet, const fieldName[]) +{ + // 默认返回-1表示未找到 + new ret = -1; + + // 获取字段总数 + new field_count = db_num_fields(dbResultSet); + + // 当前字段名称缓存 + new current_field_name[32]; + + // 遍历所有字段索引 + for (new field_index; field_index < field_count; field_index++) + { + // 获取字段名称 + if (db_field_name(dbResultSet, field_index, current_field_name, sizeof current_field_name)) + { + // 匹配目标字段名称 + if (!strcmp(fieldName, current_field_name)) + { + ret = field_index; // 记录匹配的索引 + break; // 提前退出循环 + } + } + } + + return ret; +} + +Examples_CalculateSum(DB:dbConnectionHandle) +{ + new ret; + + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 获取"value"字段的索引 + new target_field_index = FindFieldIndexByName(db_result_set, "value"); + + if (target_field_index >= 0) + { + // 遍历结果集 + do + { + // 累加整数值 + ret += db_get_field_int(db_result_set, target_field_index); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + } + + // 释放结果集 + db_free_result(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %d", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_mem_handle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_mem_handle.md new file mode 100644 index 00000000000..4fd7f23c6fd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_mem_handle.md @@ -0,0 +1,89 @@ +--- +title: db_get_mem_handle +sidebar_label: db_get_mem_handle +description: 获取通过`db_open`建立的SQLite数据库连接的内存句柄。 +keywords: + - sqlite +--- + + + + + +## 描述 + +获取通过[db_open](db_open)建立的 SQLite 数据库连接的内存句柄。 + +| 参数名 | 说明 | +| ------ | ------------------------------------------ | +| DB:db | 数据库连接句柄(由[db_open](db_open)返回) | + +## 返回值 + +返回数据库连接句柄的内存句柄(十六进制表示)。 + +## 示例 + +```c +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("数据库连接内存句柄: 0x%x", db_get_mem_handle(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的数据库连接句柄将导致服务器崩溃!请始终通过[db_open](db_open)获取有效句柄 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试用-获取已打开的数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试用-获取已打开的查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_result_mem_handle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_result_mem_handle.md new file mode 100644 index 00000000000..092b1906425 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_get_result_mem_handle.md @@ -0,0 +1,96 @@ +--- +title: db_get_result_mem_handle +sidebar_label: db_get_result_mem_handle +description: 获取通过`db_query`分配的SQLite数据库结果集内存句柄。 +keywords: + - sqlite +--- + + + + + +## 描述 + +该函数用于获取通过[db_query](db_query)分配的 SQLite 数据库结果集内存句柄。 + +| 参数名 | 说明 | +| ------ | -------------------------------------------- | +| DB:db | 数据库查询句柄(由[db_query](db_query)返回) | + +## 返回值 + +返回数据库查询结果集句柄的内存句柄(十六进制表示)。 + +## 示例 + +```c +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + // 执行数据库查询 + new DBResult:result_set = db_query(gDBConnectionHandle, "SELECT * FROM `examples`"); + print("成功连接数据库 \"example.db\""); + + if (result_set) + { + printf("查询结果内存句柄: 0x%x", db_get_result_mem_handle(result_set)); + db_free_result(result_set); // 释放结果集 + } + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库连接内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试用-获取数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试用-获取查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_next_row.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_next_row.md new file mode 100644 index 00000000000..7cc803cd55b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_next_row.md @@ -0,0 +1,123 @@ +--- +title: db_next_row +sidebar_label: db_next_row +description: 跳转到通过db_query分配的结果集的下一行。 +keywords: + - sqlite +--- + + + +## 描述 + +该函数用于跳转到通过[db_query](db_query)分配的查询结果集的下一行。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | + +## 返回值 + +- **1** - 结果集句柄有效且未到达最后一行 +- **0** - 结果集句柄无效或已遍历所有行 + +## 示例 + +```c +// 示例模块 + +// ... + +Examples_ListNames(DB:dbConnectionHandle) +{ + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `name` FROM `examples`"); + + if (db_result_set) + { + // 预分配结果存储空间 + new result[256]; + + // 遍历结果集 + do + { + // 通过字段名称获取数据 + db_get_field_assoc(db_result_set, "name", result, sizeof(result)); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + + // 释放结果集 + db_free_result(db_result_set); + } +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + Examples_ListNames(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试用-获取已打开的数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试用-获取已打开的查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_num_fields.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_num_fields.md new file mode 100644 index 00000000000..1ee95cb4894 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_num_fields.md @@ -0,0 +1,159 @@ +--- +title: db_num_fields +sidebar_label: db_num_fields +description: 获取通过`db_query`分配的结果集中的字段数量。 +keywords: + - sqlite +--- + + + +## 描述 + +该函数用于获取通过[db_query](db_query)分配的查询结果集中的字段总数。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | + +## 返回值 + +返回结果集中的字段数量(整数类型)。 + +## 示例 + +```c +// 示例模块 + +// ... + +static FindFieldIndexByName(DBResult:dbResultSet, const fieldName[]) +{ + // 默认返回-1表示未找到 + new ret = -1; + + // 获取字段总数 + new field_count = db_num_fields(dbResultSet); + + // 当前字段名称缓存 + new current_field_name[32]; + + // 遍历所有字段 + for (new field_index; field_index < field_count; field_index++) + { + // 获取字段名称 + if (db_field_name(dbResultSet, field_index, current_field_name, sizeof current_field_name)) + { + // 匹配目标字段名称 + if (!strcmp(fieldName, current_field_name)) + { + ret = field_index; // 记录匹配的索引 + break; // 提前退出循环 + } + } + } + + return ret; +} + +Float:Examples_CalculateSum(DB:dbConnectionHandle) +{ + // 返回值变量 + new Float:ret; + + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `value` FROM `examples`"); + + if (db_result_set) + { + // 获取目标字段索引 + new target_field_index = FindFieldIndexByName(db_result_set, "value"); + + if (target_field_index >= 0) + { + // 遍历结果集 + do + { + // 累加浮点数值 + ret += db_get_field_float(db_result_set, target_field_index); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + } + + // 释放结果集 + db_free_result(db_result_set); + } + + return ret; +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + printf("计算结果总和: %f", Examples_CalculateSum(gDBConnectionHandle)); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试用-获取已打开的数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试用-获取已打开的查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_num_rows.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_num_rows.md new file mode 100644 index 00000000000..2ae9b644027 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_num_rows.md @@ -0,0 +1,126 @@ +--- +title: db_num_rows +sidebar_label: db_num_rows +description: 返回通过db_query执行的查询结果中的行数。 +keywords: + - sqlite +--- + + + +## 描述 + +该函数用于获取通过[db_query](db_query)执行的查询结果中的行数。 + +| 参数名 | 说明 | +| ----------------- | ------------------------------------------ | +| DBResult:dbresult | 查询结果句柄(由[db_query](db_query)返回) | + +## 返回值 + +返回结果集中的行数(整数类型)。 + +## 示例 + +```c +// 示例模块 + +// ... + +Examples_ListNames(DB:dbConnectionHandle) +{ + // 执行数据库查询 + new DBResult:db_result_set = db_query(dbConnectionHandle, "SELECT `name` FROM `examples`"); + + if (db_result_set) + { + // 预分配结果存储空间 + new result[256]; + + // 获取总行数 + new row_count = db_num_rows(db_result_set); + printf("查询结果包含 %d 行数据", row_count); + + // 遍历结果集 + do + { + // 通过字段名称获取数据 + db_get_field_assoc(db_result_set, "name", result, sizeof(result)); + } + while (db_next_row(db_result_set)); // 跳转至下一行 + + // 释放结果集 + db_free_result(db_result_set); + } +} +``` + +```c +// 主游戏模式文件 + +// ... + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + Examples_ListNames(gDBConnectionHandle); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +使用非法的结果集句柄将导致服务器崩溃!请始终通过[db_query](db_query)获取有效的查询结果 + +::: + +## 相关函数 + +- [db_open](db_open): 建立 SQLite 数据库连接 +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试用-获取已打开的数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试用-获取已打开的查询结果数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_open.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_open.md new file mode 100644 index 00000000000..febce6c0d9e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_open.md @@ -0,0 +1,114 @@ +--- +title: db_open +sidebar_label: db_open +description: 该函数用于建立与`/scriptfiles`目录下的SQLite数据库文件的连接。 +keywords: + - sqlite +tags: ["sqlite"] +--- + + + +## 描述 + +该函数用于建立与`/scriptfiles`目录下的 SQLite 数据库文件的连接。 + +| 参数名 | 描述 | +| ------------------------------------------------------------------- | ------------------------------------------ | +| const name[] | 数据库文件名(不含路径) | +| SQLITE_OPEN:flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | [权限标志](../resources/sqlite-open-flags) | + +## 返回值 + +返回数据库连接句柄索引(从 1 开始)。 + +## 示例 + +```c +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + // 验证连接状态 + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄 + } + return 1; +} +``` + +## 注意事项 + +:::warning + +当指定数据库文件不存在时,将自动创建新数据库文件!请务必使用[db_close](db_close)关闭数据库连接! + +::: + +## 相关函数 + +- [db_close](db_close): 关闭 SQLite 数据库连接 +- [db_query](db_query): 执行 SQL 查询语句 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果集行数 +- [db_next_row](db_next_row): 跳转至下一行数据 +- [db_num_fields](db_num_fields): 获取结果集字段数量 +- [db_field_name](db_field_name): 通过索引获取字段名称 +- [db_get_field](db_get_field): 通过字段索引获取当前行数据 +- [db_get_field_assoc](db_get_field_assoc): 通过字段名称获取当前行数据 +- [db_get_field_int](db_get_field_int): 通过字段索引获取整型数据 +- [db_get_field_assoc_int](db_get_field_assoc_int): 通过字段名称获取整型数据 +- [db_get_field_float](db_get_field_float): 通过字段索引获取浮点数据 +- [db_get_field_assoc_float](db_get_field_assoc_float): 通过字段名称获取浮点数据 +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存句柄 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存句柄 +- [db_debug_openfiles](db_debug_openfiles): 调试用-获取已打开的数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试用-获取已打开的查询结果数 + +## 现代 SQLite 函数 + +- [DB_Open](DB_Open): 新版数据库连接函数 +- [DB_Close](DB_Close): 新版数据库关闭函数 +- [DB_ExecuteQuery](DB_ExecuteQuery): 新版 SQL 查询执行 +- [DB_FreeResultSet](DB_FreeResultSet): 新版结果集内存释放 +- [DB_GetRowCount](DB_GetRowCount): 获取结果集行数 +- [DB_SelectNextRow](DB_SelectNextRow): 跳转至下一行 +- [DB_GetFieldCount](DB_GetFieldCount): 获取字段总数 +- [DB_GetFieldName](DB_GetFieldName): 通过索引获取字段名称 +- [DB_GetFieldString](DB_GetFieldString): 通过索引获取字符串数据 +- [DB_GetFieldStringByName](DB_GetFieldStringByName): 通过名称获取字符串数据 +- [DB_GetFieldInt](DB_GetFieldInt): 通过索引获取整型数据 +- [DB_GetFieldIntByName](DB_GetFieldIntByName): 通过名称获取整型数据 +- [DB_GetFieldFloat](DB_GetFieldFloat): 通过索引获取浮点数据 +- [DB_GetFieldFloatByName](DB_GetFieldFloatByName): 通过名称获取浮点数据 +- [DB_GetMemHandle](DB_GetMemHandle): 获取数据库内存句柄 +- [DB_GetLegacyDBResult](DB_GetLegacyDBResult): 获取传统查询结果句柄 +- [DB_GetDatabaseConnectionCount](DB_GetDatabaseConnectionCount): 调试用-数据库连接数统计 +- [DB_GetDatabaseResultSetCount](DB_GetDatabaseResultSetCount): 调试用-结果集数量统计 + +## 相关资源 + +- [SQLite 权限标志说明](../resources/sqlite-open-flags) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_query.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_query.md new file mode 100644 index 00000000000..364254d8619 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/db_query.md @@ -0,0 +1,112 @@ +--- +title: db_query +sidebar_label: db_query +description: 在已打开的SQLite数据库上执行SQL查询语句。 +keywords: + - sqlite +--- + + + +## 描述 + +该函数用于在已建立的 SQLite 数据库连接上执行 SQL 查询。 + +| 参数名 | 描述 | +| ------- | --------------------- | +| DB:db | 数据库连接句柄 | +| query[] | 要执行的 SQL 查询语句 | + +## 返回值 + +- 执行成功返回结果集句柄索引(从 1 开始) +- 执行失败返回 0 + +## 示例 + +```c +// 实体存储模块 + +EntityStorage_SpawnAll(DB:connectionHandle) +{ + // 从"entities"表中查询所有记录 + new DBResult:db_result_set = db_query(connectionHandle, "SELECT * FROM `entities`"); + + // 验证结果集有效性 + if (db_result_set) + { + // 执行数据操作... + + // 释放结果集内存 + db_free_result(db_result_set); + } +} +``` + +```c +// 游戏模式主文件 + +#include + +static DB:gDBConnectionHandle; + +// ... + +public OnGameModeInit() +{ + // ... + + // 建立数据库连接 + gDBConnectionHandle = db_open("example.db"); + + if (gDBConnectionHandle) + { + print("成功连接数据库 \"example.db\""); + EntityStorage_SpawnAll(gDBConnectionHandle); // 加载实体数据 + } + else + { + print("无法连接数据库 \"example.db\""); + } + + return 1; +} + +public OnGameModeExit() +{ + // 关闭数据库连接 + if (db_close(gDBConnectionHandle)) + { + gDBConnectionHandle = DB:0; // 重置句柄防止重复关闭 + } + return 1; +} +``` + +## 注意事项 + +:::danger + +必须使用[db_free_result](db_free_result)释放查询结果,否则会导致内存泄漏! + +::: + +## 相关功能 + +- [db_open](db_open): 建立数据库连接 +- [db_close](db_close): 关闭数据库连接 +- [db_free_result](db_free_result): 释放查询结果内存 +- [db_num_rows](db_num_rows): 获取结果行数 +- [db_next_row](db_next_row): 遍历结果集行 +- [db_num_fields](db_num_fields): 获取字段数量 +- [db_field_name](db_field_name): 获取字段名称 +- [db_get_field](db_get_field): 通过索引获取字段值 +- [db_get_field_assoc](db_get_field_assoc): 通过名称获取字段值 +- [db_get_field_int](db_get_field_int): 获取整型数据(索引) +- [db_get_field_assoc_int](db_get_field_assoc_int): 获取整型数据(名称) +- [db_get_field_float](db_get_field_float): 获取浮点数据(索引) +- [db_get_field_assoc_float](db_get_field_assoc_float): 获取浮点数据(名称) +- [db_get_mem_handle](db_get_mem_handle): 获取数据库内存地址 +- [db_get_result_mem_handle](db_get_result_mem_handle): 获取查询结果内存地址 +- [db_debug_openfiles](db_debug_openfiles): 调试数据库连接数 +- [db_debug_openresults](db_debug_openresults): 调试结果集数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/deleteproperty.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/deleteproperty.md new file mode 100644 index 00000000000..3dd6214b861 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/deleteproperty.md @@ -0,0 +1,42 @@ +--- +title: deleteproperty +sidebar_label: deleteproperty +description: 删除先前设置的属性(setproperty)。 +tags: ["核心", "属性"] +--- + + + +## 描述 + +删除先前设置的属性([setproperty](setproperty))。 + +| 参数名 | 说明 | +| ------ | ----------------------------------------------------------------- | +| id | 使用的虚拟机 ID。应保持该值为零。_(optional=0)_ | +| name[] | 属性名称,应保持为空字符串("")。 | +| value | 属性的唯一 ID。使用哈希函数从字符串计算得出。_(optional=cellmin)_ | + +## 返回值 + +属性的值。若属性不存在则返回 0。 + +## 示例 + +```c +deleteproperty(0, "", 123984334); +``` + +## 注意事项 + +:::tip + +建议使用 PVars/SVars 或 GVar 插件替代此原生函数,因其执行效率较低。 + +::: + +## 相关函数 + +- [setproperty](setproperty): 设置属性值 +- [getproperty](getproperty): 获取属性值 +- [existproperty](existproperty): 检查属性是否存在 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/diskfree.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/diskfree.md new file mode 100644 index 00000000000..f95d084ee7b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/diskfree.md @@ -0,0 +1,68 @@ +--- +title: diskfree +sidebar_label: diskfree +description: 返回可用磁盘空间。 +tags: ["文件管理"] +--- + + + +:::warning + +该函数尚未实现。 + +::: + + + +## 描述 + +返回可用磁盘空间。 + +| 名称 | 描述 | +| ------------------- | ------------------------------------------------------ | +| const volume[] = "" | 多磁盘系统或存储卡设备的卷名称(单卷系统下此参数可选) | + +## 返回值 + +以 KiB 为单位的可用空间量。 + +## 示例 + +```c +new freeSpace = diskfree(); + +printf("可用空间 = %d KiB", freeSpace); +``` + +## 注意事项 + +:::tip + +最大支持容量为 2048 GiB (2TB) + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 写入单个字符到文件 +- [fgetchar](fgetchar): 从文件读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块到文件 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 定位文件指针位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件指针位置 +- [fflush](fflush): 刷新文件缓冲区到磁盘 +- [fstat](fstat): 获取文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算文件 32 位 CRC 校验值 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/existproperty.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/existproperty.md new file mode 100644 index 00000000000..a7f7cae4d58 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/existproperty.md @@ -0,0 +1,45 @@ +--- +title: existproperty +sidebar_label: existproperty +description: 检查属性是否存在。 +tags: ["核心", "属性"] +--- + + + +## 描述 + +检查指定属性是否存在。 + +| 名称 | 描述 | +| ------ | ------------------------------------------------------ | +| id | 使用的虚拟机 ID,应保持为 0 _(可选=0)_ | +| name[] | 属性名称,应保持为空字符串 "" | +| value | 属性唯一 ID。使用哈希函数从字符串生成 _(可选=cellmin)_ | + +## 返回值 + +如果属性存在返回 true,否则返回 false。 + +## 示例 + +```c +if (existproperty(0, "", 123984334)) +{ + // 属性存在,执行相应操作 +} +``` + +## 注意事项 + +:::tip + +由于性能较低,建议使用 PVars/SVars 或 GVar 插件替代此原生函数 + +::: + +## 相关函数 + +- [setproperty](setproperty): 设置属性值 +- [getproperty](getproperty): 获取属性值 +- [deleteproperty](deleteproperty): 删除属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/existpubvar.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/existpubvar.md new file mode 100644 index 00000000000..9183ebffb30 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/existpubvar.md @@ -0,0 +1,28 @@ +--- +title: existpubvar +sidebar_label: existpubvar +description: 检查当前脚本中是否存在特定公共变量。 +tags: ["核心", "公共变量"] +--- + + + +## 描述 + +检查当前脚本中是否存在特定公共变量。 + +| 名称 | 描述 | +| ------------ | -------------------- | +| const name[] | 要检查的公共变量名称 | + +## 返回值 + +**true** - 变量存在 + +**false** - 变量不存在 + +## 相关函数 + +- [getpubvar](getpubvar): 获取公共变量值 +- [setpubvar](setpubvar): 设置公共变量值 +- [numpubvars](numpubvars): 统计脚本中公共变量数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fattrib.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fattrib.md new file mode 100644 index 00000000000..650db1fb92b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fattrib.md @@ -0,0 +1,76 @@ +--- +title: fattrib +sidebar_label: fattrib +description: 设置文件属性。 +tags: ["文件管理"] +--- + + + + + +## 描述 + +设置文件属性参数。 + +| 名称 | 描述 | +| ---------------- | ------------------------------------------------------ | +| const filename[] | 目标文件名 | +| timestamp = 0 | 文件最后修改时间(UNIX 时间戳),设为 0 时保留原时间戳 | +| attrib = 0x0F | 文件属性位掩码,设为 0x0F 时保留原属性 | + +## 返回值 + +**true** - 操作成功 + +**false** - 操作失败 + +## 示例 + +```c +// 将文件修改时间设置为 '2024-03-07 06:28:15' +if (fattrib("file.txt", 1709792895)) +{ + // 成功提示 + print("文件属性设置成功"); +} +else +{ + // 错误处理 + print("文件\"file.txt\"不存在或无法设置属性"); +} +``` + +## 注意事项 + +:::tip + +- 时间戳使用 UNIX 纪元时间(1970 年 1 月 1 日至今的秒数) +- 文件属性使用位掩码机制 +- 具体位掩码含义取决于底层文件系统(FAT/NTFS/ext 等) + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 写入单个字符到文件 +- [fgetchar](fgetchar): 从文件读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块到文件 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 定位文件指针位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件指针位置 +- [fflush](fflush): 刷新文件缓冲区到磁盘 +- [fstat](fstat): 获取文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算文件 32 位 CRC 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fblockread.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fblockread.md new file mode 100644 index 00000000000..4d2065b234a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fblockread.md @@ -0,0 +1,103 @@ +--- +title: fblockread +sidebar_label: fblockread +description: 从文件读取原始数据块(不处理编码和行终止符)。 +tags: ["文件管理"] +--- + + + +## 描述 + +该函数允许从文件中读取原始数据块(不处理编码和行终止符)。 + +| 名称 | 描述 | +| ---------------------- | -------------------------------------- | +| File:handle | 通过 fopen()打开的文件句柄 | +| buffer | 存储读取数据的缓冲区 | +| size = sizeof (buffer) | 要读取的数据单元数量(默认缓冲区大小) | + +## 返回值 + +读取的数据单元数量,文件末尾时返回 0 + +## 示例 + +```c +// 定义枚举结构 +enum _:some_enum +{ + some_data1, + some_data2[20], + Float:some_data3 +} + +// 声明数据容器 +new some_data[some_enum]; + +// ... + +// 以只读模式打开二进制文件 +new File:handle = fopen("file.bin", io_read); + +// 声明文件长度变量 +new file_len; + +// 验证文件是否成功打开 +if (handle) +{ + // 获取文件总长度 + file_len = flength(handle); + + // 校验文件尺寸与数据结构匹配 + if (file_len == (some_enum*4)) + { + // 执行块读取操作 + fblockread(handle, some_data); + } + else + { + print("文件\"file.bin\"与数据结构不兼容"); + } + + // 关闭文件句柄 + fclose(handle); +} +else +{ + print("无法打开文件\"file.bin\""); +} +``` + +## 注意事项 + +:::warning + +使用无效句柄将导致服务器崩溃!请通过[fopen](fopen)或[ftemp](ftemp)获取有效句柄 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 写入单个字符到文件 +- [fgetchar](fgetchar): 从文件读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块到文件 +- [fseek](fseek): 定位文件指针位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件指针位置 +- [fflush](fflush): 刷新文件缓冲区到磁盘 +- [fstat](fstat): 获取文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算文件 32 位 CRC 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fblockwrite.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fblockwrite.md new file mode 100644 index 00000000000..95fdf7b10ab --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fblockwrite.md @@ -0,0 +1,89 @@ +--- +title: fblockwrite +sidebar_label: fblockwrite +description: 以二进制格式将数据写入文件,忽略换行符和编码。 +tags: ["文件管理"] +--- + + + +## 描述 + +将数据以二进制格式写入文件,不处理换行符和字符编码。 + +| 名称 | 描述 | +| ---------------------- | -------------------------------------- | +| File:handle | 通过 fopen()打开的文件句柄 | +| const buffer[] | 要写入文件的数据缓冲区 | +| size = sizeof (buffer) | 要写入的数据单元数量(默认缓冲区大小) | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +// 定义数据结构枚举 +enum _:some_enum +{ + some_data1, + some_data2[20], + Float:some_data3 +} + +// 声明数据容器 +new some_data[some_enum]; + +// ... + +// 以只写模式打开二进制文件 +new File:handle = fopen("file.bin", io_write); + +// 验证文件句柄有效性 +if (handle) +{ + // 执行块写入操作 + fblockwrite(handle, some_data); + + // 关闭文件句柄 + fclose(handle); +} +else +{ + print("无法打开文件\"file.bin\""); +} +``` + +## 注意事项 + +:::warning + +使用无效句柄将导致服务器崩溃!请通过[fopen](fopen)或[ftemp](ftemp)获取有效句柄 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 文本模式写入文件 +- [fread](fread): 文本模式读取文件 +- [fputchar](fputchar): 写入单个字符到文件 +- [fgetchar](fgetchar): 从文件读取单个字符 +- [fblockread](fblockread): 从文件读取原始数据块 +- [fseek](fseek): 定位文件指针位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件指针位置 +- [fflush](fflush): 刷新文件缓冲区到磁盘 +- [fstat](fstat): 获取文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算文件 32 位 CRC 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fclose.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fclose.md new file mode 100644 index 00000000000..6f64dc187b4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fclose.md @@ -0,0 +1,83 @@ +--- +title: fclose +sidebar_label: fclose +description: 关闭一个文件。 +tags: ["文件管理"] +--- + + + +## 描述 + +关闭一个文件。当脚本不再需要某个文件时(读取/写入后),应当始终关闭该文件。 + +| 名称 | 描述 | +| ----------- | ------------------------------------------ | +| File:handle | 要关闭的文件句柄。由 [fopen](fopen) 返回。 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败。文件无法关闭,可能已经处于关闭状态。 + +## 示例 + +```c +// 以"仅追加"模式打开"file.txt" +new File:handle = fopen("file.txt", io_append); + +// 检查文件是否成功打开 +if (handle) +{ + // 成功 + + // 向文件写入"Hi there!" + fwrite(handle, "Hi there!"); + + // 关闭文件 + fclose(handle); +} +else +{ + // 错误 + print("Failed to open file \"file.txt\"."); +} +``` + +## 注意事项 + +:::warning + +使用无效句柄将导致服务器崩溃!请通过 [fopen](fopen) 或 [ftemp](ftemp) 获取有效句柄。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 向文件写入字符 +- [fgetchar](fgetchar): 从文件读取字符 +- [fblockwrite](fblockwrite): 向文件写入数据块 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 跳转至文件指定位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件位置 +- [fflush](fflush): 将文件刷入磁盘(确保所有写入完成) +- [fstat](fstat): 返回文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 返回文件的 32 位 CRC 值 +- [diskfree](diskfree): 返回磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 + +``` + +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fcopy.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fcopy.md new file mode 100644 index 00000000000..c19c74555a9 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fcopy.md @@ -0,0 +1,70 @@ +--- +title: fcopy +sidebar_label: fcopy +description: 复制文件。 +tags: ["文件管理"] +--- + + + + + +## 描述 + +复制文件。 + +| 名称 | 描述 | +| -------------- | ------------------------------------------ | +| const source[] | 需要复制的(已存在的)文件名,可包含路径。 | +| const target[] | 新文件的名称,可包含完整路径。 | + +## 返回值 + +**true** 表示成功,**false** 表示失败。 + +## 示例 + +```c +if (fcopy("example.txt", "file.txt")) +{ + // 成功 + printf("文件 \"example.txt\" 已成功复制到 \"file.txt\"。"); +} +else +{ + // 错误 + print("文件 \"example.txt\" 不存在或无法打开。"); +} +``` + +## 注意事项 + +:::warning + +如果目标文件已存在,将被覆盖。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 向文件写入字符 +- [fgetchar](fgetchar): 从文件读取字符 +- [fblockwrite](fblockwrite): 向文件写入数据块 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 跳转至文件指定位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件位置 +- [fflush](fflush): 将文件刷入磁盘(确保所有写入完成) +- [fstat](fstat): 返回文件大小和时间戳 +- [frename](frename): 重命名文件 +- [filecrc](filecrc): 返回文件的 32 位 CRC 值 +- [diskfree](diskfree): 返回磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fcreatedir.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fcreatedir.md new file mode 100644 index 00000000000..eb70d2cfe9b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fcreatedir.md @@ -0,0 +1,69 @@ +--- +title: fcreatedir +sidebar_label: fcreatedir +description: 创建目录。 +tags: ["文件管理"] +--- + + + + + +## 描述 + +创建目录。 + +| 名称 | 描述 | +| --------------- | ---------------------------------- | +| const dirname[] | 要创建的目录名称,可包含完整路径。 | + +## 返回值 + +**true** 表示成功,**false** 表示失败。 + +## 示例 + +```c +if (fcreatedir("logs")) +{ + // 成功 + printf("目录 \"logs\" 创建成功。"); +} +else +{ + // 错误 + print("无法创建目录 \"logs\""); +} +``` + +## 注意事项 + +:::tip + +如需删除目录,请使用 [fremove](fremove)。删除前目录必须为空。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 向文件写入字符 +- [fgetchar](fgetchar): 从文件读取字符 +- [fblockwrite](fblockwrite): 向文件写入数据块 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 跳转至文件指定位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件位置 +- [fflush](fflush): 将文件刷入磁盘(确保所有写入完成) +- [fstat](fstat): 返回文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 返回文件的 32 位 CRC 值 +- [diskfree](diskfree): 返回磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fexist.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fexist.md new file mode 100644 index 00000000000..c348e2c41b4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fexist.md @@ -0,0 +1,63 @@ +--- +title: fexist +sidebar_label: fexist +description: 检查指定文件是否存在于scriptfiles目录中。 +tags: ["文件管理"] +--- + + + +## 描述 + +检查指定文件是否存在于 scriptfiles 目录中。 + +| 名称 | 描述 | +| ---------------- | ------ | +| const filename[] | 文件名 | + +## 返回值 + +返回匹配该模式的文件数量。 + +## 示例 + +```c +// 检查"file.txt"是否存在 +if (fexist("file.txt")) +{ + // 成功 + + // 输出成功信息 + print("\"file.txt\" 存在。"); +} +else +{ + // 错误 + print("\"file.txt\" 不存在。"); +} +``` + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 向文件写入字符 +- [fgetchar](fgetchar): 从文件读取字符 +- [fblockwrite](fblockwrite): 向文件写入数据块 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 跳转至文件指定位置 +- [flength](flength): 获取文件长度 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件位置 +- [fflush](fflush): 将文件刷入磁盘(确保所有写入完成) +- [fstat](fstat): 返回文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 返回文件的 32 位 CRC 值 +- [diskfree](diskfree): 返回磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fflush.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fflush.md new file mode 100644 index 00000000000..ade81b37280 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fflush.md @@ -0,0 +1,74 @@ +--- +title: fflush +sidebar_label: fflush +description: 将文件刷入磁盘(确保所有写入完成)。 +tags: ["文件管理"] +--- + + + + + +## 描述 + +将文件刷入磁盘(确保所有写入完成)。实际调用 [flength](flength) 函数实现,因为该函数需要强制刷新以确保准确性。 + +| 名称 | 描述 | +| ----------- | ------------------------------------ | +| File:handle | 文件句柄(由 [fopen](fopen) 返回)。 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败(无效的文件句柄)。 + +## 示例 + +```c +// 以"仅追加"模式打开"file.txt" +new File:handle = fopen("file.txt", io_append); + +// 检查文件是否成功打开 +if (handle) +{ + // 成功 + + // 追加文本"This is a text.\r\n" + fwrite(handle, "This is a text.\r\n"); + + fflush(handle); + + // 关闭文件 + fclose(handle); +} +else +{ + // 错误 + print("文件 \"file.txt\" 不存在或无法打开。"); +} +``` + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 向文件写入字符 +- [fgetchar](fgetchar): 从文件读取字符 +- [fblockwrite](fblockwrite): 向文件写入数据块 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 跳转至文件指定位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件位置 +- [fstat](fstat): 返回文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 返回文件的 32 位 CRC 值 +- [diskfree](diskfree): 返回磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fgetchar.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fgetchar.md new file mode 100644 index 00000000000..e41af61b98d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fgetchar.md @@ -0,0 +1,84 @@ +--- +title: fgetchar +sidebar_label: fgetchar +description: 从文件中读取单个字符。 +tags: ["文件管理"] +--- + + + +## 描述 + +从文件中读取单个字符。 + +| 名称 | 描述 | +| ----------- | ---------------------------------------------------------------------------- | +| File:handle | 文件句柄(由 [fopen](fopen) 返回) | +| value | 此参数无实际作用,保持为 "0" 即可 | +| bool:utf8 | 若为 `true` 以 UTF-8 编码读取字符,否则以扩展 ASCII 编码读取(默认:`true`) | + +## 返回值 + +成功时返回字符的扩展 ASCII 或 UTF-8 值,否则返回 EOF(文件末尾标识)。 + +## 示例 + +```c +// 以"只读"模式打开"file.txt" +new File:handle = fopen("file.txt", io_read); + +// 声明变量"g_char" +new g_char; + +// 检查"file.txt"是否成功打开 +if (handle) +{ + // 读取所有字符(忽略UTF-8编码) + while((g_char = fgetchar(handle, 0, false)) != EOF) + { + // 输出字符 + printf("[ \"file.txt\" ] 0x%x", g_char); + } + + // 关闭"file.txt" + fclose(handle); +} +else +{ + // 错误 + print("无法打开文件 \"file.txt\"。"); +} +``` + +## 注意事项 + +:::warning + +使用无效句柄将导致服务器崩溃!请通过 [fopen](fopen) 或 [ftemp](ftemp) 获取有效句柄。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 向文件写入字符 +- [fblockwrite](fblockwrite): 向文件写入数据块 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 跳转至文件指定位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件位置 +- [fflush](fflush): 将文件刷入磁盘(确保所有写入完成) +- [fstat](fstat): 返回文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 返回文件的 32 位 CRC 值 +- [diskfree](diskfree): 返回磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/filecrc.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/filecrc.md new file mode 100644 index 00000000000..3ce8ad7772c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/filecrc.md @@ -0,0 +1,72 @@ +--- +title: filecrc +sidebar_label: filecrc +description: 返回文件的32位CRC值。 +tags: ["文件管理"] +--- + + + + + +## 描述 + +返回文件的 32 位 CRC 值。 + +| 名称 | 描述 | +| ---------------- | ------ | +| const filename[] | 文件名 | + +## 返回值 + +返回文件的 32 位 CRC 值,若文件无法打开则返回 **0**。 + +## 示例 + +```c +new crc = filecrc("file.txt"); + +if (crc) +{ + // 成功 + printf("CRC 值 = %d", crc); +} +else +{ + // 错误 + print("文件 \"file.txt\" 不存在或无法打开。"); +} +``` + +## 注意事项 + +:::tip + +- CRC 值是校验文件在传输过程中是否被修改的有效指标(需事先保存原始文件的 CRC 值) +- 本函数返回的 CRC 值与 ZIP 归档工具(PKZip/WinZip)及 SFV 校验工具使用的标准完全一致 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 向文件写入字符 +- [fgetchar](fgetchar): 从文件读取字符 +- [fblockwrite](fblockwrite): 向文件写入数据块 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 跳转至文件指定位置 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件位置 +- [fflush](fflush): 将文件刷入磁盘(确保所有写入完成) +- [fstat](fstat): 返回文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [diskfree](diskfree): 返回磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/flength.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/flength.md new file mode 100644 index 00000000000..9f5807ab39f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/flength.md @@ -0,0 +1,77 @@ +--- +title: flength +sidebar_label: flength +description: 返回文件的长度。 +tags: ["文件管理"] +--- + + + +## 描述 + +返回文件的长度(以字节为单位)。 + +| 名称 | 描述 | +| ----------- | -------------------------------------------------- | +| File:handle | 由 [fopen](fopen) 或 [ftemp](ftemp) 返回的文件句柄 | + +## 返回值 + +文件长度(单位:字节) + +## 示例 + +```c +// 以"只读"模式打开"file.txt" +new File:handle = fopen("file.txt", io_read); + +// 检查文件是否成功打开 +if (handle) +{ + // 成功 + + // 输出"file.txt"的字节大小 + printf("文件大小: %d 字节", flength(handle)); + + // 关闭"file.txt" + fclose(handle); +} +else +{ + // 错误 + print("无法打开文件 \"file.txt\"。"); +} +``` + +## 注意事项 + +:::warning + +使用无效句柄将导致服务器崩溃!请通过 [fopen](fopen) 或 [ftemp](ftemp) 获取有效句柄。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 向文件写入字符 +- [fgetchar](fgetchar): 从文件读取字符 +- [fblockwrite](fblockwrite): 向文件写入数据块 +- [fblockread](fblockread): 从文件读取数据块 +- [fseek](fseek): 跳转至文件指定位置 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 检查文件名模式匹配 +- [ftell](ftell): 获取当前文件位置 +- [fflush](fflush): 将文件刷入磁盘(确保所有写入完成) +- [fstat](fstat): 返回文件大小和时间戳 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 返回文件的 32 位 CRC 值 +- [diskfree](diskfree): 返回磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/float.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/float.md new file mode 100644 index 00000000000..a149debf4c6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/float.md @@ -0,0 +1,33 @@ +--- +title: float +sidebar_label: float +description: 将整数转换为浮点数。 +tags: ["浮点数"] +--- + + + +## 描述 + +将整数转换为浮点数。 + +| 名称 | 描述 | +| ----- | ------------------ | +| value | 需要转换的整数数值 | + +## 返回值 + +转换后的浮点数值 + +## 示例 + +```c +new Float:FloatValue; +new Value = 52; +FloatValue = float(Value); // 将Value(52)转换为浮点数并存入'FloatValue'(结果为52.0) +``` + +## 相关函数 + +- [floatround](floatround): 将浮点数转换为整数(四舍五入) +- [floatstr](floatstr): 将字符串转换为浮点数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatabs.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatabs.md new file mode 100644 index 00000000000..e00dd69222a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatabs.md @@ -0,0 +1,36 @@ +--- +title: floatabs +sidebar_label: floatabs +description: 返回浮点数的绝对值。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +返回指定浮点数的绝对值。 + +| 名称 | 描述 | +| ----------- | ---------------------- | +| Float:value | 要计算绝对值的浮点数值 | + +## 返回值 + +浮点数的绝对值(以浮点数形式返回) + +## 示例 + +```c +new Float:value; + +value = floatabs(47.0); // 返回47.0 + +value = floatabs(-47.0); // 同样返回47.0 +``` + +## 相关函数 + +- [float](float): 将整数转换为浮点数 +- [floatround](floatround): 对浮点数进行四舍五入取整 +- [floatsqroot](floatsqroot): 计算浮点数的平方根 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatadd.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatadd.md new file mode 100644 index 00000000000..1504bf73c1e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatadd.md @@ -0,0 +1,39 @@ +--- +title: floatadd +sidebar_label: floatadd +description: 对两个浮点数进行加法运算。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +将两个浮点数相加。此函数功能与标准运算符(+)重复。 + +| 名称 | 描述 | +| ------------- | ------------ | +| Float:Number1 | 第一个浮点数 | +| Float:Number2 | 第二个浮点数 | + +## 返回值 + +两个浮点数的和。 + +## 示例 + +```c +public OnGameModeInit() +{ + new Float:Number1 = 2, Float:Number2 = 3; // 声明两个浮点数 Number1(2) 和 Number2(3) + new Float:Sum; + Sum = floatadd(Number1, Number2); // 将两个数的和(=2+3=5)存入浮点变量"Sum" + return 1; +} +``` + +## 相关函数 + +- [Floatsub](Floatsub): 浮点数减法运算 +- [Floatmul](Floatmul): 浮点数乘法运算 +- [Floatdiv](Floatdiv): 浮点数除法运算 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatcmp.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatcmp.md new file mode 100644 index 00000000000..ed17494960f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatcmp.md @@ -0,0 +1,41 @@ +--- +title: floatcmp +sidebar_label: floatcmp +description: 用于比较两个浮点数值以验证比较结果。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +该函数用于比较两个浮点数值,验证它们的比较关系。 + +| 名称 | 描述 | +| ----------- | ---------------------- | +| Float:oper1 | 要比较的第一个浮点数值 | +| Float:oper2 | 要比较的第二个浮点数值 | + +## 返回值 + +- **0**:数值相等 +- **1**:第一个值更大 +- **-1**:第二个值更大 + +## 示例 + +```c +new value; + +value = floatcmp(2.0, 2.0); // 返回0,因为数值相等 + +value = floatcmp(1.0, 2.0); // 返回-1,因为第二个值更大 + +value = floatcmp(2.0, 1.0); // 返回1,因为第一个值更大 +``` + +## 相关函数 + +- [float](float): 将整数转换为浮点数 +- [floatround](floatround): 浮点数四舍五入取整 +- [floatsqroot](floatsqroot): 计算浮点数的平方根 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatcos.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatcos.md new file mode 100644 index 00000000000..11c36a2da8c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatcos.md @@ -0,0 +1,49 @@ +--- +title: floatcos +sidebar_label: floatcos +description: 获取指定角度的余弦值 +tags: ["math", "floating-point"] +--- + + + +## 描述 + +获取指定角度的余弦值。输入角度可使用弧度、角度或梯度单位。 + +| 参数名 | 说明 | +| -------------- | ----------------------------------------------------------------------------- | +| Float:value | 需要计算余弦值的角度 | +| anglemode:mode | 使用的[角度模式](../resources/anglemodes),根据输入值的单位而定(默认:弧度) | + +## 返回值 + +输入值的余弦值。 + +## 示例 + +```c +public OnGameModeInit() +{ + printf("90°的余弦值为 %.0f", floatcos(90.0, degrees)); + // 输出:0 + return 1; +} +``` + +## 注意事项 + +:::warning + +在大多数情况下,GTA/SA-MP 使用角度制表示方向,例如[GetPlayerFacingAngle](GetPlayerFacingAngle)。因此建议优先使用'degrees'角度模式而非弧度制。同时注意 GTA 的角度系统采用逆时针方向:270° 为东方,90° 为西方,南方仍为 180°,北方仍为 0°/360°。 + +::: + +## 相关函数 + +- [floatsin](floatsin): 获取指定角度的正弦值 +- [floattan](floattan): 获取指定角度的正切值 + +## 相关资源 + +- [角度模式](../resources/anglemodes): 测量角度的国际单位常量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatdiv.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatdiv.md new file mode 100644 index 00000000000..4b9f2e90f8d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatdiv.md @@ -0,0 +1,39 @@ +--- +title: floatdiv +sidebar_label: floatdiv +description: 将一个浮点数除以另一个浮点数。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +将一个浮点数除以另一个浮点数。此函数功能与除法运算符(/)重复。 + +| 名称 | 描述 | +| -------------- | ---------------- | +| Float:dividend | 被除数的浮点数值 | +| Float:divisor | 除数的浮点数值 | + +## 返回值 + +两个浮点数相除的商。 + +## 示例 + +```c +public OnGameModeInit() +{ + new Float:Number1 = 8.05, Float:Number2 = 3.5; // 声明两个浮点数 Number1(8.05) 和 Number2(3.5) + new Float:Quotient; + Quotient = floatdiv(Number1, Number2); // 将两数的商(=8.05/3.5=2.3)存入浮点变量"Quotient" + return 1; +} +``` + +## 相关函数 + +- [floatadd](floatadd): 将两个浮点数相加 +- [floatsub](floatsub): 浮点数减法运算 +- [floatmul](floatmul): 浮点数乘法运算 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatfract.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatfract.md new file mode 100644 index 00000000000..1b1100e9ec4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatfract.md @@ -0,0 +1,32 @@ +--- +title: floatfract +sidebar_label: floatfract +description: 获取浮点数的小数部分。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +获取浮点数的小数部分,即小数点后的数值部分。 + +| 名称 | 描述 | +| ----------- | -------------------------- | +| Float:value | 需要获取小数部分的浮点数值 | + +## 返回值 + +浮点数的小数部分(以浮点数形式返回) + +## 示例 + +```c +new Float:fFract = floatfract(3.14159); // 返回0.14159 +``` + +## 相关函数 + +- [floatround](floatround): 将浮点数转换为整数(四舍五入) +- [floatfloor](floatfloor): 获取浮点数的整数部分(向下取整) +- [floatceil](floatceil): 获取浮点数的整数部分(向上取整) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatlog.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatlog.md new file mode 100644 index 00000000000..2edbba2652b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatlog.md @@ -0,0 +1,37 @@ +--- +title: floatlog +sidebar_label: floatlog +description: 计算浮点数的对数。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +该函数用于计算以指定底数的浮点数对数。 + +| 名称 | 描述 | +| ----------- | ---------------------- | +| Float:value | 需要计算对数的浮点数值 | +| Float:base | 对数的底数 | + +## 返回值 + +计算结果(以浮点数形式返回) + +## 示例 + +```c +public OnGameModeInit() +{ + printf("数值15.0以10.0为底的对数结果为 %.1f", floatlog(15.0, 10.0)); + return 1; +} +``` + +## 相关函数 + +- [floatsqroot](floatsqroot): 计算浮点数的平方根 +- [floatpower](floatpower): 计算浮点数的幂运算 +- [floatabs](floatabs): 获取浮点数的绝对值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatmul.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatmul.md new file mode 100644 index 00000000000..2c6f091ab42 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatmul.md @@ -0,0 +1,47 @@ +--- +title: floatmul +sidebar_label: floatmul +description: 将两个浮点数相乘。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +将两个浮点数相乘。 + +| 名称 | 描述 | +| ----------- | ---------------------- | +| Float:oper1 | 第一个浮点数(被乘数) | +| Float:oper2 | 第二个浮点数(乘数) | + +## 返回值 + +两个浮点数的乘积 + +## 示例 + +```c +public OnGameModeInit() +{ + new Float:Number1 = 2.3, Float:Number2 = 3.5; // 声明两个浮点数 Number1(2.3) 和 Number2(3.5) + new Float:Product; + Product = floatmul(Number1, Number2); // 将乘积结果(=2.3*3.5=8.05)存入浮点变量"Product" + return 1; +} +``` + +## 注意事项 + +:::tip + +此函数功能与乘法运算符(\*)重复,建议直接使用运算符。 + +::: + +## 相关函数 + +- [floatadd](floatadd): 将两个浮点数相加 +- [floatsub](floatsub): 浮点数减法运算 +- [floatdiv](floatdiv): 浮点数除法运算 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatpower.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatpower.md new file mode 100644 index 00000000000..31712a487f1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatpower.md @@ -0,0 +1,34 @@ +--- +title: floatpower +sidebar_label: floatpower +description: 对给定数值进行幂运算。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +对指定浮点数值进行幂运算,将其提升至给定指数次方。 + +| 名称 | 描述 | +| -------------- | ---------------------------------- | +| Float:value | 需要进行幂运算的浮点基数值 | +| Float:exponent | 指数值(浮点数类型,允许零或负值) | + +## 返回值 + +返回基数的指数次方运算结果 + +## 示例 + +```c +printf("2的8次方结果是 %.1f", floatpower(2.0, 8.0)); +// 输出结果: 256.0 +``` + +## 相关函数 + +- [floatsqroot](floatsqroot): 计算浮点数的平方根 +- [floatlog](floatlog): 计算浮点数的对数 +- [floatmul](floatmul): 执行浮点数乘法运算 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatround.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatround.md new file mode 100644 index 00000000000..59bc24aa01c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatround.md @@ -0,0 +1,51 @@ +--- +title: floatround +sidebar_label: floatround +description: 将浮点数四舍五入为整数值。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +将浮点数按照指定模式舍入为整数值。 + +| 名称 | 描述 | +| ---------------------- | ------------------------------------------------------------------------------------------ | +| Float:数值 | 需要进行舍入的浮点数值 | +| floatround_method:模式 | 使用的[舍入模式](../resources/floatroundmodes)
默认值:`floatround_round`(四舍五入) | + +## 返回值 + +四舍五入后的整数值 + +## 示例 + +```c +new value = floatround(3.3, floatround_ceil); // 使用向上取整模式 +printf("3.3四舍五入为 %d", value); // 输出:3.3四舍五入为 4 +``` + +
+ +```c +new value = floatround(50.996229); // 使用默认四舍五入模式 +printf("50.996229四舍五入为 %d", value); // 输出:50.996229四舍五入为 51 +``` + +
+ +```c +new value = floatround(270.0034); // 使用默认四舍五入模式 +printf("270.0034四舍五入为 %d", value); // 输出:270.0034四舍五入为 270 +``` + +## 相关函数 + +- [float](float): 将整数转换为浮点数 +- [floatstr](floatstr): 将字符串转换为浮点数 + +## 相关资源 + +- [浮点数舍入模式](../resources/floatroundmodes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsin.md new file mode 100644 index 00000000000..283349a5722 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsin.md @@ -0,0 +1,57 @@ +--- +title: floatsin +sidebar_label: floatsin +description: 获取指定角度的正弦值 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +获取指定角度的正弦值。输入角度可使用弧度、角度或梯度单位。 + +| 参数名 | 说明 | +| -------------- | ----------------------------------------------------------------------------- | +| Float:value | 需要计算正弦值的角度 | +| anglemode:mode | 使用的[角度模式](../resources/anglemodes),根据输入值的单位而定(默认:弧度) | + +## 返回值 + +输入值的正弦值。 + +## 示例 + +```c +GetPosInFrontOfPlayer(playerid, Float:distance, &Float:x, &Float:y, &Float:z) +{ + if (GetPlayerPos(playerid, x, y, z)) // 如果玩家未连接,此函数返回0 + { + new Float:z_angle; + GetPlayerFacingAngle(playerid, z_angle); + + x += distance * floatsin(-z_angle, degrees); // GTA中的角度采用逆时针方向,因此需要反转获取的角度值 + y += distance * floatcos(-z_angle, degrees); + + return 1; // 成功时返回1,实际坐标通过引用返回 + } + return 0; // 玩家未连接时返回0 +} +``` + +## 注意事项 + +:::warning + +在大多数情况下,GTA/SA-MP 使用角度制表示方向,例如[GetPlayerFacingAngle](GetPlayerFacingAngle)。因此建议优先使用'degrees'角度模式而非弧度制。同时注意 GTA 的角度系统采用逆时针方向:270° 为东方,90° 为西方,南方仍为 180°,北方仍为 0°/360°。 + +::: + +## 相关函数 + +- [floattan](floattan): 获取指定角度的正切值 +- [floatcos](floatcos): 获取指定角度的余弦值 + +## 相关资源 + +- [角度模式](../resources/anglemodes): 测量角度的国际单位常量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsqroot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsqroot.md new file mode 100644 index 00000000000..ef026adebb1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsqroot.md @@ -0,0 +1,40 @@ +--- +title: floatsqroot +sidebar_label: floatsqroot +description: 计算指定浮点数的平方根。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +计算指定浮点数的平方根。 + +| 名称 | 描述 | +| ---------- | ------------------------ | +| Float:数值 | 需要计算平方根的浮点数值 | + +## 返回值 + +输入值的平方根(以浮点数形式返回) + +## 示例 + +```c +new Float:sqroot = floatsqroot(25.0); // 返回5.0,因为5x5=25 +``` + +## 注意事项 + +:::tip + +当输入值为负数时,该函数会引发"定义域(domain)"错误。建议使用 [floatabs](floatabs) 获取绝对值(正数值)。 + +::: + +## 相关函数 + +- [floatpower](floatpower): 对指定数值进行幂运算 +- [floatlog](floatlog): 计算浮点数的对数 +- [floatabs](floatabs): 获取浮点数的绝对值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatstr.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatstr.md new file mode 100644 index 00000000000..ccf00b4b9a2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatstr.md @@ -0,0 +1,44 @@ +--- +title: floatstr +sidebar_label: floatstr +description: 将字符串转换为浮点数。 +tags: ["字符串", "浮点数"] +--- + + + +## 描述 + +将字符串转换为浮点数。 + +| 名称 | 描述 | +| -------------- | ---------------- | +| const string[] | 需要转换的字符串 | + +## 返回值 + +转换后的浮点数值 + +## 示例 + +```c +new string[4] = "6.9"; // 存储浮点数的字符串 + +new Float:value = floatstr(string); + +SetPlayerPos(playerid, 0.0, 0.0, value); // 使用转换后的浮点数值设置玩家Z坐标 +``` + +## 注意事项 + +:::warning + +如果字符串包含非数字字符(除数字、小数点和正负号外),转换结果可能不可预测 + +::: + +## 相关函数 + +- [floatround](floatround): 将浮点数转换为整数(四舍五入) +- [float](float): 将整数转换为浮点数 +- [strval](strval): 将字符串转换为整数值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsub.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsub.md new file mode 100644 index 00000000000..f2f7dbca0d0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floatsub.md @@ -0,0 +1,39 @@ +--- +title: floatsub +sidebar_label: floatsub +description: 将一个浮点数减去另一个浮点数。 +tags: ["数学", "浮点数"] +--- + + + +## 描述 + +执行浮点数减法运算。注意:此函数实际用途有限,因为可以直接使用标准减法运算符(-)替代。 + +| 名称 | 描述 | +| ----------- | ---------------------- | +| Float:oper1 | 第一个浮点数(被减数) | +| Float:oper2 | 第二个浮点数(减数) | + +## 返回值 + +两个浮点数的差值 + +## 示例 + +```c +public OnGameModeInit() +{ + new Float:Number1 = 5.0, Float:Number2 = 2.0; // 声明两个浮点数 Number1(5.0) 和 Number2(2.0) + new Float:Difference; + Difference = floatsub(Number1, Number2); // 将两数的差值(=5.0-2.0=3.0)存入浮点变量"Difference" + return 1; +} +``` + +## 相关函数 + +- [floatadd](floatadd): 将两个浮点数相加 +- [floatmul](floatmul): 执行浮点数乘法运算 +- [floatdiv](floatdiv): 执行浮点数除法运算 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floattan.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floattan.md new file mode 100644 index 00000000000..766c6bb86f3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/floattan.md @@ -0,0 +1,49 @@ +--- +title: floattan +sidebar_label: floattan +description: 获取指定角度的正切值 +tags: ["math", "floating-point"] +--- + + + +## 描述 + +获取指定角度的正切值。输入角度可使用弧度、角度或梯度单位。 + +| 参数名 | 说明 | +| ----------- | ----------------------------------------------------------------------------- | +| Float:value | 需要计算正切值的角度 | +| anglemode | 使用的[角度模式](../resources/anglemodes),根据输入值的单位而定(默认:弧度) | + +## 返回值 + +输入值的正切值。 + +## 示例 + +```c +public OnGameModeInit() +{ + printf("30°的正切值为 %.0f", floattan(30.0, degrees)); + // 输出:1 + return 1; +} +``` + +## 注意事项 + +:::warning + +在大多数情况下,GTA/SA-MP 使用角度制表示方向,例如[GetPlayerFacingAngle](GetPlayerFacingAngle)。因此建议优先使用'degrees'角度模式而非弧度制。同时注意 GTA 的角度系统采用逆时针方向:270° 为东方,90° 为西方,南方仍为 180°,北方仍为 0°/360°。 + +::: + +## 相关函数 + +- [floatsin](floatsin): 获取指定角度的正弦值 +- [floatcos](floatcos): 获取指定角度的余弦值 + +## 相关资源 + +- [角度模式](../resources/anglemodes): 测量角度的国际单位常量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fmatch.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fmatch.md new file mode 100644 index 00000000000..cc4a5b3bda0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fmatch.md @@ -0,0 +1,71 @@ +--- +title: fmatch +sidebar_label: fmatch +description: 根据匹配模式查找文件名。 +tags: ["文件管理"] +--- + + + +## 描述 + +根据通配符模式查找匹配的文件名。 + +| 名称 | 描述 | +| ------------------------ | ------------------------------------------ | +| const filename[] | 存储匹配结果的字符串(返回压缩字符串格式) | +| const pattern[] | 匹配模式(支持通配符) | +| index | 当存在多个匹配项时的文件索引号(默认:0) | +| size = sizeof (filename) | 目标字符串的最大容量 | + +## 返回值 + +**true** - 成功(找到匹配文件) + +**false** - 失败(文件不存在或模式不匹配) + +## 示例 + +```c +if (fmatch("file.txt", "*.txt")) +{ + print("文件匹配模式成功。"); +} +else +{ + print("文件 \"file.txt\" 不存在,或模式不匹配。"); +} +``` + +## 注意事项 + +:::warning + +本函数在 open.mp 服务器可用,SA:MP 服务器不支持。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 跳转文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [ftell](ftell): 获取当前文件位置 +- [fflush](fflush): 刷新文件到磁盘 +- [fstat](fstat): 获取文件状态信息 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算文件 CRC 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md new file mode 100644 index 00000000000..fa6db117ed1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md @@ -0,0 +1,166 @@ +--- +title: fopen +sidebar_label: fopen +description: 打开文件(用于读取或写入)。 +tags: ["文件管理"] +--- + + + +## 描述 + +打开文件以便进行读写操作。 + +| 名称 | 描述 | +| ---------------------------------------- | ------------------------------------------------------------- | +| const filename[] | 文件路径(若仅指定文件名,则默认在'scriptfiles'文件夹中查找) | +| [filemode:mode](../resources/file-modes) | 文件打开模式(默认值:io_readwrite) | + +## 返回值 + +- 成功时返回有效的文件句柄(File:handle 类型) +- 失败时返回 0 + +## 示例 + +**io_read 模式(只读):** + +```c +// 以"只读"模式打开"file.txt" +new File:handle = fopen("file.txt", io_read); + +// 声明缓冲区 +new buf[128]; + +// 检查文件是否成功打开 +if (handle) +{ + // 成功 + + // 逐行读取文件内容 + while(fread(handle, buf)) + { + print(buf); // 输出每行内容 + } + + // 关闭文件 + fclose(handle); +} +else +{ + // 错误提示 + print("文件 \"file.txt\" 不存在或无法打开。"); +} +``` + +
+ +**io_write 模式(只写):** + +```c +// 以"只写"模式打开"file.txt" +new File:handle = fopen("file.txt", io_write); + +if (handle) +{ + // 写入内容 + fwrite(handle, "这是新写入的内容!"); + + fclose(handle); // 关闭文件 +} +else +{ + print("无法打开文件 \"file.txt\""); +} +``` + +
+ +**io_readwrite 模式(读写):** + +```c +// 以"读写"模式打开"file.txt" +new File:handle = fopen("file.txt", io_readwrite); +new buf[128]; + +if (handle) +{ + // 读取现有内容 + while(fread(handle, buf)) + { + print(buf); + } + + // 重置文件指针到起始位置 + fseek(handle, _, seek_begin); + + // 覆盖写入新内容 + fwrite(handle, "覆盖原始内容"); + + fclose(handle); +} +else +{ + print("文件操作失败"); +} +``` + +
+ +**io_append 模式(追加):** + +```c +// 以"追加"模式打开日志文件 +new File:handle = fopen("server.log", io_append); + +if (handle) +{ + // 追加日志条目 + fwrite(handle, "[LOG] 服务器启动成功\r\n"); + + fclose(handle); +} +else +{ + print("日志文件写入失败"); +} +``` + +## 注意事项 + +:::warning + +- 在 `io_read` 模式下打开不存在的文件将返回空句柄 +- 使用无效句柄执行文件操作会导致服务器崩溃 +- 文件操作完成后务必使用 [fclose](fclose) 关闭文件 + +::: + +## 相关函数 + +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件内容 +- [fread](fread): 读取文件内容 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 批量写入数据块 +- [fblockread](fblockread): 批量读取数据块 +- [fseek](fseek): 调整文件指针位置 +- [flength](flength): 获取文件大小 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 文件名模式匹配 +- [ftell](ftell): 获取当前文件指针位置 +- [fflush](fflush): 强制写入磁盘缓存 +- [fstat](fstat): 获取文件元数据 +- [frename](frename): 文件重命名 +- [fcopy](fcopy): 文件复制 +- [filecrc](filecrc): 计算文件 CRC 校验码 +- [diskfree](diskfree): 查询磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 + +## 相关资源 + +- [文件模式详解](../resources/file-modes) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/format.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/format.md new file mode 100644 index 00000000000..db3e424f0c1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/format.md @@ -0,0 +1,95 @@ +--- +title: format +sidebar_label: format +description: 格式化字符串以嵌入变量及其他字符串。 +tags: ["字符串处理"] +--- + + + +## 描述 + +该函数用于格式化字符串,支持将变量和其他字符串嵌入目标字符串。 + +| 参数名 | 描述 | +| ----------------- | ---------------------------------- | +| output[] | 存储格式化结果的字符串缓冲区 | +| len | 输出缓冲区的最大容量(包含终止符) | +| const format[] | 格式化字符串模板 | +| \{Float, \_\}:... | 不定数量参数(支持任意标签类型) | + +## 返回值 + +此函数不返回特定值。 + +## 格式说明符 + +| 格式符 | 说明 | +| ------ | ------------------------------------ | +| %i | 无符号整数 | +| %d | 有符号整数 | +| %s | 字符串 | +| %f | 浮点数 | +| %c | ASCII 字符 | +| %x | 十六进制数 | +| %b | 二进制数 | +| %% | 百分号转义 | +| %q | SQLite 文本转义(0.3.7 R2 版本新增) | + +参数顺序需与占位符顺序严格对应,例如 `"年龄:%i 岁"` 中的 `%i` 将被整数变量替换。 + +可选字段控制: + +- 在 `%` 和格式符之间添加数字指定字段宽度(如 `%10d`) +- 对浮点数使用 `%.2f` 形式控制小数位数(保留两位小数) + +## 示例 + +```c +new result[128]; +new number = 42; +format(result, sizeof(result), "数值为 %i。", number); // 数值为 42 + +new string[] = "简单消息"; +format(result, sizeof(result), "这是%s,包含数值%i。", string, number); +// 这是简单消息,包含数值42 +``` + +
+ +```c +new string[64]; +format(string, sizeof(string), "您的得分:%d", GetPlayerScore(playerid)); +SendClientMessage(playerid, 0xFF8000FF, string); // 发送橙色消息给玩家 +``` + +
+ +```c +new string[32]; +new hour, minute, second; +gettime(hour, minute, second); +format(string, sizeof(string), "当前时间:%02d:%02d:%02d", hour, minute, second); +// 输出示例:当前时间:09:45:02 +``` + +
+ +```c +new string[32]; +format(string, sizeof(string), "43%s的衬衫是黑色。", "%%"); +SendClientMessage(playerid, 0xFF8000FF, string); // 显示"43%的衬衫是黑色" +``` + +## 注意事项 + +:::warning + +- 本函数不支持压缩字符串(packed strings) + +::: + +## 相关函数 + +- [print](print): 在服务器日志和控制台中输出基础信息 +- [printf](printf): 在服务器日志和控制台中输出格式化信息 \ No newline at end of file diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fputchar.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fputchar.md new file mode 100644 index 00000000000..d827c61554d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fputchar.md @@ -0,0 +1,78 @@ +--- +title: fputchar +sidebar_label: fputchar +description: 向文件写入单个字符。 +tags: ["文件管理"] +--- + + + +## 描述 + +向文件写入单个字符。 + +| 名称 | 说明 | +| ----------- | ------------------------------------------------------------------------- | +| File:handle | 要操作的文件句柄,需预先通过 fopen() 打开。 | +| value | 需要写入的字符。 | +| bool:utf8 | 设为 `true` 使用 UTF8 编码模式,否则使用扩展 ASCII 编码。(默认:`true`) | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +// 以"只写"模式打开"file.txt" +new File:handle = fopen("file.txt", io_write); + +if (handle) +{ + // 操作成功 + + // 向"file.txt"写入字符'e'(使用扩展ASCII编码) + fputchar(handle, 'e', false); + + // 关闭文件 + fclose(handle); +} +else +{ + // 操作失败 + print("无法打开\"file.txt\"。"); +} +``` + +## 注意事项 + +:::warning + +使用无效句柄会导致服务器崩溃!请通过 [fopen](fopen) 或 [ftemp](ftemp) 获取有效文件句柄。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fgetchar](fgetchar): 从文件读取字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 定位文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [ftell](ftell): 获取当前文件指针位置 +- [fflush](fflush): 刷新文件缓冲区 +- [fstat](fstat): 获取文件状态信息 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算文件 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fread.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fread.md new file mode 100644 index 00000000000..21b57ba29cc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fread.md @@ -0,0 +1,122 @@ +--- +title: fread +sidebar_label: fread +description: 从文件中读取单行内容。 +tags: ["文件管理"] +--- + + + +## 描述 + +从文件中读取单行内容。 + +| 名称 | 说明 | +| ---------------------- | -------------------------------------- | +| File:handle | 要读取的文件句柄(由 fopen 返回)。 | +| string[] | 存储读取内容的字符串数组(引用传递)。 | +| size = sizeof (string) | 要读取的字节数。 | +| bool:pack | 是否启用压缩格式?(默认:false)。 | + +## 返回值 + +返回读取内容的字符串长度(整数值)。 + +## 示例 + +```c +// 以"只读"模式打开"file.txt" +new File:handle = fopen("file.txt", io_read); + +// 初始化缓冲区 +new buf[128]; + +// 检查文件是否成功打开 +if (handle) +{ + // 操作成功 + + // 读取整个文件内容 + while(fread(handle, buf)) + { + print(buf); + } + + // 关闭文件 + fclose(handle); +} +else +{ + // 操作失败 + print("文件\"file.txt\"不存在或无法打开。"); +} +``` + +
+ +```c +// 以"读写"模式打开"file.txt" +new File:handle = fopen("file.txt"); + +// 初始化缓冲区 +new buf[128]; + +// 检查文件是否成功打开 +if (handle) +{ + // 操作成功 + + // 读取整个文件内容 + while(fread(handle, buf)) + { + print(buf); + } + + // 将文件指针重置到起始位置 + fseek(handle, _, seek_begin); + + // 向文件写入内容 + fwrite(handle, "I just wrote here!"); + + // 关闭文件 + fclose(handle); +} +else +{ + // 操作失败 + print("文件\"file.txt\"不存在或无法打开。"); +} +``` + +## 注意事项 + +:::warning + +使用无效句柄会导致服务器崩溃!请通过 [fopen](fopen) 或 [ftemp](ftemp) 获取有效文件句柄。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 定位文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [ftell](ftell): 获取当前指针位置 +- [fflush](fflush): 刷新文件缓冲区 +- [fstat](fstat): 获取文件状态信息 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fremove.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fremove.md new file mode 100644 index 00000000000..27a8e5e3e26 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fremove.md @@ -0,0 +1,89 @@ +--- +title: fremove +sidebar_label: fremove +description: 删除文件。 +tags: ["文件管理"] +--- + + + +## 描述 + +删除指定文件。 + +| 名称 | 说明 | +| ---------------- | ------------------ | +| const filename[] | 要删除的文件路径。 | + +## 返回值 + +**true** - 函数执行成功。 + +**false** - 函数执行失败(文件不存在或权限不足)。 + +## 示例 + +**删除文件示例:** + +```c +if (fremove("example.txt")) +{ + print("文件\"example.txt\"已删除。"); +} +else +{ + print("文件\"example.txt\"不存在。"); +} +``` + +**删除目录示例:** + +```c +if (fremove("logs")) +{ + print("目录\"logs\"已删除。"); +} +else +{ + print("目录\"logs\"不存在或非空目录。"); +} +``` + +## 注意事项 + +:::tip + +正在使用的文件(已通过 fopen 打开)需先关闭(fclose)才能删除。 + +::: + +:::warning + +文件路径必须有效。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 定位文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [ftell](ftell): 获取当前指针位置 +- [fflush](fflush): 刷新文件缓冲区 +- [fstat](fstat): 获取文件状态信息 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/frename.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/frename.md new file mode 100644 index 00000000000..c94808f1381 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/frename.md @@ -0,0 +1,62 @@ +--- +title: frename +sidebar_label: frename +description: 重命名文件。 +tags: ["文件管理"] +--- + + + + + +## 描述 + +重命名指定文件。 + +| 名称 | 说明 | +| --------------- | ---------------------------- | +| const oldname[] | 原文件名(可包含完整路径)。 | +| const newname[] | 新文件名(可包含完整路径)。 | + +## 返回值 + +**true** 操作成功,**false** 操作失败。 + +## 示例 + +```c +if (frename("example.txt", "file.txt")) +{ + // 操作成功 + printf("文件\"example.txt\"已重命名为\"file.txt\"。"); +} +else +{ + // 操作失败 + print("文件\"example.txt\"不存在或无法访问。"); +} +``` + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 定位文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [ftell](ftell): 获取当前指针位置 +- [fflush](fflush): 刷新文件缓冲区 +- [fstat](fstat): 获取文件状态信息 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fseek.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fseek.md new file mode 100644 index 00000000000..68de2de46af --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fseek.md @@ -0,0 +1,89 @@ +--- +title: fseek +sidebar_label: fseek +description: 修改文件指针位置。 +tags: ["文件管理"] +--- + + + +## 描述 + +修改文件指针位置。可在文件中进行正向或反向定位。 + +| 名称 | 说明 | +| --------------------------------------------------- | -------------------------------------------- | +| File:handle | 要操作的文件句柄(由 fopen 返回)。 | +| position | 相对于基准位置的偏移量(详见 whence 参数)。 | +| [seek_whence:whence](../resources/file-seek-whence) | 定位基准点(指定偏移量计算的起始位置)。 | + +## 返回值 + +返回相对于文件起始位置的新偏移量(整数值)。 + +## 示例 + +```c +// 以"只读"模式打开"file.txt" +new File:handle = fopen("file.txt", io_read); + +// 检查文件是否成功打开 +if (handle) +{ + // 操作成功 + + // 跳转到文件起始位置并输出 + printf("文件起始位置: %d", fseek(handle, 0, seek_start)); + + // 跳转到文件末尾位置并输出 + printf("文件末尾位置: %d", fseek(handle, 0, seek_end)); + + // 保持当前位置并输出 + printf("当前文件位置: %d", fseek(handle, 0, seek_current)); + + // 关闭文件 + fclose(handle); +} +else +{ + // 操作失败 + print("无法打开\"file.txt\"。"); +} +``` + +## 注意事项 + +:::warning + +使用无效句柄会导致服务器崩溃!请通过 [fopen](fopen) 或 [ftemp](ftemp) 获取有效文件句柄。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [ftell](ftell): 获取当前指针位置 +- [fflush](fflush): 刷新文件缓冲区 +- [fstat](fstat): 获取文件状态信息 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 + +## 相关资源 + +- [文件定位基准](../resources/file-seek-whence) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fstat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fstat.md new file mode 100644 index 00000000000..d5d95f15f20 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fstat.md @@ -0,0 +1,73 @@ +--- +title: fstat +sidebar_label: fstat +description: 获取文件状态信息。 +tags: ["文件管理"] +--- + + + + + +## 描述 + +获取文件大小、最后修改时间戳及相关属性信息。 + +| 名称 | 说明 | +| ---------------- | ------------------------------------------------------------------------------- | +| const filename[] | 目标文件名 | +| &size | 成功时接收文件大小(单位:字节) | +| ×tamp | 成功时接收最后修改时间戳(UNIX 时间戳格式) | +| &attrib | 成功时接收文件属性标志 | +| &inode | 成功时接收 inode 编号(唯一标识文件的数字,通常表示文件在存储介质中的物理位置) | + +## 返回值 + +**true**​ - 函数执行成功 + +**false**​ - 文件不存在或无法访问 + +## 示例 + +```c +new + size, + timestamp, + attrib, + inode; + +if (fstat("file.txt", size, timestamp, attrib, inode)) +{ + // 操作成功 + printf("文件大小: %d 字节 | 修改时间: %d | 属性: %d | inode编号: %d", size, timestamp, attrib, inode); +} +else +{ + // 操作失败 + print("文件\"file.txt\"不存在或无法访问。"); +} +``` + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 定位文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [ftell](ftell): 获取当前指针位置 +- [fflush](fflush): 刷新文件缓冲区 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ftell.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ftell.md new file mode 100644 index 00000000000..70e9012b9b2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ftell.md @@ -0,0 +1,69 @@ +--- +title: ftell +sidebar_label: ftell +description: 获取当前文件指针位置。 +tags: ["文件管理"] +--- + + + + + +## 描述 + +获取文件指针的当前位置。 + +| 名称 | 说明 | +| ----------- | ----------------------------------- | +| File:handle | 要操作的文件句柄(由 fopen 返回)。 | + +## 返回值 + +返回相对于文件起始位置的当前偏移量(整数值)。 + +## 示例 + +```c +// 以"只读"模式打开"file.txt" +new File:handle = fopen("file.txt", io_read); + +// 检查文件是否成功打开 +if (handle) +{ + // 操作成功 + + printf("当前指针位置: %d", ftell(handle)); + + // 关闭文件 + fclose(handle); +} +else +{ + // 操作失败 + print("文件\"file.txt\"不存在或无法访问。"); +} +``` + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 定位文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [fflush](fflush): 刷新文件缓冲区 +- [fstat](fstat): 获取文件状态信息 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md new file mode 100644 index 00000000000..4a9db810a6e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md @@ -0,0 +1,131 @@ +--- +title: ftemp +sidebar_label: ftemp +description: 在"tmp"、"temp"目录或根目录创建随机命名的临时文件用于读写。 +tags: ["文件管理"] +--- + + + +## 描述 + +在"tmp"、"temp"目录或根目录创建随机命名的临时文件用于读写。该文件在使用 fclose()关闭后会自动删除。 + +## 示例 + +```c +// 创建临时文件流 +new File:t_handle = ftemp(); + +// 声明句柄变量 +new File:handle; + +// 声明字符变量 +new g_char; + +// 检查临时文件是否成功创建 +if (t_handle) +{ + // 操作成功 + + // 以"只读"模式打开"file.txt"并检查 + if (handle = fopen("file.txt", io_read)) + { + // 读取源文件所有字符 + while((g_char = fgetchar(handle, 0, false)) != EOF) + { + // 将小写字符写入临时文件 + fputchar(t_handle, tolower(g_char), false); + } + + // 关闭源文件 + fclose(handle); + + // 重置临时文件指针到起始位置 + fseek(t_handle, _, seek_begin); + + // 以"只写"模式打开"file1.txt"并检查 + if (handle = fopen("file1.txt", io_write)) + { + // 读取临时文件所有字符 + while((g_char = fgetchar(t_handle, 0, false)) != EOF) + { + // 写入目标文件1 + fputchar(handle, g_char, false); + } + + // 关闭目标文件1 + fclose(handle); + + // 再次重置临时文件指针 + fseek(t_handle, _, seek_begin); + } + else + { + print("无法打开\"file1.txt\"文件。"); + } + + // 以"只写"模式打开"file2.txt"并检查 + if (handle = fopen("file2.txt", io_write)) + { + // 读取临时文件所有字符 + while((g_char = fgetchar(t_handle, 0, false)) != EOF) + { + // 写入目标文件2 + fputchar(handle, g_char, false); + } + + // 关闭目标文件2 + fclose(handle); + } + else + { + print("无法打开\"file2.txt\"文件。"); + } + } + else + { + print("无法打开\"file.txt\"文件。"); + } + + // 关闭临时文件流(自动删除) + fclose(t_handle); +} +else +{ + print("创建临时文件流失败。"); +} +``` + +## 注意事项 + +:::warning + +若目标目录未正确创建,此函数可能导致服务器崩溃。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [fremove](fremove): 删除文件 +- [fwrite](fwrite): 写入文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 定位文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [ftell](ftell): 获取当前指针位置 +- [fflush](fflush): 刷新文件缓冲区 +- [fstat](fstat): 获取文件状态信息 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/funcidx.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/funcidx.md new file mode 100644 index 00000000000..461f4679c5b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/funcidx.md @@ -0,0 +1,36 @@ +--- +title: funcidx +sidebar_label: funcidx +description: 通过函数名获取公共函数的ID。 +tags: ["core"] +--- + + + +## 描述 + +通过函数名获取公共函数的唯一标识符(ID)。 + +| 名称 | 说明 | +| ------------ | ---------------------- | +| const name[] | 要查询的公共函数名称。 | + +## 返回值 + +- 成功时返回函数 ID(ID 从**0**开始) +- 函数不存在时返回 **-1** + +## 示例 + +```c +public OnFilterScriptInit() +{ + printf("OnFilterScriptInit的ID: %d", funcidx("OnFilterScriptInit")); + return 1; +} +``` + +## 相关函数 + +- [CallLocalFunction](CallLocalFunction): 调用脚本内的函数 +- [CallRemoteFunction](CallRemoteFunction): 跨脚本调用函数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md new file mode 100644 index 00000000000..629ff66f7b4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md @@ -0,0 +1,140 @@ +--- +title: fwrite +sidebar_label: fwrite +description: 向文件写入文本内容。 +tags: ["文件管理"] +--- + + + +## 描述 + +向指定文件写入文本内容。 + +| 名称 | 说明 | +| -------------- | ----------------------------------- | +| File:handle | 要操作的文件句柄(由 fopen 返回)。 | +| const string[] | 需要写入的文本字符串。 | + +## 返回值 + +返回成功写入的字符串长度(整数值)。 + +## 示例 + +```c +// 以"只写"模式打开"file.txt" +new File:handle = fopen("file.txt", io_write); + +// 检查文件是否成功打开 +if (handle) +{ + // 操作成功 + + // 写入内容到文件 + fwrite(handle, "I just wrote here!"); + + // 关闭文件 + fclose(handle); +} +else +{ + // 操作失败 + print("无法打开\"file.txt\"文件。"); +} +``` + +
+ +```c +// 以"读写"模式打开"file.txt" +new File:handle = fopen("file.txt"); + +// 初始化缓冲区 +new buf[128]; + +// 检查文件是否成功打开 +if (handle) +{ + // 读取文件全部内容 + while(fread(handle, buf)) + { + print(buf); + } + + // 重置文件指针到起始位置 + fseek(handle, _, seek_begin); + + // 写入新内容 + fwrite(handle, "I just wrote here!"); + + // 关闭文件 + fclose(handle); +} +else +{ + // 操作失败 + print("文件\"file.txt\"不存在或无法访问。"); +} +``` + +
+ +```c +// 以"追加"模式打开"file.txt" +new File:handle = fopen("file.txt", io_append); + +// 检查文件是否成功打开 +if (handle) +{ + // 追加写入内容(包含换行符) + fwrite(handle, "This is a test.\r\n"); + + // 关闭文件 + fclose(handle); +} +else +{ + // 操作失败 + print("无法打开\"file.txt\"文件。"); +} +``` + +## 注意事项 + +:::tip + +本函数使用 UTF-8 编码写入文件,可能无法支持某些特殊语言符号。 + +::: + +:::warning + +使用无效句柄会导致服务器崩溃!请通过 [fopen](fopen) 或 [ftemp](ftemp) 获取有效文件句柄。 + +::: + +## 相关函数 + +- [fopen](fopen): 打开文件 +- [fclose](fclose): 关闭文件 +- [ftemp](ftemp): 创建临时文件流 +- [fremove](fremove): 删除文件 +- [fread](fread): 读取文件 +- [fputchar](fputchar): 写入单个字符 +- [fgetchar](fgetchar): 读取单个字符 +- [fblockwrite](fblockwrite): 写入数据块 +- [fblockread](fblockread): 读取数据块 +- [fseek](fseek): 定位文件指针 +- [flength](flength): 获取文件长度 +- [fexist](fexist): 检查文件是否存在 +- [fmatch](fmatch): 匹配文件名模式 +- [ftell](ftell): 获取当前指针位置 +- [fflush](fflush): 刷新文件缓冲区 +- [fstat](fstat): 获取文件状态信息 +- [frename](frename): 重命名文件 +- [fcopy](fcopy): 复制文件 +- [filecrc](filecrc): 计算 CRC32 校验值 +- [diskfree](diskfree): 获取磁盘剩余空间 +- [fattrib](fattrib): 设置文件属性 +- [fcreatedir](fcreatedir): 创建目录 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getarg.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getarg.md new file mode 100644 index 00000000000..8f14ba705e4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getarg.md @@ -0,0 +1,42 @@ +--- +title: getarg +sidebar_label: getarg +description: 获取传递给函数的参数。 +tags: ["核心", "参数"] +--- + + + +## 描述 + +获取传递给函数的参数。 + +| 参数名 | 说明 | +| ------ | -------------------------------- | +| arg | 参数序号(0 表示第一个参数) | +| index | 数组参数的索引(可选,默认为 0) | + +## 返回值 + +返回参数的对应值。 + +## 示例代码 + +```c +SomeFunc(...) +{ + printf("%i", getarg(3)); // 获取第四个参数的值 +} + +public OnFilterScriptInit() +{ + SomeFunc(1, 3, 3, 7); // 传入四个参数 +} + +// 输出:7(第四个参数,索引3的值为7) +``` + +## 相关函数 + +- [numargs](numargs.md): 获取参数数量 +- [setarg](setarg.md): 设置参数值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getdate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getdate.md new file mode 100644 index 00000000000..42816d432ae --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getdate.md @@ -0,0 +1,35 @@ +--- +title: getdate +sidebar_label: getdate +description: 获取当前服务器日期并存储到年、月、日变量中。 +tags: ["时间", "日期"] +--- + + + +## 描述 + +获取当前服务器日期,并将结果存储到指定的年、月、日变量中。 + +| 参数名 | 说明 | +| -------- | ------------------------------------------ | +| &year=0 | 整型变量(引用传递),用于存储年份 | +| &month=0 | 整型变量(引用传递),用于存储月份(1-12) | +| &day=0 | 整型变量(引用传递),用于存储日期(1-31) | + +## 返回值 + +返回自年初以来的天数。 + +## 示例代码 + +```c +new Year, Month, Day, Days; +Days = getdate(Year, Month, Day); +printf("当前日期: %02d/%02d/%d", Day, Month, Year); // 输出格式:日/月/年 +printf("本年已过天数: %d", Days); // 输出自年初以来的天数 +``` + +## 相关函数 + +- [gettime](gettime.md): 获取服务器时间的 UNIX 时间戳 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getproperty.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getproperty.md new file mode 100644 index 00000000000..36bbd9cc7a8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getproperty.md @@ -0,0 +1,52 @@ +--- +title: getproperty +sidebar_label: getproperty +description: 从内存中获取特定属性,返回的字符串为打包格式 +tags: ["核心", "属性"] +--- + + + +## 描述 + +从内存中获取特定属性,返回的字符串为打包格式(需使用 strunpack 解包) + +| 名称 | 说明 | +| -------- | -------------------------------------------------------------- | +| id | 使用的虚拟机 ID(应始终保留为 0) _(可选参数=0)_ | +| name[] | 属性名称(应保留为空字符串) | +| value | 属性唯一 ID(可通过哈希函数从字符串生成) _(可选参数=cellmin)_ | +| string[] | 存储结果的字符数组(引用传递) | + +## 返回值 + +通过名称查询时返回属性值,通过 ID 查询时填充字符串参数。若属性不存在则返回 0 + +## 示例代码 + +```c +new value[16]; + +// 通过ID 123984334查询属性值 +getproperty(0, "", 123984334, value); + +// 解包压缩字符串 +strunpack(value, value, sizeof(value)); + +// 输出结果 +print(value); +``` + +## 注意事项 + +:::tip + +建议使用 PVars/SVars 或 GVar 插件替代此原生函数,因其执行效率较低 + +::: + +## 相关函数 + +- [setproperty](setproperty): 设置属性值 +- [deleteproperty](deleteproperty): 删除指定属性 +- [existproperty](existproperty): 检测属性是否存在 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getpubvar.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getpubvar.md new file mode 100644 index 00000000000..6dad3921f83 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/getpubvar.md @@ -0,0 +1,26 @@ +--- +title: getpubvar +sidebar_label: getpubvar +description: 获取当前脚本中的特定公共变量 +tags: ["核心", "pubvar", "公共变量"] +--- + + + +## 描述 + +获取当前脚本中声明的特定公共变量值 + +| 名称 | 说明 | +| ------------ | ---------------- | +| const name[] | 目标公共变量名称 | + +## 返回值 + +若变量不存在返回无效值(建议先使用[existpubvar](existpubvar)进行检测) + +## 相关函数 + +- [setpubvar](setpubvar): 设置当前脚本的公共变量值 +- [existpubvar](existpubvar): 检测公共变量是否存在 +- [numpubvars](numpubvars): 统计脚本中公共变量数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/gettime.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/gettime.md new file mode 100644 index 00000000000..2d505891a9a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/gettime.md @@ -0,0 +1,48 @@ +--- +title: gettime +sidebar_label: gettime +description: 获取服务器当前时间,并将小时、分钟和秒存储到指定变量中。 +tags: ["时间"] +--- + + + +## 描述 + +获取服务器当前时间,并将小时、分钟和秒存储到指定变量中。 + +| 参数名 | 说明 | +| --------- | ---------------------------------------- | +| &hour=0 | 存储小时的变量(通过引用传递,默认值 0) | +| &minute=0 | 存储分钟的变量(通过引用传递,默认值 0) | +| &second=0 | 存储秒数的变量(通过引用传递,默认值 0) | + +## 返回值 + +返回 Unix 时间戳。 + +## 示例 + +```c +new + hours, + minutes, + seconds, + timestamp; + +timestamp = gettime(hours, minutes, seconds); +printf("%02d:%02d:%02d", hours, minutes, seconds); +printf("自1970年1月1日午夜起的秒数: %d", timestamp); +``` + +## 注意事项 + +:::tip + +本函数通过返回时间戳的特性,特别适合用于测量时间间隔。例如实现指令冷却功能(如某个指令每 30 秒才能执行一次),无需依赖定时器即可实现精准时间控制。 + +::: + +## 相关函数 + +- [getdate](getdate): 获取服务器当前日期 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/gpci.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/gpci.md new file mode 100644 index 00000000000..cc61eca820e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/gpci.md @@ -0,0 +1,80 @@ +--- +title: gpci +sidebar_label: gpci +description: 获取玩家的客户端识别码(CI),该编码关联玩家的SAMP/GTA客户端实例。 +tags: [] +--- + + + +## 描述 + +获取玩家的客户端识别码(Computer/Client Identification),该编码与玩家计算机上的 SAMP/GTA 客户端绑定。 + +:::warning + +客户端识别码不具备唯一性,不同玩家可能拥有相同或相似的 CI,禁止仅凭 CI 匹配进行封禁操作 + +::: + +## 参数 + +| 参数名 | 说明 | +| --------------------- | ------------------------------------ | +| playerid | 目标玩家的 ID 编号 | +| serial[] | 存储 CI 的字符串数组(通过引用传递) | +| len = sizeof (serial) | 数组容量(建议使用 sizeof 获取) | + +## 返回值 + +返回玩家客户端识别码的字符串形式 + +## 使用示例 + +**SA-MP 服务器:** + +```c +#include + +#if !defined gpci + native gpci(playerid, serial[], len); +#endif + +public OnPlayerConnect(playerid) +{ + new serial[41]; // 40字符长度 + 终止符\0 + gpci(playerid, serial, sizeof(serial)); + + new string[128]; + format(string, sizeof(string), "您的客户端识别码: %s", serial); + SendClientMessage(playerid, -1, string); + return 1; +} +``` + +**open.mp 服务器:** + +```c +#include + +public OnPlayerConnect(playerid) +{ + new serial[41]; // 40字符长度 + 终止符\0 + GPCI(playerid, serial, sizeof(serial)); + SendClientMessage(playerid, -1, "您的客户端识别码: %s", serial); + return 1; +} +``` + +## 注意事项 + +:::warning + +在 SA-MP 服务器使用时,必须在脚本顶部添加 'native gpci(playerid, serial[], len);' 声明 + +::: + +## 相关函数 + +- [GetNetworkStats](GetNetworkStats): 获取服务器网络状态统计信息 +- [GetPlayerNetworkStats](GetPlayerNetworkStats): 获取玩家网络状态统计信息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/heapspace.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/heapspace.md new file mode 100644 index 00000000000..d8a9bfa6e58 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/heapspace.md @@ -0,0 +1,22 @@ +--- +title: heapspace +sidebar_label: heapspace +description: 返回堆/栈内存的可用空间(单位:字节)。 +tags: ["核心"] +--- + + + +## 描述 + +返回当前堆/栈内存的可用空间(单位:字节)。 + +## 示例 + +```c +public OnGameModeInit() +{ + printf("堆内存空间:%i KB", heapspace() / 1024); + return 1; +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ispacked.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ispacked.md new file mode 100644 index 00000000000..68b07573462 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/ispacked.md @@ -0,0 +1,38 @@ +--- +title: ispacked +sidebar_label: ispacked +description: 检查字符串是否已打包 +tags: ["字符串"] +--- + +<函数名小写形式 /> + +## 描述 + +检查指定字符串是否处于打包状态。 + +| 参数 | 说明 | +| -------------- | ---------------- | +| const string[] | 需要检查的字符串 | + +## 返回值 + +**1** - 字符串已打包 +**0** - 字符串未打包 + +## 示例 + +```c +// 创建打包字符串 +new string[24 char]; + +if (ispacked(string)) +{ + print("该字符串已打包。"); +} +``` + +## 相关函数 + +- [strpack](strpack): 打包字符串 +- [strunpack](strunpack): 解包字符串 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/listenport.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/listenport.md new file mode 100644 index 00000000000..b13d446c53a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/listenport.md @@ -0,0 +1,40 @@ +--- +title: listenport +sidebar_label: listenport +description: 设置监听的端口号 +tags: ["数据报文"] +--- + + + +:::warning + +该函数已弃用,请使用 [HTTP](HTTP) 插件或 [pawn-requests](https://github.com/Southclaws/pawn-requests) 插件替代 + +::: + +## 描述 + +设置服务器监听的端口号。 + +| 参数名 | 说明 | +| ------ | ------------------------------------------------ | +| port | 要监听的端口号 (1-65535),应避免使用系统保留端口 | + +## 返回值 + +本函数总是返回 **0** + +## 注意事项 + +:::warning + +- 必须在接收首个数据包**之前**调用此函数,通常应在 `main` 函数中配置 +- 若未明确指定端口,默认监听 **9930** 端口 + +::: + +## 相关函数 + +- [@receivestring](@receivestring): 接收字符串数据包时触发 +- [sendstring](sendstring): 发送包含字符串的数据包 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/max.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/max.md new file mode 100644 index 00000000000..cf5794abcba --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/max.md @@ -0,0 +1,45 @@ +--- +title: max +sidebar_label: max +description: 返回两个数值中的较大者 +tags: ["核心"] +--- + + + +## 描述 + +用于比较数值的函数 + +| 参数 | 说明 | +| ------ | --------------------- | +| value1 | 待比较的第一个值(a) | +| value2 | 待比较的第二个值(b) | + +## 返回值 + +`value1` 与 `value2` 中的较大值 + +若两者相等,则返回 `value1` + +## 示例 + +```c +public OnGameModeInit() +{ + new a, b, result; + + a = 5; + b = 10; + result = max(a, b); + + printf("max(%d, %d) = %d", a, b, result); + // 由于b大于a,结果将为10 + + return 1; +} +``` + +## 相关函数 + +- [min](min): 比较并获取最小值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/memcpy.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/memcpy.md new file mode 100644 index 00000000000..eee3528df75 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/memcpy.md @@ -0,0 +1,49 @@ +--- +title: memcpy +sidebar_label: memcpy +description: 将字节从一个位置复制到另一个位置 +tags: ["字符串"] +--- + + + +## 描述 + +用于将字节从一个位置复制到另一个位置 + +| 参数 | 说明 | +| ------------------------- | -------------------------------------------- | +| dest[] | 目标数组,用于存放从源数组复制的字节 | +| const source[] | 源数组 | +| index = 0 | 目标数组中开始复制的字节索引(以字节为单位) | +| numbytes | 要复制的字节数(非单元格数) | +| maxlength = sizeof (dest) | 目标缓冲区的最大单元格容量 | + +## 返回值 + +成功时返回 **true**,失败时返回 **false** + +## 示例 + +```c +// 使用memcpy拼接两个字符串 +new + destination[64] = "This is ", + source[] = "a string in a 32 Bit Array"; + +memcpy(destination, source, strlen(destination) * 4, sizeof source * 4, sizeof destination); +print(destination); +// 输出: This is a string in a 32 Bit Array +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strfind](strfind): 在字符串中搜索子串 +- [strdel](strdel): 删除字符串的部分或全部内容 +- [strins](strins): 将字符串插入到另一个字符串中 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 从字符串中提取指定字符 +- [strpack](strpack): 将字符串打包到目标缓冲区 +- [strval](strval): 转换字符串为数值 +- [strcat](strcat): 拼接两个字符串 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/min.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/min.md new file mode 100644 index 00000000000..fcd3acd81af --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/min.md @@ -0,0 +1,45 @@ +--- +title: min +sidebar_label: min +description: 返回两个数值中的较小者 +tags: ["核心"] +--- + + + +## 描述 + +用于比较数值的函数 + +| 参数 | 说明 | +| ------ | --------------------- | +| value1 | 待比较的第一个值(a) | +| value1 | 待比较的第二个值(b) | + +## 返回值 + +`value1` 与 `value2` 中的较小值 + +若两者相等,则返回 `value1` + +## 示例 + +```c +public OnGameModeInit() +{ + new a, b, result; + + a = 5; + b = 10; + result = min(a, b); + + printf("min(%d, %d) = %d", a, b, result); + // 由于a小于b,结果将为5 + + return 1; +} +``` + +## 相关函数 + +- [max](max): 比较并获取最大值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/numargs.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/numargs.md new file mode 100644 index 00000000000..583c2ba6f8e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/numargs.md @@ -0,0 +1,34 @@ +--- +title: numargs +sidebar_label: numargs +description: 获取函数接收的参数数量 +tags: ["核心", "参数", "args"] +--- + + + +## 描述 + +用于获取函数接收的参数数量 + +## 示例 + +```c +SomeFunction(...) +{ + printf("numargs(): %i", numargs()); +} + +public OnFilterScriptInit() +{ + SomeFunction(1, 2, 3); +} + +// 输出: "numargs(): 3" +// 因为传递了三个参数(1, 2, 3) +``` + +## 相关函数 + +- [getarg](getarg): 从可变参数列表获取指定参数 +- [setarg](setarg): 设置可变参数的值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/numpubvars.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/numpubvars.md new file mode 100644 index 00000000000..d5db0b3729c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/numpubvars.md @@ -0,0 +1,22 @@ +--- +title: numpubvars +sidebar_label: numpubvars +description: 统计脚本中公共变量的数量 +tags: ["核心", "公共变量"] +--- + + + +## 描述 + +用于统计脚本中声明的公共变量总数 + +## 返回值 + +当前脚本中声明的公共变量数量 + +## 相关函数 + +- [getpubvar](getpubvar): 从当前脚本获取指定公共变量的值 +- [setpubvar](setpubvar): 设置当前脚本中的指定公共变量 +- [existpubvar](existpubvar): 检测指定公共变量是否存在 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/print.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/print.md new file mode 100644 index 00000000000..ac1c6c84973 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/print.md @@ -0,0 +1,54 @@ +--- +title: print +sidebar_label: print +description: 将字符串输出至服务器控制台(非游戏内聊天框)并记录日志(log.txt)。 +tags: ["控制台"] +--- + + + +## 描述 + +将字符串输出至服务器控制台(非游戏内聊天框)并记录日志(log.txt)。 + +| 名称 | 描述 | +| ----------------- | ----------------- | -------------- | +| const string[] | 需要输出的字符串 | +| | + +## 返回值 + +该函数不返回特定值。 + + + +## 示例 + +```c +public OnGameModeInit() +{ + print("游戏模式已启动。"); + return 1; +} +``` + +## 相关函数 + +- [printf](printf): 向服务器日志和控制台输出格式化信息 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/printf.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/printf.md new file mode 100644 index 00000000000..65446ab9066 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/printf.md @@ -0,0 +1,65 @@ +--- +title: printf +sidebar_label: printf +description: 在控制台(服务器窗口,非游戏内聊天框)输出格式化字符串。 +tags: ["控制台"] +--- + + + +## 描述 + +在控制台(服务器窗口,非游戏内聊天框)输出格式化字符串。 + +| 名称 | 描述 | +| ----------------- | -------------------------- | +| const format[] | 格式字符串 | +| \{Float, \_\}:... | 任意标签类型的可变数量参数 | + +## 返回值 + +该函数不返回特定值。 + +## 格式说明符 + +| 标识符 | 含义 | +| ------ | --------------------------------------- | +| %i | 整数 | +| %d | 整数 | +| %s | 字符串 | +| %f | 浮点数 | +| %c | ASCII 字符 | +| %x | 十六进制数 | +| %b | 二进制数 | +| %% | 字面量 '%' | +| %q | 为 SQLite 转义文本(0.3.7 R2 版本新增) | + +占位符对应的参数值必须严格按照调用时的参数顺序排列,例如 `"我今年%i岁"` 中的 `%i` 将被替换为表示年龄的整型变量。 + +可在 `%` 和格式字母之间添加数字指定字段宽度。若参数值的实际宽度小于指定字段宽度,系统会自动用空格扩展字段。若要限制浮点数显示的小数位数,可在 `%` 和 `f` 之间添加 `.<最大位数>`,例如 `%.2f` 表示保留两位小数。 + +## 示例 + +```c +new number = 42; +printf("数值为 %d。", number); // 数值为 42。 + +new string[] = "简单信息"; +printf("这是包含数字 %d 的 %s。", string, number); // 这是包含数字 42 的简单信息。 + +new character = 64; +printf("字符表示为:%c", character); // 字符表示为:@ +``` + +## 注意事项 + +:::warning + +格式字符串或其输出结果不应超过 1024 个字符。超出该长度可能导致服务器崩溃。 + +::: + +## 相关函数 + +- [print](print): 向服务器日志和控制台输出基础信息 +- [format](format): 格式化字符串 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/random.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/random.md new file mode 100644 index 00000000000..79bb786f2f5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/random.md @@ -0,0 +1,56 @@ +--- +title: random +sidebar_label: random +description: 获取伪随机数 +tags: ["核心"] +--- + + + +## 描述 + +获取伪随机数 + +| 参数名 | 描述 | +| ------ | --------------------------------------- | +| max | 定义返回值范围(从 0 到该值减一的区间) | + +## 返回值 + +返回一个介于 0 到 max-1 之间的随机整数 + +## 示例 + +```c +new value = random(5); + +// 'value' 可能为 0, 1, 2, 3 或 4 (共5种可能值) +new Float:RandomSpawn[][4] = +{ + // 坐标数组 (X, Y, Z 及朝向角度) + {-2796.9854, 1224.8180, 20.5429, 192.0335}, + {-2454.2170, 503.8759, 30.0790, 267.2932}, + {-2669.7322, -6.0874, 6.1328, 89.8853} +}; + + +public OnPlayerSpawn(playerid) +{ + new rand = random(sizeof(RandomSpawn)); + + // 将玩家传送到随机坐标 + SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]); + + // 设置玩家随机朝向角度 + SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]); + return 1; +} +``` + +## 注意事项 + +:::tip + +当参数值小于 1 时会产生异常结果 + +::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/sendpacket.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/sendpacket.md new file mode 100644 index 00000000000..ff1ad7e7449 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/sendpacket.md @@ -0,0 +1,33 @@ +--- +title: sendpacket +sidebar_label: sendpacket +description: 发送数据包(已弃用函数) +tags: ["数据报"] +--- + + + +:::warning + +该函数已弃用,请使用[HTTP](HTTP)或[pawn-requests 插件](https://github.com/Southclaws/pawn-requests) + +::: + +## 描述 + +发送网络数据包。 + +| 参数名 | 说明 | +| ------------------------ | ---------------------------------------------------------------------------------------- | +| const packet[] | 包含要发送数据包的缓冲区 | +| size | 缓冲区大小 | +| const destination[] = "" | 数据包目标地址的 IP 和端口。若为空或未指定,将使用默认端口 9930 进行广播 _(可选参数="")_ | + +## 返回值 + +**1** 表示成功,**0** 表示失败。 + +## 相关函数 + +- [@receivepacket](@receivepacket): 接收数据包时触发 +- [sendstring](sendstring): 发送包含字符串的数据包 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/sendstring.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/sendstring.md new file mode 100644 index 00000000000..753dfc4512c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/sendstring.md @@ -0,0 +1,32 @@ +--- +title: sendstring +sidebar_label: sendstring +description: 发送包含字符串的数据包(已弃用函数) +tags: ["数据报"] +--- + + + +:::warning + +该函数已弃用,请使用[HTTP](HTTP)或[pawn-requests 插件](https://github.com/Southclaws/pawn-requests) + +::: + +## 描述 + +发送包含字符串的网络数据包。 + +| 参数名 | 说明 | +| ------------------------ | ---------------------------------------------------------------------------------------- | +| const message[] | 包含要发送字符串的缓冲区。如果是未打包的字符串,传输前会进行 UTF-8 编码 | +| const destination[] = "" | 数据包目标地址的 IP 和端口。若为空或未指定,将使用默认端口 9930 进行广播 _(可选参数="")_ | + +## 返回值 + +**1** 表示成功,**0** 表示失败。 + +## 相关函数 + +- [@receivestring](@receivestring): 接收字符串数据包时触发 +- [sendpacket](sendpacket): 发送通用数据包 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setarg.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setarg.md new file mode 100644 index 00000000000..edf6ffdbcb5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setarg.md @@ -0,0 +1,27 @@ +--- +title: setarg +sidebar_label: setarg +description: 设置传递给函数的参数。 +tags: ["核心", "参数", "args"] +--- + + + +## 描述 + +设置传递给函数的参数。 + +| 参数名 | 描述 | +| ------ | ---------------------------------------- | +| arg | 参数序号(0 表示第一个参数) | +| index | 索引(若参数是数组)_(可选,默认为 0)_ | +| value | 要设置的参数值 | + +## 返回值 + +成功返回**1**,若参数或索引无效则返回**0**。 + +## 相关函数 + +- [getarg](getarg): 从可变参数列表中获取参数 +- [numargs](numargs): 返回参数数量 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md new file mode 100644 index 00000000000..ffd0fe937e1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md @@ -0,0 +1,57 @@ +--- +title: setproperty +sidebar_label: setproperty +description: 添加新属性或修改现有属性。 +tags: ["核心功能", "属性"] +--- + + + +## 描述 + +添加新属性或修改现有属性。 + +| 参数名 | 描述 | +| -------- | --------------------------------------------------------------------------------------------------- | +| id | 虚拟机标识符(应保持默认值 0)_(optional=0)_ | +| name[] | 与 value 参数配合使用存储整型数据,存储字符串时无需使用 | +| value | 存储的整型数值,或存储字符串时使用的属性唯一 ID(可通过哈希函数计算字符串生成)_(optional=cellmin)_ | +| string[] | 字符串类型的属性值,存储整型时无需使用 | + +## 返回值 + +本函数没有返回值。 + +## 示例 + +```c +setproperty(.name = "MyInteger", .value = 42); + +new value = getproperty(.name = "MyInteger"); +printf("存储的整数值为: %d", value); +setproperty(0, "", 123984334, ":)"); + +new value[4]; +getproperty(0, "", 123984334, value); +strunpack(value, value, sizeof(value)); // 需要先解压字符串 +print(value); + +// 应该打印 :) +setproperty(.value = 123984334, .string = ":)"); + +// 其余操作与上述示例相同 +``` + +## 重要说明 + +:::tip + +建议使用 PVars/SVars 或 GVar 插件替代此原生函数,因其执行效率较低。 + +::: + +## 相关函数 + +- [getproperty](getproperty): 获取属性值 +- [deleteproperty](deleteproperty): 删除属性 +- [existproperty](existproperty): 检查属性是否存在 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setpubvar.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setpubvar.md new file mode 100644 index 00000000000..5b3a57e1e98 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setpubvar.md @@ -0,0 +1,27 @@ +--- +title: setpubvar +sidebar_label: setpubvar +description: 设置当前脚本中的特定公共变量。 +tags: ["核心", "公共变量"] +--- + + + +## 描述 + +设置当前脚本中的特定公共变量。 + +| 参数名 | 说明 | +| ------------ | -------------------- | +| const name[] | 公共变量名称 | +| value | 要存储到公共变量的值 | + +## 返回值 + +该变量的先前值。 + +## 相关函数 + +- [getpubvar](getpubvar): 获取当前脚本中的特定公共变量 +- [existpubvar](existpubvar): 检查当前脚本中是否存在特定公共变量 +- [numpubvars](numpubvars): 统计脚本中公共变量的总数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcat.md new file mode 100644 index 00000000000..28529a1932f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcat.md @@ -0,0 +1,42 @@ +--- +title: strcat +sidebar_label: strcat +description: 该函数用于将两个字符串拼接(连接)到目标字符串中。 +tags: ["字符串"] +--- + + + +## 描述 + +该函数用于将两个字符串拼接(连接)到目标字符串中。 + +| 参数 | 说明 | +| ------------------------- | ------------------------ | +| dest[] | 存储拼接结果的目标字符串 | +| const source[] | 源字符串 | +| maxlength = sizeof (dest) | 目标字符串的最大容量 | + +## 返回值 + +新目标字符串的长度。 + +## 示例代码 + +```c +new string[40] = "Hello"; +strcat(string, " World!"); + +// 字符串现在变为'Hello World!' +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strfind](strfind): 在字符串中搜索子串 +- [strdel](strdel): 删除字符串片段 +- [strins](strins): 向字符串插入内容 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 提取字符串片段 +- [strpack](strpack): 压缩字符串到目标地址 +- [strval](strval): 将字符串转换为整数值 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcmp.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcmp.md new file mode 100644 index 00000000000..a3e8bb75c54 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcmp.md @@ -0,0 +1,75 @@ +--- +title: strcmp +sidebar_label: strcmp +description: 比较两个字符串是否相同。 +tags: ["字符串"] +--- + + + +## 描述 + +比较两个字符串是否相同。 + +## 参数 + +| 名称 | 说明 | +| ------------------------ | ------------------------------------------------------------------------------------ | +| const string1[] | 要比较的第一个字符串 | +| const string2[] | 要比较的第二个字符串 | +| bool:ignorecase _(可选)_ | 设为 **true** 时忽略大小写(HeLLo 与 Hello 视为相同),设为 **false** 时区分大小写 | +| length _(可选)_ | 设置比较长度,仅比较前 X 个字符(如用长度 4 比较 "Hello" 和 "Hell No" 将判定为相同) | + +## 返回值 + +- **0**:在指定长度内字符串完全匹配 +- **1** 或 **-1**:存在不匹配字符(计算方式为 `string1[i] - string2[i]`,i 表示从 0 开始的字符索引) +- **字符数差异**:当某一字符串仅部分匹配另一字符串时返回字符数量差 + +## 示例 + +```c +new string1[] = "Hello World"; +new string2[] = "Hello World"; + +// 检查字符串是否相同 +if (!strcmp(string1, string2)) + +new string3[] = "Hell"; + +// 检查前4个字符是否匹配 +if (!strcmp(string2, string3, false, 4)) + +// 使用 isnull() 检查空字符串 +if (!strcmp(string1, string2) && !isnull(string1) && !isnull(string2)) + +// isnull() 宏定义: +#if !defined isnull + #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) +#endif +``` + +## 注意事项 + +:::warning + +- 当任一字符串为空时本函数会返回 **0**,请使用 `isnull()` 进行空值检测 +- 比较来自文本文件的字符串时需注意回车符 (`\r`) 和换行符 (`\n`),使用 [fread](fread) 读取时会包含这些特殊字符 + +::: + +## 相关函数 + +- [strfind](strfind): 在字符串中搜索子串 +- [strequal](strequal): 判断两个字符串是否相同 +- [strdel](strdel): 删除字符串片段 +- [strins](strins): 插入字符串内容 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 截取子字符串 +- [strpack](strpack): 打包字符串 +- [strval](strval): 字符串转整型 +- [strcat](strcat): 字符串拼接 + +## 教程指南 + +- [字符串操作技巧](../../tutorials/stringmanipulation) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcopy.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcopy.md new file mode 100644 index 00000000000..bb18dec56ab --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strcopy.md @@ -0,0 +1,38 @@ +--- +title: strcopy +sidebar_label: strcopy +description: 将源字符串复制到目标字符串中。 +tags: ["字符串"] +--- + + + + + +## 描述 + +将源字符串复制到目标字符串中。 + +| 参数名称 | 说明 | +| ------------------------- | ------------------------------------ | +| dest[] | 接收复制内容的目标字符串 | +| const source[] | 被复制的源字符串 | +| maxlength = sizeof (dest) | 目标字符串的最大长度限制(可选参数) | + +## 返回值 + +新目标字符串的长度。 + +## 示例代码 + +```c +new playerName[MAX_PLAYER_NAME]; +GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); + +new string[64]; +strcopy(string, playerName); // 将playerName复制到string中 +``` + +## 相关函数 + +- [strcat](strcat): 连接两个字符串到目标引用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strdel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strdel.md new file mode 100644 index 00000000000..b367e767272 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strdel.md @@ -0,0 +1,42 @@ +--- +title: strdel +sidebar_label: strdel +description: 删除字符串的一部分。 +tags: ["字符串"] +--- + + + +## 描述 + +删除字符串的指定部分。 + +## 参数 + +| 名称 | 说明 | +| -------- | ---------------------- | +| string[] | 需要操作的字符串 | +| start | 要删除的起始位置(含) | +| end | 要删除的结束位置(含) | + +## 返回值 + +此函数不返回任何特定值。 + +## 示例 + +```c +new string[42] = "We will delete everything apart from this"; +strdel(string, 0, 37); // 字符串现在为 "this" +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strfind](strfind): 在字符串中搜索子串 +- [strins](strins): 向字符串插入内容 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 截取子字符串 +- [strpack](strpack): 压缩字符串存储 +- [strval](strval): 字符串转整型数值 +- [strcat](strcat): 字符串拼接操作 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strequal.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strequal.md new file mode 100644 index 00000000000..f53c5500515 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strequal.md @@ -0,0 +1,54 @@ +--- +title: strequal +sidebar_label: strequal +description: 比较两个字符串是否相同。 +tags: ["字符串"] +--- + + + + + +## 描述 + +比较两个字符串是否相同。 + +| 参数 | 说明 | +| ------------------------ | ------------------------------------------------------------------------------------------------------- | +| const string1[] | 待比较的第一个字符串 | +| const string2[] | 待比较的第二个字符串 | +| bool:ignorecase _(可选)_ | 设为**true**时忽略大小写(HeLLo 与 Hello 视为相同),设为**false**时区分大小写 | +| length _(可选)_ | 设定比较长度时,仅比较前 X 个字符。例如比较 "Hello" 和 "Hell No" 时若 length 设为 4,将判定为相同字符串 | + +## 返回值 + +在指定长度内字符串相同返回**true**,否则返回**false**。 + +## 示例代码 + +```c +new string1[] = "Hello World"; +new string2[] = "Hello World"; + +// 检测字符串是否相同 +if (strequal(string1, string2)) +{ + print("字符串相同。"); +} +else +{ + print("字符串不同。"); +} +``` + +## 注意事项 + +:::tip + +本函数是基于[strcmp](strcmp)的便捷封装函数。 + +::: + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strfind.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strfind.md new file mode 100644 index 00000000000..010fba5caf6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strfind.md @@ -0,0 +1,43 @@ +--- +title: strfind +sidebar_label: strfind +description: 在字符串中搜索子字符串。 +tags: ["字符串"] +--- + + + +## 描述 + +在字符串中搜索指定子字符串。 + +| 参数名称 | 说明 | +| ---------------------------- | -------------------------------------------------------------------------- | +| const string[] | 被搜索的目标字符串(haystack) | +| const sub[] | 需要查找的子字符串(needle) | +| bool:ignorecase _(可选参数)_ | 设为 true 时忽略大小写(HeLLo 与 Hello 视为相同),设为 false 时区分大小写 | +| Position _(可选参数)_ | 指定搜索起始位置的字符偏移量 | + +## 返回值 + +返回子字符串的起始字符位置索引,若未找到则返回-1。 + +## 示例代码 + +```c +if (strfind("Are you in here?", "you", true) != -1) // 返回4,因为子字符串'you'的起始位置在索引4 +{ + SendClientMessageToAll(0xFFFFFFFF, "找到目标字符串!"); +} +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strdel](strdel): 删除字符串指定部分 +- [strins](strins): 向字符串插入内容 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 截取字符串片段 +- [strpack](strpack): 压缩字符串到目标变量 +- [strval](strval): 将字符串转为整数值 +- [strcat](strcat): 连接两个字符串到目标引用 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strfloat.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strfloat.md new file mode 100644 index 00000000000..360f4a72eb5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strfloat.md @@ -0,0 +1,47 @@ +--- +title: strfloat +sidebar_label: strfloat +description: 将字符串转换为浮点数。 +tags: ["字符串", "浮点数"] +--- + + + + + +## 描述 + +将字符串转换为浮点数。 + +## 参数 + +| 名称 | 说明 | +| -------------- | -------------- | +| const string[] | 待转换的字符串 | + +## 返回值 + +转换后的浮点数值。 + +## 示例 + +```c +new string[4] = "6.9"; // 存储浮点数的字符串 + +new Float:value = strfloat(string); + +SetPlayerPos(playerid, 0.0, 0.0, value); +``` + +## 注意事项 + +:::tip + +此函数功能与 [floatstr](floatstr) 完全一致。 + +::: + +## 相关函数 + +- [floatround](floatround): 将浮点数转换为整数(四舍五入) +- [float](float): 将整数转换为浮点数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strins.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strins.md new file mode 100644 index 00000000000..dfbc96d7414 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strins.md @@ -0,0 +1,49 @@ +--- +title: strins +sidebar_label: strins +description: 将字符串插入到另一个字符串中 +tags: ["字符串"] +--- + + + +## 描述 + +该函数用于将一个字符串插入到另一个字符串的指定位置。 + +| 参数 | 说明 | +| --------------------------- | ------------------------------------ | +| string[] | 目标字符串(将被插入新内容的字符串) | +| const substr[] | 待插入的子字符串 | +| pos | 插入起始位置(基于 0 的索引) | +| maxlength = sizeof (string) | 目标字符串的最大容量 | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +// 在玩家名称前添加[AFK]标签 +new playerName[MAX_PLAYER_NAME]; +GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); +if (strlen(playerName) <= 18) +{ + strins(playerName, "[AFK]", 0); +} +SetPlayerName(playerid, playerName); + +// 注意:名称长度20+的玩家无法添加标签,添加后总长度25会超过24字符限制 +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strfind](strfind): 在字符串中搜索子串 +- [strdel](strdel): 删除字符串片段 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 提取字符串片段 +- [strpack](strpack): 压缩字符串到目标地址 +- [strval](strval): 将字符串转换为整数值 +- [strcat](strcat): 拼接两个字符串到目标地址 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strlen.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strlen.md new file mode 100644 index 00000000000..cd8ab96b201 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strlen.md @@ -0,0 +1,37 @@ +--- +title: strlen +sidebar_label: strlen +description: 获取字符串长度。 +tags: ["字符串"] +--- + + + +## 描述 + +获取指定字符串的长度。 + +| 参数名称 | 说明 | +| -------------- | ------------------------ | +| const string[] | 需要获取长度的目标字符串 | + +## 返回值 + +返回字符串的长度(整数值)。 + +## 示例代码 + +```c +new stringLength = strlen("This is an example string."); // stringLength的值将被设为26 +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strfind](strfind): 在字符串中搜索子字符串 +- [strins](strins): 向字符串插入内容 +- [strmid](strmid): 截取字符串片段 +- [strpack](strpack): 压缩字符串到目标变量 +- [strval](strval): 将字符串转为整数值 +- [strcat](strcat): 连接两个字符串到目标引用 +- [strdel](strdel): 删除字符串指定部分 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strmid.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strmid.md new file mode 100644 index 00000000000..089681306df --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strmid.md @@ -0,0 +1,44 @@ +--- +title: strmid +sidebar_label: strmid +description: 从字符串中提取指定范围的字符 +tags: ["字符串"] +--- + + + +## 描述 + +该函数用于从字符串中提取指定范围的字符。 + +| 参数 | 说明 | +| ------------------------- | -------------------------------------------- | +| dest[] | 存储提取结果的目标字符串 | +| const source[] | 源字符串 | +| start | 起始位置(基于 0 的索引) | +| end | 结束位置(基于 0 的索引) | +| maxlength = sizeof (dest) | 目标字符串的最大容量(默认为 dest 数组长度) | + +## 返回值 + +存入目标字符串的字符数量。 + +## 示例代码 + +```c +new string[6]; +// 从字符串提取'HELLO'并去除感叹号 +strmid(string, "Extract 'HELLO' without the !!!!: HELLO!!!!", 34, 39); +// 字符串将包含"HELLO" +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strfind](strfind): 在字符串中搜索子串 +- [strins](strins): 向字符串插入内容 +- [strlen](strlen): 获取字符串长度 +- [strpack](strpack): 压缩字符串到目标地址 +- [strval](strval): 将字符串转换为整数值 +- [strcat](strcat): 拼接两个字符串到目标地址 +- [strdel](strdel): 删除字符串片段 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strpack.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strpack.md new file mode 100644 index 00000000000..47a58b7a849 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strpack.md @@ -0,0 +1,40 @@ +--- +title: strpack +sidebar_label: strpack +description: 压缩字符串。 +tags: ["字符串"] +--- + + + +## 描述 + +压缩字符串。压缩后的字符串可减少 75%的内存占用。 + +| 参数名称 | 说明 | +| --------------------------- | ---------------------------------------- | +| dest[] | 目标字符串(用于存储压缩结果的引用) | +| const source[] | 源字符串(需压缩的原始内容) | +| maxlength = sizeof (string) | 最大压缩长度限制(默认为目标字符串容量) | + +## 返回值 + +返回实际压缩的字符数量。 + +## 示例代码 + +```c +new string[32 char]; +strpack(string, "Hi, how are you?"); +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strfind](strfind): 在字符串中搜索子字符串 +- [strins](strins): 向字符串插入内容 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 截取字符串片段 +- [strval](strval): 将字符串转为整数值 +- [strcat](strcat): 连接两个字符串到目标引用 +- [strdel](strdel): 删除字符串指定部分 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strunpack.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strunpack.md new file mode 100644 index 00000000000..0808b3fb04e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strunpack.md @@ -0,0 +1,45 @@ +--- +title: strunpack +sidebar_label: strunpack +description: 该函数用于解包字符串。 +tags: ["字符串"] +--- + + + +## 描述 + +该函数用于解包字符串。 + +## 参数 + +| 名称 | 说明 | +| --------------------------- | -------------------------------------------- | +| dest[] | 目标字符串(引用传递),用于存储解包后的内容 | +| const source[] | 源字符串(已打包的原始字符串) | +| maxlength = sizeof (string) | 最大解包长度(默认取目标字符串容量) | + +## 返回值 + +解包的字符数量。 + +## 示例 + +```c +new string[17]; +new pstring[17 char] = !"Hi, how are you?"; +strunpack(string, pstring); // 解包已压缩字符串 +``` + +## 相关函数 + +- [ispacked](ispacked): 检测字符串是否已打包 +- [strpack](strpack): 打包字符串 +- [strcmp](strcmp): 比较字符串是否相同 +- [strfind](strfind): 在字符串中搜索子串 +- [strins](strins): 插入字符串内容 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 截取子字符串 +- [strval](strval): 字符串转整型 +- [strcat](strcat): 字符串拼接 +- [strdel](strdel): 删除字符串片段 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strval.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strval.md new file mode 100644 index 00000000000..6b7395006b4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/strval.md @@ -0,0 +1,38 @@ +--- +title: strval +sidebar_label: strval +description: 将字符串转换为整数值 +tags: ["字符串"] +--- + + + +## 描述 + +将字符串转换为整数值。 + +| 参数 | 说明 | +| -------------- | ---------------- | +| const string[] | 需要转换的字符串 | + +## 返回值 + +字符串对应的整数值(若字符串非数字格式则返回 0) + +## 示例代码 + +```c +new string[4] = "250"; +new iValue = strval(string); // 此时iValue的值为250 +``` + +## 相关函数 + +- [strcmp](strcmp): 比较两个字符串是否相同 +- [strfind](strfind): 在字符串中搜索子串 +- [strdel](strdel): 删除字符串片段 +- [strins](strins): 向字符串插入内容 +- [strlen](strlen): 获取字符串长度 +- [strmid](strmid): 提取字符串片段 +- [strpack](strpack): 压缩字符串到目标地址 +- [strcat](strcat): 拼接两个字符串到目标地址 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/swapchars.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/swapchars.md new file mode 100644 index 00000000000..48360e521e7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/swapchars.md @@ -0,0 +1,20 @@ +--- +title: swapchars +sidebar_label: swapchars +description: 交换变量中的字节顺序。 +tags: ["字符串"] +--- + + + +## 描述 + +交换变量中的字节顺序。 + +| 参数名称 | 说明 | +| -------- | ------------------------ | +| c | 需要进行字节交换的变量值 | + +## 返回值 + +返回字节顺序交换后的变量值(最低有效字节变为最高有效字节) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/tolower.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/tolower.md new file mode 100644 index 00000000000..8529d4441ee --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/tolower.md @@ -0,0 +1,35 @@ +--- +title: tolower +sidebar_label: tolower +description: 将单个字符转换为小写形式 +tags: ["字符串处理"] +--- + + + +## 描述 + +将指定字符转换为小写形式。 + +| 参数名 | 说明 | +| ------ | -------------- | +| c | 需要转换的字符 | + +## 返回值 + +返回对应字符的小写 ASCII 编码值 + +## 示例代码 + +```c +public OnPlayerText(playerid, text[]) +{ + text[0] = tolower(text[0]); + // 将输入文本的首字母转换为小写 + return 1; +} +``` + +## 相关函数 + +- [toupper](toupper): 将单个字符转换为大写形式 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/toupper.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/toupper.md new file mode 100644 index 00000000000..09dee7f2c5a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/toupper.md @@ -0,0 +1,35 @@ +--- +title: toupper +sidebar_label: toupper +description: 将单个字符转换为大写形式。 +tags: ["字符串处理"] +--- + + + +## 描述 + +该函数用于将单个字符转换为大写形式。 + +| 名称 | 描述 | +| ---- | -------------------- | +| c | 需要转换为大写的字符 | + +## 返回值 + +返回输入字符对应的大写 ASCII 码值。 + +## 示例 + +```c +public OnPlayerText(playerid, text[]) +{ + text[0] = toupper(text[0]); + // 将玩家输入的首字母转换为大写 + return 1; +} +``` + +## 相关函数 + +- [tolower](tolower): 将单个字符转换为小写形式 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/uudecode.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/uudecode.md new file mode 100644 index 00000000000..d54cab445b1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/uudecode.md @@ -0,0 +1,33 @@ +--- +title: uudecode +sidebar_label: uudecode +description: 解码UU编码字符串 +tags: ["字符串", "加密"] +--- + + + +## 描述 + +解码 UU 编码格式的字符串。 + +| 名称 | 描述 | +| ------------------------- | ------------------------ | +| dest[] | 存储解码结果的数组 | +| const source[] | 需要解码的 UU 编码字符串 | +| maxlength = sizeof (dest) | 目标数组的最大可用长度 | + +## 返回值 + +此函数不返回特定值。 + +## 示例 + +```c +uudecode(normalString, encodedString); // 将encodedString解码到normalString数组 +``` + +## 相关函数 + +- [uuencode](uuencode): 将字符串编码为 UU 格式 +- [memcpy](memcpy): 内存数据复制函数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/uuencode.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/uuencode.md new file mode 100644 index 00000000000..18744512d26 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/uuencode.md @@ -0,0 +1,34 @@ +--- +title: uuencode +sidebar_label: uuencode +description: 将字符串编码为UU格式字符串。 +tags: ["字符串处理", "加密"] +--- + + + +## 描述 + +将原始字符串编码为 UU 格式字符串。 + +| 名称 | 描述 | +| ------------------------- | ------------------------------------ | +| dest[] | 用于存储编码后字符串的目标数组 | +| const source[] | 需要编码的原始字符串 | +| numbytes | 要编码的字节数(建议不超过 45 字节) | +| maxlength = sizeof (dest) | 目标数组的最大存储容量 | + +## 返回值 + +该函数不返回特定值。 + +## 示例 + +```c +uuencode(encodedString, normalString, 45); // 将普通字符串编码为UU格式 +``` + +## 相关函数 + +- [uudecode](uudecode): 解码 UU 编码字符串 +- [memcpy](memcpy): 内存复制函数 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md new file mode 100644 index 00000000000..843cf65a897 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md @@ -0,0 +1,60 @@ +--- +title: valstr +sidebar_label: valstr +description: 将整数值转换为字符串形式 +tags: ["字符串处理"] +--- + + + +## 描述 + +将整数值转换为字符串形式存储。 + +| 参数名 | 说明 | +| ------------- | -------------------------------- | +| dest | 目标字符串存储位置 | +| value | 待转换的整数值 | +| pack _(可选)_ | 是否启用字符串压缩(默认不启用) | + +## 返回值 + +本函数不返回特定值。 + +## 示例代码 + +```c +new string[4]; +new value = 250; +valstr(string, value); // 字符串内容变为"250" +``` + +## 注意事项 + +:::warning + +当传入极大整数值时可能导致服务端崩溃,建议使用以下修复方案(需在脚本中预先声明): + +```c +// valstr修复代码 by Slice +stock FIX_valstr(dest[], value, bool:pack = false) +{ + // 处理cellmin特殊值 + static const cellmin_value[] = !"-2147483648"; + + if (value == cellmin) + pack && strpack(dest, cellmin_value, 12) || strunpack(dest, cellmin_value, 12); + else + format(dest, 12, "%d", value), pack && strpack(dest, dest, 12); +} +#define valstr FIX_valstr +``` + +完整修复方案参见[fixes.inc](https://github.com/pawn-lang/sa-mp-fixes) + +::: + +## 相关函数 + +- [strval](strval): 将字符串转换为整数值 +- [strcmp](strcmp): 对比两个字符串是否相同 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/ControlStructures.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/ControlStructures.md new file mode 100644 index 00000000000..828278ec08e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/ControlStructures.md @@ -0,0 +1,713 @@ +--- +title: 控制结构 +sidebar_label: 控制结构 +description: Pawn语言中的控制结构概述 +--- + +## 条件语句 + +### if + +if 语句检查某个条件是否为真,若为真则执行相应操作。 + +```c +new + a = 5; +if (a == 5) +{ + print("a 是 5"); +} +``` + +在 `if` 后的括号内的代码称为条件表达式,支持多种测试条件(参见运算符章节)。 + +上述示例中 `a` 和 5 都是符号,函数也可以作为符号: + +```c +if (SomeFunction() == 5) +{ + print("SomeFunction() 返回 5"); +} +``` + +这会检测 SomeFunction 的返回值(见下文)是否等于 5。 + +还可以组合多个条件进行复合检查: + +```c +new + a = 5, + b = 3; +if (a == 5 && b != 3) +{ + print("此信息不会被输出"); +} +``` + +该示例检查 a 等于 5 且 b 不等于 3,但 b 实际为 3 导致条件不满足。 + +```c +new + a = 5, + b = 3; +if (a == 5 || b != 3) +{ + print("此信息将会被输出"); +} +``` + +该示例检查 a 等于 5 或 b 不等于 3。虽然 b 等于 3 导致后半部分不成立\*,但由于 a 等于 5 且我们使用 ||(或)运算符,只要任一条件为真即可(若两个条件都为真语句仍成立,这与自然语言中"或"仅指两者其一的含义略有不同),因此整体条件成立。 + +此外还可以直接链式比较而无需显式使用与运算符: + +```c +new + idx = 3; + +if (0 < idx < 5) +{ + print("idx 大于 0 且小于 5!"); +} +``` + +### 运算符 + +下列符号可用于条件判断及其说明,部分已在示例中使用。 + +| 运算符 | 含义 | 用法 | +| ------------ | --------------------------------------------------------- | -------------------------------------------------------------------------- | +| == | 左表达式等于右表达式 | if (左表达式 == 右表达式) | +| != | 左表达式不等于右表达式 | if (左表达式 != 右表达式) | +| > | 左表达式大于右表达式 | if (左表达式 > 右表达式) | +| >= | 左表达式大于等于右表达式 | if (左表达式 >= 右表达式) | +| \< | 左表达式小于右表达式 | if (左表达式 \< 右表达式) | +| \<= | 左表达式小于等于右表达式 | if (左表达式 \<= 右表达式) | +| && | 与 | if (左表达式 && 右表达式) | +| || | 或 | if (左表达式 || 右表达式) | +| ! | 非 | if (!变量) | +| | 或非 | if (!(左表达式 || 右表达式)) | +| | 与非 | if (!(左表达式 && 右表达式)) | +| | 异或(xor, eor) - 仅一个条件为真时成立,两者同真则不成立 | if (!(左表达式 && 右表达式) && (左表达式 || 右表达式)) | +| | 同或(nxor, neor) - 两者同真或同假时成立 | if ((左表达式 && 右表达式) || !(左表达式 || 右表达式)) | + +### 括号 + +条件语句中另一个重要方面是括号的使用,括号控制着运算顺序: + +```c +new + a = 3, + b = 3, + c = 1; +if (a == 5 && b == 3 || c == 1) +{ + print("这段会被执行吗?"); +} +``` + +上述语句有两种解析方式: + +```c +if ((a == 5 && b == 3) || c == 1) +``` + +或者: + +```c +if (a == 5 && (b == 3 || c == 1)) +``` + +第一种解析会先检查 a 是否等于 5 且 b 是否等于 3,若该条件不成立(即其中任一或两个值不符),则检查 c 是否等于 1。由于 (a == 5 && b == 3) 显然不成立(根据之前知识),我们可用 FALSE 代替该组合: + +```c +if (FALSE || c == 1) +``` + +已知 FALSE 不成立,但 c 等于 1 使得后半部分成立,因此整个条件语句通过或运算成立。 + +第二种解析会先检查 a 是否等于 5,若成立则检查 b 是否等于 3 或 c 是否等于 1。虽然引擎实际会先处理 a==5 的判定,但为便于理解我们反向分析。(b ==3 || c ==1) 结果为真(两个子条件均成立),因此整体条件变为: + +```c +if (a == 5 && TRUE) +``` + +由于 a 实际为 3,(a ==5) 结果为假,故整体表达式简化为: + +```c +if (FALSE && TRUE) +``` + +显然该条件不成立,因此判定失败。 + +此案例展示了括号如何改变逻辑判定结果。若无括号,编译器会默认采用第一种解析方式,但为确保明确性应始终使用括号——即使仅为提升代码可读性。 + +- 注:在或运算示例中 (b !=3) 实际上并未执行判定(因编译器采用短路求值机制,当首个条件已成立时不再评估后续条件)。若强行评估该条件则会失败。 + +### else + +else 语句用于当 if 条件不成立时执行操作: + +```c +new + a = 5; +if (a == 3) // 条件不成立 +{ + print("此信息不会被输出"); +} +else +{ + print("因主条件失败,此信息将被输出"); +} +``` + +### else if + +else if 语句在主条件失败时进行次级条件判定: + +```c +new + a = 5; +if (a == 1) +{ + print("当 a=1 时输出"); +} +else if (a == 5) +{ + print("当 a=5 时输出"); +} +else +{ + print("其他数值时输出"); +} +``` + +可链式使用多个 else if 语句(每组条件判断中只能有一个 if 和一个 else): + +```c +new + a = 4; +if (a == 1) +{ + // 条件不成立 +} +else if (a == 2) +{ + // 条件不成立 +} +else if (a == 3) +{ + // 条件不成立 +} +else if (a == 4) +{ + // 条件成立 +} +else +{ + // 条件不成立 +} +``` + +需注意:else if 的条件判定基于初始变量值,无法捕获动态变化。例如: + +```c +new + a = 5; +if (a == 5) +{ + // 条件成立被执行 + a = 4; // 修改变量值 +} +else if (a == 4) +{ + // 不会执行,因首个条件已成立(即使此时 a=4) +} +``` + +若需实现动态追踪,需将 else if 改为独立 if 语句。 + +### 三元运算符 ?: + +'?' 与 ':' 组合称为三元运算符,可在其他语句中实现条件判断功能: + +```c +new + a, + b = 3; +if (b == 3) +{ + a = 5; +} +else +{ + a = 7; +} +``` + +上述条件赋值可简化为: + +```c +new + a, + b = 3; +a = (b == 3) ? (5) : (7); // 条件成立返回5,否则返回7 +``` + +问号前为条件表达式,与常规条件语句逻辑相同。问号后为条件成立时返回值,冒号后为条件失败时返回值。支持链式嵌套实现多级条件: + +```c +new + a, + b = 3; +if (b == 1) +{ + a = 2; +} +else if (b == 2) +{ + a = 3; +} +else if (b == 3) +{ + a = 4; +} +else +{ + a = 5; +} +``` + +可以写成: + +```c +new + a, + b = 3; +a = (b == 1) ? (2) : ((b == 2) ? (3) : ((b == 3) ? (4) : (5))); +``` + +此结构等价于: + +```c +new + a, + b = 3; +if (b == 1) +{ + a = 2; +} +else +{ + if (b == 2) + { + a = 3; + } + else + { + if (b == 3) + { + a = 4; + } + else + { + a = 5; + } + } +} +``` + +## 循环结构 + +### while 循环 + +"while"循环在条件成立时重复执行代码块,条件检查机制与 if 语句相同: + +```c +new + a = 9; +while (a < 10) // 当a<10时持续执行 +{ + // 循环体内代码 + a++; // 每次循环递增a +} +// 循环结束后执行 +``` + +当 a 初始值为 8 时,循环将执行两次直至 a 达到 10。 + +### for 循环 + +"for"循环是紧凑型循环结构,包含三个要素:初始化、条件判断、迭代操作: + +```c +for (new a = 9; a < 10; a++) // 初始化a=9,条件a<10,每次循环a递增 +{ + // 循环体内代码 +} +// 循环结束后执行 +``` + +典型应用场景——遍历玩家列表: + +```c +for(new i, maxPlayers = GetMaxPlayers(); i < maxPlayers; i++) // 初始化最大玩家数 +{ + if (IsPlayerConnected(i)) // 检查玩家是否在线 + { + // 执行相关操作 + } +} +``` + +各要素可选择性省略: + +```c +new + a = 9; +for ( ; a < 10; ) // 省略初始化和迭代操作 +{ + // 循环体内代码 + a++; // 手动递增 +} +``` + +**作用域差异**: + +1. 第一个示例中变量 a 仅在循环内有效 +2. 第二个示例中变量 a 在循环外声明,作用域更广 +3. 使用`continue`语句时,标准 for 循环会执行迭代操作,而省略迭代操作的版本会跳过 + +**执行顺序说明**: +完整 for 循环中,迭代操作(如 a++)在每次循环结束前执行。当使用`continue`跳过当前循环时,仍会执行迭代操作,保证循环控制变量正确更新。 + +### do-while 循环 + +do-while 循环是一种将条件判断置于循环体代码之后(而非之前)的 while 循环结构。这意味着循环内部的代码始终会至少执行一次,因为代码执行先于条件检查: + +```c +new + a = 10; +do +{ + // 循环内部代码 + a++; +} +while (a < 10); // 注意结尾的分号 +// 循环后续代码 +``` + +若将此结构替换为标准 while 循环,变量 a 将不会自增,因为 (a < 10) 的条件初始即为 false。但在此结构中,自增操作发生于条件检查之前。假设 a 的初始值为 9,该循环仍会执行一次;初始值为 8 则执行两次,以此类推。 + +### if-goto 结构 + +这本质上是上述循环结构经编译后的底层实现。尽管 goto 语句通常不推荐使用,但观察其实现方式有助于理解循环的实际运作机制: + +```c +new + a = 9; + +loop_start: +if (a < 10) +{ + // 循环内部代码 + a++; + goto loop_start; +} +// 循环后续代码 +``` + +### OBOE(差一错误) + +OBOE 是 Off By One Error(差一错误)的缩写,指循环执行次数多一次或少一次的常见编程错误。例如: + +```c +new + a = 0, + b[10]; +while (a <= sizeof (b)) +{ + b[a] = 0; +} +``` + +这个简单示例演示了最常见的差一错误场景。乍看之下可能认为该循环会遍历数组 b 的所有元素并置零,但实际上循环会执行 11 次并试图访问不存在的 b[10](即数组中从 0 开始的第 11 个位置),这将导致各种问题。这种现象被称为越界错误(Out Of Bounds,OOB)。 + +使用 do-while 循环时需特别警惕差一错误,因为此类循环必定会至少执行一次。 + +## Switch 语句 + +### switch 语句 + +switch 语句本质上是结构化的 if/else if/else 系统(类似于 for 循环是结构化的 while 循环)。通过示例可以最直观地解释其工作原理: + +```c +new + a = 5; +switch (a) +{ + case 1: + { + // 不会执行 + } + case 2: + { + // 不会执行 + } + case 5: + { + // 将会执行 + } + default: + { + // 不会执行 + } +} +``` + +这在功能上等价于: + +```c +new + a = 5; +if (a == 1) +{ + // 不会执行 +} +else if (a == 2) +{ + // 不会执行 +} +else if (a == 5) +{ + // 将会执行 +} +else +{ + // 不会执行 +} +``` + +但 switch 语句的代码结构更为清晰。 + +需要特别注意 if 语句和 switch 语句的处理方式差异: + +```c +switch (SomeFunction()) +{ + case 1: {} + case 2: {} + case 3: {} +} +``` + +上述代码会调用 SomeFunction() 一次并进行三次结果比对。 + +```c +if (SomeFunction() == 1) {} +else if (SomeFunction() == 2) {} +else if (SomeFunction() == 3) {} +``` + +而此代码会调用 SomeFunction() 三次,效率较低。switch 语句等效于: + +```c +new + result = SomeFunction(); +if (result == 1) {} +else if (result == 2) {} +else if (result == 3) {} +``` + +对于熟悉 C 语言的开发者需注意:PAWN 的 switch 语句不支持 fall-through 机制,每个 case 分支都有独立的作用域,因此不需要 break 语句。 + +### case 分支 + +case 语句(即 switch 中的 "case X:" 部分)支持多种数值匹配方式。除了单个数值外,还可以匹配数值列表(替代 C 语言的 fall-through)或数值范围: + +```c +case 1, 2, 3, 4: +``` + +此分支会在检测值为 1、2、3 或 4 时触发,等价于: + +```c +if (bla == 1 || bla == 2 || bla == 3 || bla == 4) +``` + +但语法更为简洁。当需要匹配连续数值时,推荐使用范围语法: + +```c +case 1 .. 4: +``` + +此分支效果与前述列表相同,但通过范围检查实现,等价于: + +```c +if (bla >= 1 && bla <= 4) +``` + +```c +new + a = 4; +switch (a) +{ + case 1 .. 3: + { + } + case 5, 8, 11: + { + } + case 4: + { + } + default: + { + } +} +``` + +### default 分支 + +default 分支等效于 if 语句中的 else,当所有 case 分支匹配失败时执行。 + +## 单行控制语句 + +### goto 语句 + +goto 语句实现无条件跳转,直接跳转到指定标签位置。if-goto 循环示例已展示其基本用法: + +```c +goto my_label; + +// 此部分代码将被跳过 + +my_label: // 标签以冒号结尾且独占一行 + +// 从此处继续正常执行 +``` + +由于可能破坏程序流程,goto 语句通常不建议使用。 + +### break 语句 + +break 语句用于提前终止循环: + +```c +for (new a = 0; a < 10; a++) +{ + if (a == 5) break; +} +``` + +该循环将执行 6 次迭代,但 break 之后的代码仅执行 5 次。 + +### continue 语句 + +continue 语句用于跳过当前循环迭代: + +```c +for (new a = 0; a < 3; a++) +{ + if (a == 1) continue; + printf("a = %d", a); +} +``` + +输出结果为: + +```c +a = 0 a = 2 +``` + +需特别注意 continue 在某些循环中的使用: + +```c +new + a = 0; +while (a < 3) +{ + if (a == 1) continue; + printf("a = %d", a); + a++; +} +``` + +此例中 continue 会跳过 a++ 语句,导致循环变量 a 始终为 1,形成无限循环。 + +### return 语句 + +return 语句终止函数执行并返回调用点: + +```c +main() +{ + print("1"); + MyFunction(1); + print("3"); +} + +MyFunction(num) +{ + if (num == 1) + { + return; + } + print("2"); +} +``` + +输出结果为: + +1 3 + +因为 print("2"); 语句永远不会执行。 + +return 也可用于返回值: + +```c +main() +{ + print("1"); + if (MyFunction(1) == 27) + { + print("3"); + } +} + +MyFunction(num) +{ + if (num == 1) + { + return 27; + } + print("2"); + return 0; +} +``` + +注意函数末尾必须显式返回数值(即使函数逻辑上不会执行到该处),因为 PAWN 不允许混合有返回值和无返回值的返回方式。返回值可以是数字、变量或另一个函数的返回值(此时会先执行该函数,其必须返回有效值)。 + +返回值可存储供后续使用: + +```c +main() +{ + print("1"); + new + ret = MyFunction(1); + if (ret == 27) + { + print("3"); + } +} + +MyFunction(num) +{ + if (num == 1) + { + return 27; + } + print("2"); + return 0; +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Directives.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Directives.md new file mode 100644 index 00000000000..31366094ea4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Directives.md @@ -0,0 +1,340 @@ +--- +title: "关键字:预处理器指令" +sidebar_label: "关键字:预处理器指令" +--- + +预处理器指令是传递给编译器的指令,用于控制其对源代码的解析方式。 + +## `#assert` + +该指令用于检查常量表达式是否为真,若结果为假则终止编译。 + +```c +#define MOO 10 +#assert MOO > 5 +``` + +上述代码能通过编译。 + +```c +#define MOO 1 +#assert MOO > 5 +``` + +该代码将触发致命错误终止编译。其效果等价于: + +```c +#define MOO 1 +#if MOO <= 5 + #error MOO check failed +#endif +``` + +但使用#assert 会输出如下错误信息: + +``` +断言失败:1 > 5 +``` + +而后者会提示: + +``` +用户错误:Moo check failed +``` + +两者的错误提示信息在调试效果上各有优劣。 + +## `#define` + +`#define` 是文本替换指令,预处理器会将该指令首符号在代码中的所有出现替换为后续定义内容。 + +```c +#define MOO 7 +printf("%d", MOO); +``` + +将被转换为: + +```c +printf("%d", 7); +``` + +这也是为何反编译时所有宏定义都会丢失——编译时宏已被展开(所有预处理指令都在编译前处理)。宏定义不仅限于数值: + +```c +#define PL new i = 0; i < MAX_PLAYERS; i++) if (IsPlayerConnected(i) + +for(PL) printf("%d 已连接", i); +``` + +将展开为经典的玩家循环结构。注意此处括号的运用:部分来自 for 语句,部分来自宏展开。 + +另一个较少提及的特性是:通过反斜杠换行符可实现多行宏定义。常规情况下换行符会终止宏定义,但以下写法合法: + +```c +#define PL \ + new i = 0; i < MAX_PLAYERS; i++) \ + if (IsPlayerConnected(i) + +printf("%d", MOO(6)); +``` + +该代码将输出 42。注意宏定义中额外的括号?这是为了确保宏展开后的运算顺序正确: + +```c +printf("%d", ((6) * 7)); +``` + +这种处理能有效避免运算优先级问题。例如: + +```c +printf("%d", MOO(5 + 6)); +``` + +预期结果为 77((5 + 6) \* 7)。若未使用括号保护: + +```c +#define MOO(%0) \ + %0 * 7 + +printf("%d", MOO(5 + 6)); +``` + +将展开为: + +```c +printf("%d", MOO(5 + 6 * 7)); +``` + +由于运算符优先级,实际计算为 5 + (6\*7) = 47,导致错误结果。 + +宏参数的另一个特性是:当参数数量超过形参数量时,最后一个形参会吸收所有剩余实参。例如: + +```c +#define PP(%0,%1) \ + printf(%0, %1) + +PP(%s %s %s, "hi", "hello", "hi"); +``` + +实际输出: + +``` +hi hello hi +``` + +因为`%1`包含了"hi", "hello", "hi"。你可能注意到此处`#`符号用于字面量字符串化,此为 SA-MP 特有功能并且很有用。此处添加这个符号的主要目的是实现参数间的明确区分。 + +## `#else` + +`#else` 是条件编译中的"否则"分支,对应`#if`指令。 + +## `#elseif` + +`#elseif` 实现条件编译中的"否则如果"逻辑。 + +```c +#define MOO 10 + +#if MOO == 9 + printf("if"); +#elseif MOO == 8 + printf("else if"); +#else + printf("else"); +#endif +``` + +## `#emit` + +该指令未在 pawn-lang.pdf 中列明但实际存在。它实现内联汇编功能,允许直接插入 AMX 操作码到代码中。语法为:`#emit <操作码> <参数>`,`<参数>`可为有理数、整数或符号(变量/函数/标签)。具体操作码列表参考 Pawn Toolkit ver.3664。 + +## `#endif` + +`#endif` 标志着`#if`条件块的结束,类似代码块中的右花括号。 + +## `#endinput, #endscript` + +终止当前文件的包含过程。 + +## `#error` + +立即终止编译并输出自定义错误信息。参见`#assert`示例。 + +## `#if` + +预处理器的条件判断指令,用于控制代码包含策略。与常规 if 语句不同,`#if`要求表达式必须为常量。 例如以下代码: + +```c +#define LIMIT 10 + +if (LIMIT < 10) +{ + printf("Limit too low"); +} +``` + +将被编译为: + +```c +if (10 < 10) +{ + printf("Limit too low"); +} +``` + +显然该条件永远不可能为真,编译器会识别这种情况——因此给出"constant expression"警告。关键在于,既然条件永远不成立,保留这段代码的意义何在?虽然可以直接删除代码,但这将导致当有人修改 LIMIT 后重新编译时失去检查机制。这正是`#if`的应用场景。与普通 if 语句在表达式为常量时产生警告不同,`#if`表达式必须为常量表达式。因此: + +```c +#define LIMIT 10 + +#if LIMIT < 10 + #error 限制值过低 +#endif +``` + +该方式能在编译阶段直接检测限制值是否过小,若不符合要求则触发**编译时错误**,而无需通过运行测试来发现问题。这种机制还意味着不会生成冗余代码。注意此处省略了括号——虽然您可以使用括号,在复杂表达式中可能需要它们,但简单情况下并非必需。 + +再看另一个示例: + +```c +#define LIMIT 10 + +if (LIMIT < 10) +{ + printf("Limit less than 10"); +} +else +{ + printf("Limit equal to or above 10"); +} +``` + +这同样属于常量检查的范畴,编译器会发出警告。尽管我们明确知道只有一条分支会被执行,但两条打印语句仍会被编译。使用`#if`预处理指令改写后: + +```c +#define LIMIT 10 + +#if LIMIT < 10 + printf("Limit less than 10"); +#else + printf("Limit equal to or above 10"); +#endif +``` + +通过这种方式,仅需保留的打印语句会被编译进最终代码,另一条语句仍驻留在源码中——既保证了当开发者修改 LIMIT 值后重新编译时的条件检测能力,又剔除了当前不需要的代码段。更重要的是,这种方式彻底消除了每次程序运行时执行无效条件判断的性能损耗,这对代码执行效率具有显著优化意义。 + +## `#include` + +该指令将指定文件的所有代码插入到当前文件包含指令所在位置。包含方式分为两类:相对路径包含与系统路径包含(此为自创术语,如有更佳命名欢迎提议)。相对路径包含使用双引号包裹文件名,路径解析基于当前文件所在目录: + +```c +#include "me.pwn" +``` + +上述指令将从当前文件所在目录引入"me.pwn"文件。系统路径包含则从 Pawn 编译器同级目录或上级目录的"include"文件夹(路径规则:"include","../include")中查找文件: + +```c +#include +``` + +该指令将从 pawno/include 目录(假设使用 pawno 环境)引入"me.inc"文件(注意省略扩展名的默认规则,若文件非.p/.pwn/.inc 格式需显式指定扩展名)。 + +两种包含方式均支持子目录路径: + +```c +#include "folder/me.pwn" +``` + +```c +#include +``` + +上述指令将分别从相对路径和系统路径的默认目录下一级子目录查找文件。若文件不存在则立即触发编译失败。 + +## `#pragma` + +这是最复杂的预处理器指令之一,提供多项编译参数控制脚本行为。典型设置示例如: + +```c +#pragma ctrlchar '$' +``` + +该指令将转义字符从\改为$,因此换行符将由"\r\n"变为"$r\$n"。多数参数设计用于嵌入式系统的 AMX 编译限制(PC 端通常无此限制),完整列表详见 pawn-lang.pdf,以下仅列出与 SA:MP 相关的核心参数: + +| 参数名 | 取值范围 | 技术说明 | +| ---------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| codepage | 名称/数值 | 设置字符串使用的 Unicode 代码页 | +| compress | 1/0 | SA-MP 环境不支持,切勿使用 | +| deprecated | 符号名 | 对指定符号启用弃用警告,提示存在更优替代方案 | +| dynamic | 数值(通常为 2 的幂) | 设置栈与堆的内存分配大小(单位:存储单元)。当编译后出现内存超额警告时需调整此值(编译器版权信息后的异常表格即为此类警告) | +| library | DLL 名称 | SA-MP 社区常见误用参数。该参数指定获取原生函数(native functions)的 DLL 来源,并非用于声明文件作为库 | +| pack | 1/0 | 切换!""与""的语义。详见 pawn-lang.pdf 获取打包字符串的详细说明 | +| tabsize | 数值 | 另一常见误用参数。用于设置制表符宽度以避免因混用空格/制表符导致的错误编译警告。SA:MP 中设为 4 以匹配 pawno 的制表符宽度。设为 0 将禁用所有缩进警告,但会导致代码可读性严重下降,强烈不建议使用 | +| unused | 符号名 | 对指定符号禁用"未使用"警告。通常更推荐使用 stock 修饰符实现类似效果,但某些场景不适用(例如函数参数无法被排除) | + +### 弃用警告示例 + +```c +new + gOldVariable = 5; + +#pragma deprecated gOldVariable + +main() {printf("%d", gOldVariable);} +``` + +该代码将触发 gOldVariable 的弃用警告。此机制常用于函数级 API 更新时保持向后兼容性。 + +### `#tryinclude` + +功能类似#include,但文件不存在时不会导致编译失败。该机制的核心价值在于:仅当用户安装了特定插件(或至少包含相关插件头文件)时,才在脚本中启用对应功能模块。 + +**myinc.inc** + +```c +#if defined _MY_INC_INC + #endinput +#endif +#define _MY_INC_INC + +stock MyIncFunc() {printf("Hello");} +``` + +**游戏主脚本:​** + +```c +#tryinclude + +main() +{ + #if defined _MY_INC_INC + MyIncFunc(); + #endif +} +``` + +仅当 myinc.inc 存在且成功编译时才会调用 MyIncFunc()。此特性特别适用于 IRC 插件等需要运行时检测插件是否加载的场景。 + +### `#undef` + +移除已定义的宏或常量符号。 + +```c +#define MOO 10 +printf("%d", MOO); +#undef MOO +printf("%d", MOO); +``` + +该代码将在第二个 printf 处编译失败,因为 MOO 已被取消定义。 + +```c +enum { + e_example = 300 +}; + +printf("%d", e_example); +#undef e_example +printf("%d", e_example); // 致命错误 +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Initialisers.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Initialisers.md new file mode 100644 index 00000000000..e3f89511b39 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Initialisers.md @@ -0,0 +1,886 @@ +--- +title: 关键字:初始化器 +sidebar_label: 关键字:初始化器 +--- + +## `const` + +```c +new const + MY_CONSTANT[] = {1, 2, 3}; +``` + +const 关键字虽未广泛应用,但其功能为声明不可通过代码修改的常量变量。主要应用场景包括: + +- 函数参数声明为 const 数组时可获得编译优化 +- 替代宏定义(#define)实现数组类型的常量声明 + +const 作为修饰符必须与 new 或其他变量声明符配合使用。若尝试修改 const 变量,编译器将产生错误提示。此修饰符通过强制不可变性保障数据完整性,适用于需要运行时确定常量值的场景(与编译期确定的宏定义形成互补)。 + +## `enum` + +枚举是一种非常有用的系统,可用于表示大量数据组并快速修改常量。其主要用途包括:替代大量 define 语句、符号化表示数组槽位(这实际上与 define 功能相同但表现形式不同)以及创建新标签。 + +目前最常见的用途是作为数组定义: + +```c +enum E_MY_ARRAY +{ + E_MY_ARRAY_MONEY, + E_MY_ARRAY_GUN +} + +new + gPlayerData[MAX_PLAYERS][E_MY_ARRAY]; + +public OnPlayerConnect(playerid) +{ + gPlayerData[playerid][E_MY_ARRAY_MONEY] = 0; + gPlayerData[playerid][E_MY_ARRAY_GUN] = 5; +} +``` + +这将为每个玩家创建包含两个槽位的数组。当玩家连接时,在 E_MY_ARRAY_MONEY 对应的槽位存入 0,在 E_MY_ARRAY_GUN 槽位存入 5。若不使用枚举,代码将呈现为: + +```c +new + gPlayerData[MAX_PLAYERS][2]; + +public OnPlayerConnect(playerid) +{ + gPlayerData[playerid][0] = 0; + gPlayerData[playerid][1] = 5; +} +``` + +这正是第一种方式编译后的实际形态。虽然可行,但可读性较差——槽位 0 和 1 分别代表什么?且灵活性不足,若需在 0 和 1 之间新增槽位,必须将所有 1 重命名为 2,添加新项后还需检查是否遗漏修改。而使用枚举只需: + +```c +enum E_MY_ARRAY +{ + E_MY_ARRAY_MONEY, + E_MY_ARRAY_AMMO, + E_MY_ARRAY_GUN +} + +new + gPlayerData[MAX_PLAYERS][E_MY_ARRAY]; + +public OnPlayerConnect(playerid) +{ + gPlayerData[playerid][E_MY_ARRAY_MONEY] = 0; + gPlayerData[playerid][E_MY_ARRAY_AMMO] = 100; + gPlayerData[playerid][E_MY_ARRAY_GUN] = 5; +} +``` + +重新编译后所有内容将自动更新。 + +那么枚举如何确定各项的赋值?其完整语法结构为: + +```c +enum NAME (modifier) +{ + NAME_ENTRY_1 = value, + NAME_ENTRY_2 = value, + ... + NAME_ENTRY_N = value +} +``` + +但多数情况下采用默认参数。若未指定修饰符,默认使用(+= 1),即枚举中每个项的值为前项值加 1。例如: + +```c +enum E_EXAMPLE +{ + E_EXAMPLE_0, + E_EXAMPLE_1, + E_EXAMPLE_2 +} +``` + +首项 E_EXAMPLE_0 默认为 0,第二项 E_EXAMPLE_1 为 1(0+1),第三项 E_EXAMPLE_2 为 2(1+1)。此时整个枚举 E_EXAMPLE 的值为 3(2+1),枚举名称即代表最后一项的值。若修改修饰符将得到不同赋值: + +```c +enum E_EXAMPLE (+= 5) +{ + E_EXAMPLE_0, + E_EXAMPLE_1, + E_EXAMPLE_2 +} +``` + +此例中每个项的值递增步长为 5,初始值仍为 0,则得到:E_EXAMPLE_0=0,E_EXAMPLE_1=5,E_EXAMPLE_2=10,E_EXAMPLE=15。若声明数组: + +```c +new + gEnumArray[E_EXAMPLE]; +``` + +将创建 15 个单元的数组,但只能通过枚举值访问 0、5、10 号单元(仍可使用普通数字索引)。再看另一示例: + +```c +enum E_EXAMPLE (*= 2) +{ + E_EXAMPLE_0, + E_EXAMPLE_1, + E_EXAMPLE_2 +} +``` + +此处所有项均为 0。原因在于首项默认 0,后续项按 0 \* 2=0 计算。如何修正?需使用自定义初始值: + +```c +enum E_EXAMPLE (*= 2) +{ + E_EXAMPLE_0 = 1, + E_EXAMPLE_1, + E_EXAMPLE_2 +} +``` + +这将得到 1、2、4、8 的赋值序列。以此创建数组将生成 8 单元数组,并通过命名访问 1、2、4 号单元。可自由设置任意值和任意数量的自定义项: + +```c +enum E_EXAMPLE (*= 2) +{ + E_EXAMPLE_0, + E_EXAMPLE_1 = 1, + E_EXAMPLE_2 +} +``` + +得到: + +```c +0, 1, 2, 4 +``` + +而: + +```c +enum E_EXAMPLE (*= 2) +{ + E_EXAMPLE_0 = 1, + E_EXAMPLE_1 = 1, + E_EXAMPLE_2 = 1 +} +``` + +则生成: + +```c +1, 1, 1, 2 +``` + +建议仅对数组使用+=1 的默认递增方式。 + +枚举中亦可包含数组定义: + +```c +enum E_EXAMPLE +{ + E_EXAMPLE_0[10], + E_EXAMPLE_1, + E_EXAMPLE_2 +} +``` + +这将使 E_EXAMPLE_0=0,E_EXAMPLE_1=10,E_EXAMPLE_2=11,E_EXAMPLE=12,而非通常认为的 0,1,2,3 序列。 + +枚举项可附加标签,例如: + +```c +enum E_MY_ARRAY +{ + E_MY_ARRAY_MONEY, + E_MY_ARRAY_AMMO, + Float:E_MY_ARRAY_HEALTH, + E_MY_ARRAY_GUN +} + +new + gPlayerData[MAX_PLAYERS][E_MY_ARRAY]; + +public OnPlayerConnect(playerid) +{ + gPlayerData[playerid][E_MY_ARRAY_MONEY] = 0; + gPlayerData[playerid][E_MY_ARRAY_AMMO] = 100; + gPlayerData[playerid][E_MY_ARRAY_GUN] = 5; + gPlayerData[playerid][E_MY_ARRAY_HEALTH] = 50.0; +} +``` + +此写法不会引发标签类型不匹配错误。 + +枚举本身亦可作为标签使用: + +```c +enum E_MY_TAG (<<= 1) +{ + E_MY_TAG_NONE, + E_MY_TAG_VAL_1 = 1, + E_MY_TAG_VAL_2, + E_MY_TAG_VAL_3, + E_MY_TAG_VAL_4 +} + +new + E_MY_TAG:gMyTagVar = E_MY_TAG_VAL_2 | E_MY_TAG_VAL_3; +``` + +这将创建新变量并赋值为 6(4 | 2),且带有自定义标签。若执行: + +```c +gMyTagVar = 7; +``` + +会触发标签不匹配警告,但可通过强制类型转换绕过: + +```c +gMyTagVar = E_MY_TAG:7; +``` + +此特性对标志位数据处理(即用单个位表示特定数据)或组合数据非常有用: + +```c +enum E_MY_TAG (<<= 1) +{ + E_MY_TAG_NONE, + E_MY_TAG_MASK = 0xFF, + E_MY_TAG_VAL_1 = 0x100, + E_MY_TAG_VAL_2, + E_MY_TAG_VAL_3, + E_MY_TAG_VAL_4 +} + +new + E_MY_TAG:gMyTagVar = E_MY_TAG_VAL_2 | E_MY_TAG_VAL_3 | (E_MY_TAG:7 & E_MY_TAG_MASK); +``` + +将生成十进制值 1543(0x0607)。 + +最后,如最初所述,枚举可通过省略名称来替代宏定义: + +```c +#define TEAM_NONE 0 +#define TEAM_COP 1 +#define TEAM_ROBBER 2 +#define TEAM_CIV 3 +#define TEAM_CLERK 4 +#define TEAM_DRIVER 5 +``` + +此类团队定义方式常见但缺乏灵活性。可用枚举实现自动数值分配: + +```c +enum +{ + TEAM_NONE, + TEAM_COP, + TEAM_ROBBER, + TEAM_CIV, + TEAM_CLERK, + TEAM_DRIVER +} +``` + +各团队值保持不变,用法完全相同: + +```c +new + gPlayerTeam[MAX_PLAYERS] = {TEAM_NONE, ...}; + +public OnPlayerConnect(playerid) +{ + gPlayerTeam[playerid] = TEAM_NONE; +} + +public OnPlayerRequestSpawn(playerid) +{ + if (gPlayerSkin[playerid] == gCopSkin) + { + gPlayerTeam[playerid] = TEAM_COP; + } +} +``` + +在此基础上,有更优的团队定义方式: + +```c +enum (<<= 1) +{ + TEAM_NONE, + TEAM_COP = 1, + TEAM_ROBBER, + TEAM_CIV, + TEAM_CLERK, + TEAM_DRIVER +} +``` + +此时 TEAM_COP=1,TEAM_ROBBER=2,TEAM_CIV=4 等(二进制分别为 0b00000001, 0b00000010, 0b00000100)。这意味着若玩家团队值为 3,则同时属于警察和劫匪团队。这种设计虽看似矛盾,却开启了新的可能性: + +```c +enum (<<= 1) +{ + TEAM_NONE, + TEAM_COP = 1, + TEAM_ROBBER, + TEAM_CIV, + TEAM_CLERK, + TEAM_DRIVER, + TEAM_ADMIN +} +``` + +通过此枚举,玩家可同时属于常规团队和管理员团队。虽然需要少量代码调整,但实现简单: + +添加玩家至团队: + +```c +gPlayerTeam[playerid] |= TEAM_COP; +``` + +移除玩家出团队: + +```c +gPlayerTeam[playerid] &= ~TEAM_COP; +``` + +检查玩家所属团队: + +```c +if (gPlayerTeam[playerid] & TEAM_COP) +``` + +该方法简洁高效,极具实用价值。 + +## `forward` + +`forward`关键字用于向编译器预先声明函数的存在。该指令对所有 public 函数都是必需的,同时也可用于其他场景。其语法结构为:在"forward"后跟随完整的函数名称及参数列表,并以分号结尾: + +```c +forward MyPublicFunction(playerid, const string[]); + +public MyPublicFunction(playerid, const string[]) +{ +} +``` + +除 public 函数必须使用外,`forward`还可用于解决特定场景下的类型解析警告——当带有标签返回值(如浮点型)的函数在声明前被调用时: + +```c +main() +{ + new + Float:myVar = MyFloatFunction(); +} + +Float:MyFloatFunction() +{ + return 5.0; +} +``` + +此时编译器会发出 reparse 警告,因为它无法确定函数返回值是普通整型还是浮点型。显然此例中函数返回浮点值。解决方案有两种: + +方案一:将函数定义置于调用代码之前: + +```c +Float:MyFloatFunction() +{ + return 5.0; +} + +main() +{ + new + Float:myVar = MyFloatFunction(); +} +``` + +方案二:使用`forward`声明提前告知编译器返回类型: + +```c +forward Float:MyFloatFunction(); + +main() +{ + new + Float:myVar = MyFloatFunction(); +} + +Float:MyFloatFunction() +{ + return 5.0; +} +``` + +特别注意:`forward`声明中必须包含返回值标签。 + +## `native` + +原生函数(native function)是指在虚拟机(即运行脚本的环境)中定义的函数,而非脚本自身实现。此类函数只能通过 SA:MP 或插件进行原生定义,但开发者可以创建伪原生函数。由于.inc 文件中定义的原生函数会被 PAWNO 识别并显示在右侧函数列表框中,使用`native`关键字有助于将自定义函数纳入该列表。典型原生函数声明示例如下: + +```c +native printf(const format[], \{Float, _\}:...); +``` + +若希望自定义函数显示在列表却无需实际声明为原生函数,可采用注释伪装法: + +```c +/* +native MyFunction(playerid); +*/ +``` + +PAWNO 不识别此类注释格式,仍会将函数加入列表,而编译器则正常忽略该声明。 + +`native`关键字的另一妙用是函数重命名/重载: + +```c +native my_print(const string[]) = print; +``` + +此时`print`函数在脚本层面已不存在。虽然 SA:MP 底层仍保留该函数,且编译器通过"= print"知晓其真实名称,但在 PAWN 代码中调用`print()`将报错,因其已被重命名为`my_print`。鉴于`print`的脚本级定义已移除,开发者可自由重新定义: + +```c +print(const string[]) +{ + my_print("检测到print()调用"); + my_print(string); +} +``` + +此后脚本中所有`print()`调用均会触发自定义函数而非原函数。此例中,每次调用会先输出提示信息再打印原始内容。 + +## `new` + +该关键字是变量系统的核心,属于最重要的关键字之一。`new`用于声明新变量: + +```c +new + myVar = 5; +``` + +此操作将创建名为 myVar 的变量并赋初值 5。若未显式赋值,所有变量默认初始化为 0: + +```c +new + myVar; + +printf("%d", myVar); +``` + +输出结果为"0"。 + +变量的作用域(scope)决定其可用范围。作用域由大括号{}限定,在大括号内声明的变量仅能在该代码块内使用: + +```c +if (a == 1) +{ + // 大括号作用域起始于上一行 + new + myVar = 5; + + // 当前printf处于同一作用域内,可访问myVar + printf("%d", myVar); + + // 此if语句也处于相同作用域,内部代码可访问myVar + if (myVar == 1) + { + printf("%d", myVar); + } + // 大括号作用域结束于下一行 +} +// 此处已脱离作用域,将触发错误 +printf("%d", myVar); +``` + +此示例也印证了代码缩进规范的重要性。 + +全局变量(即函数外声明的变量)通过`new`声明后,可在声明位置之后的所有位置使用: + +文件 File1.pwn: + +```c +MyFunc1() +{ + // 错误,gMyVar尚未定义 + printf("%d", gMyVar); +} + +// 在此处声明全局变量 +new + gMyVar = 10; + +MyFunc2() +{ + // 有效,gMyVar已存在 + printf("%d", gMyVar); +} + +// 包含其他文件 +#include "file2.pwn" +``` + +文件 file2.pwn: + +```c +MyFunc3() +{ + // 同样有效,因该文件在主文件声明后引入,且new不限制文件边界 + printf("%d", gMyVar); +} +``` + +## `operator` + +该关键字允许为自定义标签重载操作符。例如: + +```c +stock BigEndian:operator=(b) +{ + return BigEndian:(((b >>> 24) & 0x000000FF) | ((b >>> 8) & 0x0000FF00) | ((b << 8) & 0x00FF0000) | ((b << 24) & 0xFF000000)); +} + +main() +{ + new + BigEndian:a = 7; + printf("%d", _:a); +} +``` + +常规 PAWN 数值采用小端序(little endian)存储。通过此操作符可定义赋值行为,将常规数值转换为大端序格式。大端序与小端序的本质区别在于字节存储顺序: + +数值 7 在小端序中存储为: + +```c +07 00 00 00 +``` + +而大端序存储为: + +```c +00 00 00 07 +``` + +因此若以大端序格式存储数值后直接打印,系统会按小端序解析导致字节逆序,最终输出 0x07000000(十进制 117440512),这也正是上述代码的运行结果。 + +支持重载的操作符包括: + +```c ++, -, *, /, %, ++, --, ==, !=, <, >, <=, >=, ! 和 = +``` + +值得注意的是,操作符行为可完全自定义: + +```c +stock BigEndian:operator+(BigEndian:a, BigEndian:b) +{ + return BigEndian:42; +} + +main() +{ + new + BigEndian:a = 7, + BigEndian:b = 199; + printf("%d", _:(a + b)); +} +``` + +此示例将直接输出 42,完全摒弃加法运算的原始逻辑。 + +## `public` + +`public`关键字用于使函数对虚拟机可见,即允许 SA:MP 服务器直接调用该函数,而不仅限于在 PAWN 脚本内部调用。该关键字也可用于变量声明,使其值能在服务器端读写(尽管 SA:MP 未直接使用此特性,但可通过插件实现),结合`const`可创建仅允许服务器修改的只读变量。 + +公共函数在 amx 文件中存储其文本名称,而普通函数仅存储跳转地址,这为反编译增加了难度。这种机制使得可以通过名称从脚本外部调用函数,同时也支持在脚本内部通过名称调用函数(需通过跨脚本上下文切换)。原生函数(native)调用机制与公共函数形成互补——前者从脚本内部调用外部函数,后者则反之。结合两者可实现如 SetTimer、SetTimerEx、CallRemoteFunction 和 CallLocalFunction 等通过名称(而非地址)调用的函数。 + +通过名称调用函数的示例: + +```c +forward MyPublicFunc(); + +main() +{ + CallLocalFunction("MyPublicFunc", ""); +} + +public MyPublicFunc() +{ + printf("Hello"); +} +``` + +公共函数名称前缀可为"public"或"@",且必须配合`forward`声明使用: + +```c +forward MyPublicFunc(); +forward @MyOtherPublicFunc(var); + +main() +{ + CallLocalFunction("MyPublicFunc", ""); + SetTimerEx("@MyOtherPublicFunc", 5000, 0, "i", 7); +} + +public MyPublicFunc() +{ + printf("Hello"); +} + +@MyOtherPublicFunc(var) +{ + printf("%d", var); +} +``` + +此示例演示了通过 SetTimerEx 在 5 秒后调用"MyOtherPublicFunc"并传递整型参数 7 进行打印。 + +示例中频繁出现的`main`函数虽具有类似公共函数的特性(可被外部调用),但本质并非公共函数——其拥有特殊已知地址,服务器通过该地址跳转执行。 + +所有 SA:MP 回调函数均需声明为 public 并由服务器自动调用: + +```c +public OnPlayerConnect(playerid) +{ + printf("%d connected", playerid); +} +``` + +当玩家加入服务器时,系统将自动在所有脚本(游戏模式 优先于 滤镜脚本)中查找此公共函数并执行。 + +若需在脚本内部调用公共函数,无需使用名称调用机制,公共函数同样具备常规函数特性: + +```c +forward MyPublicFunc(); + +main() +{ + MyPublicFunc(); +} + +public MyPublicFunc() +{ + printf("Hello"); +} +``` + +此直接调用方式在性能上显著优于 CallLocalFunction 等原生函数调用方式。 + +## `static` + +静态变量(static variable)与全局变量相似,但具有更严格的作用域限制。当在全局作用域使用`static`时,生成的变量仅限在声明区域所属的代码段内访问(参见#section)。以前述`new`示例为基础进行改造: + +**file1.pwn** + +```c +MyFunc1() +{ + // 错误,gMyVar此时尚未声明 + printf("%d", gMyVar); +} + +// 在此处声明gMyVar +new + gMyVar = 10; + +MuFunc2() +{ + // 正常,因为gMyVar此时已存在 + printf("%d", gMyVar); +} + +// 在此包含另一个文件 +#include "file2.pwn" +``` + +file2.pwn + +```c +MyFunc3() +{ + // 此处同样正常,因为该文件在主文件声明后包含,且`new`不受文件作用域限制 + printf("%d", gMyVar); +} +``` + +将其修改为静态将得到: + +file1.pwn + +```c +MyFunc1() +{ + // 错误,g_sMyVar尚未定义 + printf("%d", g_sMyVar); +} + +// 在此处声明静态全局变量 +static + g_sMyVar = 10; + +MyFunc2() +{ + // 有效,g_sMyVar已存在 + printf("%d", g_sMyVar); +} + +// 包含其他文件 +#include "file2.pwn" +``` + +文件 file2.pwn + +```c +MyFunc3() +{ + // 错误,g_sMyVar仅限声明文件(或代码段)内访问,此处属于不同文件 + printf("%d", g_sMyVar); +} +``` + +此机制允许在不同文件中定义同名全局静态变量。 + +若在局部作用域(函数内部)使用`static`,该变量与`new`声明的局部变量类似,仅能在声明作用域内访问(基于大括号规则,参见`new`章节)。但与`new`变量不同,`static`局部变量在多次函数调用间保持数值持久性。 + +```c +main() +{ + for (new loopVar = 0; loopVar < 4; loopVar++) + { + MyFunc(); + } +} + +MyFunc() +{ + new + i = 0; + printf("%d", i); + i++; + printf("%d", i); +} +``` + +每次函数调用时 i 都会被重置为 0,输出结果为: + +```c +0 +1 +0 +1 +0 +1 +0 +1 +``` + +若将`new`替换为`static`: + +```c +main() +{ + for (new loopVar = 0; loopVar < 4; loopVar++) + { + MyFunc(); + } +} + +MyFunc() +{ + static + i = 0; + printf("%d", i); + i++; + printf("%d", i); +} +``` + +由于静态局部变量具备数值持久性,输出结果变为: + +```c +0 +1 +1 +2 +2 +3 +3 +4 +``` + +声明时的初始值(若指定,默认值为 0)仅在首次函数调用时生效。例如使用`static i = 5;`将输出: + +```c +5 +6 +6 +7 +7 +8 +8 +9 +``` + +静态变量在底层实现中实质为全局变量,编译器仅进行作用域使用检查。因此反编译时无法区分普通全局变量、全局静态变量与局部静态变量,均显示为普通全局变量。 + +此外,可声明静态函数,此类函数仅能在声明文件中调用。该特性常用于实现私有风格的函数封装。 + +## `stock` + +`stock` 用于声明可能未被使用但您不希望生成未使用警告的变量和函数。对于变量而言,`stock` 类似于 `const`,它是一个修饰符而非完整声明,因此您可以这样使用: + +```c +new stock + gMayBeUsedVar; + +static stock + g_sMayBeUsedVar; +``` + +如果变量或函数被使用,编译器会包含它;如果未被使用,则会将其排除。这与使用 `#pragma unused (symbol)` 不同,后者仅会抑制(即隐藏)警告但仍保留相关信息,而 `stock` 会完全忽略未使用的数据。 + +`stock` 最常见于自定义库开发场景。当您编写函数库时,会提供大量函数供他人使用,但您无法预知哪些函数会被实际调用。如果用户未使用的每个函数都会触发大量警告,他们可能会提出抱怨(除非某些函数必须被调用以执行初始化变量等强制操作)。尽管如此,根据 YSI 库的实际经验,用户往往仍会提出各种反馈。 + +```c +main() +{ + Func1(); +} + +Func1() +{ + printf("Hello"); +} + +Func2() +{ + printf("Hi"); +} +``` + +在此示例中,`Func2` 从未被调用,因此编译器会生成警告。这在独立脚本中可能有助于提醒您是否遗漏了函数调用,但如果 `Func1` 和 `Func2` 属于函数库,用户可能确实不需要 `Func2`。此时可采用以下方案: + +```c +main() +{ + Func1(); +} + +stock Func1() +{ + printf("Hello"); +} + +stock Func2() +{ + printf("Hi"); +} +``` + +通过添加 `stock` 修饰符,未使用的 `Func2` 将不会被编译,同时消除相关警告。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Operators.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Operators.md new file mode 100644 index 00000000000..dca813c1a7b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Operators.md @@ -0,0 +1,147 @@ +--- +title: "关键字:操作符" +sidebar_label: "关键字:操作符" +--- + +## `char` + +`char` 返回存储指定数量字符(打包字符串)所需的内存单元数。即存储给定字节数所需的 4 字节内存单元数量。例如: + +```c +4 char +``` + +返回 1。 + +```c +3 char +``` + +返回 1(无法存在 3/4 个变量单元)。 + +```c +256 char +``` + +返回 64(256 除以 4)。 + +通常用于变量声明: + +```c +new + someVar[40 char]; +``` + +将创建包含 10 个单元的数组(40 / 4 = 10)。 + +关于打包字符串的详细信息请参阅 pawn-lang.pdf。 + +## `defined` + +检查符号是否已定义,主要用于预处理指令 `#if`: + +```c +new + someVar = 5; +#if defined someVar + printf("%d", someVar); +#else + #error 变量 'someVar' 未定义 +#endif +``` + +常见用途是根据宏定义生成不同代码: + +```c +#define FILTERSCRIPT + +#if defined FILTERSCRIPT + +public OnFilterScriptInit() +{ + return 1; +} + +#else + +public OnGameModeInit() +{ + return 1; +} + +#endif +``` + +## `sizeof` + +返回数组的 元素数量: + +```c +new + someVar[10]; +printf("%d", sizeof (someVar)); +``` + +输出: + +```c +10 +``` + +多维数组示例: + +```c +new + someVar[2][10]; +printf("%d %d", sizeof (someVar), sizeof (someVar[])); +``` + +输出: + +```c +2 10 +``` + +## `state` + +该关键字与 PAWN 自动机系统相关,本文不做详细说明。 + +## `tagof` + +返回表示变量标签的数值: + +```c +new + someVar, + Float:someFloat; +printf("%d %d", tagof (someVar), tagof (someFloat)); +``` + +输出可能显示为乱码: + +```c +-./,),(-*,( -1073741820 +``` + +实际对应十六进制值: + +```c +0x80000000 0xC0000004 +``` + +检查变量是否为浮点类型(带 `Float:` 标签): + +```c +new Float: fValue = 6.9; + +new tag = tagof (fValue); + +if (tag == tagof (Float:)) +{ + print("浮点类型"); +} +else +{ + print("非浮点类型"); +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Statements.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Statements.md new file mode 100644 index 00000000000..63dc6eed70a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Statements.md @@ -0,0 +1,703 @@ +--- +title: "关键字:语句" +sidebar_label: "关键字:语句" +--- + +## `assert` + +当表达式结果为逻辑假时,触发运行时错误并终止程序执行。该语句仅在`main()`代码块中生效。`assert`应用于标识逻辑(程序员)错误,而非运行时(用户)错误。 + +```c +main() +{ + assert (MAX_PLAYERS == GetMaxPlayers()); // 验证MAX_PLAYERS宏定义是否与实际服务器玩家槽位数一致 +} +``` + +## `break` + +立即终止当前循环执行,仅退出最内层循环而非所有嵌套循环。 + +```c +for (new i = 0; i < 10; i++) +{ + printf("%d", i); + if (i == 5) + { + break; + } +} +``` + +输出结果: + +```c +0 +1 +2 +3 +4 +5 +``` + +而: + +```c +for (new i = 0; i < 10; i++) +{ + if (i == 5) + { + break; + } + printf("%d", i); +} +``` + +输出结果: + +```c +0 +1 +2 +3 +4 +``` + +因循环立即终止,两个示例均未完成 10 次迭代,且第二个示例在打印数字 5 前退出。 + +## `case` + +处理`switch`语句中的特定匹配结果。支持单值匹配、多值枚举或数值范围匹配: + +```c +new + switchVar = 10; +switch (switchVar) +{ + case 1: + { + printf("switchVar等于1"); + } + case 4: + { + printf("switchVar等于4"); + } + case 2, 3, 5: + { + printf("switchVar可能是2、3或5"); + } + case 7 .. 11: + { + printf("switchVar位于7到11之间(含7、8、9、10、11)"); + } + default: + { + printf("switchVar不是1、2、3、4、5、7、8、9、10或11"); + } +} +``` + +## `continue` + +跳过当前循环迭代剩余代码,直接进入下一轮循环。需注意其在不同类型循环中的跳转位置差异。 + +```c +for (new i = 0; i < 10; i++) +{ + if (i == 5) + { + continue; + } + printf("%d", i); +} +``` + +输出结果: + +```c +0 +1 +2 +3 +4 +6 +7 +8 +9 +``` + +若`continue`置于打印语句之后则无效。在`for`循环中,`continue`跳转至循环条件更新部分(示例中的`i++`),而`while`循环中表现不同: + +```c +new + i = 0; +while (i < 10) +{ + if (i == 5) + { + continue; + } + printf("%d", i); + i++; +} +``` + +此代码将导致无限循环:`continue`跳转至`i++`之后,但`i`始终为 5,条件`i < 10`持续成立。 + +## `default` + +处理`switch`语句中未被显式`case`覆盖的情况。参见上文`case`示例。 + +## `do` + +`do-while`循环结构,保证代码块至少执行一次。注意`while()`后的分号: + +```c +new + i = 10; +do +{ + printf("%d", i); + i++; +} +while (i < 10); +``` + +尽管初始条件`i < 10`不成立,仍输出: + +```c +10 +``` + +对应的`while`循环: + +```c +new + i = 10; +while (i < 10) +{ + printf("%d", i); + i++; +} +``` + +无任何输出,因条件检查在循环开始前执行。 + +`do-while`可优化双重条件检查场景: + +```c +new + checkVar = 10; +if (checkVar == 10) +{ + new + i = 0; + while (checkVar == 10) + { + checkVar = someFunction(i); + i++; + } +} +``` + +虽然这不算严重问题,但您在循环开始时快速连续检查了两次`checkVar`变量,这显然没有实际意义。然而`if`语句是必要的,因为需要在条件为真时执行循环外的代码(这在编程中是较为常见的情况)。可通过以下方式优化: + +```c +new + checkVar = 10; +if (checkVar == 10) +{ + new + i = 0; + do + { + checkVar = someFunction(i); + i++; + } + while (checkVar == 10); +} +``` + +两版功能相同,但后者减少了一次冗余条件检查。 + +## `else` + +当`if`语句条件不满足时执行`else`代码块: + +```c +new + checkVar = 5; +if (checkVar == 10) +{ + printf("此代码永不执行"); +} +else +{ + printf("if条件失败,执行else代码块"); +} +``` + +支持`else if`链式条件: + +```c +new + checkVar = 2; +if (checkVar == 1) +{ + printf("条件不成立,不执行"); +} +else if (checkVar == 2) +{ + printf("首个if失败,检查第二个条件并执行"); +} +else +{ + printf("任一条件成立,不执行此处"); +} +``` + +## `exit` + +此指令立即退出当前程序。 + +```c +main() +{ + exit; + return 0; +} +``` + +## `for` + +for 循环是一种包含初始化、条件判断和更新三阶段的循环结构。各阶段由分号分隔(眨眼符号;),均可留空。最基础的 for 循环格式为: + +```c +for ( ; ; ) {} +``` + +该结构无初始化、无条件判断、无更新,因此将无限循环(缺失条件判断时默认为真)。 + +典型应用示例如下: + +```c +for (new i = 0; i < MAX_PLAYERS; i++) +{ + printf("%d", i); +} +``` + +此循环的初始化部分为: + +```c +new i = 0; +``` + +分号标志着初始化结束。此处声明的新变量 i 仅在循环体内有效。随后执行条件判断,将 i 与 MAX_PLAYERS(默认值 500,参见#define)比较,若条件成立则继续循环。循环体执行完毕后执行更新语句"i++"递增变量值。完成完整迭代后,循环将返回条件判断阶段(初始化仅执行一次)。 + +该循环将输出 0 到 499(含)的所有数字。等效的 while 循环(忽略 continue 的影响)为: + +```c +new + i = 0; +while (i < MAX_PLAYERS) +{ + printf("%d", i); + i++; +} +``` + +通过逗号运算符扩展初始化和更新阶段,可构建复杂循环结构: + +```c +for (new i = 0, j = 200; i < MAX_PLAYERS && j > 10; i++, j -= 2) +{ + printf("%d %d", i, j); +} +``` + +此例将创建两个变量并初始化为 0 和 200,循环条件为 i 小于 200 且 j 大于 10,每次迭代 i 递增,j 递减 2。 + +注意循环变量的作用域限制: + +```c +for (new i = 0; i < MAX_PLAYERS; i++) +{ + printf("%d", i); +} +printf("%d", i); // 错误:i在循环外不可访问 +``` + +若需在循环外访问变量,需在外部声明: + +```c +new + i = 0; +for ( ; i < MAX_PLAYERS; i++) +{ + printf("%d", i); +} +printf("%d", i); +``` + +或采用外部变量初始化: + +```c +new + i; +for (i = 0; i < MAX_PLAYERS; i++) +{ + printf("%d", i); +} +printf("%d", i); +``` + +## `goto` + +goto 语句和标签在编程社区中通常不推荐使用,因其功能可通过代码重构更好实现。基本语法为: + +```c +goto my_label; +printf("此语句永不执行"); +my_label: +printf("此语句将被执行"); +``` + +编译器对 goto 语句的处理并不理想,因此这类代码完全不会进行优化处理,例如以下情况: + +```c +{ + new + i = 5; + if (i == 5) + { + goto my_label; + } + else + { + my_label: + return 0; + } +} +``` + +当遇到带有条件的返回分支时,编译器会发出"返回类型不一致"的警告——它错误地认为条件为真(true)的分支没有返回值,但实际上该分支通过非常迂回的方式(即 `goto` 跳转)最终仍会返回一个值。此外需注意: + +```c +MyFunction() +{ + new + i = 5; + if (i == 5) + { + goto my_label; + } + return 0; + my_label: + return 1; +} +``` + +即使相关代码实际可被正常访问,编译器仍会触发"无法访问的代码"警告。 + +基本语法结构如下: + +```c +label: + +goto label; +``` + +标签应独占一行书写,且以冒号(:)结尾,而非分号(;)。标签命名需遵循与变量、函数等标识符相同的规范。 + +## `if` + +`if` 是最重要的操作符之一。它用于判断是否执行某段代码,与 `goto` 共同构成几乎所有控制结构的基础: + +```c +for (new i = 0; i < 10; i++) +{ +} +``` + +等价于: + +```c +new + i = 0; +for_loop: +if (i < 10) +{ + i++; + goto for_loop; +} +``` + +`if` 的条件判断方式非常丰富,以下列举部分常用操作符: + +| 操作符 | 说明 | 示例 | 当 a=1, b=0 时的结果 | 当 a=1, b=1 时的结果 | 当 a=0, b=1 时的结果 | 当 a=0, b=0 时的结果 | +| ------ | ---------------------- | ---------------- | -------------------- | -------------------- | -------------------- | -------------------- | +| `==` | 等于判断 | `if (a == b)` | false | true | false | true | +| `!=` | 不等于判断 | `if (a != b)` | true | false | true | false | +| `<` | 小于判断 | `if (a < b)` | false | false | true | false | +| `>` | 大于判断 | `if (a > b)` | true | false | false | false | +| `<=` | 小于等于判断 | `if (a <= b)` | false | true | true | true | +| `>=` | 大于等于判断 | `if (a >= b)` | true | true | false | true | +| `&&` | 逻辑与(两者均为真) | `if (a && b)` | false | true | false | false | +| `\|\|` | 逻辑或(至少一者为真) | `if (a \|\| b)` | true | true | true | false | +| `!` | 逻辑非(取反) | `if (!(a == b))` | true | false | true | false | + +通过组合这些操作符可构建复杂条件判断: + +```c +if (a == b && (c != d || f < g)) +``` + +当 a 等于 b 且(c 不等于 d 或 f 小于 g)时,该条件成立。 + +## `return` + +该关键字用于从函数中返回,并可向调用函数传递数据: + +```c +MyFunction() +{ + new + someVar = OtherFunction(); +} + +OtherFunction() +{ + return 5; +} +``` + +此时 someVar 的值将为 5。 + +```c +MyFunction() +{ + if (SomeFunction()) + { + printf("Returned 1"); + } +} + +SomeFunction() +{ + return random(2); +} +``` + +该代码将向调用函数的 if 语句返回 1 或 0。在条件判断中,1 代表真,0 代表假,因此仅当返回 1 时会打印文本。再看以下示例: + +```c +MyFunction() +{ + if (SomeFunction()) + { + printf("Returned something between 1 and 10"); + } +} + +SomeFunction() +{ + return random(11); +} +``` + +此时可能返回 0 至 10 之间的任意整数。非零值均视为真,因此当返回 1-10 时都会显示文本。 + +也可用于返回字符串: + +```c +MyFunction() +{ + printf("%s", SomeFunction()); +} + +SomeFunction() +{ + new + str[10] = "Hello"; + return str; +} +``` + +将输出 "Hello"(不含引号)。 + +函数可不返回任何值: + +```c +MyFunction() +{ + SomeFunction(); +} + +SomeFunction() +{ + return; +} +``` + +但需确保返回值不被使用: + +```c +MyFunction() +{ + if (SomeFunction()) + { + printf("Problem"); + } +} + +SomeFunction() +{ + return; +} +``` + +此情况下 SomeFunction 未返回有效值,而 MyFunction 尝试检查其返回值的真假性,将导致编译器报错。空返回是默认行为,因此: + +```c +SomeFunction() +{ + return; +} +``` + +与: + +```c +SomeFunction() +{ +} +``` + +完全等效。 + +注意返回值类型不可混用: + +```c +MyFunction() +{ + SomeFunction(); +} + +SomeFunction() +{ + if (random(2)) + { + return 1; + } + else + { + return; + } +} +``` + +将引发错误,因编译器无法确定返回类型。 + +```c +SomeFunction() +{ + if (random(2)) + { + return 1; + } +} +``` + +同样非法,因默认返回为空值。 + +## `sleep` + +该伪函数可使当前执行暂停指定毫秒数: + +```c +printf("Time 0s"); +sleep(1000); +printf("Time 1s"); +``` + +注意该函数仅在 main() 函数中有效,不适用于回调函数,因其运行于 PAWN 线程中。 + +## `state` + +`state` 是 PAWN 状态机及自动机系统的重要组成部分,详细信息请参阅[此主题帖](https://forum.sa-mp.com/showthread.php?t=86850)。 + +## `switch` + +`switch` 本质上是一种结构化的 if/else if/else 体系: + +```c +switch (someVar) +{ + case 1: + { + printf("one"); + } + case 2: + { + printf("two"); + } + case 3: + { + printf("three"); + } + default: + { + printf("other"); + } +} +``` + +这等同于以下代码,但具有效率略高(且更加整洁)的实现方式: + +```c +if (someVar == 1) +{ + printf("one"); +} +else if (someVar == 2) +{ + printf("two"); +} +else if (someVar == 3) +{ + printf("three"); +} +else +{ + printf("other"); +} +``` + +## `while` + +`while` 是与 `for` 和 `do..while` 相似的循环类型。其基本逻辑是:若条件判断为真则执行代码块并跳转回条件判断处,若为假则退出循环(无 else 分支)。参考以下 goto 实现示例: + +```c +new + i = 0; +for_loop: +if (i < 10) +{ + i++; + goto for_loop; +} +``` + +等价于: + +```c +new + i = 0; +while (i < 10) +{ + i++; +} +``` + +更多细节请参阅 `do` 和 `for` 循环的相关文档。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Style.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Style.md new file mode 100644 index 00000000000..27a9798abbc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Style.md @@ -0,0 +1,257 @@ +--- +title: "Pawn 代码风格指南" +sidebar_label: "Pawn 代码风格指南" +description: "关于Pawn源码通用命名规范及其他代码风格要素的简明指南,旨在提升代码意图传达效率,并优化调试与共享流程。" +--- + +本文档是关于 Pawn 源码通用命名规范及其他代码风格要素的简明指南,旨在提升代码意图传达效率,并优化调试与共享流程。 + +扩展阅读: + +- [Modern Pawn](https://github.com/Southclaws/sampctl/wiki/Modern-Pawn) +- [Pawn Package](https://github.com/Southclaws/sampctl/wiki/Packages) + +## 术语定义 + +### 语句(Statement) + +语句是命令式指示宿主程序执行操作的代码单元,由可产生结果的合法代码构成。 + +```c +a = b + c; +``` + +这是由变量赋值操作组成的语句,其右侧使用了[#表达式]。 + +```c +SetPlayerColor(playerid, 0xFF4700FF); +``` + +这是调用函数并传递参数的语句。 + +```c +x + 8 +``` + +这并非语句,因其结果未被使用,仅构成一个[#表达式]。 + +### 复合语句(Compound Statement) + +由大括号包裹的多个语句集合。 + +```c +{ + new message[] = "hi!"; + print(message); +} +``` + +包含两个语句的复合语句。 + +```c +if (a == b) +{ + print("hello!"); +} +``` + +带有`if`条件的复合语句,通常称为"if 语句"。 + +```c +return Function1(), Function2(), Function3(); +``` + +这并非复合语句,而是通过逗号分隔的语句链。此类写法属于不良实践。 + +### 表达式(Expression) + +可产生值的语法单元,除非该值被使用,否则不能构成有效语句。 + +表达式通常组合形成语句。 + +```c +a + b +``` + +简单的加法表达式,对两个值执行加法运算。 + +## 代码规范 + +### 大括号格式 + +推荐使用 Allman 风格大括号: + +```pawn +function() +{ + // +} +``` + +若已形成肌肉记忆,亦可采用 K&R 风格: + +```pawn +function() { + // +} +``` + +### 条件分支 + +`switch`语句需使用两级缩进:一级用于`switch`代码块,另一级用于每个`case`子句或复合语句。 + +```pawn +switch (variable) +{ + case 0: + return 0; + case 1: + return 1; + case 2: + return 2; + default: + return -1; +} +``` + +```pawn +switch (variable) +{ + case 0: + { + // 代码... + return 0; + } + case 1: + { + // 代码... + return 1; + } + case 2: + { + // 代码... + return 2; + } + default: + { + // 代码... + return -1; + } +} +``` + +### 复合语句(代码块) + +代码块必须始终使用大括号包裹,即使仅包含单行代码。此规则适用于所有层级,包括函数定义。 + +```pawn +func() +{ + singleLineExpr(); +} +``` + +```pawn +func() +{ + if () + { + singleLineExpr(); + } +} +``` + +```pawn +func() +{ + if () + { + singleLineExpr(); + } + else if () + { + // + } + else + { + // + } +} +``` + +### 命名规范 + +#### 函数命名 + +函数必须采用`PascalCase`大驼峰命名法。 + +#### 全局变量 + +- 通过`new`声明的全局变量必须始终使用`g_`前缀的大驼峰命名法,如`g_VariableName` +- 通过`static`声明的全局变量必须始终使用`s_`前缀的大驼峰命名法,如`s_VariableName` +- 常量全局变量必须使用全大写蛇形命名法(SCREAMING_SNAKE_CASE) + +#### 局部变量 + +局部变量必须使用`camelCase`小驼峰命名法,且禁止使用单字母命名,以下情况除外: + +- `for`循环中的`i`, `j`, `k`等迭代变量 +- 数学上下文中使用的`x`, `y`, `z`等坐标变量 + +#### 枚举类型 + +具名枚举类型必须使用`E_`前缀(强标签)或`e_`前缀(弱标签): + +枚举字段必须同样采用全大写蛇形命名法`(SCREAMING_SNAKE_CASE)`,并以枚举器名称作为前缀。例如: + +```pawn +static enum E_PLAYER_DATA { + E_PLAYER_CASH, + Float:E_PLAYER_HEALTH, +} +``` + +弱标签示例: + +```pawn +static enum e_PLAYER_DATA { + E_PLAYER_CASH, + Float:E_PLAYER_HEALTH, +} +``` + +匿名枚举字段必须同样使用全大写蛇形命名法,并以枚举类型名称为前缀: + +```pawn +static enum { + ENUMATOR_INTEGER, + Float:ENUMATOR_FLOAT, +} +``` + +除非需跨模块使用,否则枚举必须始终声明为`static`。 + +#### 宏与预处理定义 + +- 宏定义必须始终使用全大写蛇形命名法(`SCREAMING_SNAKE_CASE`) +- 预处理常量定义同样使用全大写蛇形命名法 + +此规范有助于区分变量/常量、函数/宏的关系。 + +建议避免创造新语法元素,以防止初学者混淆语言特性与库函数。但部分历史遗留库因兼容性要求可能例外。 + +### 文档规范 + +导出函数必须使用行注释进行文档说明,格式为`// FunctionName 实现X、Y、Z功能并返回A`,首词为函数名,后接功能简述。无需详细描述每个参数,例如: + +```pawn +// LoadPlayerAccount 用于初始化账户加载流程。本函数将触发HTTP请求 +// 获取玩家数据,向玩家显示对话框,最终在流程完成后触发`OnPlayerLogin` +// 事件。若加载失败则踢出玩家。 +stock Error:LoadPlayerAccount(playerid) +{ + // 代码... +} +``` + +每个代码包应包含`README`文档,必要时在模块首行添加功能描述注释。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Tags.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Tags.md new file mode 100644 index 00000000000..3206349064d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Tags.md @@ -0,0 +1,186 @@ +--- +title: "脚本编写: 标签" +sidebar_label: "脚本编写: 标签" +description: "关于标签(Tags)的指南,这是Pawn语言中一种类类型特性,为处理不同用途的值提供安全机制。" +--- + +## 引言 + +标签(Tag)是变量的前缀,用于告知编译器在特定情况下特殊处理该变量。例如您可以通过标签定义变量的使用范围,或者指定变量的特殊运算方式。 + +标签分为两种类型: + +- **强标签**(以大写字母开头) +- **弱标签**(以小写字母开头) + +两者的主要区别在于:弱标签在某些情况下可能被编译器静默转换为无标签变量(即不会产生警告),而强标签在隐式转换时总会触发警告。 + +以下是一个简单示例: + +```c +new + File:myfile = fopen("file.txt", io_read); +myFile += 4; +``` + +`fopen`函数返回带有`File:`标签的值,首行赋值操作没有问题(注意标签大小写需一致)。但第二行对文件句柄进行数值加法运算时,`4`是无标签值,而`myFile`带有`File:`标签,这种类型不匹配将触发编译器警告。这种机制非常有用,因为文件句柄的实际数值没有意义,修改它会导致句柄失效从而无法关闭文件。 + +### 强标签 + +强标签以大写字母开头,SA:MP 中的常见示例包括: + +```c +Float: +File: +Text: +``` + +强标签变量不可与其他类型混用,以下操作都会触发警告: + +```c +new + Float:myFloat, + File:myFile, + myBlank; + +myFile = fopen("file.txt", io_read); // File: = File:,无警告 + +myFloat = myFile; // Float: = File:,"标签不匹配"警告 + +myFloat = 4; // Float: = _:(无标签),"标签不匹配"警告 + +myBlank = myFloat; // _:(无标签) = Float:,"标签不匹配"警告 +``` + +### 弱标签 + +弱标签的行为与强标签基本相似,但当目标变量无标签时,弱标签转换不会触发警告: + +```c +new + Strong:myStrong, + weak:myWeak, + myNone; + +myNone = myStrong; // 触发警告 +myNone = myWeak; // 无警告 +``` + +但反向操作仍会触发警告: + +```c +myWeak = myNone; // 触发警告 +``` + +函数参数传递同理:向无标签参数传递弱标签变量不会触发警告: + +```c +new + weak:myWeak; +MyFunction(myWeak); + + + +MyFunction(myVar) +{ + ... +} +``` + +但向带标签参数(无论强弱)传递无标签参数会触发警告。SA:MP 中弱标签的典型示例包括: + +```c +bool: +filemode: +floatround_method: +``` + +## 使用方法 + +### 声明变量 + +声明带标签变量非常简单,直接书写标签即可(无需预先定义标签): + +```c +new + Mytag:myVariable; +``` + +使用现有标签声明变量后,即可将该变量用于该标签对应的函数和运算符。 + +### 函数定义 + +定义带标签参数的函数时,只需在参数或返回值前添加标签: + +```c +Float:GetValue(File:fHnd, const name[]) +{ + ... +} +``` + +该函数接收文件句柄并返回浮点数值(假设是从文件中读取并与`name[]`参数传递的数值名称对应的值)。此函数很可能使用`floatstr`函数(通过在 Pawno 右侧函数列表点击该函数时查看状态栏可知,该函数也返回`Float:`类型值)进行字符串转换。虽然具体实现细节无关紧要,但其核心逻辑是将字符串转换为 IEEE 浮点数值,并以 PAWN 单元(cell)形式存储(实际上严格存储为整型数值,只是其位模式恰好与对应的 IEEE 浮点数一致——这正是标签机制部分要解决的问题,因为 PAWN 本身是无类型语言)。 + +### 运算符重载 + +运算符(例如 `+`、`==`、`>` 等)可为不同标签实现重载。这意味着对两个`Float:`变量执行`+`运算,其行为将与无标签变量的加法运算截然不同。该特性对浮点型变量尤为重要——如先前所述,`Float:`变量并非真正的浮点数,而是采用特定位模式的整型存储。若未重载运算符,这些运算将在整型层面直接执行,若将结果重新解释为浮点数将产生无效结果。因此`Float:`标签重载了多数运算符,通过调用服务端的特殊数学函数实现运算(而非在 PAWN 脚本层处理)。 + +运算符重载函数的定义方式与普通函数类似,区别在于需使用"operator(**符号**)"语法代替函数名,其中(**符号**)代表被重载的运算符。可重载的合法运算符包括: + +```c ++ +- += +++ +-- +== +* +/ +!= +> +< +>= +<= +! +% +``` + +诸如`\`、`*`、`=`等运算符会被自动处理。而`&`等位运算符无法被重载。您还可以针对不同的标签组合多次重载同一个运算符。例如: + +```c +stock Float:operator=(Mytag:oper) +{ + return float(_:oper); +} +``` + +添加此代码后,以下操作将不再触发警告: + +```c +new + Float:myFloat, + Mytag:myTag; + +myFloat = myTag; +``` + +由于`Float: = Mytag:`这种情况下的赋值运算符`=`已被显式处理,编译器现在能够准确理解其操作逻辑,因此您将不再收到此前会出现的编译器警告。 + +### 标签覆盖 + +使用`_:`前缀可强制忽略变量标签。但需谨慎处理类型转换: + +```c +return float(_:oper); +``` + +这是标签覆盖的典型示例。操作数前的`_:`表示编译器将忽略`oper`变量原有的`Mytag:`标签类型,强制将其视为`_:`标签类型(即无标签类型)。`float()`函数用于将普通数值标记为浮点类型,因此必须接收无标签数值。在此示例中,我们假设`Mytag`存储的是普通整型数值,但进行标签覆盖时必须格外谨慎。例如下列操作将产生异常结果: + +```c +new + Float:f1, + Float:f2 = 4.0; +f1 = float(_:f2); +``` + +根据常识推断,`f1`应被赋值为`4.0`,但实际结果并非如此。如前所述,`f2`变量存储的是`4.0`的 IEEE 浮点位模式表示(而非简单的整型数值`4`),这意味着当您要求编译器将该变量作为整型处理时,它会直接将变量中的位模式作为整型值读取(而不会执行浮点到整型的数值转换)。因此您将得到一个看似随机的数字(实际上该数值遵循 IEEE 浮点规范的结构规律,但其整型表现形式与`4.0`毫无相似性)。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Variables.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Variables.md new file mode 100644 index 00000000000..d2001ab0afb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/language/Variables.md @@ -0,0 +1,218 @@ +--- +title: "基础:变量" +sidebar_label: "基础:变量" +description: Pawn语言变量入门指南 +--- + +## 变量 + +编程中最重要的概念之一是「变量」。在编程中,变量是一个可变的实体,但具体是就什么而言可变?在 Pawn 语言中,变量在任何时刻都持有一个「值」,而这个值——正如其名所示——是「可变的」或「可更改的」。 + +变量之所以如此重要,是因为它们本质上是计算机内存的小单元,可以在程序执行(运行)期间保存或「记住」不同的值,这一特性在编程中非常有用。例如,若想要追踪游戏中 100 名玩家的分数,您可以通过编程让计算机存储(记住)并更新这些值。之后如果您想计算这些玩家的平均分或创建排行榜,可以轻松从变量中访问这些值并用于相应目的。 + +### 声明变量 + +以下是变量声明的语法: + +```c +// 创建(更准确地说,「声明」)一个名为'myVariable'的变量 + +new myVariable; + +// 'new'关键字用于声明变量 +// 上述代码行声明了一个名为'myVariable'的变量 +// 结尾使用分号来结束声明语句 +``` + +通过查看一些示例可以更好地理解声明语法: + +```c +new var; +new ammo; +new score; +new vehicles; +new topScore; +``` + +上述每个已定义的变量都有一个默认值,即零。有多种方法可以为变量赋值。其中一种方法是在声明时直接为变量赋值: + +```c +new letters = 25; +``` + +在上述示例中,声明了一个名为「letters」的变量,其值为 25。您会注意到等号是一个简单的赋值运算符,可用于为变量赋值。它会计算右侧的表达式,并将结果值赋给左侧引用的变量。除了在声明时直接赋值外,您也可以在代码的后续部分进行赋值: + +```c +new letters; + +letters = 25; +``` + +### 作用域 + +只有在引用变量的代码部分位于该变量的作用域内时,才能修改变量的值。变量的作用域取决于声明该变量的代码块或位置。例如,在任何代码块外部声明的变量(通常在脚本开头)具有「全局」作用域,可以从脚本内的任何位置访问: + +```c +#include + +new g_var = 5; + +public OnFilterScriptInit() +{ + g_var = 10; + + printf("当前值为 %i", g_var); + + return 1; +} + +public OnPlayerConnect(playerid) +{ + g_var = 100; + + printf("当前值为 %i", g_var); + + return 1; +} + +// 输出: +// 当前值为 10 +// 当前值为 100 + +// 注意:第二个输出行仅在玩家连接时显示 +``` + +除了「全局」(作用域)变量外,还有「局部」或「私有」变量,这些变量只能从声明它们的代码块内部访问: + +```c +#include + +public OnFilterScriptInit() +{ + new localVar; + + localVar = 5; + + return 1; +} + +public OnPlayerConnect(playerid) +{ + localVar = 10; // 此行在编译时会显示错误 + + return 1; +} +``` + +如果您尝试编译上述代码,编译器会显示错误,这是合理的,因为局部变量在一个完全不同的代码块中被引用。注意:如果是嵌套代码块,则可以从那里访问变量。 + +需要注意的重要一点是,如果变量的作用域相互交叉,则不能声明同名变量。例如,如果您在全局作用域中已有一个名为「score」的变量,则不能在全局作用域或局部作用域中创建另一个名为「score」的变量,反之亦然(如果已存在局部变量,请避免声明同名的全局变量): + +```c +#include + +new g_score; + +public OnFilterScriptInit() +{ + new g_score = 5; // 此行会显示错误 + return 1; +} +``` + +### 命名规则 + +既然您已经知道如何声明变量,您需要了解声明变量的命名规则,如下所列: + +- 所有变量名必须以字母或下划线(`_`)开头 +- 在第一个起始字母之后,变量名可以包含字母和数字,但不能包含空格或特殊字符 +- 变量名区分大小写,即大写字母与小写字母不同 +- 使用保留字(关键字)作为变量名会显示错误 + +#### 示例: + +```c +new new; // 错误:使用保留字 +new _new; // 正确 + +new 10letters; // 错误:名称以数字开头 +new letters10; // 正确 +new letters_10; // 正确 + +new my name; // 错误:名称中包含空格 +new my_name; // 正确 + +new !nternet; // 错误 +new Internet; // 正确 +``` + +### 存储不同类型的数据 + +接下来,让我们看看可以在变量中存储哪些类型的数据以及如何存储: + +```c +new letter = 'M'; + + +new value = 100; + + +new decimalValue = 1.0; +// 有效,但会显示编译器警告 +// warning 213: 标签不匹配 + + +new engineOn = true; +// 有效,且不会显示编译器警告,但建议使用标签 + + +new sentence = "This is a sentence"; +// 会显示错误 +// error 006: 必须赋值给数组 +``` + +变量能够保存字符、整数值、布尔值(真或假)和浮点值(小数值)。上述代码中的注释显示,在变量中存储字符串会导致错误(因为字符串只能存储在*数组*中)。除此之外,为变量赋浮点值会导致编译器警告,这可以通过添加「标签」来避免。没有正确的标签,脚本在编译时会显示警告,但仍是可执行的。标签告诉编译器打算存储在变量中的数据类型,如果我们代码中出现破坏程序的错误,这反过来会以错误或警告的形式通知我们。标签示例: + +```c +new decimalValue = 1.0; // 错误 +new bool:decimalValue = 1.0 // 错误 +new Float:decimalValue = 1.0; // 正确 + +new switchOn = 1.0; // 错误 +new switchOn = true; // 错误,不会显示警告 +new bool:switchOn = true; // 正确 +``` + +使用正确的标签对于避免程序执行期间的任何错误或故障非常重要。 + +Pawn 作为一种无类型语言,允许我们在同一个变量中存储不同类型的数据,这在某些情况下可能有用,但在其他情况下可能带来麻烦,因此不建议这样使用变量: + +```c +#include + +public OnFilterScriptInit() +{ + + new var; + + var = 'a'; + printf("%c", var); + + var = 1; + printf("%d", var); + + var = 1.0; + printf("%f", var); + + var = true; + printf("%d", var); // 打印值0或1 + + return 1; +} + +// 输出: +a +1 +1.000000 +1 +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/Componentslots.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/Componentslots.md new file mode 100644 index 00000000000..53dd33cc213 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/Componentslots.md @@ -0,0 +1,30 @@ +--- +title: 改装插槽 +sidebar_label: 改装插槽 +--- + +:::info + +以下车辆改装类型适用于[GetVehicleComponentInSlot](../functions/GetVehicleComponentInSlot)函数。 + +::: + +| 插槽 | 定义(英文常量) | +| ---- | ------------------------------------ | +| -1 | 无组件(CARMODTYPE_NONE) | +| 0 | 尾翼(CARMODTYPE_SPOILER) | +| 1 | 引擎盖(CARMODTYPE_HOOD) | +| 2 | 车顶(CARMODTYPE_ROOF) | +| 3 | 侧裙(CARMODTYPE_SIDESKIRT) | +| 4 | 车灯(CARMODTYPE_LAMPS) | +| 5 | 氮气加速(CARMODTYPE_NITRO) | +| 6 | 排气管(CARMODTYPE_EXHAUST) | +| 7 | 车轮(CARMODTYPE_WHEELS) | +| 8 | 音响系统(CARMODTYPE_STEREO) | +| 9 | 液压系统(CARMODTYPE_HYDRAULICS) | +| 10 | 前保险杠(CARMODTYPE_FRONT_BUMPER) | +| 11 | 后保险杠(CARMODTYPE_REAR_BUMPER) | +| 12 | 右侧通风口(CARMODTYPE_VENT_RIGHT) | +| 13 | 左侧通风口(CARMODTYPE_VENT_LEFT) | +| 14 | 前防撞杆(CARMODTYPE_FRONT_BULLBAR) | +| 15 | 后防撞杆(CARMODTYPE_REAR_BULLBAR) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/anglemodes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/anglemodes.md new file mode 100644 index 00000000000..10fa857da59 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/anglemodes.md @@ -0,0 +1,18 @@ +--- +title: 角度模式 +sidebar_label: 角度模式 +description: 用于测量角度的SI单位常量。 +--- + +:::note + +这些角度模式被以下函数使用: +[floatsin](../functions/floatsin)、[floatcos](../functions/floatcos) 和 [floattan](../functions/floattan) + +::: + +| 模式 | 描述 | +| ------- | --------------------- | +| radian | 角度将以弧度表示 | +| degrees | 角度将以度数表示 | +| grades | 角度将以百分度表示 | \ No newline at end of file diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/animations.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/animations.md new file mode 100644 index 00000000000..11d1712b3a7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/animations.md @@ -0,0 +1,1894 @@ +--- +title: 动画列表 +sidebar_label: 动画列表 +description: 所有动画的列表 +tags: [] +--- + +:::note + +这些动画由[ApplyAnimation](../functions/ApplyAnimation)函数调用 + +::: + +:::note + +- 注意部分列出的动画可能在 SA-MP 中无法使用 +- 后缀为`_O`的动画专用于物体(例如降落伞运动),应用于玩家时不会生效 + +::: + +| 索引 | 动画库 | 名称 | 帧数 | 持续时间(秒) | 描述 | 备注 | +| ---- | ------------ | ---------------------- | ---- | ------------ | ---------------------------------- | ------------------ | +| 1 | AIRPORT | thrw_barl_thrw | 120 | 2.00 | 双手推门动作 | | +| 2 | Attractors | Stepsit_in | 100 | 1.67 | 地面坐姿起始动作 | | +| 3 | Attractors | Stepsit_loop | 200 | 3.33 | 地面坐姿循环 | | +| 4 | Attractors | Stepsit_out | 100 | 1.67 | 从地面站立动作 | | +| 5 | BAR | Barcustom_get | 180 | 3.00 | 接取饮料动作 | | +| 6 | BAR | Barcustom_loop | 120 | 2.00 | 等待饮料循环动作 | | +| 7 | BAR | Barcustom_order | 220 | 3.67 | 点单饮料动作 | | +| 8 | BAR | BARman_idle | 500 | 8.33 | 男性酒保待机动作 | | +| 9 | BAR | Barserve_bottle | 180 | 3.00 | 从底层货架取瓶动作 | | +| 10 | BAR | Barserve_give | 140 | 2.33 | 递送酒瓶动作 | | +| 11 | BAR | Barserve_glass | 220 | 3.67 | 向玻璃杯倾倒液体动作 | | +| 12 | BAR | Barserve_in | 100 | 1.67 | 女性酒保前倾起始动作 | | +| 13 | BAR | Barserve_loop | 140 | 2.33 | 女性酒保待机循环 | | +| 14 | BAR | Barserve_order | 220 | 3.67 | 酒保接单动作 | | +| 15 | BAR | dnk_stndF_loop | 140 | 2.33 | 女性饮酒循环 | | +| 16 | BAR | dnk_stndM_loop | 140 | 2.33 | 男性饮酒循环 | | +| 17 | BASEBALL | Bat_1 | 54 | 0.90 | 第一次挥棒击打 | | +| 18 | BASEBALL | Bat_2 | 68 | 1.13 | 第二次挥棒击打 | | +| 19 | BASEBALL | Bat_3 | 72 | 1.20 | 第三次挥棒击打 | | +| 20 | BASEBALL | Bat_4 | 60 | 1.00 | 对倒地目标的挥棒击打 | | +| 21 | BASEBALL | Bat_block | 28 | 0.47 | 棒球格挡动作 | | +| 22 | BASEBALL | Bat_Hit_1 | 50 | 0.83 | 被球棒击中反应 1 | | +| 23 | BASEBALL | Bat_Hit_2 | 64 | 1.07 | 被球棒击中反应 2 | | +| 24 | BASEBALL | Bat_Hit_3 | 68 | 1.13 | 被球棒击中反应 3 | | +| 25 | BASEBALL | Bat_IDLE | 56 | 0.93 | 持棒待机姿势 | | +| 26 | BASEBALL | Bat_M | 32 | 0.53 | 持棒奔跑攻击 | | +| 27 | BASEBALL | BAT_PART | 32 | 0.53 | 持棒部件动画 | | +| 28 | BD_FIRE | BD_Fire1 | 110 | 1.83 | [缺失动画] | | +| 29 | BD_FIRE | BD_Fire2 | 100 | 1.67 | [缺失动画] | | +| 30 | BD_FIRE | BD_Fire3 | 110 | 1.83 | [缺失动画] | | +| 31 | BD_FIRE | BD_GF_Wave | 304 | 5.07 | 女友挥手动画 | | +| 32 | BD_FIRE | BD_Panic_01 | 200 | 3.33 | 窗口恐慌动作 | | +| 33 | BD_FIRE | BD_Panic_02 | 200 | 3.33 | 窗口恐慌动作 | | +| 34 | BD_FIRE | BD_Panic_03 | 200 | 3.33 | 窗口恐慌动作 | | +| 35 | BD_FIRE | BD_Panic_04 | 200 | 3.33 | 窗口恐慌动作 | | +| 36 | BD_FIRE | BD_Panic_Loop | 200 | 3.33 | 窗口恐慌循环 | | +| 37 | BD_FIRE | Grlfrd_Kiss_03 | 420 | 7.00 | 女友亲吻动画 | | +| 38 | BD_FIRE | M_smklean_loop | 300 | 5.00 | 男性倚靠抽烟循环 | | +| 39 | BD_FIRE | Playa_Kiss_03 | 420 | 7.00 | 玩家亲吻动画 | | +| 40 | BD_FIRE | wash_up | 180 | 3.00 | 洗漱动作 | | +| 41 | BEACH | bather | 252 | 4.20 | 女性日光浴动作 | | +| 42 | BEACH | Lay_Bac_Loop | 160 | 2.67 | 男性日光浴循环 | | +| 43 | BEACH | ParkSit_M_loop | 220 | 3.67 | 男性海滩坐姿 | | +| 44 | BEACH | ParkSit_W_loop | 200 | 3.33 | 女性海滩坐姿 | | +| 45 | BEACH | SitnWait_loop_W | 80 | 1.33 | 替代男性海滩坐姿 | | +| 46 | benchpress | gym_bp_celebrate | 300 | 5.00 | 健身庆祝动作 | | +| 47 | benchpress | gym_bp_down | 60 | 1.00 | 卧推下放动作 | | +| 48 | benchpress | gym_bp_getoff | 520 | 8.67 | 结束卧推动作 | | +| 49 | benchpress | gym_bp_geton | 320 | 5.33 | 开始卧推动作 | | +| 50 | benchpress | gym_bp_up_A | 140 | 2.33 | 卧推上举动作 A 型 | | +| 51 | benchpress | gym_bp_up_B | 160 | 2.67 | 卧推上举动作 B 型 | | +| 52 | benchpress | gym_bp_up_smooth | 80 | 1.33 | 流畅卧推上举 | | +| 53 | BF_injection | BF_getin_LHS | 60 | 1.00 | 左侧进入注射动作 | | +| 54 | BF_injection | BF_getin_RHS | 60 | 1.00 | 右侧进入注射动作 | | +| 55 | BF_injection | BF_getout_LHS | 68 | 1.13 | 左侧退出注射动作 | | +| 56 | BF_injection | BF_getout_RHS | 68 | 1.13 | 右侧退出注射动作 | | +| 57 | BIKED | BIKEd_Back | 6 | 0.10 | Sanchez 摩托后仰 | | +| 58 | BIKED | BIKEd_drivebyFT | 12 | 0.20 | Sanchez 前侧扫射 | | +| 59 | BIKED | BIKEd_drivebyLHS | 12 | 0.20 | Sanchez 左侧扫射 | | +| 60 | BIKED | BIKEd_drivebyRHS | 12 | 0.20 | Sanchez 右侧扫射 | | +| 61 | BIKED | BIKEd_Fwd | 12 | 0.20 | Sanchez 前倾动作 | | +| 62 | BIKED | BIKEd_getoffBACK | 88 | 1.47 | 高速跳离 Sanchez | | +| 63 | BIKED | BIKEd_getoffLHS | 60 | 1.00 | 左侧下车动作 | | +| 64 | BIKED | BIKEd_getoffRHS | 60 | 1.00 | 右侧下车动作 | | +| 65 | BIKED | BIKEd_hit | 2 | 0.03 | Sanchez 碰撞反应 | | +| 66 | BIKED | BIKEd_jumponL | 58 | 0.97 | 左侧跃上 Sanchez | | +| 67 | BIKED | BIKEd_jumponR | 58 | 0.97 | 右侧跃上 Sanchez | | +| 68 | BIKED | BIKEd_kick | 64 | 1.07 | 前踢动作 | | +| 69 | BIKED | BIKEd_Left | 6 | 0.10 | Sanchez 左倾 | | +| 70 | BIKED | BIKEd_passenger | 2 | 0.03 | 乘客受惊反应 | | +| 71 | BIKED | BIKEd_pushes | 48 | 0.80 | 倒车操作 | | +| 72 | BIKED | BIKEd_Ride | 2 | 0.03 | 骑行基本状态 | | +| 73 | BIKED | BIKEd_Right | 6 | 0.10 | Sanchez 右倾 | | +| 74 | BIKED | BIKEd_shuffle | 26 | 0.43 | 从后方上车 | | +| 75 | BIKED | BIKEd_Still | 2 | 0.03 | 静止骑行状态 | | +| 76 | BIKEH | BIKEh_Back | 6 | 0.10 | Freeway 摩托后仰 | | +| 77 | BIKEH | BIKEh_drivebyFT | 12 | 0.20 | Freeway 前侧扫射 | | +| 78 | BIKEH | BIKEh_drivebyLHS | 12 | 0.20 | Freeway 左侧扫射 | | +| 79 | BIKEH | BIKEh_drivebyRHS | 12 | 0.20 | Freeway 右侧扫射 | | +| 80 | BIKEH | BIKEh_Fwd | 12 | 0.20 | Freeway 前倾 | | +| 81 | BIKEH | BIKEh_getoffBACK | 102 | 1.70 | 高速脱离 Freeway | | +| 82 | BIKEH | BIKEh_getoffLHS | 46 | 0.77 | 左侧下车动作 | | +| 83 | BIKEH | BIKEh_getoffRHS | 44 | 0.73 | 右侧下车动作 | | +| 84 | BIKEH | BIKEh_hit | 2 | 0.03 | Freeway 碰撞反应 | | +| 85 | BIKEH | BIKEh_jumponL | 88 | 1.47 | 左侧跃上 Freeway | | +| 86 | BIKEH | BIKEh_jumponR | 90 | 1.50 | 右侧跃上 Freeway | | +| 87 | BIKEH | BIKEh_kick | 64 | 1.07 | 前踢上车动作 | | +| 88 | BIKEH | BIKEh_Left | 8 | 0.13 | Freeway 左倾 | | +| 89 | BIKEH | BIKEh_passenger | 2 | 0.03 | 乘客受惊反应 | | +| 90 | BIKEH | BIKEh_pushes | 58 | 0.97 | 倒车操作 | | +| 91 | BIKEH | BIKEh_Ride | 2 | 0.03 | 骑行基本状态 | | +| 92 | BIKEH | BIKEh_Right | 8 | 0.13 | Freeway 右倾 | | +| 93 | BIKEH | BIKEh_Still | 2 | 0.03 | 静止骑行状态 | | +| 94 | BIKELEAP | bk_blnce_in | 114 | 1.90 | 站立平衡起始 | | +| 95 | BIKELEAP | bk_blnce_out | 60 | 1.00 | 平衡结束返回座位 | | +| 96 | BIKELEAP | bk_jmp | 24 | 0.40 | 跳跃下车动作 | | +| 97 | BIKELEAP | bk_rdy_in | 30 | 0.50 | 准备跳跃起始 | | +| 98 | BIKELEAP | bk_rdy_out | 24 | 0.40 | 取消跳跃动作 | | +| 99 | BIKELEAP | struggle_cesar | 28 | 0.47 | 与卡车司机搏斗 | | +| 100 | BIKELEAP | struggle_driver | 28 | 0.47 | 卡车司机挣扎动作 | | +| 101 | BIKELEAP | truck_driver | 44 | 0.73 | 卡车司机被抛出 | | +| 102 | BIKELEAP | truck_getin | 150 | 2.50 | 劫车者抢夺卡车 | | +| 103 | BIKES | BIKEs_Back | 6 | 0.10 | PCJ 摩托后仰 | | +| 104 | BIKES | BIKEs_drivebyFT | 12 | 0.20 | PCJ 前侧扫射 | | +| 105 | BIKES | BIKEs_drivebyLHS | 12 | 0.20 | PCJ 左侧扫射 | | +| 106 | BIKES | BIKEs_drivebyRHS | 12 | 0.20 | PCJ 右侧扫射 | | +| 107 | BIKES | BIKEs_Fwd | 12 | 0.20 | PCJ 前倾动作 | | +| 108 | BIKES | BIKEs_getoffBACK | 146 | 2.43 | 高速脱离 PCJ | | +| 109 | BIKES | BIKEs_getoffLHS | 66 | 1.10 | 左侧下车动作 | | +| 110 | BIKES | BIKEs_getoffRHS | 66 | 1.10 | 右侧下车动作 | | +| 111 | BIKES | BIKEs_hit | 2 | 0.03 | PCJ 碰撞反应 | | +| 112 | BIKES | BIKEs_jumponL | 54 | 0.90 | 左侧跃上 PCJ | | +| 113 | BIKES | BIKEs_jumponR | 54 | 0.90 | 右侧跃上 PCJ | | +| 114 | BIKES | BIKEs_kick | 60 | 1.00 | 前侧上车动作 | | +| 115 | BIKES | BIKEs_Left | 6 | 0.10 | PCJ 左倾 | | +| 116 | BIKES | BIKEs_passenger | 2 | 0.03 | 乘客动画 | | +| 117 | BIKES | BIKEs_pushes | 44 | 0.73 | 倒车操作 | | +| 118 | BIKES | BIKEs_Ride | 2 | 0.03 | 骑行基本状态 | | +| 119 | BIKES | BIKEs_Right | 6 | 0.10 | PCJ 右倾 | | +| 120 | BIKES | BIKEs_Snatch_L | 26 | 0.43 | 骑行中左侧抢夺动作 | | +| 121 | BIKES | BIKEs_Snatch_R | 26 | 0.43 | 骑行中右侧抢夺动作 | | +| 122 | BIKES | BIKEs_Still | 2 | 0.03 | 静止骑行状态 | | +| 123 | BIKEV | BIKEv_Back | 10 | 0.17 | Faggio 后仰动作 | | +| 124 | BIKEV | BIKEv_drivebyFT | 10 | 0.17 | Faggio 前侧扫射 | | +| 125 | BIKEV | BIKEv_drivebyLHS | 14 | 0.23 | Faggio 左侧扫射 | | +| 126 | BIKEV | BIKEv_drivebyRHS | 12 | 0.20 | Faggio 右侧扫射 | | +| 127 | BIKEV | BIKEv_Fwd | 12 | 0.20 | Faggio 前倾动作 | | +| 128 | BIKEV | BIKEv_getoffBACK | 102 | 1.70 | 高速脱离 Faggio | | +| 129 | BIKEV | BIKEv_getoffLHS | 40 | 0.67 | 左侧下车动作 | | +| 130 | BIKEV | BIKEv_getoffRHS | 40 | 0.67 | 右侧下车动作 | | +| 131 | BIKEV | BIKEv_hit | 2 | 0.03 | Faggio 碰撞反应 | | +| 132 | BIKEV | BIKEv_jumponL | 40 | 0.67 | 左侧跃上 Faggio | | +| 133 | BIKEV | BIKEv_jumponR | 40 | 0.67 | 右侧跃上 Faggio | | +| 134 | BIKEV | BIKEv_kick | 60 | 1.00 | 前踢上车动作 | | +| 135 | BIKEV | BIKEv_Left | 6 | 0.10 | Faggio 左倾 | | +| 136 | BIKEV | BIKEv_passenger | 2 | 0.03 | 乘客动画 | | +| 137 | BIKEV | BIKEv_pushes | 44 | 0.73 | 倒车操作 | | +| 138 | BIKEV | BIKEv_Ride | 2 | 0.03 | 骑行基本状态 | | +| 139 | BIKEV | BIKEv_Right | 6 | 0.10 | Faggio 右倾 | | +| 140 | BIKEV | BIKEv_Still | 2 | 0.03 | 静止骑行状态 | | +| 141 | BIKE_DBZ | Pass_Driveby_BWD | 50 | 0.83 | 后座乘客向后扫射 | | +| 142 | BIKE_DBZ | Pass_Driveby_FWD | 50 | 0.83 | 后座乘客向前扫射 | | +| 143 | BIKE_DBZ | Pass_Driveby_LHS | 50 | 0.83 | 后座乘客左侧扫射 | | +| 144 | BIKE_DBZ | Pass_Driveby_RHS | 50 | 0.83 | 后座乘客右侧扫射 | | +| no | BLOWJOBZ | BJ_Car_End_P | 248 | 4.13 | 车内服务结束(被动方) | | +| no | BLOWJOBZ | BJ_Car_End_W | 220 | 3.67 | 车内服务结束(主动方) | | +| no | BLOWJOBZ | BJ_Car_Loop_P | 40 | 0.67 | 车内服务循环(被动方) | | +| no | BLOWJOBZ | BJ_Car_Loop_W | 40 | 0.67 | 车内服务循环(主动方) | | +| no | BLOWJOBZ | BJ_Car_Start_P | 140 | 2.33 | 车内服务起始(被动方) | | +| no | BLOWJOBZ | BJ_Car_Start_W | 140 | 2.33 | 车内服务起始(主动方) | | +| no | BLOWJOBZ | BJ_Couch_End_P | 460 | 7.67 | 沙发服务结束(被动方) | | +| no | BLOWJOBZ | BJ_Couch_End_W | 460 | 7.67 | 沙发服务结束(主动方) | | +| no | BLOWJOBZ | BJ_Couch_Loop_P | 120 | 2.00 | 沙发服务循环(被动方) | | +| no | BLOWJOBZ | BJ_Couch_Loop_W | 120 | 2.00 | 沙发服务循环(主动方) | | +| no | BLOWJOBZ | BJ_Couch_Start_P | 320 | 5.33 | 沙发服务起始(被动方) | | +| no | BLOWJOBZ | BJ_Couch_Start_W | 320 | 5.33 | 沙发服务起始(主动方) | | +| no | BLOWJOBZ | BJ_Stand_End_P | 292 | 4.87 | 站立服务结束(被动方) | | +| no | BLOWJOBZ | BJ_Stand_End_W | 320 | 5.33 | 站立服务结束(主动方) | | +| no | BLOWJOBZ | BJ_Stand_Loop_P | 40 | 0.67 | 站立服务循环(被动方) | | +| no | BLOWJOBZ | BJ_Stand_Loop_W | 40 | 0.67 | 站立服务循环(主动方) | | +| no | BLOWJOBZ | BJ_Stand_Start_P | 120 | 2.00 | 站立服务起始(被动方) | | +| no | BLOWJOBZ | BJ_Stand_Start_W | 120 | 2.00 | 站立服务起始(主动方) | | +| 145 | BMX | BMX_back | 6 | 0.10 | BMX 后仰 | | +| 146 | BMX | BMX_bunnyhop | 20 | 0.33 | BMX 兔跳动作 | | +| 147 | BMX | BMX_drivebyFT | 12 | 0.20 | BMX 前侧扫射 | | +| 148 | BMX | BMX_driveby_LHS | 12 | 0.20 | BMX 左侧扫射 | | +| 149 | BMX | BMX_driveby_RHS | 12 | 0.20 | BMX 右侧扫射 | | +| 150 | BMX | BMX_fwd | 8 | 0.13 | BMX 前倾动作 | | +| 151 | BMX | BMX_getoffBACK | 82 | 1.37 | 高速脱离 BMX | | +| 152 | BMX | BMX_getoffLHS | 44 | 0.73 | 左侧下车动作 | | +| 153 | BMX | BMX_getoffRHS | 38 | 0.63 | 右侧下车动作 | | +| 154 | BMX | BMX_jumponL | 54 | 0.90 | 左侧跃上 BMX | | +| 155 | BMX | BMX_jumponR | 54 | 0.90 | 右侧跃上 BMX | | +| 156 | BMX | BMX_Left | 8 | 0.13 | BMX 左倾 | | +| 157 | BMX | BMX_pedal | 44 | 0.73 | 踩踏动作 | | +| 158 | BMX | BMX_pushes | 48 | 0.80 | 倒车操作 | | +| 159 | BMX | BMX_Ride | 2 | 0.03 | 骑行基本状态 | | +| 160 | BMX | BMX_Right | 8 | 0.13 | BMX 右倾 | | +| 161 | BMX | BMX_sprint | 40 | 0.67 | 冲刺动作 | | +| 162 | BMX | BMX_still | 2 | 0.03 | 静止骑行状态 | | +| 163 | BOMBER | BOM_Plant | 160 | 2.67 | 安装炸弹动作 | | +| 164 | BOMBER | BOM_Plant_2Idle | 60 | 1.00 | 安装后待机状态 | | +| 165 | BOMBER | BOM_Plant_Crouch_In | 48 | 0.80 | 蹲姿安装起始 | | +| 166 | BOMBER | BOM_Plant_Crouch_Out | 48 | 0.80 | 蹲姿安装结束 | | +| 167 | BOMBER | BOM_Plant_In | 52 | 0.87 | 安装起始动作 | | +| 168 | BOMBER | BOM_Plant_Loop | 48 | 0.80 | 安装循环动作 | | +| 169 | BOX | boxhipin | 392 | 6.53 | 髋部放置箱子动作 | | +| 170 | BOX | boxhipup | 300 | 5.00 | 髋部举起箱子动作 | | +| 171 | BOX | boxshdwn | 366 | 6.10 | 肩部放下箱子动作 | | +| 172 | BOX | boxshup | 312 | 5.20 | 肩部举起箱子动作 | | +| 173 | BOX | bxhipwlk | 90 | 1.50 | 髋部负重行走 | | +| 174 | BOX | bxhwlki | 58 | 0.97 | 负重行走起始 | | +| 175 | BOX | bxshwlk | 150 | 2.50 | 肩部负重行走 | | +| 176 | BOX | bxshwlki | 58 | 0.97 | 肩部负重行走起始 | | +| 177 | BOX | bxwlko | 32 | 0.53 | 负重行走结束 | | +| 178 | BOX | catch_box | 90 | 1.50 | 接箱动作 | | +| 179 | BSKTBALL | BBALL_def_jump_shot | 70 | 1.17 | 防守跳跃封盖 | | +| 180 | BSKTBALL | BBALL_def_loop | 60 | 1.00 | 防守姿势循环 | | +| 181 | BSKTBALL | BBALL_def_stepL | 36 | 0.60 | 防守左移步 | | +| 182 | BSKTBALL | BBALL_def_stepR | 36 | 0.60 | 防守右移步 | | +| 183 | BSKTBALL | BBALL_Dnk | 84 | 1.40 | 灌篮完整动作 | | +| 184 | BSKTBALL | BBALL_Dnk_Gli | 22 | 0.37 | 灌篮滑行动画 | | +| 185 | BSKTBALL | BBALL_Dnk_Gli_O | 22 | 0.37 | 缺失动画 | | +| 186 | BSKTBALL | BBALL_Dnk_Lnch | 12 | 0.20 | 灌篮起跳动作 | | +| 187 | BSKTBALL | BBALL_Dnk_Lnch_O | 12 | 0.20 | 缺失动画 | | +| 188 | BSKTBALL | BBALL_Dnk_Lnd | 56 | 0.93 | 灌篮落地动作 | | +| 189 | BSKTBALL | BBALL_Dnk_O | 6 | 0.10 | 缺失动画 | | +| 190 | BSKTBALL | BBALL_idle | 146 | 2.43 | 花式运球待机 | | +| 191 | BSKTBALL | BBALL_idle2 | 160 | 2.67 | 交替花式运球 | | +| 192 | BSKTBALL | BBALL_idle2_O | 160 | 2.67 | 缺失动画 | | +| 193 | BSKTBALL | BBALL_idleloop | 40 | 0.67 | 基础待机循环 | | +| 194 | BSKTBALL | BBALL_idleloop_O | 40 | 0.67 | 缺失动画 | | +| 195 | BSKTBALL | BBALL_idle_O | 146 | 2.43 | 缺失动画 | | +| 196 | BSKTBALL | BBALL_Jump_Cancel | 64 | 1.07 | 跳跃取消动作 | | +| 197 | BSKTBALL | BBALL_Jump_Cancel_O | 64 | 1.07 | 缺失动画 | | +| 198 | BSKTBALL | BBALL_Jump_End | 56 | 0.93 | 跳跃投篮落地 | | +| 199 | BSKTBALL | BBALL_Jump_Shot | 100 | 1.67 | 跳投完整动作 | | +| 200 | BSKTBALL | BBALL_Jump_Shot_O | 40 | 0.67 | 缺失动画 | | +| 201 | BSKTBALL | BBALL_Net_Dnk_O | 110 | 1.83 | 缺失动画 | | +| 202 | BSKTBALL | BBALL_pickup | 110 | 1.83 | 拾取篮球动作 | | +| 203 | BSKTBALL | BBALL_pickup_O | 110 | 1.83 | 缺失动画 | | +| 204 | BSKTBALL | BBALL_react_miss | 48 | 0.80 | 投篮未中反应 | | +| 205 | BSKTBALL | BBALL_react_score | 66 | 1.10 | 得分庆祝动作 | | +| 206 | BSKTBALL | BBALL_run | 54 | 0.90 | 带球跑动 | | +| 207 | BSKTBALL | BBALL_run_O | 54 | 0.90 | 缺失动画 | | +| 208 | BSKTBALL | BBALL_SkidStop_L | 30 | 0.50 | 左侧急停动作 | | +| 209 | BSKTBALL | BBALL_SkidStop_L_O | 30 | 0.50 | 缺失动画 | | +| 210 | BSKTBALL | BBALL_SkidStop_R | 30 | 0.50 | 右侧急停动作 | | +| 211 | BSKTBALL | BBALL_SkidStop_R_O | 30 | 0.50 | 缺失动画 | | +| 212 | BSKTBALL | BBALL_walk | 64 | 1.07 | 带球行走 | | +| 213 | BSKTBALL | BBALL_WalkStop_L | 30 | 0.50 | 左侧行走停止 | | +| 214 | BSKTBALL | BBALL_WalkStop_L_O | 30 | 0.50 | 缺失动画 | | +| 215 | BSKTBALL | BBALL_WalkStop_R | 30 | 0.50 | 右侧行走停止 | | +| 216 | BSKTBALL | BBALL_WalkStop_R_O | 30 | 0.50 | 缺失动画 | | +| 217 | BSKTBALL | BBALL_walk_O | 64 | 1.07 | 缺失动画 | | +| 218 | BSKTBALL | BBALL_walk_start | 12 | 0.20 | 开始带球行走 | | +| 219 | BSKTBALL | BBALL_walk_start_O | 12 | 0.20 | 缺失动画 | | +| 220 | BUDDY | buddy_crouchfire | 52 | 0.87 | 霰弹枪蹲姿射击 | | +| 221 | BUDDY | buddy_crouchreload | 66 | 1.10 | 霰弹枪蹲姿换弹 | | +| 222 | BUDDY | buddy_fire | 48 | 0.80 | 霰弹枪站立射击 | | +| 223 | BUDDY | buddy_fire_poor | 80 | 1.33 | 低熟练度霰弹枪射击 | | +| 224 | BUDDY | buddy_reload | 78 | 1.30 | 霰弹枪换弹动作 | | +| 225 | BUS | BUS_close | 24 | 0.40 | 关闭巴士车门 | | +| 226 | BUS | BUS_getin_LHS | 20 | 0.33 | 左侧进入巴士 | | +| 227 | BUS | BUS_getin_RHS | 130 | 2.17 | 右侧进入巴士 | | +| 228 | BUS | BUS_getout_LHS | 48 | 0.80 | 左侧离开巴士 | | +| 229 | BUS | BUS_getout_RHS | 112 | 1.87 | 右侧离开巴士 | | +| 230 | BUS | BUS_jacked_LHS | 68 | 1.13 | 被强行拉出巴士 | | +| 231 | BUS | BUS_open | 88 | 1.47 | 打开巴士车门 | | +| 232 | BUS | BUS_open_RHS | 72 | 1.20 | 右侧车门开启 | | +| 233 | BUS | BUS_pullout_LHS | 48 | 0.80 | 从左侧拖拽司机 | | +| 234 | CAMERA | camcrch_cmon | 140 | 2.33 | 蹲姿摄影机手势:前行 | | +| 235 | CAMERA | camcrch_idleloop | 120 | 2.00 | 蹲姿摄影机待机循环 | | +| 236 | CAMERA | camcrch_stay | 120 | 2.00 | 蹲姿摄影机手势:停留 | | +| 237 | CAMERA | camcrch_to_camstnd | 80 | 1.33 | 蹲姿转站立摄影机 | | +| 238 | CAMERA | camstnd_cmon | 180 | 3.00 | 站立摄影机手势:前行 | | +| 239 | CAMERA | camstnd_idleloop | 120 | 2.00 | 站立摄影机待机循环 | | +| 240 | CAMERA | camstnd_lkabt | 260 | 4.33 | 站立摄影机环视动作 | | +| 241 | CAMERA | camstnd_to_camcrch | 60 | 1.00 | 站立转蹲姿摄影机 | | +| 242 | CAMERA | piccrch_in | 80 | 1.33 | 蹲姿准备拍照 | | +| 243 | CAMERA | piccrch_out | 120 | 2.00 | 蹲姿拍照后动作 | | +| 244 | CAMERA | piccrch_take | 60 | 1.00 | 蹲姿拍摄照片 | | +| 245 | CAMERA | picstnd_in | 60 | 1.00 | 站立准备拍照 | | +| 246 | CAMERA | picstnd_out | 40 | 0.67 | 站立拍照后动作 | | +| 247 | CAMERA | picstnd_take | 60 | 1.00 | 站立拍摄照片 | | +| 248 | CAR | Fixn_Car_Loop | 300 | 5.00 | 车辆维修循环动作 | | +| 249 | CAR | Fixn_Car_Out | 140 | 2.33 | 结束车辆维修站立 | | +| 250 | CAR | flag_drop | 270 | 4.50 | 赛车旗帜掉落动画 | | +| 251 | CAR | Sit_relaxed | 2 | 0.03 | 车内放松坐姿 | | +| 252 | CAR | Tap_hand | 20 | 0.33 | 轻拍车窗动作 | | +| 253 | CAR | Tyd2car_bump | 50 | 0.83 | 被绑车头颠簸反应 | | +| 254 | CAR | Tyd2car_high | 480 | 8.00 | 高压力被绑车头状态 | | +| 255 | CAR | Tyd2car_low | 400 | 6.67 | 低压力被绑车头状态 | | +| 256 | CAR | Tyd2car_med | 400 | 6.67 | 中压力被绑车头状态 | | +| 257 | CAR | Tyd2car_TurnL | 60 | 1.00 | 被绑车头左转 | | +| 258 | CAR | Tyd2car_TurnR | 60 | 1.00 | 被绑车头右转 | | +| 259 | CARRY | crry_prtial | 2 | 0.03 | 搬运起始动作 | | +| 260 | CARRY | liftup | 92 | 1.53 | 举起物品动作 | | +| 261 | CARRY | liftup05 | 38 | 0.63 | 中位高度举物 | | +| 262 | CARRY | liftup105 | 40 | 0.67 | 高位举物 | | +| 263 | CARRY | putdwn | 68 | 1.13 | 放置物品动作 | | +| 264 | CARRY | putdwn05 | 40 | 0.67 | 中位放置物品 | | +| 265 | CARRY | putdwn105 | 32 | 0.53 | 高位放置物品 | | +| 266 | CAR_CHAT | carfone_in | 360 | 6.00 | 车内接听电话起始 | | +| 267 | CAR_CHAT | carfone_loopA | 240 | 4.00 | 车内通话循环状态 A | | +| 268 | CAR_CHAT | carfone_loopA_to_B | 60 | 1.00 | 车内通话状态切换 A→B | | +| 269 | CAR_CHAT | carfone_loopB | 300 | 5.00 | 车内通话循环状态 B | | +| 270 | CAR_CHAT | carfone_loopB_to_A | 40 | 0.67 | 车内通话状态切换 B→A | | +| 271 | CAR_CHAT | carfone_out | 180 | 3.00 | 车内挂断电话动作 | | +| 272 | CAR_CHAT | CAR_Sc1_BL | 700 | 11.67 | 车内对话场景 1(后左座) | | +| 273 | CAR_CHAT | CAR_Sc1_BR | 700 | 11.67 | 车内对话场景 1(后右座) | | +| 274 | CAR_CHAT | CAR_Sc1_FL | 700 | 11.67 | 车内对话场景 1(前左座) | | +| 275 | CAR_CHAT | CAR_Sc1_FR | 700 | 11.67 | 车内对话场景 1(前右座) | | +| 276 | CAR_CHAT | CAR_Sc2_FL | 300 | 5.00 | 车内对话场景 2(前左座) | | +| 277 | CAR_CHAT | CAR_Sc3_BR | 650 | 10.83 | 车内对话场景 3(后右座) | | +| 278 | CAR_CHAT | CAR_Sc3_FL | 650 | 10.83 | 车内对话场景 3(前左座) | | +| 279 | CAR_CHAT | CAR_Sc3_FR | 650 | 10.83 | 车内对话场景 3(前右座) | | +| 280 | CAR_CHAT | CAR_Sc4_BL | 264 | 4.40 | 车内对话场景 4(后左座) | | +| 281 | CAR_CHAT | CAR_Sc4_BR | 392 | 6.53 | 车内对话场景 4(后右座) | | +| 282 | CAR_CHAT | CAR_Sc4_FL | 600 | 10.00 | 车内对话场景 4(前左座) | | +| 283 | CAR_CHAT | CAR_Sc4_FR | 600 | 10.00 | 车内对话场景 4(前右座) | | +| 284 | CAR_CHAT | car_talkm_in | 100 | 1.67 | 男性车内对话起始 | | +| 285 | CAR_CHAT | car_talkm_loop | 260 | 4.33 | 男性车内对话循环 | | +| 286 | CAR_CHAT | car_talkm_out | 440 | 7.33 | 男性车内对话结束 | | +| 287 | CASINO | cards_in | 40 | 0.67 | 入座牌桌动作 | | +| 288 | CASINO | cards_loop | 200 | 3.33 | 牌桌游戏循环 | | +| 289 | CASINO | cards_lose | 200 | 3.33 | 输牌反应 | | +| 290 | CASINO | cards_out | 40 | 0.67 | 离开牌桌动作 | | +| 291 | CASINO | cards_pick_01 | 280 | 4.67 | 抽牌动作 1 | | +| 292 | CASINO | cards_pick_02 | 320 | 5.33 | 抽牌动作 2 | | +| 293 | CASINO | cards_raise | 100 | 1.67 | 加注手势 | | +| 294 | CASINO | cards_win | 180 | 3.00 | 赢牌庆祝动作 | | +| 295 | CASINO | dealone | 48 | 0.80 | 发单张牌动作 | | +| 296 | CASINO | manwinb | 90 | 1.50 | 男性基础胜利动作 | | +| 297 | CASINO | manwind | 100 | 1.67 | 男性花式胜利动作 | | +| 298 | CASINO | Roulette_bet | 140 | 2.33 | 轮盘下注动作 | | +| 299 | CASINO | Roulette_in | 40 | 0.67 | 加入轮盘游戏 | | +| 300 | CASINO | Roulette_loop | 220 | 3.67 | 轮盘等待循环 | | +| 301 | CASINO | Roulette_lose | 160 | 2.67 | 轮盘赌输局动画 | | +| 302 | CASINO | Roulette_out | 40 | 0.67 | 离开轮盘赌桌 | | +| 303 | CASINO | Roulette_win | 140 | 2.33 | 轮盘赌赢局庆祝 | | +| 304 | CASINO | Slot_bet_01 | 280 | 4.67 | 老虎机下注动作 1 | | +| 305 | CASINO | Slot_bet_02 | 120 | 2.00 | 老虎机下注动作 2 | | +| 306 | CASINO | Slot_in | 220 | 3.67 | 开始使用老虎机 | | +| 307 | CASINO | Slot_lose_out | 240 | 4.00 | 老虎机输局结束动画 | | +| 308 | CASINO | Slot_Plyr | 80 | 1.33 | 玩家操作老虎机 | | +| 309 | CASINO | Slot_wait | 220 | 3.67 | 等待老虎机停止 | | +| 310 | CASINO | Slot_win_out | 560 | 9.33 | 老虎机赢局结束动画 | | +| 311 | CASINO | wof | 88 | 1.47 | 命运之轮旋转动画 | | +| 312 | CHAINSAW | CSAW_1 | 60 | 1.00 | 电锯挥砍动作 1 | | +| 313 | CHAINSAW | CSAW_2 | 62 | 1.03 | 电锯挥砍动作 2 | | +| 314 | CHAINSAW | CSAW_3 | 52 | 0.87 | 电锯挥砍动作 3 | | +| 315 | CHAINSAW | CSAW_G | 70 | 1.17 | 地面电锯攻击动作 | | +| 316 | CHAINSAW | CSAW_Hit_1 | 50 | 0.83 | 被电锯击中反应 1 | | +| 317 | CHAINSAW | CSAW_Hit_2 | 64 | 1.07 | 被电锯击中反应 2 | | +| 318 | CHAINSAW | CSAW_Hit_3 | 68 | 1.13 | 被电锯击中反应 3 | | +| 319 | CHAINSAW | csaw_part | 8 | 0.13 | 电锯持握部件动画 | | +| 320 | CHAINSAW | IDLE_csaw | 90 | 1.50 | 持电锯待机姿势 | | +| 321 | CHAINSAW | WEAPON_csaw | 80 | 1.33 | VC 电锯挥砍动画 | | +| 322 | CHAINSAW | WEAPON_csawlo | 114 | 1.90 | VC 电锯地面挥砍动画 | | +| 323 | CHOPPA | CHOPPA_back | 6 | 0.10 | 直升机摩托后仰 | | +| 324 | CHOPPA | CHOPPA_bunnyhop | 20 | 0.33 | 直升机摩托兔跳 | | +| 325 | CHOPPA | CHOPPA_drivebyFT | 12 | 0.20 | 直升机摩托前侧扫射 | | +| 326 | CHOPPA | CHOPPA_driveby_LHS | 12 | 0.20 | 直升机摩托左侧扫射 | | +| 327 | CHOPPA | CHOPPA_driveby_RHS | 12 | 0.20 | 直升机摩托右侧扫射 | | +| 328 | CHOPPA | CHOPPA_fwd | 12 | 0.20 | 直升机摩托前倾 | | +| 329 | CHOPPA | CHOPPA_getoffBACK | 76 | 1.27 | 高速脱离直升机摩托 | | +| 330 | CHOPPA | CHOPPA_getoffLHS | 44 | 0.73 | 左侧离开直升机摩托 | | +| 331 | CHOPPA | CHOPPA_getoffRHS | 38 | 0.63 | 右侧离开直升机摩托 | | +| 332 | CHOPPA | CHOPPA_jumponL | 42 | 0.70 | 左侧跃上直升机摩托 | | +| 333 | CHOPPA | CHOPPA_jumponR | 48 | 0.80 | 右侧跃上直升机摩托 | | +| 334 | CHOPPA | CHOPPA_Left | 8 | 0.13 | 直升机摩托左倾 | | +| 335 | CHOPPA | CHOPPA_pedal | 44 | 0.73 | 直升机摩托踩踏动作 | | +| 336 | CHOPPA | CHOPPA_Pushes | 48 | 0.80 | 直升机摩托倒车操作 | | +| 337 | CHOPPA | CHOPPA_ride | 2 | 0.03 | 直升机摩托骑行状态 | | +| 338 | CHOPPA | CHOPPA_Right | 8 | 0.13 | 直升机摩托右倾 | | +| 339 | CHOPPA | CHOPPA_sprint | 40 | 0.67 | 直升机摩托冲刺 | | +| 340 | CHOPPA | CHOPPA_Still | 2 | 0.03 | 直升机摩托静止状态 | | +| 341 | CLOTHES | CLO_Buy | 124 | 2.07 | 试衣间购买姿势 | | +| 342 | CLOTHES | CLO_In | 240 | 4.00 | 进入衣橱动作 | | +| 343 | CLOTHES | CLO_Out | 160 | 2.67 | 离开衣橱动作 | | +| 344 | CLOTHES | CLO_Pose_Hat | 200 | 3.33 | 帽子展示姿势 | | +| 345 | CLOTHES | CLO_Pose_In | 188 | 3.13 | 换装姿势起始动作 | | +| 346 | CLOTHES | CLO_Pose_In_O | 240 | 4.00 | 换装姿势起始动作(物件) | | +| 347 | CLOTHES | CLO_Pose_Legs | 200 | 3.33 | 裤子展示姿势 | | +| 348 | CLOTHES | CLO_Pose_Loop | 360 | 6.00 | 换装展示循环动作 | | +| 349 | CLOTHES | CLO_Pose_Out | 240 | 4.00 | 结束换装姿势 | | +| 350 | CLOTHES | CLO_Pose_Out_O | 240 | 4.00 | 结束换装姿势(物件) | | +| 351 | CLOTHES | CLO_Pose_Shoes | 200 | 3.33 | 鞋子展示姿势 | | +| 352 | CLOTHES | CLO_Pose_Torso | 200 | 3.33 | 上衣展示姿势 | | +| 353 | CLOTHES | CLO_Pose_Watch | 200 | 3.33 | 手表展示姿势 | | +| 354 | COACH | COACH_inL | 130 | 2.17 | 左侧进入长途巴士 | | +| 355 | COACH | COACH_inR | 132 | 2.20 | 右侧进入长途巴士 | | +| 356 | COACH | COACH_opnL | 72 | 1.20 | 打开长途巴士左侧车门 | | +| 357 | COACH | COACH_opnR | 72 | 1.20 | 打开长途巴士右侧车门 | | +| 358 | COACH | COACH_outL | 104 | 1.73 | 左侧离开长途巴士 | | +| 359 | COACH | COACH_outR | 110 | 1.83 | 右侧离开长途巴士 | | +| 360 | COLT45 | 2guns_crouchfire | 48 | 0.80 | 双枪蹲姿射击 | | +| 361 | COLT45 | colt45_crouchfire | 48 | 0.80 | Colt45 蹲姿射击 | | +| 362 | COLT45 | colt45_crouchreload | 60 | 1.00 | Colt45 蹲姿换弹 | | +| 363 | COLT45 | colt45_fire | 44 | 0.73 | Colt45 站立射击 | | +| 364 | COLT45 | colt45_fire_2hands | 52 | 0.87 | 双手持 Colt45 射击 | | +| 365 | COLT45 | colt45_reload | 56 | 0.93 | Colt45 换弹动作 | | +| 366 | COLT45 | sawnoff_reload | 56 | 0.93 | 短管霰弹枪换弹 | | +| 367 | COP_AMBIENT | Copbrowse_in | 300 | 5.00 | 警察检查轮胎起始 | | +| 368 | COP_AMBIENT | Copbrowse_loop | 140 | 2.33 | 警察维修轮胎循环 | | +| 369 | COP_AMBIENT | Copbrowse_nod | 240 | 4.00 | 警察点头确认动作 | | +| 370 | COP_AMBIENT | Copbrowse_out | 160 | 2.67 | 警察结束检查站立 | | +| 371 | COP_AMBIENT | Copbrowse_shake | 110 | 1.83 | 警察摇头否定动作 | | +| 372 | COP_AMBIENT | Coplook_in | 80 | 1.33 | 警察抱臂待机起始 | | +| 373 | COP_AMBIENT | Coplook_loop | 160 | 2.67 | 警察抱臂待机循环 | | +| 374 | COP_AMBIENT | Coplook_nod | 320 | 5.33 | 警察抱臂点头动作 | | +| 375 | COP_AMBIENT | Coplook_out | 40 | 0.67 | 警察结束抱臂动作 | | +| 376 | COP_AMBIENT | Coplook_shake | 240 | 4.00 | 警察抱臂摇头动作 | | +| 377 | COP_AMBIENT | Coplook_think | 200 | 3.33 | 警察抱臂思考动作 | | +| 378 | COP_AMBIENT | Coplook_watch | 120 | 2.00 | 警察抱臂看表动作 | | +| 379 | COP_DVBYZ | COP_Dvby_B | 50 | 0.83 | 警用摩托后侧扫射 | | +| 380 | COP_DVBYZ | COP_Dvby_FT | 50 | 0.83 | 警用摩托前侧扫射 | | +| 381 | COP_DVBYZ | COP_Dvby_L | 50 | 0.83 | 警用摩托左侧扫射 | | +| 382 | COP_DVBYZ | COP_Dvby_R | 50 | 0.83 | 警用摩托右侧扫射 | | +| 383 | CRACK | Bbalbat_Idle_01 | 400 | 6.67 | 瘾君子持棒待机 1 | | +| 384 | CRACK | Bbalbat_Idle_02 | 600 | 10.00 | 瘾君子持棒待机 2 | | +| 385 | CRACK | crckdeth1 | 130 | 2.17 | 瘾君子死亡动画 1 | | +| 386 | CRACK | crckdeth2 | 180 | 3.00 | 瘾君子死亡动画 2 | | +| 387 | CRACK | crckdeth3 | 130 | 2.17 | 瘾君子死亡动画 3 | | +| 388 | CRACK | crckdeth4 | 100 | 1.67 | 瘾君子死亡动画 4 | | +| 389 | CRACK | crckidle1 | 210 | 3.50 | 瘾君子待机动作 1 | | +| 390 | CRACK | crckidle2 | 200 | 3.33 | 瘾君子待机动作 2 | | +| 391 | CRACK | crckidle3 | 200 | 3.33 | 瘾君子待机动作 3 | | +| 392 | CRACK | crckidle4 | 160 | 2.67 | 瘾君子待机动作 4 | | +| 393 | CRIB | CRIB_Console_Loop | 180 | 3.00 | 游戏机操作循环 | | +| 394 | CRIB | CRIB_Use_Switch | 70 | 1.17 | 游戏机开关操作 | | +| 395 | CRIB | PED_Console_Loop | 180 | 3.00 | 玩家游戏机操作循环 | | +| 396 | CRIB | PED_Console_Loose | 210 | 3.50 | 玩家游戏失败动画 | | +| 397 | CRIB | PED_Console_Win | 210 | 3.50 | 玩家游戏胜利动画 | | +| 398 | DAM_JUMP | DAM_Dive_Loop | 80 | 1.33 | 大坝跳水循环动作 | | +| 399 | DAM_JUMP | DAM_Land | 156 | 2.60 | 大坝跳水着陆动作 | | +| 400 | DAM_JUMP | DAM_Launch | 144 | 2.40 | 大坝跳水起跳动作 | | +| 401 | DAM_JUMP | Jump_Roll | 190 | 3.17 | 终点线跳跃翻滚 | | +| 402 | DAM_JUMP | SF_JumpWall | 180 | 3.00 | 栏杆跳水动作 | | +| 403 | DANCING | bd_clap | 192 | 3.20 | 鼓掌舞蹈 | | +| 404 | DANCING | bd_clap1 | 158 | 2.63 | 变式鼓掌舞蹈 | | +| 405 | DANCING | dance_loop | 70 | 1.17 | 基础舞蹈循环 | | +| 406 | DANCING | DAN_Down_A | 60 | 1.00 | 下蹲舞姿 | | +| 407 | DANCING | DAN_Left_A | 60 | 1.00 | 左侧舞姿 | | +| 408 | DANCING | DAN_Loop_A | 120 | 2.00 | 主舞姿循环 | | +| 409 | DANCING | DAN_Right_A | 60 | 1.00 | 右侧舞姿 | | +| 410 | DANCING | DAN_Up_A | 60 | 1.00 | 上扬舞姿 | | +| 411 | DANCING | dnce_M_a | 128 | 2.13 | 男性舞蹈 A 型 | | +| 412 | DANCING | dnce_M_b | 116 | 1.93 | 男性舞蹈 B 型 | | +| 413 | DANCING | dnce_M_c | 116 | 1.93 | 男性舞蹈 C 型 | | +| 414 | DANCING | dnce_M_d | 146 | 2.43 | 男性舞蹈 D 型 | | +| 415 | DANCING | dnce_M_e | 54 | 0.90 | 男性舞蹈 E 型 | | +| 416 | DEALER | DEALER_DEAL | 190 | 3.17 | 毒贩交易手势 | | +| 417 | DEALER | DEALER_IDLE | 400 | 6.67 | 毒贩待机姿势 | | +| 418 | DEALER | DEALER_IDLE_01 | 300 | 5.00 | 毒贩警戒待机 | | +| 419 | DEALER | DEALER_IDLE_02 | 240 | 4.00 | 毒贩观望待机 | | +| 420 | DEALER | DEALER_IDLE_03 | 280 | 4.67 | 毒贩踱步待机 | | +| 421 | DEALER | DRUGS_BUY | 190 | 3.17 | 购买毒品交互动作 | | +| 422 | DEALER | shop_pay | 280 | 4.67 | 商店付款动作 | | +| 423 | DILDO | DILDO_1 | 58 | 0.97 | 情玩具挥击 1 | | +| 424 | DILDO | DILDO_2 | 66 | 1.10 | 情玩具挥击 2 | | +| 425 | DILDO | DILDO_3 | 70 | 1.17 | 情玩具挥击 3 | | +| 426 | DILDO | DILDO_block | 28 | 0.47 | 情玩具格挡 | | +| 427 | DILDO | DILDO_G | 88 | 1.47 | 地面情玩具攻击 | | +| 428 | DILDO | DILDO_Hit_1 | 46 | 0.77 | 被情玩具击中反应 1 | | +| 429 | DILDO | DILDO_Hit_2 | 62 | 1.03 | 被情玩具击中反应 2 | | +| 430 | DILDO | DILDO_Hit_3 | 54 | 0.90 | 被情玩具击中反应 3 | | +| 431 | DILDO | DILDO_IDLE | 52 | 0.87 | 持情玩具待机 | | +| 432 | DODGE | Cover_Dive_01 | 360 | 6.00 | 战术翻滚动作 1 | | +| 433 | DODGE | Cover_Dive_02 | 360 | 6.00 | 战术翻滚动作 2 | | +| 434 | DODGE | Crushed | 56 | 0.93 | 受压制准备闪避 | | +| 435 | DODGE | Crush_Jump | 190 | 3.17 | 受压侧跳翻滚 | | +| 436 | DOZER | DOZER_Align_LHS | 58 | 0.97 | 左侧校准推土机 | | +| 437 | DOZER | DOZER_Align_RHS | 56 | 0.93 | 右侧校准推土机 | | +| 438 | DOZER | DOZER_getin_LHS | 26 | 0.43 | 左侧进入推土机 | | +| 439 | DOZER | DOZER_getin_RHS | 26 | 0.43 | 右侧进入推土机 | | +| 440 | DOZER | DOZER_getout_LHS | 64 | 1.07 | 左侧离开推土机 | | +| 441 | DOZER | DOZER_getout_RHS | 46 | 0.77 | 右侧离开推土机 | | +| 442 | DOZER | DOZER_Jacked_LHS | 76 | 1.27 | 左侧被劫推土机 | | +| 443 | DOZER | DOZER_Jacked_RHS | 64 | 1.07 | 右侧被劫推土机 | | +| 444 | DOZER | DOZER_pullout_LHS | 44 | 0.73 | 左侧拖出推土机驾驶员 | | +| 445 | DOZER | DOZER_pullout_RHS | 42 | 0.70 | 右侧拖出推土机驾驶员 | | +| 446 | DRIVEBYS | Gang_DrivebyLHS | 50 | 0.83 | 帮派左侧驾车扫射 | | +| 447 | DRIVEBYS | Gang_DrivebyLHS_Bwd | 50 | 0.83 | 帮派左侧倒车扫射 | | +| 448 | DRIVEBYS | Gang_DrivebyLHS_Fwd | 50 | 0.83 | 帮派左侧前进扫射 | | +| 449 | DRIVEBYS | Gang_DrivebyRHS | 50 | 0.83 | 帮派右侧驾车扫射 | | +| 450 | DRIVEBYS | Gang_DrivebyRHS_Bwd | 50 | 0.83 | 帮派右侧倒车扫射 | | +| 451 | DRIVEBYS | Gang_DrivebyRHS_Fwd | 50 | 0.83 | 帮派右侧前进扫射 | | +| 452 | DRIVEBYS | Gang_DrivebyTop_LHS | 50 | 0.83 | 帮派天窗左侧扫射 | | +| 453 | DRIVEBYS | Gang_DrivebyTop_RHS | 50 | 0.83 | 帮派天窗右侧扫射 | | +| 454 | FAT | FatIdle | 90 | 1.50 | 肥胖 CJ 待机 | | +| 455 | FAT | FatIdle_armed | 92 | 1.53 | 肥胖持械待机 | | +| 456 | FAT | FatIdle_Csaw | 90 | 1.50 | 肥胖持电锯待机 | | +| 457 | FAT | FatIdle_Rocket | 96 | 1.60 | 肥胖持火箭筒待机 | | +| 458 | FAT | FatRun | 46 | 0.77 | 肥胖奔跑动作 | | +| 459 | FAT | FatRun_armed | 46 | 0.77 | 肥胖持械奔跑 | | +| 460 | FAT | FatRun_Csaw | 46 | 0.77 | 肥胖持电锯奔跑 | | +| 461 | FAT | FatRun_Rocket | 46 | 0.77 | 肥胖持火箭筒奔跑 | | +| 462 | FAT | FatSprint | 36 | 0.60 | 肥胖冲刺动作 | | +| 463 | FAT | FatWalk | 70 | 1.17 | 肥胖行走动作 | | +| 464 | FAT | FatWalkstart | 12 | 0.20 | 肥胖起步动作 | | +| 465 | FAT | FatWalkstart_Csaw | 12 | 0.20 | 肥胖持电锯起步 | | +| 466 | FAT | FatWalkSt_armed | 12 | 0.20 | 肥胖持械起步 | | +| 467 | FAT | FatWalkSt_Rocket | 12 | 0.20 | 肥胖持火箭筒起步 | | +| 468 | FAT | FatWalk_armed | 70 | 1.17 | 肥胖持械行走 | | +| 469 | FAT | FatWalk_Csaw | 70 | 1.17 | 肥胖持电锯行走 | | +| 470 | FAT | FatWalk_Rocket | 70 | 1.17 | 肥胖持火箭筒行走 | | +| 471 | FAT | IDLE_tired | 64 | 1.07 | 肥胖疲倦待机 | | +| 472 | FIGHT_B | FightB_1 | 44 | 0.73 | 拳击连招 1 | | +| 473 | FIGHT_B | FightB_2 | 66 | 1.10 | 拳击连招 2 | | +| 474 | FIGHT_B | FightB_3 | 72 | 1.20 | 拳击终结技 | | +| 475 | FIGHT_B | FightB_block | 28 | 0.47 | 拳击格挡 | | +| 476 | FIGHT_B | FightB_G | 64 | 1.07 | 拳击地面攻击 | | +| 477 | FIGHT_B | FightB_IDLE | 48 | 0.80 | 拳击待机姿势 | | +| 478 | FIGHT_B | FightB_M | 30 | 0.50 | 拳击冲锋攻击 | | +| 479 | FIGHT_B | HitB_1 | 44 | 0.73 | 受拳击命中 1 | | +| 480 | FIGHT_B | HitB_2 | 50 | 0.83 | 受拳击命中 2 | | +| 481 | FIGHT_B | HitB_3 | 86 | 1.43 | 受拳击命中 3 | | +| 482 | FIGHT_C | FightC_1 | 50 | 0.83 | 功夫踢击 1 | | +| 483 | FIGHT_C | FightC_2 | 62 | 1.03 | 功夫踢击 2 | | +| 484 | FIGHT_C | FightC_3 | 60 | 1.00 | 功夫终结技 | | +| 485 | FIGHT_C | FightC_block | 28 | 0.47 | 功夫格挡 | | +| 486 | FIGHT_C | FightC_blocking | 192 | 3.20 | 功夫防守架势 | | +| 487 | FIGHT_C | FightC_G | 46 | 0.77 | 功夫地面攻击 | | +| 488 | FIGHT_C | FightC_IDLE | 60 | 1.00 | 功夫待机姿势 | | +| 489 | FIGHT_C | FightC_M | 54 | 0.90 | 功夫移动攻击 | | +| 490 | FIGHT_C | FightC_Spar | 192 | 3.20 | 功夫对练动作 | | +| 491 | FIGHT_C | HitC_1 | 18 | 0.30 | 受功夫命中 1 | | +| 492 | FIGHT_C | HitC_2 | 40 | 0.67 | 受功夫命中 2 | | +| 493 | FIGHT_C | HitC_3 | 50 | 0.83 | 受功夫命中 3 | | +| 494 | FIGHT_D | FightD_1 | 56 | 0.93 | 泰拳踢击 | | +| 495 | FIGHT_D | FightD_2 | 112 | 1.87 | 泰拳连招 | | +| 496 | FIGHT_D | FightD_3 | 54 | 0.90 | 泰拳终结技 | | +| 497 | FIGHT_D | FightD_block | 28 | 0.47 | 泰拳格挡 | | +| 498 | FIGHT_D | FightD_G | 50 | 0.83 | 泰拳地面攻击 | | +| 499 | FIGHT_D | FightD_IDLE | 92 | 1.53 | 泰拳待机姿势 | | +| 500 | FIGHT_D | FightD_M | 64 | 1.07 | 泰拳冲锋攻击 | | +| 501 | FIGHT_D | HitD_1 | 40 | 0.67 | 受泰拳命中 1 | | +| 502 | FIGHT_D | HitD_2 | 110 | 1.83 | 受泰拳命中 2 | | +| 503 | FIGHT_D | HitD_3 | 58 | 0.97 | 受泰拳命中 3 | | +| 504 | FIGHT_E | FightKick | 46 | 0.77 | CJ 默认拳击动作 | | +| 505 | FIGHT_E | FightKick_B | 62 | 1.03 | CJ 默认踢击动作 | | +| 506 | FIGHT_E | Hit_fightkick | 30 | 0.50 | 受基础攻击命中 | | +| 507 | FIGHT_E | Hit_fightkick_B | 68 | 1.13 | 受基础踢击命中 | | +| 508 | FINALE | FIN_Climb_In | 174 | 2.90 | Sweet 进入车辆 | | +| 509 | FINALE | FIN_Cop1_ClimbOut2 | 360 | 6.00 | 警察攀爬消防车云梯 | | +| 510 | FINALE | FIN_Cop1_Loop | 120 | 2.00 | 警察站立云梯状态 | | +| 511 | FINALE | FIN_Cop1_Stomp | 60 | 1.00 | 警察踩踏 Sweet 的手指 | | +| 512 | FINALE | FIN_Hang_L | 34 | 0.57 | Sweet 左摆悬挂 | | +| 513 | FINALE | FIN_Hang_Loop | 240 | 4.00 | Sweet 悬挂循环 | | +| 514 | FINALE | FIN_Hang_R | 34 | 0.57 | Sweet 右摆悬挂 | | +| 515 | FINALE | FIN_Hang_Slip | 200 | 3.33 | Sweet 悬挂打滑 | | +| 516 | FINALE | FIN_Jump_On | 336 | 5.60 | Sweet 跳上 CJ 车辆 | | +| 517 | FINALE | FIN_Land_Car | 40 | 0.67 | Sweet 着陆车顶 | | +| 518 | FINALE | FIN_Land_Die | 142 | 2.37 | Sweet 坠落死亡 | | +| 519 | FINALE | FIN_LegsUp | 60 | 1.00 | Sweet 抬腿悬挂 | | +| 520 | FINALE | FIN_LegsUp_L | 30 | 0.50 | Sweet 左摆抬腿 | | +| 521 | FINALE | FIN_LegsUp_Loop | 80 | 1.33 | Sweet 抬腿循环 | | +| 522 | FINALE | FIN_LegsUp_R | 30 | 0.50 | Sweet 右摆抬腿 | | +| 523 | FINALE | FIN_Let_Go | 10 | 0.17 | Sweet 松手坠落 | | +| 524 | FINALE2 | FIN_Cop1_ClimbOut | 240 | 4.00 | 警察离开消防车 | | +| 525 | FINALE2 | FIN_Cop1_Fall | 26 | 0.43 | 警察坠落云梯 | | +| 526 | FINALE2 | FIN_Cop1_Loop | 120 | 2.00 | 警察悬挂循环 | | +| 527 | FINALE2 | FIN_Cop1_Shot | 124 | 2.07 | 警察中弹坠落 | | +| 528 | FINALE2 | FIN_Cop1_Swing | 70 | 1.17 | 警察尸体摆动 | | +| 529 | FINALE2 | FIN_Cop2_ClimbOut | 320 | 5.33 | 第二名警察离开消防车 | | +| 530 | FINALE2 | FIN_Switch_P | 238 | 3.97 | 驾驶员换位 | | +| 531 | FINALE2 | FIN_Switch_S | 130 | 2.17 | 乘客换位 | | +| 532 | FLAME | FLAME_fire | 48 | 0.80 | 火焰喷射器射击 | | +| 533 | Flowers | Flower_attack | 48 | 0.80 | 花束攻击 | | +| 534 | Flowers | Flower_attack_M | 74 | 1.23 | 男性花束攻击 | | +| 535 | Flowers | Flower_Hit | 50 | 0.83 | 被花束击中 | | +| 536 | FOOD | EAT_Burger | 300 | 5.00 | 吃汉堡 | | +| 537 | FOOD | EAT_Chicken | 300 | 5.00 | 吃鸡肉 | | +| 538 | FOOD | EAT_Pizza | 300 | 5.00 | 吃披萨 | | +| 539 | FOOD | EAT_Vomit_P | 480 | 8.00 | 呕吐动作 | | +| 540 | FOOD | EAT_Vomit_SK | 480 | 8.00 | 呕吐动作 | | +| 541 | FOOD | FF_Dam_Bkw | 40 | 0.67 | 坐姿后部受击 | | +| 542 | FOOD | FF_Dam_Fwd | 40 | 0.67 | 坐姿前部受击 | | +| 543 | FOOD | FF_Dam_Left | 40 | 0.67 | 坐姿左侧受击 | | +| 544 | FOOD | FF_Dam_Right | 40 | 0.67 | 坐姿右侧受击 | | +| 545 | FOOD | FF_Die_Bkw | 40 | 0.67 | 坐姿后向死亡 | | +| 546 | FOOD | FF_Die_Fwd | 40 | 0.67 | 坐姿前向死亡 | | +| 547 | FOOD | FF_Die_Left | 40 | 0.67 | 坐姿左侧死亡 | | +| 548 | FOOD | FF_Die_Right | 40 | 0.67 | 坐姿右侧死亡 | | +| 549 | FOOD | FF_Sit_Eat1 | 170 | 2.83 | 坐姿进食 1 | | +| 550 | FOOD | FF_Sit_Eat2 | 160 | 2.67 | 坐姿进食 2 | | +| 551 | FOOD | FF_Sit_Eat3 | 160 | 2.67 | 坐姿进食 3 | | +| 552 | FOOD | FF_Sit_In | 180 | 3.00 | 入座动作 | | +| 553 | FOOD | FF_Sit_In_L | 120 | 2.00 | 左侧入座 | | +| 554 | FOOD | FF_Sit_In_R | 120 | 2.00 | 右侧入座 | | +| 555 | FOOD | FF_Sit_Look | 480 | 8.00 | 坐姿环视 | | +| 556 | FOOD | FF_Sit_Loop | 160 | 2.67 | 坐姿循环 | | +| 557 | FOOD | FF_Sit_Out_180 | 170 | 2.83 | 180 度起身 | | +| 558 | FOOD | FF_Sit_Out_L_180 | 80 | 1.33 | 左侧 180 度起身 | | +| 559 | FOOD | FF_Sit_Out_R_180 | 80 | 1.33 | 右侧 180 度起身 | | +| 560 | FOOD | SHP_Thank | 70 | 1.17 | 店员致谢 | | +| 561 | FOOD | SHP_Tray_In | 40 | 0.67 | 放入托盘 | | +| 562 | FOOD | SHP_Tray_Lift | 100 | 1.67 | 托举托盘 | | +| 563 | FOOD | SHP_Tray_Lift_In | 30 | 0.50 | 托举准备 | | +| 564 | FOOD | SHP_Tray_Lift_Loop | 480 | 8.00 | 托举循环 | | +| 565 | FOOD | SHP_Tray_Lift_Out | 30 | 0.50 | 放下托盘 | | +| 566 | FOOD | SHP_Tray_Out | 40 | 0.67 | 取出托盘 | | +| 567 | FOOD | SHP_Tray_Pose | 40 | 0.67 | 托盘待机 | | +| 568 | FOOD | SHP_Tray_Return | 80 | 1.33 | 归还托盘 | | +| 569 | Freeweights | gym_barbell | 142 | 2.37 | 坐姿哑铃训练 | | +| 570 | Freeweights | gym_free_A | 116 | 1.93 | 站姿哑铃上举 A | | +| 571 | Freeweights | gym_free_B | 140 | 2.33 | 站姿哑铃上举 B | | +| 572 | Freeweights | gym_free_celebrate | 200 | 3.33 | 肌肉展示 | | +| 573 | Freeweights | gym_free_down | 34 | 0.57 | 哑铃下放 | | +| 574 | Freeweights | gym_free_loop | 40 | 0.67 | 哑铃持握 | | +| 575 | Freeweights | gym_free_pickup | 190 | 3.17 | 取用哑铃 | | +| 576 | Freeweights | gym_free_putdown | 190 | 3.17 | 放置哑铃 | | +| 577 | Freeweights | gym_free_up_smooth | 60 | 1.00 | 流畅上举 | | +| 578 | GANGS | DEALER_DEAL | 70 | 1.17 | 毒品交易 | | +| 579 | GANGS | DEALER_IDLE | 120 | 2.00 | 毒贩待机 | | +| 580 | GANGS | drnkbr_prtl | 160 | 2.67 | 帮派饮酒 | | +| 581 | GANGS | drnkbr_prtl_F | 160 | 2.67 | 女性帮派饮酒 | | +| 582 | GANGS | DRUGS_BUY | 70 | 1.17 | 购买毒品 | | +| 583 | GANGS | hndshkaa | 240 | 4.00 | 帮派手势 A | | +| 584 | GANGS | hndshkba | 140 | 2.33 | 帮派手势 B | | +| 585 | GANGS | hndshkca | 200 | 3.33 | 帮派手势 C | | +| 586 | GANGS | hndshkcb | 200 | 3.33 | 帮派手势 C2 | | +| 587 | GANGS | hndshkda | 120 | 2.00 | 帮派手势 D | | +| 588 | GANGS | hndshkea | 60 | 1.00 | 帮派手势 E | | +| 589 | GANGS | hndshkfa | 250 | 4.17 | 帮派手势 F | | +| 590 | GANGS | hndshkfa_swt | 250 | 4.17 | 帮派手势 F 变体 | | +| 591 | GANGS | Invite_No | 200 | 3.33 | 拒绝入伙 | | +| 592 | GANGS | Invite_Yes | 260 | 4.33 | 同意入伙 | | +| 593 | GANGS | leanIDLE | 60 | 1.00 | 倚靠待机 | | +| 594 | GANGS | leanIN | 60 | 1.00 | 开始倚靠 | | +| 595 | GANGS | leanOUT | 60 | 1.00 | 结束倚靠 | | +| 596 | GANGS | prtial_gngtlkA | 240 | 4.00 | 帮派对话 A | | +| 597 | GANGS | prtial_gngtlkB | 370 | 6.17 | 帮派对话 B | | +| 598 | GANGS | prtial_gngtlkC | 440 | 7.33 | 帮派对话 C | | +| 599 | GANGS | prtial_gngtlkD | 180 | 3.00 | 帮派对话 D | | +| 600 | GANGS | prtial_gngtlkE | 170 | 2.83 | 帮派对话 E | | +| 601 | GANGS | prtial_gngtlkF | 310 | 5.17 | 帮派对话 F | | +| 602 | GANGS | prtial_gngtlkG | 420 | 7.00 | 帮派对话 G | | +| 603 | GANGS | prtial_gngtlkH | 360 | 6.00 | 帮派对话 H | | +| 604 | GANGS | prtial_hndshk_01 | 100 | 1.67 | 帮派手势 01 | | +| 605 | GANGS | prtial_hndshk_biz_01 | 140 | 2.33 | 商务帮派手势 | | +| 606 | GANGS | shake_cara | 100 | 1.67 | 推撞车辆 | | +| 607 | GANGS | shake_carK | 76 | 1.27 | 踢踹车辆 | | +| 608 | GANGS | shake_carSH | 90 | 1.50 | 全身冲撞车辆 | | +| 609 | GANGS | smkcig_prtl | 450 | 7.50 | 吸烟动作 | | +| 610 | GANGS | smkcig_prtl_F | 450 | 7.50 | 女性吸烟动作 | | +| 1762 | GFUNK | Dance_B1 | 76 | 1.27 | 不良 G 式舞步 1 | | +| 1763 | GFUNK | Dance_B2 | 76 | 1.27 | 不良 G 式舞步 2 | | +| 1764 | GFUNK | Dance_B3 | 76 | 1.27 | 不良 G 式舞步 3 | | +| 1765 | GFUNK | Dance_B4 | 76 | 1.27 | 不良 G 式舞步 4 | | +| 1766 | GFUNK | Dance_B5 | 76 | 1.27 | 不良 G 式舞步 5 | | +| 1767 | GFUNK | Dance_B6 | 76 | 1.27 | 不良 G 式舞步 6 | | +| 1768 | GFUNK | Dance_B7 | 76 | 1.27 | 不良 G 式舞步 7 | | +| 1769 | GFUNK | Dance_B8 | 76 | 1.27 | 不良 G 式舞步 8 | | +| 1770 | GFUNK | Dance_B9 | 76 | 1.27 | 不良 G 式舞步 9 | | +| 1771 | GFUNK | Dance_B10 | 76 | 1.27 | 不良 G 式舞步 10 | | +| 1772 | GFUNK | Dance_B11 | 76 | 1.27 | 不良 G 式舞步 11 | | +| 1773 | GFUNK | Dance_B12 | 76 | 1.27 | 不良 G 式舞步 12 | | +| 1774 | GFUNK | Dance_B13 | 76 | 1.27 | 不良 G 式舞步 13 | | +| 1775 | GFUNK | Dance_B14 | 76 | 1.27 | 不良 G 式舞步 14 | | +| 1776 | GFUNK | Dance_B15 | 76 | 1.27 | 不良 G 式舞步 15 | | +| 1777 | GFUNK | Dance_B16 | 76 | 1.27 | 不良 G 式舞步 16 | | +| 1746 | GFUNK | Dance_G1 | 76 | 1.27 | 标准 G 式舞步 1 | | +| 1747 | GFUNK | Dance_G2 | 76 | 1.27 | 标准 G 式舞步 2 | | +| 1748 | GFUNK | Dance_G3 | 76 | 1.27 | 标准 G 式舞步 3 | | +| 1749 | GFUNK | Dance_G4 | 76 | 1.27 | 标准 G 式舞步 4 | | +| 1750 | GFUNK | Dance_G5 | 76 | 1.27 | 标准 G 式舞步 5 | | +| 1751 | GFUNK | Dance_G6 | 76 | 1.27 | 标准 G 式舞步 6 | | +| 1752 | GFUNK | Dance_G7 | 76 | 1.27 | 标准 G 式舞步 7 | | +| 1753 | GFUNK | Dance_G8 | 76 | 1.27 | 标准 G 式舞步 8 | | +| 1754 | GFUNK | Dance_G9 | 76 | 1.27 | 标准 G 式舞步 9 | | +| 1755 | GFUNK | Dance_G10 | 76 | 1.27 | 标准 G 式舞步 10 | | +| 1756 | GFUNK | Dance_G11 | 76 | 1.27 | 标准 G 式舞步 11 | | +| 1757 | GFUNK | Dance_G12 | 76 | 1.27 | 标准 G 式舞步 12 | | +| 1758 | GFUNK | Dance_G13 | 76 | 1.27 | 标准 G 式舞步 13 | | +| 1759 | GFUNK | Dance_G14 | 76 | 1.27 | 标准 G 式舞步 14 | | +| 1760 | GFUNK | Dance_G15 | 76 | 1.27 | 标准 G 式舞步 15 | | +| 1761 | GFUNK | Dance_G16 | 76 | 1.27 | 标准 G 式舞步 16 | | +| 1778 | GFUNK | dance_loop | 70 | 1.17 | 基础舞蹈循环 | | +| 611 | GHANDS | gsign1 | 286 | 4.77 | 帮派手势 | | +| 612 | GHANDS | gsign1LH | 164 | 2.73 | 高位帮派手势 | | +| 613 | GHANDS | gsign2 | 128 | 2.13 | 帮派手势 | | +| 614 | GHANDS | gsign2LH | 140 | 2.33 | 高位帮派手势 | | +| 615 | GHANDS | gsign3 | 280 | 4.67 | 帮派手势 | | +| 616 | GHANDS | gsign3LH | 120 | 2.00 | 高位帮派手势 | | +| 617 | GHANDS | gsign4 | 250 | 4.17 | 帮派手势 | | +| 618 | GHANDS | gsign4LH | 280 | 4.67 | 高位帮派手势 | | +| 619 | GHANDS | gsign5 | 372 | 6.20 | 帮派手势 | | +| 620 | GHANDS | gsign5LH | 120 | 2.00 | 高位帮派手势 | | +| 621 | GHANDS | LHGsign1 | 120 | 2.00 | 帮派手势 | | +| 622 | GHANDS | LHGsign2 | 120 | 2.00 | 帮派手势 | | +| 623 | GHANDS | LHGsign3 | 120 | 2.00 | 帮派手势 | | +| 624 | GHANDS | LHGsign4 | 120 | 2.00 | 帮派手势 | | +| 625 | GHANDS | LHGsign5 | 120 | 2.00 | 帮派手势 | | +| 626 | GHANDS | RHGsign1 | 120 | 2.00 | 帮派手势 | | +| 627 | GHANDS | RHGsign2 | 120 | 2.00 | 帮派手势 | | +| 628 | GHANDS | RHGsign3 | 120 | 2.00 | 帮派手势 | | +| 629 | GHANDS | RHGsign4 | 120 | 2.00 | 帮派手势 | | +| 630 | GHANDS | RHGsign5 | 120 | 2.00 | 帮派手势 | | +| 631 | GHETTO_DB | GDB_Car2_PLY | 570 | 9.50 | CJ 在车内的动画 | | +| 632 | GHETTO_DB | GDB_Car2_SMO | 570 | 9.50 | Big Smoke 在车内的动画 | | +| 633 | GHETTO_DB | GDB_Car2_SWE | 570 | 9.50 | Sweet 在车内的动画 | | +| 634 | GHETTO_DB | GDB_Car_PLY | 800 | 13.33 | CJ 在车内的动画 | | +| 635 | GHETTO_DB | GDB_Car_RYD | 800 | 13.33 | Ryder 在车内的动画 | | +| 636 | GHETTO_DB | GDB_Car_SMO | 800 | 13.33 | Big Smoke 在车内的动画 | | +| 637 | GHETTO_DB | GDB_Car_SWE | 800 | 13.33 | Sweet 在车内的动画 | | +| 638 | goggles | goggles_put_on | 48 | 0.80 | 佩戴/摘除夜视镜 | | +| 639 | GRAFFITI | graffiti_Chkout | 280 | 4.67 | 收起喷漆罐 | | +| 640 | GRAFFITI | spraycan_fire | 140 | 2.33 | 涂鸦喷涂 | | +| 641 | GRAVEYARD | mrnF_loop | 280 | 4.67 | 女性哀悼者循环动作 | | +| 642 | GRAVEYARD | mrnM_loop | 160 | 2.67 | 男性哀悼者循环动作 | | +| 643 | GRAVEYARD | prst_loopa | 240 | 4.00 | 墓地牧师循环动作 | | +| 644 | GRENADE | WEAPON_start_throw | 12 | 0.20 | 投掷起始动作 | | +| 645 | GRENADE | WEAPON_throw | 52 | 0.87 | 手雷/燃烧瓶高举投掷 | | +| 646 | GRENADE | WEAPON_throwu | 40 | 0.67 | 手雷/燃烧瓶抛掷 | | +| 647 | GYMNASIUM | GYMshadowbox | 306 | 5.10 | 拳击动作 | | +| 648 | GYMNASIUM | gym_bike_celebrate | 116 | 1.93 | 完成动感单车训练后的庆祝动作 | | +| 649 | GYMNASIUM | gym_bike_fast | 24 | 0.40 | 快速蹬踏动感单车 | | +| 650 | GYMNASIUM | gym_bike_faster | 24 | 0.40 | 超快速蹬踏动感单车 | | +| 651 | GYMNASIUM | gym_bike_getoff | 100 | 1.67 | 下动感单车动作 | | +| 652 | GYMNASIUM | gym_bike_geton | 100 | 1.67 | 上动感单车动作 | | +| 653 | GYMNASIUM | gym_bike_pedal | 24 | 0.40 | 动感单车蹬踏动作 | | +| 654 | GYMNASIUM | gym_bike_slow | 26 | 0.43 | 慢速蹬踏动感单车 | | +| 655 | GYMNASIUM | gym_bike_still | 100 | 1.67 | 静止在动感单车上 | | +| 656 | GYMNASIUM | gym_jog_falloff | 130 | 2.17 | 跑步机跌落动作 | | +| 657 | GYMNASIUM | gym_shadowbox | 306 | 5.10 | 拳击动作 | | +| 658 | GYMNASIUM | gym_tread_celebrate | 150 | 2.50 | 完成跑步机训练后的庆祝动作 | | +| 659 | GYMNASIUM | gym_tread_falloff | 120 | 2.00 | 跑步机跌落动作 | | +| 660 | GYMNASIUM | gym_tread_getoff | 200 | 3.33 | 下跑步机动作 | | +| 661 | GYMNASIUM | gym_tread_geton | 150 | 2.50 | 上跑步机动作 | | +| 662 | GYMNASIUM | gym_tread_jog | 46 | 0.77 | 跑步机慢跑动作 | | +| 663 | GYMNASIUM | gym_tread_sprint | 40 | 0.67 | 跑步机冲刺动作 | | +| 664 | GYMNASIUM | gym_tread_tired | 80 | 1.33 | 跑步机疲劳状态 | | +| 665 | GYMNASIUM | gym_tread_walk | 64 | 1.07 | 跑步机行走动作 | | +| 666 | GYMNASIUM | gym_walk_falloff | 200 | 3.33 | 跑步机跌落动作 | | +| 667 | GYMNASIUM | Pedals_fast | 24 | 0.40 | 快速蹬踏动感单车 | | +| 668 | GYMNASIUM | Pedals_med | 24 | 0.40 | 中速蹬踏动感单车 | | +| 669 | GYMNASIUM | Pedals_slow | 26 | 0.43 | 慢速蹬踏动感单车 | | +| 670 | GYMNASIUM | Pedals_still | 26 | 0.43 | 静止在动感单车上 | | +| 671 | HAIRCUTS | BRB_Beard_01 | 270 | 4.50 | 理发师修须动作 | | +| 672 | HAIRCUTS | BRB_Buy | 250 | 4.17 | 购买发型动画 | | +| 673 | HAIRCUTS | BRB_Cut | 102 | 1.70 | 理发师剪发动作 | | +| 674 | HAIRCUTS | BRB_Cut_In | 50 | 0.83 | 理发师开始剪发动画 | | +| 675 | HAIRCUTS | BRB_Cut_Out | 80 | 1.33 | 理发师展示发型动作 | | +| 676 | HAIRCUTS | BRB_Hair_01 | 230 | 3.83 | 欣赏发型 | | +| 677 | HAIRCUTS | BRB_Hair_02 | 270 | 4.50 | 欣赏发型 | | +| 678 | HAIRCUTS | BRB_In | 80 | 1.33 | 理发师起始动画 | | +| 679 | HAIRCUTS | BRB_Loop | 160 | 2.67 | 理发师循环动画 | | +| 680 | HAIRCUTS | BRB_Out | 40 | 0.67 | 理发师结束动画 | | +| 681 | HAIRCUTS | BRB_Sit_In | 124 | 2.07 | 入座理发椅 | | +| 682 | HAIRCUTS | BRB_Sit_Loop | 420 | 7.00 | 理发椅循环坐姿 | | +| 683 | HAIRCUTS | BRB_Sit_Out | 180 | 3.00 | 离开理发椅 | | +| 684 | HEIST9 | CAS_G2_GasKO | 200 | 3.33 | 毒气窒息动画 | | +| 685 | HEIST9 | swt_wllpk_L | 160 | 2.67 | 左侧掩体隐蔽 | | +| 686 | HEIST9 | swt_wllpk_L_back | 30 | 0.50 | 左侧掩体隐蔽 | | +| 687 | HEIST9 | swt_wllpk_R | 220 | 3.67 | 右侧掩体隐蔽 | | +| 688 | HEIST9 | swt_wllpk_R_back | 26 | 0.43 | 右侧掩体隐蔽 | | +| 689 | HEIST9 | swt_wllshoot_in_L | 60 | 1.00 | 左侧掩体持枪露出 | | +| 690 | HEIST9 | swt_wllshoot_in_R | 78 | 1.30 | 右侧掩体持枪露出 | | +| 691 | HEIST9 | swt_wllshoot_out_L | 120 | 2.00 | 返回左侧掩体 | | +| 692 | HEIST9 | swt_wllshoot_out_R | 86 | 1.43 | 返回右侧掩体 | | +| 693 | HEIST9 | Use_SwipeCard | 70 | 1.17 | 刷卡动作 | | +| 694 | INT_HOUSE | BED_In_L | 200 | 3.33 | 左侧上床动作 | | +| 695 | INT_HOUSE | BED_In_R | 200 | 3.33 | 右侧上床动作 | | +| 696 | INT_HOUSE | BED_Loop_L | 200 | 3.33 | 左侧床上睡眠循环 | | +| 697 | INT_HOUSE | BED_Loop_R | 200 | 3.33 | 右侧床上睡眠循环 | | +| 698 | INT_HOUSE | BED_Out_L | 200 | 3.33 | 左侧下床动作 | | +| 699 | INT_HOUSE | BED_Out_R | 200 | 3.33 | 右侧下床动作 | | +| 700 | INT_HOUSE | LOU_In | 110 | 1.83 | 入座沙发 | | +| 701 | INT_HOUSE | LOU_Loop | 200 | 3.33 | 沙发坐姿循环 | | +| 702 | INT_HOUSE | LOU_Out | 120 | 2.00 | 从沙发起身动作 | | +| 703 | INT_HOUSE | wash_up | 180 | 3.00 | 洗手台洗手动作 | | +| 704 | INT_OFFICE | FF_Dam_Fwd | 40 | 0.67 | 坐姿前向受击动作 | | +| 705 | INT_OFFICE | OFF_Sit_2Idle_180 | 170 | 2.83 | 起身 180 度转体动作 | | +| 706 | INT_OFFICE | OFF_Sit_Bored_Loop | 170 | 2.83 | 坐姿无聊状态循环 | | +| 707 | INT_OFFICE | OFF_Sit_Crash | 200 | 3.33 | 坐姿猛击键盘动作 | | +| 708 | INT_OFFICE | OFF_Sit_Drink | 250 | 4.17 | 坐姿饮水动作 | | +| 709 | INT_OFFICE | OFF_Sit_Idle_Loop | 124 | 2.07 | 坐姿待机循环 | | +| 710 | INT_OFFICE | OFF_Sit_In | 166 | 2.77 | 入座动作 | | +| 711 | INT_OFFICE | OFF_Sit_Read | 200 | 3.33 | 坐姿阅读动作 | | +| 712 | INT_OFFICE | OFF_Sit_Type_Loop | 200 | 3.33 | 坐姿键盘输入循环 | | +| 713 | INT_OFFICE | OFF_Sit_Watch | 120 | 2.00 | 坐姿查看手表动作 | | +| 714 | INT_SHOP | shop_cashier | 400 | 6.67 | 开启收银机动作 | | +| 715 | INT_SHOP | shop_in | 60 | 1.00 | 收银机启动起始动画 | | +| 716 | INT_SHOP | shop_lookA | 120 | 2.00 | 收银台查看物品动作 | | +| 717 | INT_SHOP | shop_lookB | 180 | 3.00 | 收银台查看物品动作 | | +| 718 | INT_SHOP | shop_loop | 120 | 2.00 | 收银台操作循环 | | +| 719 | INT_SHOP | shop_out | 80 | 1.33 | 收银操作结束动画 | | +| 720 | INT_SHOP | shop_pay | 400 | 6.67 | 取钱放置柜台动作 | | +| 721 | INT_SHOP | shop_shelf | 140 | 2.33 | 货架取物动作 | | +| 722 | JST_BUISNESS | girl_01 | 200 | 3.33 | 女孩坐姿动画 | | +| 723 | JST_BUISNESS | girl_02 | 680 | 11.33 | 女孩坐姿动画 | | +| 724 | JST_BUISNESS | player_01 | 1490 | 24.83 | CJ 在"正经买卖"任务中的动画 | | +| 725 | JST_BUISNESS | smoke_01 | 1500 | 25.00 | Big Smoke 在"正经买卖"任务中的动画 | | +| 726 | KART | KART_getin_LHS | 50 | 0.83 | 左侧进入卡丁车动作 | | +| 727 | KART | KART_getin_RHS | 50 | 0.83 | 右侧进入卡丁车动作 | | +| 728 | KART | KART_getout_LHS | 50 | 0.83 | 左侧离开卡丁车动作 | | +| 729 | KART | KART_getout_RHS | 50 | 0.83 | 右侧离开卡丁车动作 | | +| 730 | KISSING | BD_GF_Wave | 304 | 5.07 | 女友挥手动作 | | +| 731 | KISSING | gfwave2 | 160 | 2.67 | 女友挥手动作 | | +| 732 | KISSING | GF_CarArgue_01 | 300 | 5.00 | 车内争吵动作 | | +| 733 | KISSING | GF_CarArgue_02 | 300 | 5.00 | 车内争吵动作 | | +| 734 | KISSING | GF_CarSpot | 300 | 5.00 | 车内发现目标动作 | | +| 735 | KISSING | GF_StreetArgue_01 | 300 | 5.00 | 街头争吵动作 | | +| 736 | KISSING | GF_StreetArgue_02 | 300 | 5.00 | 街头争吵动作 | | +| 737 | KISSING | gift_get | 320 | 5.33 | 接收礼物动作 | | +| 738 | KISSING | gift_give | 320 | 5.33 | 赠送礼物动作 | | +| 739 | KISSING | Grlfrd_Kiss_01 | 250 | 4.17 | 女友亲吻动画 | | +| 740 | KISSING | Grlfrd_Kiss_02 | 346 | 5.77 | 女友亲吻动画 | | +| 741 | KISSING | Grlfrd_Kiss_03 | 420 | 7.00 | 女友亲吻动画 | | +| 742 | KISSING | Playa_Kiss_01 | 300 | 5.00 | 玩家亲吻动画 | | +| 743 | KISSING | Playa_Kiss_02 | 346 | 5.77 | 玩家亲吻动画 | | +| 744 | KISSING | Playa_Kiss_03 | 420 | 7.00 | 玩家亲吻动画 | | +| 745 | KNIFE | KILL_Knife_Ped_Damage | 134 | 2.23 | 背后割喉受击动作 | | +| 746 | KNIFE | KILL_Knife_Ped_Die | 116 | 1.93 | 潜杀死亡动画 | | +| 747 | KNIFE | KILL_Knife_Player | 160 | 2.67 | 玩家背后割喉动作 | | +| 748 | KNIFE | KILL_Partial | 2 | 0.03 | 背后持刀击杀动作 | | +| 749 | KNIFE | knife_1 | 60 | 1.00 | 匕首挥砍动作 | | +| 750 | KNIFE | knife_2 | 56 | 0.93 | 匕首挥砍动作 | | +| 751 | KNIFE | knife_3 | 52 | 0.87 | 匕首挥砍动作 | | +| 752 | KNIFE | Knife_4 | 54 | 0.90 | 匕首挥砍动作 | | +| 753 | KNIFE | knife_block | 28 | 0.47 | 匕首格挡动作 | | +| 754 | KNIFE | Knife_G | 54 | 0.90 | 匕首处决倒地目标动作 | | +| 755 | KNIFE | knife_hit_1 | 34 | 0.57 | 匕首受击动作 | | +| 756 | KNIFE | knife_hit_2 | 38 | 0.63 | 匕首受击动作 | | +| 757 | KNIFE | knife_hit_3 | 96 | 1.60 | 匕首受击动作 | | +| 758 | KNIFE | knife_IDLE | 78 | 1.30 | 匕首待机动作 | | +| 759 | KNIFE | knife_part | 32 | 0.53 | 匕首分离动画 | | +| 760 | KNIFE | WEAPON_knifeidle | 78 | 1.30 | 匕首待机动作 | | +| 761 | LAPDAN1 | LAPDAN_D | 2264 | 37.73 | 膝上舞表演 | | +| 762 | LAPDAN1 | LAPDAN_P | 2264 | 37.73 | 膝上舞表演 | | +| 763 | LAPDAN2 | LAPDAN_D | 2810 | 46.83 | 膝上舞表演 | | +| 764 | LAPDAN2 | LAPDAN_P | 2810 | 46.83 | 膝上舞表演 | | +| 765 | LAPDAN3 | LAPDAN_D | 3088 | 51.47 | 膝上舞表演 | | +| 766 | LAPDAN3 | LAPDAN_P | 3088 | 51.47 | 膝上舞表演 | | +| 767 | LOWRIDER | F_smklean_loop | 240 | 4.00 | 女性倚靠抽烟循环 | | +| 768 | LOWRIDER | lrgirl_bdbnce | 160 | 2.67 | 车顶座椅弹跳动作 | | +| 769 | LOWRIDER | lrgirl_hair | 140 | 2.33 | 车顶座椅撩发动作 | | +| 770 | LOWRIDER | lrgirl_hurry | 170 | 2.83 | 车内催促手势 | | +| 771 | LOWRIDER | lrgirl_idleloop | 130 | 2.17 | 车内坐姿循环 | | +| 772 | LOWRIDER | lrgirl_idle_to_l0 | 130 | 2.17 | 低底盘车入座动作 | | +| 773 | LOWRIDER | lrgirl_l0_bnce | 40 | 0.67 | 低底盘车座椅弹跳动作 | | +| 774 | LOWRIDER | lrgirl_l0_loop | 120 | 2.00 | 低底盘车坐姿循环 | | +| 775 | LOWRIDER | lrgirl_l0_to_l1 | 220 | 3.67 | 起身至车顶座椅动作 | | +| 776 | LOWRIDER | lrgirl_l12_to_l0 | 120 | 2.00 | 返回车内座椅动作 | | +| 777 | LOWRIDER | lrgirl_l1_bnce | 40 | 0.67 | 车顶座椅弹跳动作 | | +| 778 | LOWRIDER | lrgirl_l1_loop | 120 | 2.00 | 车顶座椅坐姿循环 | | +| 779 | LOWRIDER | lrgirl_l1_to_l2 | 80 | 1.33 | 车顶座椅欢呼动作 | | +| 780 | LOWRIDER | lrgirl_l2_bnce | 40 | 0.67 | 车顶座椅弹跳动作 | | +| 781 | LOWRIDER | lrgirl_l2_loop | 90 | 1.50 | 车顶座椅坐姿循环 | | +| 782 | LOWRIDER | lrgirl_l2_to_l3 | 90 | 1.50 | 低底盘车挡风玻璃倚靠动作 | | +| 783 | LOWRIDER | lrgirl_l345_to_l1 | 60 | 1.00 | 返回车顶座椅动作 | | +| 784 | LOWRIDER | lrgirl_l3_bnce | 40 | 0.67 | 挡风玻璃倚靠弹跳动作 | | +| 785 | LOWRIDER | lrgirl_l3_loop | 120 | 2.00 | 挡风玻璃倚靠循环 | | +| 786 | LOWRIDER | lrgirl_l3_to_l4 | 40 | 0.67 | 挡风玻璃欢呼动作 | | +| 787 | LOWRIDER | lrgirl_l4_bnce | 40 | 0.67 | 挡风玻璃弹跳动作 | | +| 788 | LOWRIDER | lrgirl_l4_loop | 140 | 2.33 | 挡风玻璃倚靠循环 | | +| 789 | LOWRIDER | lrgirl_l4_to_l5 | 60 | 1.00 | 单手持握挡风玻璃动作 | | +| 790 | LOWRIDER | lrgirl_l5_bnce | 50 | 0.83 | 单手挡风玻璃弹跳动作 | | +| 791 | LOWRIDER | lrgirl_l5_loop | 100 | 1.67 | 单手挡风玻璃持握循环 | | +| 792 | LOWRIDER | M_smklean_loop | 300 | 5.00 | 男性倚靠抽烟循环 | | +| 793 | LOWRIDER | M_smkstnd_loop | 320 | 5.33 | 男性站立抽烟循环 | | +| 794 | LOWRIDER | prtial_gngtlkB | 88 | 1.47 | 低底盘车帮派对话 | | +| 795 | LOWRIDER | prtial_gngtlkC | 90 | 1.50 | 低底盘车帮派对话 | | +| 796 | LOWRIDER | prtial_gngtlkD | 148 | 2.47 | 低底盘车帮派对话 | | +| 797 | LOWRIDER | prtial_gngtlkE | 180 | 3.00 | 低底盘车帮派对话 | | +| 798 | LOWRIDER | prtial_gngtlkF | 160 | 2.67 | 低底盘车帮派对话 | | +| 799 | LOWRIDER | prtial_gngtlkG | 160 | 2.67 | 低底盘车帮派对话 | | +| 800 | LOWRIDER | prtial_gngtlkH | 200 | 3.33 | 低底盘车帮派对话 | | +| 801 | LOWRIDER | RAP_A_Loop | 160 | 2.67 | 低底盘车说唱动作 | | +| 802 | LOWRIDER | RAP_B_Loop | 160 | 2.67 | 低底盘车说唱动作 | | +| 803 | LOWRIDER | RAP_C_Loop | 180 | 3.00 | 低底盘车说唱动作 | | +| 804 | LOWRIDER | Sit_relaxed | 2 | 0.03 | 车内放松坐姿 | | +| 805 | LOWRIDER | Tap_hand | 20 | 0.33 | 车窗敲击手势 | | +| 806 | MD_CHASE | Carhit_Hangon | 92 | 1.53 | 警员悬挂挡风玻璃动作 | | +| 807 | MD_CHASE | Carhit_Tumble | 122 | 2.03 | 警员翻滚悬挂动作 | | +| 808 | MD_CHASE | donutdrop | 90 | 1.50 | 空白动画 | | +| 809 | MD_CHASE | Fen_Choppa_L1 | 86 | 1.43 | 空白动画 | | +| 810 | MD_CHASE | Fen_Choppa_L2 | 78 | 1.30 | 空白动画 | | +| 811 | MD_CHASE | Fen_Choppa_L3 | 78 | 1.30 | 空白动画 | | +| 812 | MD_CHASE | Fen_Choppa_R1 | 78 | 1.30 | 空白动画 | | +| 813 | MD_CHASE | Fen_Choppa_R2 | 78 | 1.30 | 空白动画 | | +| 814 | MD_CHASE | Fen_Choppa_R3 | 78 | 1.30 | 空白动画 | | +| 815 | MD_CHASE | Hangon_Stun_loop | 280 | 4.67 | 悬挂眩晕状态循环 | | +| 816 | MD_CHASE | Hangon_Stun_Turn | 240 | 4.00 | 悬挂状态转向动作 | | +| 817 | MD_CHASE | MD_BIKE_2_HANG | 82 | 1.37 | 翻滚悬挂保险杠动作 | | +| 818 | MD_CHASE | MD_BIKE_Jmp_BL | 66 | 1.10 | 摩托车左侧跳车动作 | | +| 819 | MD_CHASE | MD_BIKE_Jmp_F | 60 | 1.00 | 摩托车右侧跳车动作 | | +| 820 | MD_CHASE | MD_BIKE_Lnd_BL | 54 | 0.90 | 左侧车顶着陆动作 | | +| 821 | MD_CHASE | MD_BIKE_Lnd_Die_BL | 92 | 1.53 | 左侧车顶死亡动画 | | +| 822 | MD_CHASE | MD_BIKE_Lnd_Die_F | 48 | 0.80 | 右侧车顶死亡动画 | | +| 823 | MD_CHASE | MD_BIKE_Lnd_F | 70 | 1.17 | 右侧车顶着陆动作 | | +| 824 | MD_CHASE | MD_BIKE_Lnd_Roll | 162 | 2.70 | 左侧翻滚跌落动画 | | +| 825 | MD_CHASE | MD_BIKE_Lnd_Roll_F | 62 | 1.03 | 右侧翻滚跌落动画 | | +| 826 | MD_CHASE | MD_BIKE_Punch | 110 | 1.83 | 车顶挥拳攻击动作 | | +| 827 | MD_CHASE | MD_BIKE_Punch_F | 110 | 1.83 | 车顶挥拳攻击动作 | | +| 828 | MD_CHASE | MD_BIKE_Shot_F | 80 | 1.33 | 车顶中枪跌落动画 | | +| 829 | MD_CHASE | MD_HANG_Lnd_Roll | 162 | 2.70 | 悬挂状态翻滚死亡动画 | | +| 830 | MD_CHASE | MD_HANG_Loop | 60 | 1.00 | 车尾悬挂循环 | | +| 831 | MD_END | END_SC1_PLY | 300 | 5.00 | CJ 解脱动画 | | +| 832 | MD_END | END_SC1_RYD | 300 | 5.00 | Ryder 解脱动画 | | +| 833 | MD_END | END_SC1_SMO | 300 | 5.00 | Big Smoke 解脱动画 | | +| 834 | MD_END | END_SC1_SWE | 300 | 5.00 | Sweet 解脱动画 | | +| 835 | MD_END | END_SC2_PLY | 540 | 9.00 | CJ 结局动画 | | +| 836 | MD_END | END_SC2_RYD | 540 | 9.00 | Ryder 结局动画 | | +| 837 | MD_END | END_SC2_SMO | 540 | 9.00 | Big Smoke 结局动画 | | +| 838 | MD_END | END_SC2_SWE | 540 | 9.00 | Sweet 结局动画 | | +| 839 | MEDIC | CPR | 500 | 8.33 | 医护心肺复苏动作 | | +| 840 | MISC | bitchslap | 70 | 1.17 | 掌掴动作 | | +| 841 | MISC | BMX_celebrate | 94 | 1.57 | 小轮车庆祝动作 | | +| 842 | MISC | BMX_comeon | 46 | 0.77 | 小轮车召唤手势 | | +| 843 | MISC | bmx_idleloop_01 | 200 | 3.33 | 小轮车待机状态 | | +| 844 | MISC | bmx_idleloop_02 | 400 | 6.67 | 小轮车待机状态 | | +| 845 | MISC | bmx_talkleft_in | 40 | 0.67 | 小轮车左侧交谈起始 | | +| 846 | MISC | bmx_talkleft_loop | 400 | 6.67 | 小轮车左侧交谈循环 | | +| 847 | MISC | bmx_talkleft_out | 40 | 0.67 | 小轮车左侧交谈结束 | | +| 848 | MISC | bmx_talkright_in | 40 | 0.67 | 小轮车右侧交谈起始 | | +| 849 | MISC | bmx_talkright_loop | 440 | 7.33 | 小轮车右侧交谈循环 | | +| 850 | MISC | bmx_talkright_out | 40 | 0.67 | 小轮车右侧交谈结束 | | +| 851 | MISC | bng_wndw | 440 | 7.33 | 窗户敲击动作 | | +| 852 | MISC | bng_wndw_02 | 440 | 7.33 | 隔窗交谈动作 | | +| 853 | MISC | Case_pickup | 60 | 1.00 | 手提箱拾取动作 | | +| 854 | MISC | door_jet | 320 | 5.33 | 空白动画 | | +| 855 | MISC | GRAB_L | 24 | 0.40 | 左侧抓取动作 | | +| 856 | MISC | GRAB_R | 24 | 0.40 | 右侧抓取动作 | | +| 857 | MISC | Hiker_Pose | 20 | 0.33 | 右侧打车手势 | | +| 858 | MISC | Hiker_Pose_L | 20 | 0.33 | 左侧打车手势 | | +| 859 | MISC | Idle_Chat_02 | 434 | 7.23 | 待机闲聊动作 | | +| 860 | MISC | KAT_Throw_K | 200 | 3.33 | 武士刀投掷挑衅动作 | | +| 861 | MISC | KAT_Throw_O | 200 | 3.33 | 空白动画 | | +| 862 | MISC | KAT_Throw_P | 200 | 3.33 | 武士刀备战动作 | | +| 863 | MISC | PASS_Rifle_O | 80 | 1.33 | 空白动画 | | +| 864 | MISC | PASS_Rifle_Ped | 80 | 1.33 | 步枪传递动作 | | +| 865 | MISC | PASS_Rifle_Ply | 80 | 1.33 | 步枪接收动作 | | +| 866 | MISC | pickup_box | 24 | 0.40 | 箱子拾取动作 | | +| 867 | MISC | Plane_door | 320 | 5.33 | 空白动画 | | +| 868 | MISC | Plane_exit | 320 | 5.33 | CJ 飞机离舱动画 | | +| 869 | MISC | Plane_hijack | 320 | 5.33 | 飞机劫持动作 | | +| 870 | MISC | Plunger_01 | 200 | 3.33 | 起爆器引爆动作 | | +| 871 | MISC | Plyrlean_loop | 160 | 2.67 | 玩家倚靠循环 | | +| 872 | MISC | plyr_shkhead | 100 | 1.67 | 扶额无奈动作 | | +| 873 | MISC | Run_Dive | 496 | 8.27 | Ryder 飞扑动作 | | +| 874 | MISC | Scratchballs_01 | 500 | 8.33 | 胯部抓痒动作 | | +| 875 | MISC | SEAT_LR | 220 | 3.67 | 坐姿回头动作 | | +| 876 | MISC | Seat_talk_01 | 220 | 3.67 | 坐姿交谈动作 | | +| 877 | MISC | Seat_talk_02 | 200 | 3.33 | 坐姿交谈动作 | | +| 878 | MISC | SEAT_watch | 140 | 2.33 | 坐姿查看手表 | | +| 879 | MISC | smalplane_door | 380 | 6.33 | 空白动画 | | +| 880 | MISC | smlplane_door | 320 | 5.33 | 空白动画 | | +| 881 | MTB | MTB_back | 6 | 0.10 | 山地自行车后仰 | | +| 882 | MTB | MTB_bunnyhop | 20 | 0.33 | 山地自行车跳跃动作 | | +| 883 | MTB | MTB_drivebyFT | 12 | 0.20 | 山地车前向飞车 | | +| 884 | MTB | MTB_driveby_LHS | 12 | 0.20 | 山地车左侧飞车 | | +| 885 | MTB | MTB_driveby_RHS | 12 | 0.20 | 山地车右侧飞车 | | +| 886 | MTB | MTB_fwd | 12 | 0.20 | 山地车前倾动作 | | +| 887 | MTB | MTB_getoffBACK | 92 | 1.53 | 山地车高速跌落动作 | | +| 888 | MTB | MTB_getoffLHS | 44 | 0.73 | 山地车左侧下车 | | +| 889 | MTB | MTB_getoffRHS | 44 | 0.73 | 山地车右侧下车 | | +| 890 | MTB | MTB_jumponL | 48 | 0.80 | 山地车左侧上车 | | +| 891 | MTB | MTB_jumponR | 50 | 0.83 | 山地车右侧上车 | | +| 892 | MTB | MTB_Left | 8 | 0.13 | 山地车左侧倾斜 | | +| 893 | MTB | MTB_pedal | 40 | 0.67 | 山地车蹬踏动作 | | +| 894 | MTB | MTB_pushes | 48 | 0.80 | 山地车倒推行进 | | +| 895 | MTB | MTB_Ride | 2 | 0.03 | 山地车骑行状态 | | +| 896 | MTB | MTB_Right | 8 | 0.13 | 山地车右侧倾斜 | | +| 897 | MTB | MTB_sprint | 48 | 0.80 | 山地车冲刺动作 | | +| 898 | MTB | MTB_still | 2 | 0.03 | 山地车静止骑行 | | +| 899 | MUSCULAR | MscleWalkst_armed | 12 | 0.20 | 肌肉男持械行走起始 | | +| 900 | MUSCULAR | MscleWalkst_Csaw | 12 | 0.20 | 肌肉男电锯行走起始 | | +| 901 | MUSCULAR | Mscle_rckt_run | 48 | 0.80 | 肌肉男 CJ 火箭冲刺 | | +| 902 | MUSCULAR | Mscle_rckt_walkst | 12 | 0.20 | 肌肉男 CJ 火箭行走起始 | | +| 903 | MUSCULAR | Mscle_run_Csaw | 48 | 0.80 | 肌肉男 CJ 电锯奔跑 | | +| 904 | MUSCULAR | MuscleIdle | 90 | 1.50 | 肌肉男 CJ 待机姿势 | | +| 905 | MUSCULAR | MuscleIdle_armed | 90 | 1.50 | 肌肉男 CJ 持械待机 | | +| 906 | MUSCULAR | MuscleIdle_Csaw | 90 | 1.50 | 肌肉男 CJ 电锯待机 | | +| 907 | MUSCULAR | MuscleIdle_rocket | 90 | 1.50 | 肌肉男 CJ 火箭筒待机 | | +| 908 | MUSCULAR | MuscleRun | 48 | 0.80 | 肌肉男 CJ 奔跑 | | +| 909 | MUSCULAR | MuscleRun_armed | 48 | 0.80 | 肌肉男 CJ 持械奔跑 | | +| 910 | MUSCULAR | MuscleSprint | 34 | 0.57 | 肌肉男 CJ 冲刺 | | +| 911 | MUSCULAR | MuscleWalk | 64 | 1.07 | 肌肉男 CJ 行走 | | +| 912 | MUSCULAR | MuscleWalkstart | 16 | 0.27 | 肌肉男 CJ 行走起始 | | +| 913 | MUSCULAR | MuscleWalk_armed | 64 | 1.07 | 肌肉男 CJ 持械行走 | | +| 914 | MUSCULAR | Musclewalk_Csaw | 64 | 1.07 | 肌肉男 CJ 电锯行走 | | +| 915 | MUSCULAR | Musclewalk_rocket | 64 | 1.07 | 肌肉男 CJ 火箭筒行走 | | +| 916 | NEVADA | NEVADA_getin | 112 | 1.87 | 内华达飞机登入动画 | | +| 917 | NEVADA | NEVADA_getout | 56 | 0.93 | 内华达飞机离舱动画 | | +| 918 | ON_LOOKERS | lkaround_in | 20 | 0.33 | 环顾四周起始动画 | | +| 919 | ON_LOOKERS | lkaround_loop | 420 | 7.00 | 环顾四周循环动作 | | +| 920 | ON_LOOKERS | lkaround_out | 20 | 0.33 | 环顾四周结束动画 | | +| 921 | ON_LOOKERS | lkup_in | 100 | 1.67 | 抬头仰望起始动画 | | +| 922 | ON_LOOKERS | lkup_loop | 320 | 5.33 | 抬头仰望循环动作 | | +| 923 | ON_LOOKERS | lkup_out | 60 | 1.00 | 抬头仰望结束动画 | | +| 924 | ON_LOOKERS | lkup_point | 200 | 3.33 | 抬头指认动作 | | +| 925 | ON_LOOKERS | panic_cower | 400 | 6.67 | 蜷缩恐惧状态 | | +| 926 | ON_LOOKERS | panic_hide | 380 | 6.33 | 恐慌躲藏动作 | | +| 927 | ON_LOOKERS | panic_in | 50 | 0.83 | 恐慌状态起始 | | +| 928 | ON_LOOKERS | panic_loop | 100 | 1.67 | 恐慌状态循环 | | +| 929 | ON_LOOKERS | panic_out | 40 | 0.67 | 恐慌状态结束 | | +| 930 | ON_LOOKERS | panic_point | 360 | 6.00 | 恐慌指向前方动作 | | +| 931 | ON_LOOKERS | panic_shout | 520 | 8.67 | 恐慌尖叫动作 | | +| 932 | ON_LOOKERS | Pointup_in | 60 | 1.00 | 上指起始动作 | | +| 933 | ON_LOOKERS | Pointup_loop | 160 | 2.67 | 上指循环动作 | | +| 934 | ON_LOOKERS | Pointup_out | 60 | 1.00 | 上指结束动作 | | +| 935 | ON_LOOKERS | Pointup_shout | 180 | 3.00 | 仰头呼喊动作 | | +| 936 | ON_LOOKERS | point_in | 30 | 0.50 | 前指起始动作 | | +| 937 | ON_LOOKERS | point_loop | 180 | 3.00 | 前指循环动作 | | +| 938 | ON_LOOKERS | point_out | 20 | 0.33 | 前指结束动作 | | +| 939 | ON_LOOKERS | shout_01 | 160 | 2.67 | 欢呼动作 | | +| 940 | ON_LOOKERS | shout_02 | 240 | 4.00 | 欢呼动作 | | +| 941 | ON_LOOKERS | shout_in | 100 | 1.67 | 呼喊起始动作 | | +| 942 | ON_LOOKERS | shout_loop | 120 | 2.00 | 呼喊循环动作 | | +| 943 | ON_LOOKERS | shout_out | 20 | 0.33 | 呼喊结束动作 | | +| 944 | ON_LOOKERS | wave_in | 50 | 0.83 | 挥手起始动作 | | +| 945 | ON_LOOKERS | wave_loop | 90 | 1.50 | 挥手循环动作 | | +| 946 | ON_LOOKERS | wave_out | 50 | 0.83 | 挥手结束动作 | | +| 947 | OTB | betslp_in | 80 | 1.33 | 赌桌书写起始动作 | | +| 948 | OTB | betslp_lkabt | 160 | 2.67 | 赌桌书写思考动作 | | +| 949 | OTB | betslp_loop | 160 | 2.67 | 赌桌书写循环动作 | | +| 950 | OTB | betslp_out | 60 | 1.00 | 赌桌书写结束动作 | | +| 951 | OTB | betslp_tnk | 336 | 5.60 | 赌桌书写沉思动作 | | +| 952 | OTB | wtchrace_cmon | 300 | 5.00 | 赛马观战助威动作 | | +| 953 | OTB | wtchrace_in | 100 | 1.67 | 赛马观战起始动作 | | +| 954 | OTB | wtchrace_loop | 160 | 2.67 | 赛马观战循环动作 | | +| 955 | OTB | wtchrace_lose | 240 | 4.00 | 赛马赌输反应动作 | | +| 956 | OTB | wtchrace_out | 60 | 1.00 | 赛马观战结束动作 | | +| 957 | OTB | wtchrace_win | 260 | 4.33 | 赛马赌赢庆祝动作 | | +| 958 | PARACHUTE | FALL_skyDive | 80 | 1.33 | 高空跳伞动作 | | +| 959 | PARACHUTE | FALL_SkyDive_Accel | 80 | 1.33 | 跳伞加速动作 | | +| 960 | PARACHUTE | FALL_skyDive_DIE | 60 | 1.00 | 跳伞坠落死亡动画 | | +| 961 | PARACHUTE | FALL_SkyDive_L | 80 | 1.33 | 跳伞左向滑翔 | | +| 962 | PARACHUTE | FALL_SkyDive_R | 80 | 1.33 | 跳伞右向滑翔 | | +| 963 | PARACHUTE | PARA_decel | 120 | 2.00 | 降落伞屈膝减速 | | +| 964 | PARACHUTE | PARA_decel_O | 120 | 2.00 | 角色异常状态 | | +| 965 | PARACHUTE | PARA_float | 120 | 2.00 | 降落伞直腿滑翔 | | +| 966 | PARACHUTE | PARA_float_O | 120 | 2.00 | 角色异常状态 | | +| 967 | PARACHUTE | PARA_Land | 100 | 1.67 | 降落伞着陆动作 | | +| 968 | PARACHUTE | PARA_Land_O | 130 | 2.17 | 角色异常状态 | | +| 969 | PARACHUTE | PARA_Land_Water | 140 | 2.33 | 水上降落伞着陆 | | +| 970 | PARACHUTE | PARA_Land_Water_O | 130 | 2.17 | 角色异常状态 | | +| 971 | PARACHUTE | PARA_open | 170 | 2.83 | 降落伞开启动画 | | +| 972 | PARACHUTE | PARA_open_O | 140 | 2.33 | 角色异常状态 | | +| 973 | PARACHUTE | PARA_Rip_Land_O | 54 | 0.90 | 角色异常状态 | | +| 974 | PARACHUTE | PARA_Rip_Loop_O | 60 | 1.00 | 角色异常状态 | | +| 975 | PARACHUTE | PARA_Rip_O | 14 | 0.23 | 角色异常状态 | | +| 976 | PARACHUTE | PARA_steerL | 120 | 2.00 | 降落伞左向操控 | | +| 977 | PARACHUTE | PARA_steerL_O | 120 | 2.00 | 角色异常状态 | | +| 978 | PARACHUTE | PARA_steerR | 120 | 2.00 | 降落伞右向操控 | | +| 979 | PARACHUTE | PARA_steerR_O | 120 | 2.00 | 角色异常状态 | | +| 980 | PARK | Tai_Chi_in | 130 | 2.17 | 太极起势动作 | | +| 981 | PARK | Tai_Chi_Loop | 720 | 12.00 | 太极循环动作 | | +| 982 | PARK | Tai_Chi_Out | 50 | 0.83 | 太极收势动作 | | +| 983 | PAULNMAC | Piss_in | 540 | 9.00 | 小便起始动画 | | +| 984 | PAULNMAC | Piss_loop | 400 | 6.67 | 小便循环动作 | | +| 985 | PAULNMAC | Piss_out | 660 | 11.00 | 小便结束动画 | | +| 986 | PAULNMAC | PnM_Argue1_A | 260 | 4.33 | Paul 与 Maccer 争吵 | | +| 987 | PAULNMAC | PnM_Argue1_B | 260 | 4.33 | Paul 与 Maccer 争吵 | | +| 988 | PAULNMAC | PnM_Argue2_A | 260 | 4.33 | Paul 与 Maccer 争吵 | | +| 989 | PAULNMAC | PnM_Argue2_B | 260 | 4.33 | Paul 与 Maccer 争吵 | | +| 990 | PAULNMAC | PnM_Loop_A | 320 | 5.33 | Paul 与 Maccer 循环动作 | | +| 991 | PAULNMAC | PnM_Loop_B | 320 | 5.33 | Paul 与 Maccer 循环动作 | | +| 992 | PAULNMAC | wank_in | 440 | 7.33 | 自慰起始动作 | | +| 993 | PAULNMAC | wank_loop | 160 | 2.67 | 自慰循环动作 | | +| 994 | PAULNMAC | wank_out | 700 | 11.67 | 自慰结束动作 | | +| 995 | ped | abseil | 2 | 0.03 | 绳索垂降动作 | | +| 996 | ped | ARRESTgun | 40 | 0.67 | 持枪逮捕动作 | | +| 997 | ped | ATM | 730 | 12.17 | ATM 机使用动画 | | +| 998 | ped | BIKE_elbowL | 58 | 0.97 | 自行车左肘动作 | | +| 999 | ped | BIKE_elbowR | 58 | 0.97 | 自行车右肘动作 | | +| 1000 | ped | BIKE_fallR | 98 | 1.63 | 自行车右侧跌落动作 | | +| 1001 | ped | BIKE_fall_off | 64 | 1.07 | 自行车跌落动作 | | +| 1002 | ped | BIKE_pickupL | 64 | 1.07 | 左侧扶起自行车动作 | | +| 1003 | ped | BIKE_pickupR | 64 | 1.07 | 右侧扶起自行车动作 | | +| 1004 | ped | BIKE_pullupL | 60 | 1.00 | 左侧拉起自行车动作 | | +| 1005 | ped | BIKE_pullupR | 60 | 1.00 | 右侧拉起自行车动作 | | +| 1006 | ped | bomber | 36 | 0.60 | 投弹手动画 | | +| 1007 | ped | CAR_alignHI_LHS | 44 | 0.73 | 左侧高位校准车辆动作 | | +| 1008 | ped | CAR_alignHI_RHS | 44 | 0.73 | 右侧高位校准车辆动作 | | +| 1009 | ped | CAR_align_LHS | 8 | 0.13 | 左侧车辆校准动作 | | +| 1010 | ped | CAR_align_RHS | 8 | 0.13 | 右侧车辆校准动作 | | +| 1011 | ped | CAR_closedoorL_LHS | 36 | 0.60 | 左侧关闭车门动作 | | +| 1012 | ped | CAR_closedoorL_RHS | 24 | 0.40 | 右侧关闭车门动作 | | +| 1013 | ped | CAR_closedoor_LHS | 36 | 0.60 | 左侧关闭车门动作 | | +| 1014 | ped | CAR_closedoor_RHS | 24 | 0.40 | 右侧关闭车门动作 | | +| 1015 | ped | CAR_close_LHS | 44 | 0.73 | 左侧关闭车门动作 | | +| 1016 | ped | CAR_close_RHS | 44 | 0.73 | 右侧关闭车门动作 | | +| 1017 | ped | CAR_crawloutRHS | 130 | 2.17 | 右侧爬出翻覆车辆动作 | | +| 1018 | ped | CAR_dead_LHS | 2 | 0.03 | 左侧车内死亡状态 | | +| 1019 | ped | CAR_dead_RHS | 2 | 0.03 | 右侧车内死亡状态 | | +| 1020 | ped | CAR_doorlocked_LHS | 80 | 1.33 | 左侧车门上锁动作 | | +| 1021 | ped | CAR_doorlocked_RHS | 76 | 1.27 | 右侧车门上锁动作 | | +| 1022 | ped | CAR_fallout_LHS | 34 | 0.57 | 左侧紧急跳车动作 | | +| 1023 | ped | CAR_fallout_RHS | 34 | 0.57 | 右侧紧急跳车动作 | | +| 1024 | ped | CAR_getinL_LHS | 60 | 1.00 | 左侧进入车辆动作 | | +| 1025 | ped | CAR_getinL_RHS | 60 | 1.00 | 右侧进入车辆动作 | | +| 1026 | ped | CAR_getin_LHS | 60 | 1.00 | 左侧进入车辆动作 | | +| 1027 | ped | CAR_getin_RHS | 60 | 1.00 | 右侧进入车辆动作 | | +| 1028 | ped | CAR_getoutL_LHS | 56 | 0.93 | 左侧离开车辆动作 | | +| 1029 | ped | CAR_getoutL_RHS | 60 | 1.00 | 右侧离开车辆动作 | | +| 1030 | ped | CAR_getout_LHS | 68 | 1.13 | 左侧离开车辆动作 | | +| 1031 | ped | CAR_getout_RHS | 48 | 0.80 | 右侧离开车辆动作 | | +| 1032 | ped | car_hookertalk | 258 | 4.30 | 车内应召女郎对话动作 | | +| 1033 | ped | CAR_jackedLHS | 174 | 2.90 | 左侧劫车动作 | | +| 1034 | ped | CAR_jackedRHS | 206 | 3.43 | 右侧劫车动作 | | +| 1035 | ped | CAR_jumpin_LHS | 60 | 1.00 | 左侧跳入车辆动作 | | +| 1036 | ped | CAR_LB | 14 | 0.23 | 左侧车载射击动作 | | +| 1037 | ped | CAR_LB_pro | 6 | 0.10 | 专业左侧车载射击 | | +| 1038 | ped | CAR_LB_weak | 14 | 0.23 | 普通左侧车载射击 | | +| 1039 | ped | CAR_LjackedLHS | 214 | 3.57 | 左侧被劫车动作 | | +| 1040 | ped | CAR_LjackedRHS | 208 | 3.47 | 右侧被劫车动作 | | +| 1041 | ped | CAR_Lshuffle_RHS | 24 | 0.40 | 右侧座位调整动作 | | +| 1042 | ped | CAR_Lsit | 2 | 0.03 | 左侧车内坐姿 | | +| 1043 | ped | CAR_open_LHS | 66 | 1.10 | 左侧开启车门动作 | | +| 1044 | ped | CAR_open_RHS | 66 | 1.10 | 右侧开启车门动作 | | +| 1045 | ped | CAR_pulloutL_LHS | 176 | 2.93 | 左侧拖出乘客动作 | | +| 1046 | ped | CAR_pulloutL_RHS | 176 | 2.93 | 右侧拖出司机动作 | | +| 1047 | ped | CAR_pullout_LHS | 138 | 2.30 | 左侧拖出乘客动作 | | +| 1048 | ped | CAR_pullout_RHS | 168 | 2.80 | 右侧拖出乘客动作 | | +| 1049 | ped | CAR_Qjacked | 198 | 3.30 | 快速劫车动作 | | +| 1050 | ped | CAR_rolldoor | 36 | 0.60 | 滚动关闭车门动作 | | +| 1051 | ped | CAR_rolldoorLO | 36 | 0.60 | 低位滚动关闭车门 | | +| 1052 | ped | CAR_rollout_LHS | 98 | 1.63 | 左侧翻滚出车动作 | | +| 1053 | ped | CAR_rollout_RHS | 76 | 1.27 | 右侧翻滚出车动作 | | +| 1054 | ped | CAR_shuffle_RHS | 24 | 0.40 | 右侧座位调整动作 | | +| 1055 | ped | CAR_sit | 2 | 0.03 | 车内坐姿 | | +| 1056 | ped | CAR_sitp | 2 | 0.03 | 车内坐姿 | | +| 1057 | ped | CAR_sitpLO | 2 | 0.03 | 低位车内坐姿 | | +| 1058 | ped | CAR_sit_pro | 2 | 0.03 | 专业车内坐姿 | | +| 1059 | ped | CAR_sit_weak | 2 | 0.03 | 普通车内坐姿 | | +| 1060 | ped | CAR_tune_radio | 38 | 0.63 | 车内调频动作 | | +| 1061 | ped | CLIMB_idle | 48 | 0.80 | 攀爬待机姿势 | | +| 1062 | ped | CLIMB_jump | 34 | 0.57 | 跳跃攀附动作 | | +| 1063 | ped | CLIMB_jump2fall | 2 | 0.03 | 攀附坠落动作 | | +| 1064 | ped | CLIMB_jump_B | 58 | 0.97 | 翻越障碍动作 | | +| 1065 | ped | CLIMB_Pull | 52 | 0.87 | 攀爬牵引动作 | | +| 1066 | ped | CLIMB_Stand | 48 | 0.80 | 攀爬后站立动作 | | +| 1067 | ped | CLIMB_Stand_finish | 12 | 0.20 | 攀爬结束站立 | | +| 1068 | ped | cower | 48 | 0.80 | 畏缩防御姿势 | | +| 1069 | ped | Crouch_Roll_L | 56 | 0.93 | 左侧蹲姿翻滚 | | +| 1070 | ped | Crouch_Roll_R | 56 | 0.93 | 右侧蹲姿翻滚 | | +| 1071 | ped | DAM_armL_frmBK | 50 | 0.83 | 左臂后方受击反应 | | +| 1072 | ped | DAM_armL_frmFT | 50 | 0.83 | 左臂前方受击反应 | | +| 1073 | ped | DAM_armL_frmLT | 40 | 0.67 | 左臂侧向受击反应 | | +| 1074 | ped | DAM_armR_frmBK | 50 | 0.83 | 右臂后方受击反应 | | +| 1075 | ped | DAM_armR_frmFT | 30 | 0.50 | 右臂前方受击反应 | | +| 1076 | ped | DAM_armR_frmRT | 16 | 0.27 | 右臂侧向受击反应 | | +| 1077 | ped | DAM_LegL_frmBK | 50 | 0.83 | 左腿后方受击反应 | | +| 1078 | ped | DAM_LegL_frmFT | 50 | 0.83 | 左腿前方受击反应 | | +| 1079 | ped | DAM_LegL_frmLT | 50 | 0.83 | 左腿侧向受击反应 | | +| 1080 | ped | DAM_LegR_frmBK | 50 | 0.83 | 右腿后方受击反应 | | +| 1081 | ped | DAM_LegR_frmFT | 50 | 0.83 | 右腿前方受击反应 | | +| 1082 | ped | DAM_LegR_frmRT | 50 | 0.83 | 右腿侧向受击反应 | | +| 1083 | ped | DAM_stomach_frmBK | 50 | 0.83 | 腹部后方受击反应 | | +| 1084 | ped | DAM_stomach_frmFT | 50 | 0.83 | 腹部前方受击反应 | | +| 1085 | ped | DAM_stomach_frmLT | 50 | 0.83 | 腹部左侧受击反应 | | +| 1086 | ped | DAM_stomach_frmRT | 50 | 0.83 | 腹部右侧受击反应 | | +| 1087 | ped | DOOR_LHinge_O | 64 | 1.07 | 左侧车门异常动画 | | +| 1088 | ped | DOOR_RHinge_O | 64 | 1.07 | 右侧车门异常动画 | | +| 1089 | ped | DrivebyL_L | 12 | 0.20 | 左侧车载射击(左) | | +| 1090 | ped | DrivebyL_R | 12 | 0.20 | 左侧车载射击(右) | | +| 1091 | ped | Driveby_L | 12 | 0.20 | 左侧车载射击 | | +| 1092 | ped | Driveby_R | 12 | 0.20 | 右侧车载射击 | | +| 1093 | ped | DRIVE_BOAT | 2 | 0.03 | 船只驾驶状态 | | +| 1094 | ped | DRIVE_BOAT_back | 6 | 0.10 | 船只倒船动作 | | +| 1095 | ped | DRIVE_BOAT_L | 6 | 0.10 | 船只左转动作 | | +| 1096 | ped | DRIVE_BOAT_R | 6 | 0.10 | 船只右转动作 | | +| 1097 | ped | Drive_L | 8 | 0.13 | 车辆左转动作 | | +| 1098 | ped | Drive_LO_l | 8 | 0.13 | 低位车辆左转 | | +| 1099 | ped | Drive_LO_R | 8 | 0.13 | 低位车辆右转 | | +| 1100 | ped | Drive_L_pro | 8 | 0.13 | 专业级车辆左转 | | +| 1101 | ped | Drive_L_pro_slow | 8 | 0.13 | 专业级车辆左转慢速 | | +| 1102 | ped | Drive_L_slow | 8 | 0.13 | 车辆左转慢速 | | +| 1103 | ped | Drive_L_weak | 8 | 0.13 | 普通级车辆左转 | | +| 1104 | ped | Drive_L_weak_slow | 8 | 0.13 | 普通级车辆左转慢速 | | +| 1105 | ped | Drive_R | 8 | 0.13 | 车辆右转动作 | | +| 1106 | ped | Drive_R_pro | 8 | 0.13 | 专业级车辆右转 | | +| 1107 | ped | Drive_R_pro_slow | 8 | 0.13 | 专业级车辆右转慢速 | | +| 1108 | ped | Drive_R_slow | 8 | 0.13 | 车辆右转慢速 | | +| 1109 | ped | Drive_R_weak | 8 | 0.13 | 普通级车辆右转 | | +| 1110 | ped | Drive_R_weak_slow | 8 | 0.13 | 普通级车辆右转慢速 | | +| 1111 | ped | Drive_truck | 2 | 0.03 | 卡车驾驶状态 | | +| 1112 | ped | DRIVE_truck_back | 6 | 0.10 | 卡车倒车动作 | | +| 1113 | ped | DRIVE_truck_L | 8 | 0.13 | 卡车左转动作 | | +| 1114 | ped | DRIVE_truck_R | 8 | 0.13 | 卡车右转动作 | | +| 1115 | ped | Drown | 150 | 2.50 | 溺水挣扎动画 | | +| 1116 | ped | DUCK_cower | 48 | 0.80 | 蹲姿防御状态 | | +| 1117 | ped | endchat_01 | 120 | 2.00 | 对话结束动作 | | +| 1118 | ped | endchat_02 | 120 | 2.00 | 对话结束动作 | | +| 1119 | ped | endchat_03 | 140 | 2.33 | 挥手告别动作 | | +| 1120 | ped | EV_dive | 140 | 2.33 | 紧急侧扑闪避动作 | | +| 1121 | ped | EV_step | 64 | 1.07 | 紧急后撤步动作 | | +| 1122 | ped | facanger | 8 | 0.13 | 愤怒表情动画 | | +| 1123 | ped | facgum | 62 | 1.03 | 咀嚼口香糖动作 | | +| 1124 | ped | facsurp | 8 | 0.13 | 惊讶表情动画 | | +| 1125 | ped | facsurpm | 8 | 0.13 | 惊讶表情动画 | | +| 1126 | ped | factalk | 140 | 2.33 | 对话表情动画 | | +| 1127 | ped | facurios | 8 | 0.13 | 好奇表情动画 | | +| 1128 | ped | FALL_back | 44 | 0.73 | 仰面跌落动作 | | +| 1129 | ped | FALL_collapse | 60 | 1.00 | 低空跌落缓冲动作 | | +| 1130 | ped | FALL_fall | 44 | 0.73 | 自由跌落动画 | | +| 1131 | ped | FALL_front | 44 | 0.73 | 俯身跌落动作 | | +| 1132 | ped | FALL_glide | 48 | 0.80 | 滑翔跌落动作 | | +| 1133 | ped | FALL_land | 28 | 0.47 | 软着陆缓冲动作 | | +| 1134 | ped | FALL_skyDive | 80 | 1.33 | 高空跳伞动作 | | +| 1135 | ped | Fight2Idle | 20 | 0.33 | 战斗待机姿势 | | +| 1136 | ped | FightA_1 | 26 | 0.43 | 直拳攻击动作 | | +| 1137 | ped | FightA_2 | 46 | 0.77 | 勾拳攻击动作 | | +| 1138 | ped | FightA_3 | 52 | 0.87 | 摆拳攻击动作 | | +| 1139 | ped | FightA_block | 28 | 0.47 | 格挡防御动作 | | +| 1140 | ped | FightA_G | 56 | 0.93 | 倒地踢击动作 | | +| 1141 | ped | FightA_M | 24 | 0.40 | 冲刺攻击动作 | | +| 1142 | ped | FIGHTIDLE | 78 | 1.30 | 战斗待机姿势 | | +| 1143 | ped | FightShB | 28 | 0.47 | 战斗后撤步动作 | | +| 1144 | ped | FightShF | 32 | 0.53 | 战斗前进步动作 | | +| 1145 | ped | FightSh_BWD | 40 | 0.67 | 战斗后退移动 | | +| 1146 | ped | FightSh_FWD | 40 | 0.67 | 战斗前进移动 | | +| 1147 | ped | FightSh_Left | 40 | 0.67 | 战斗左移动作 | | +| 1148 | ped | FightSh_Right | 40 | 0.67 | 战斗右移动作 | | +| 1149 | ped | flee_lkaround_01 | 120 | 2.00 | 逃跑环顾动作 | | +| 1150 | ped | FLOOR_hit | 22 | 0.37 | 仰卧受击反应 | | +| 1151 | ped | FLOOR_hit_f | 24 | 0.40 | 俯卧受击反应 | | +| 1152 | ped | fucku | 80 | 1.33 | 竖中指侮辱动作 | | +| 1153 | ped | gang_gunstand | 2 | 0.03 | 帮派持枪待机 | | +| 1154 | ped | gas_cwr | 60 | 1.00 | 催泪瓦斯呛咳动作 | | +| 1155 | ped | getup | 82 | 1.37 | 起身动作 | | +| 1156 | ped | getup_front | 82 | 1.37 | 前向起身动作 | | +| 1157 | ped | gum_eat | 320 | 5.33 | 咀嚼口香糖循环 | | +| 1158 | ped | GunCrouchBwd | 60 | 1.00 | 持枪蹲姿后移 | | +| 1159 | ped | GunCrouchFwd | 44 | 0.73 | 持枪蹲姿前移 | | +| 1160 | ped | GunMove_BWD | 62 | 1.03 | 持枪后撤步动作 | | +| 1161 | ped | GunMove_FWD | 60 | 1.00 | 持枪前进动作 | | +| 1162 | ped | GunMove_L | 60 | 1.00 | 持枪左移动作 | | +| 1163 | ped | GunMove_R | 60 | 1.00 | 持枪右移动作 | | +| 1164 | ped | Gun_2_IDLE | 16 | 0.27 | 持步枪待机姿势 | | +| 1165 | ped | GUN_BUTT | 26 | 0.43 | 枪托砸击动作 | | +| 1166 | ped | GUN_BUTT_crouch | 26 | 0.43 | 蹲姿枪托砸击 | | +| 1167 | ped | Gun_stand | 2 | 0.03 | 持步枪站立待机 | | +| 1168 | ped | handscower | 116 | 1.93 | 双手护头后退动作 | | +| 1169 | ped | handsup | 36 | 0.60 | 举手投降动作 | | +| 1170 | ped | HitA_1 | 18 | 0.30 | 受击反应动作(轻) | | +| 1171 | ped | HitA_2 | 32 | 0.53 | 受击反应动作(中) | | +| 1172 | ped | HitA_3 | 34 | 0.57 | 受击反应动作(重) | | +| 1173 | ped | HIT_back | 30 | 0.50 | 背部受击反应 | | +| 1174 | ped | HIT_behind | 40 | 0.67 | 后方受击反应 | | +| 1175 | ped | HIT_front | 36 | 0.60 | 正面受击反应 | | +| 1176 | ped | HIT_GUN_BUTT | 30 | 0.50 | 枪托受击反应 | | +| 1177 | ped | HIT_L | 42 | 0.70 | 左侧受击反应 | | +| 1178 | ped | HIT_R | 36 | 0.60 | 右侧受击反应 | | +| 1179 | ped | HIT_walk | 20 | 0.33 | 行走中受击反应 | | +| 1180 | ped | HIT_wall | 42 | 0.70 | 撞击墙面动作 | | +| 1181 | ped | Idlestance_fat | 100 | 1.67 | 肥胖角色待机姿势 | | +| 1182 | ped | idlestance_old | 120 | 2.00 | 老年角色待机姿势 | | +| 1183 | ped | IDLE_armed | 88 | 1.47 | 持械待机姿势 | | +| 1184 | ped | IDLE_chat | 400 | 6.67 | 交谈手势循环 | | +| 1185 | ped | IDLE_csaw | 92 | 1.53 | 持电锯待机姿势 | | +| 1186 | ped | Idle_Gang1 | 100 | 1.67 | 帮派成员待机姿势 | | +| 1187 | ped | IDLE_HBHB | 160 | 2.67 | 观察物品待机姿势 | | +| 1188 | ped | IDLE_ROCKET | 94 | 1.57 | 持火箭筒待机姿势 | | +| 1189 | ped | IDLE_stance | 90 | 1.50 | 标准站立待机姿势 | | +| 1190 | ped | IDLE_taxi | 52 | 0.87 | 出租车招手动作 | | +| 1191 | ped | IDLE_tired | 60 | 1.00 | 疲惫喘息待机 | | +| 1192 | ped | Jetpack_Idle | 2 | 0.03 | 喷气背包待机状态 | | +| 1193 | ped | JOG_femaleA | 46 | 0.77 | 女性慢跑动作 | | +| 1194 | ped | JOG_maleA | 46 | 0.77 | 男性慢跑动作 | | +| 1195 | ped | JUMP_glide | 30 | 0.50 | 跳跃滑翔动作 | | +| 1196 | ped | JUMP_land | 14 | 0.23 | 跳跃着陆动作 | | +| 1197 | ped | JUMP_launch | 12 | 0.20 | 左腿起跳动作 | | +| 1198 | ped | JUMP_launch_R | 12 | 0.20 | 右腿起跳动作 | | +| 1199 | ped | KART_drive | 2 | 0.03 | 卡丁车驾驶状态 | | +| 1200 | ped | KART_L | 8 | 0.13 | 卡丁车左侧倾斜驾驶 | | +| 1201 | ped | KART_LB | 2 | 0.03 | 卡丁车驾驶状态 | | +| 1202 | ped | KART_R | 8 | 0.13 | 卡丁车右侧倾斜驾驶 | | +| 1203 | ped | KD_left | 54 | 0.90 | 爆炸中左侧死亡动画 | | +| 1204 | ped | KD_right | 54 | 0.90 | 爆炸中右侧死亡动画 | | +| 1205 | ped | KO_shot_face | 126 | 2.10 | 捂脸死亡动作 | | +| 1206 | ped | KO_shot_front | 34 | 0.57 | 前倾倒地死亡 | | +| 1207 | ped | KO_shot_stom | 190 | 3.17 | 捂腹死亡动作 | | +| 1208 | ped | KO_skid_back | 58 | 0.97 | 后滑倒地死亡 | | +| 1209 | ped | KO_skid_front | 68 | 1.13 | 前滑倒地死亡 | | +| 1210 | ped | KO_spin_L | 52 | 0.87 | 左旋倒地死亡 | | +| 1211 | ped | KO_spin_R | 56 | 0.93 | 右旋倒地死亡 | | +| 1212 | ped | pass_Smoke_in_car | 104 | 1.73 | 车内吸烟动作 | | +| 1213 | ped | phone_in | 140 | 2.33 | 接听电话起始动作 | | +| 1214 | ped | phone_out | 120 | 2.00 | 挂断电话动作 | | +| 1215 | ped | phone_talk | 120 | 2.00 | 通话交谈动作 | | +| 1216 | ped | Player_Sneak | 80 | 1.33 | 玩家潜行站立姿势 | | +| 1217 | ped | Player_Sneak_walkstart | 18 | 0.30 | 潜行移动起始动作 | | +| 1218 | ped | roadcross | 120 | 2.00 | 过马路左右观察动作 | | +| 1219 | ped | roadcross_female | 240 | 4.00 | 女性过马路观察动作 | | +| 1220 | ped | roadcross_gang | 120 | 2.00 | 帮派成员过马路观察 | | +| 1221 | ped | roadcross_old | 240 | 4.00 | 老人过马路观察动作 | | +| 1222 | ped | run_1armed | 46 | 0.77 | 单手持械奔跑 | | +| 1223 | ped | run_armed | 42 | 0.70 | 持突击步枪奔跑 | | +| 1224 | ped | run_civi | 44 | 0.73 | 市民慢跑动作 | | +| 1225 | ped | run_csaw | 42 | 0.70 | 持电锯奔跑动作 | | +| 1226 | ped | run_fat | 48 | 0.80 | 肥胖角色奔跑 | | +| 1227 | ped | run_fatold | 48 | 0.80 | 老年肥胖奔跑 | | +| 1228 | ped | run_gang1 | 50 | 0.83 | 帮派成员奔跑 | | +| 1229 | ped | run_left | 40 | 0.67 | 左侧位移奔跑 | | +| 1230 | ped | run_old | 48 | 0.80 | 老年男性奔跑 | | +| 1231 | ped | run_player | 44 | 0.73 | 玩家标准奔跑 | | +| 1232 | ped | run_right | 40 | 0.67 | 右侧位移奔跑 | | +| 1233 | ped | run_rocket | 46 | 0.77 | 持火箭筒奔跑 | | +| 1234 | ped | Run_stop | 52 | 0.87 | 奔跑急停动作 | | +| 1235 | ped | Run_stopR | 48 | 0.80 | 奔跑停止动作 | | +| 1236 | ped | Run_Wuzi | 46 | 0.77 | 前伸手臂奔跑姿势 | | +| 1237 | ped | SEAT_down | 90 | 1.50 | 就座动作 | | +| 1238 | ped | SEAT_idle | 120 | 2.00 | 坐姿待机 | | +| 1239 | ped | SEAT_up | 70 | 1.17 | 离座起身动作 | | +| 1240 | ped | SHOT_leftP | 18 | 0.30 | 左侧受击反应 | | +| 1241 | ped | SHOT_partial | 22 | 0.37 | 正面部分受击 | | +| 1242 | ped | SHOT_partial_B | 20 | 0.33 | 背部部分受击 | | +| 1243 | ped | SHOT_rightP | 20 | 0.33 | 右侧受击反应 | | +| 1244 | ped | Shove_Partial | 32 | 0.53 | 推搡动作 | | +| 1245 | ped | Smoke_in_car | 104 | 1.73 | 车内吸烟动作 | | +| 1246 | ped | sprint_civi | 32 | 0.53 | 市民冲刺动作 | | +| 1247 | ped | sprint_panic | 36 | 0.60 | NPC 恐慌冲刺 | | +| 1248 | ped | Sprint_Wuzi | 40 | 0.67 | 前伸手臂冲刺姿势 | | +| 1249 | ped | swat_run | 40 | 0.67 | 特警战术奔跑 | | +| 1250 | ped | Swim_Tread | 78 | 1.30 | 踩水待机动作 | | +| 1251 | ped | Tap_hand | 2 | 0.03 | 左侧车窗敲击动作 | | +| 1252 | ped | Tap_handP | 2 | 0.03 | 右侧车窗敲击动作 | | +| 1253 | ped | turn_180 | 38 | 0.63 | 180 度转身动作 | | +| 1254 | ped | Turn_L | 48 | 0.80 | 左转动作 | | +| 1255 | ped | Turn_R | 48 | 0.80 | 右转动作 | | +| 1256 | ped | WALK_armed | 64 | 1.07 | 持械慢行 | | +| 1257 | ped | WALK_civi | 68 | 1.13 | 市民慢走动作 | | +| 1258 | ped | WALK_csaw | 64 | 1.07 | 持电锯慢行 | | +| 1259 | ped | Walk_DoorPartial | 48 | 0.80 | 局部开门动作 | | +| 1260 | ped | WALK_drunk | 236 | 3.93 | 醉酒步态 | | +| 1261 | ped | WALK_fat | 80 | 1.33 | 肥胖角色行走 | | +| 1262 | ped | WALK_fatold | 70 | 1.17 | 老年肥胖行走 | | +| 1263 | ped | WALK_gang1 | 84 | 1.40 | 帮派成员行走 | | +| 1264 | ped | WALK_gang2 | 84 | 1.40 | 帮派成员行走 | | +| 1265 | ped | WALK_old | 84 | 1.40 | 老年角色行走 | | +| 1266 | ped | WALK_player | 72 | 1.20 | 玩家标准行走 | | +| 1267 | ped | WALK_rocket | 64 | 1.07 | 持火箭筒行走 | | +| 1268 | ped | WALK_shuffle | 72 | 1.20 | 蹒跚行走姿势 | | +| 1269 | ped | WALK_start | 16 | 0.27 | 行走起始动作 | | +| 1270 | ped | WALK_start_armed | 12 | 0.20 | 持械行走起始 | | +| 1271 | ped | WALK_start_csaw | 12 | 0.20 | 持电锯行走起始 | | +| 1272 | ped | WALK_start_rocket | 12 | 0.20 | 持火箭筒行走起始 | | +| 1273 | ped | Walk_Wuzi | 70 | 1.17 | 前伸手臂行走姿势 | | +| 1274 | ped | WEAPON_crouch | 48 | 0.80 | 持械蹲姿移动 | | +| 1275 | ped | woman_idlestance | 320 | 5.33 | 女性待机姿势 | | +| 1276 | ped | woman_run | 46 | 0.77 | 女性奔跑动画 | | +| 1277 | ped | WOMAN_runbusy | 40 | 0.67 | 忙碌女性奔跑 | | +| 1278 | ped | WOMAN_runfatold | 72 | 1.20 | 老年肥胖女性奔跑 | | +| 1279 | ped | woman_runpanic | 36 | 0.60 | 女性惊慌奔跑 | | +| 1280 | ped | WOMAN_runsexy | 42 | 0.70 | 性感女性奔跑 | | +| 1281 | ped | WOMAN_walkbusy | 60 | 1.00 | 忙碌女性行走 | | +| 1282 | ped | WOMAN_walkfatold | 72 | 1.20 | 老年肥胖女性行走 | | +| 1283 | ped | WOMAN_walknorm | 68 | 1.13 | 普通女性步态 | | +| 1284 | ped | WOMAN_walkold | 72 | 1.20 | 老年女性行走 | | +| 1285 | ped | WOMAN_walkpro | 80 | 1.33 | 性工作者步态 | | +| 1286 | ped | WOMAN_walksexy | 70 | 1.17 | 性感女性步态 | | +| 1287 | ped | WOMAN_walkshop | 58 | 0.97 | 女性购物步态 | | +| 1288 | ped | XPRESSscratch | 238 | 3.97 | 抓痒待机动作 | | +| 1289 | PLAYER_DVBYS | Plyr_DrivebyBwd | 50 | 0.83 | 玩家倒车射击 | | +| 1290 | PLAYER_DVBYS | Plyr_DrivebyFwd | 50 | 0.83 | 玩家前进射击 | | +| 1291 | PLAYER_DVBYS | Plyr_DrivebyLHS | 50 | 0.83 | 玩家左侧射击 | | +| 1292 | PLAYER_DVBYS | Plyr_DrivebyRHS | 50 | 0.83 | 玩家右侧射击 | | +| 1293 | PLAYIDLES | shift | 216 | 3.60 | CJ 换挡待机动画 | | +| 1294 | PLAYIDLES | shldr | 130 | 2.17 | CJ 耸肩待机动画 | | +| 1295 | PLAYIDLES | stretch | 276 | 4.60 | CJ 伸展待机动画 | | +| 1296 | PLAYIDLES | strleg | 220 | 3.67 | CJ 腿部拉伸待机 | | +| 1297 | PLAYIDLES | time | 312 | 5.20 | CJ 查看时间待机 | | +| 1298 | POLICE | CopTraf_Away | 88 | 1.47 | 交警指挥车辆离开 | | +| 1299 | POLICE | CopTraf_Come | 172 | 2.87 | 交警指挥车辆靠近 | | +| 1300 | POLICE | CopTraf_Left | 120 | 2.00 | 交警指挥左转交通 | | +| 1301 | POLICE | CopTraf_Stop | 120 | 2.00 | 交警指挥停车 | | +| 1302 | POLICE | COP_getoutcar_LHS | 50 | 0.83 | 警员左侧下车瞄准动作 | | +| 1303 | POLICE | Cop_move_FWD | 60 | 1.00 | 持枪前进巡逻动作 | | +| 1304 | POLICE | crm_drgbst_01 | 1114 | 18.57 | 被警员抛掷至车顶 | | +| 1305 | POLICE | Door_Kick | 80 | 1.33 | 破门踢击动作 | | +| 1306 | POLICE | plc_drgbst_01 | 1236 | 20.60 | 警员逮捕动作 | | +| 1307 | POLICE | plc_drgbst_02 | 454 | 7.57 | 警员搜查后备箱 | | +| 1308 | POOL | POOL_ChalkCue | 290 | 4.83 | 台球杆擦巧粉动作 | | +| 1309 | POOL | POOL_Idle_Stance | 120 | 2.00 | 持杆待机姿势 | | +| 1310 | POOL | POOL_Long_Shot | 100 | 1.67 | 长杆击球动作 | | +| 1311 | POOL | POOL_Long_Shot_O | 100 | 1.67 | 空白动画 | | +| 1312 | POOL | POOL_Long_Start | 40 | 0.67 | 长杆击球起始动作 | | +| 1313 | POOL | POOL_Long_Start_O | 40 | 0.67 | 空白动画 | | +| 1314 | POOL | POOL_Med_Shot | 100 | 1.67 | 中杆击球动作 | | +| 1315 | POOL | POOL_Med_Shot_O | 100 | 1.67 | 空白动画 | | +| 1316 | POOL | POOL_Med_Start | 40 | 0.67 | 中杆击球起始动作 | | +| 1317 | POOL | POOL_Med_Start_O | 40 | 0.67 | 空白动画 | | +| 1318 | POOL | POOL_Place_White | 150 | 2.50 | 放置白球动作 | | +| 1319 | POOL | POOL_Short_Shot | 100 | 1.67 | 短杆击球动作 | | +| 1320 | POOL | POOL_Short_Shot_O | 100 | 1.67 | 空白动画 | | +| 1321 | POOL | POOL_Short_Start | 40 | 0.67 | 短杆击球起始动作 | | +| 1322 | POOL | POOL_Short_Start_O | 40 | 0.67 | 空白动画 | | +| 1323 | POOL | POOL_Walk | 76 | 1.27 | 持杆行走动作 | | +| 1324 | POOL | POOL_Walk_Start | 12 | 0.20 | 持杆行走起始动作 | | +| 1325 | POOL | POOL_XLong_Shot | 100 | 1.67 | 超长杆击球动作 | | +| 1326 | POOL | POOL_XLong_Shot_O | 100 | 1.67 | 空白动画 | | +| 1327 | POOL | POOL_XLong_Start | 40 | 0.67 | 超长杆击球起始动作 | | +| 1328 | POOL | POOL_XLong_Start_O | 40 | 0.67 | 空白动画 | | +| 1329 | POOR | WINWASH_Start | 26 | 0.43 | 十字路口擦窗起始动作 | | +| 1330 | POOR | WINWASH_Wash2Beg | 128 | 2.13 | 十字路口持续擦窗动作 | | +| 1331 | PYTHON | python_crouchfire | 72 | 1.20 | 沙漠之鹰蹲姿射击 | | +| 1332 | PYTHON | python_crouchreload | 60 | 1.00 | 沙漠之鹰蹲姿换弹 | | +| 1333 | PYTHON | python_fire | 70 | 1.17 | 沙漠之鹰站立射击 | | +| 1334 | PYTHON | python_fire_poor | 88 | 1.47 | 沙漠之鹰低精度射击 | | +| 1335 | PYTHON | python_reload | 56 | 0.93 | 沙漠之鹰换弹动作 | | +| 1336 | QUAD | QUAD_back | 6 | 0.10 | 四轮摩托车后仰驾驶 | | +| 1337 | QUAD | QUAD_driveby_FT | 12 | 0.20 | 四轮摩托车前向飞车射击 | | +| 1338 | QUAD | QUAD_driveby_LHS | 12 | 0.20 | 四轮摩托车左侧飞车射击 | | +| 1339 | QUAD | QUAD_driveby_RHS | 12 | 0.20 | 四轮摩托车右侧飞车射击 | | +| 1340 | QUAD | QUAD_FWD | 12 | 0.20 | 四轮摩托车前倾驾驶 | | +| 1341 | QUAD | QUAD_getoff_B | 98 | 1.63 | 四轮摩托车高速跌落动作 | | +| 1342 | QUAD | QUAD_getoff_LHS | 40 | 0.67 | 左侧离开四轮摩托车 | | +| 1343 | QUAD | QUAD_getoff_RHS | 42 | 0.70 | 右侧离开四轮摩托车 | | +| 1344 | QUAD | QUAD_geton_LHS | 44 | 0.73 | 左侧登上四轮摩托车 | | +| 1345 | QUAD | QUAD_geton_RHS | 44 | 0.73 | 右侧登上四轮摩托车 | | +| 1346 | QUAD | QUAD_hit | 2 | 0.03 | 四轮摩托车受击状态 | | +| 1347 | QUAD | QUAD_kick | 68 | 1.13 | 前向登上四轮摩托车 | | +| 1348 | QUAD | QUAD_Left | 8 | 0.13 | 四轮摩托车左倾驾驶 | | +| 1349 | QUAD | QUAD_passenger | 2 | 0.03 | 四轮摩托车乘客坐姿 | | +| 1350 | QUAD | QUAD_reverse | 10 | 0.17 | 四轮摩托车倒车驾驶 | | +| 1351 | QUAD | QUAD_ride | 2 | 0.03 | 四轮摩托车驾驶状态 | | +| 1352 | QUAD | QUAD_Right | 8 | 0.13 | 四轮摩托车右倾驾驶 | | +| 1353 | QUAD_DBZ | Pass_Driveby_BWD | 50 | 0.83 | 四轮摩托车乘客后向射击 | | +| 1354 | QUAD_DBZ | Pass_Driveby_FWD | 50 | 0.83 | 四轮摩托车乘客前向射击 | | +| 1355 | QUAD_DBZ | Pass_Driveby_LHS | 50 | 0.83 | 四轮摩托车乘客左侧射击 | | +| 1356 | QUAD_DBZ | Pass_Driveby_RHS | 50 | 0.83 | 四轮摩托车乘客右侧射击 | | +| 1357 | RAPPING | Laugh_01 | 320 | 5.33 | 说唱大笑动作 | | +| 1358 | RAPPING | RAP_A_IN | 50 | 0.83 | 说唱 A 段起始 | | +| 1359 | RAPPING | RAP_A_Loop | 160 | 2.67 | 说唱 A 段循环 | | +| 1360 | RAPPING | RAP_A_OUT | 20 | 0.33 | 说唱 A 段结束 | | +| 1361 | RAPPING | RAP_B_IN | 60 | 1.00 | 说唱 B 段起始 | | +| 1362 | RAPPING | RAP_B_Loop | 160 | 2.67 | 说唱 B 段循环 | | +| 1363 | RAPPING | RAP_B_OUT | 52 | 0.87 | 说唱 B 段结束 | | +| 1364 | RAPPING | RAP_C_Loop | 180 | 3.00 | 说唱 C 段循环 | | +| 1365 | RIFLE | RIFLE_crouchfire | 52 | 0.87 | 步枪蹲姿射击 | | +| 1366 | RIFLE | RIFLE_crouchload | 76 | 1.27 | 步枪蹲姿换弹 | | +| 1367 | RIFLE | RIFLE_fire | 48 | 0.80 | 步枪站立射击 | | +| 1368 | RIFLE | RIFLE_fire_poor | 48 | 0.80 | 步枪低精度射击 | | +| 1369 | RIFLE | RIFLE_load | 84 | 1.40 | 步枪换弹动作 | | +| 1370 | RIOT | RIOT_ANGRY | 300 | 5.00 | 暴动愤怒状态 | | +| 1371 | RIOT | RIOT_ANGRY_B | 38 | 0.63 | 暴动愤怒状态 B 型 | | +| 1372 | RIOT | RIOT_challenge | 194 | 3.23 | 暴动挑衅动作 | | +| 1373 | RIOT | RIOT_CHANT | 104 | 1.73 | 暴动口号呼喊 | | +| 1374 | RIOT | RIOT_FUKU | 40 | 0.67 | 暴动竖中指动作 | | +| 1375 | RIOT | RIOT_PUNCHES | 40 | 0.67 | 暴动挥拳动作 | | +| 1376 | RIOT | RIOT_shout | 60 | 1.00 | 暴动高声呼喊 | | +| 1377 | ROB_BANK | CAT_Safe_End | 30 | 0.50 | 保险柜开启结束动作 | | +| 1378 | ROB_BANK | CAT_Safe_Open | 200 | 3.33 | 保险柜开启动作 | | +| 1379 | ROB_BANK | CAT_Safe_Open_O | 200 | 3.33 | 保险柜开启动作 | | +| 1380 | ROB_BANK | CAT_Safe_Rob | 110 | 1.83 | 保险柜抢劫动作 | | +| 1381 | ROB_BANK | SHP_HandsUp_Scr | 40 | 0.67 | 缓慢放下双手动作 | | +| 1382 | ROCKET | idle_rocket | 96 | 1.60 | 火箭筒待机姿势 | | +| 1383 | ROCKET | RocketFire | 58 | 0.97 | 火箭筒发射动作 | | +| 1384 | ROCKET | run_rocket | 46 | 0.77 | 持火箭筒奔跑 | | +| 1385 | ROCKET | walk_rocket | 64 | 1.07 | 持火箭筒行走 | | +| 1386 | ROCKET | WALK_start_rocket | 12 | 0.20 | 持火箭筒行走起始 | | +| 1795 | RUNNINGMAN | Dance_B1 | 32 | 0.53 | 低质版"好莱坞摇摆舞" | | +| 1796 | RUNNINGMAN | Dance_B2 | 34 | 0.57 | 低质版"好莱坞摇摆舞" | | +| 1797 | RUNNINGMAN | Dance_B3 | 32 | 0.53 | 低质版"好莱坞摇摆舞" | | +| 1798 | RUNNINGMAN | Dance_B4 | 34 | 0.57 | 低质版"好莱坞摇摆舞" | | +| 1799 | RUNNINGMAN | Dance_B5 | 32 | 0.53 | 低质版"好莱坞摇摆舞" | | +| 1800 | RUNNINGMAN | Dance_B6 | 34 | 0.57 | 低质版"好莱坞摇摆舞" | | +| 1801 | RUNNINGMAN | Dance_B7 | 32 | 0.53 | 低质版"好莱坞摇摆舞" | | +| 1802 | RUNNINGMAN | Dance_B8 | 34 | 0.57 | 低质版"好莱坞摇摆舞" | | +| 1803 | RUNNINGMAN | Dance_B9 | 32 | 0.53 | 低质版"好莱坞摇摆舞" | | +| 1804 | RUNNINGMAN | Dance_B10 | 34 | 0.57 | 低质版"好莱坞摇摆舞" | | +| 1805 | RUNNINGMAN | Dance_B11 | 32 | 0.53 | 低质版"好莱坞摇摆舞" | | +| 1806 | RUNNINGMAN | Dance_B12 | 34 | 0.57 | 低质版"好莱坞摇摆舞" | | +| 1807 | RUNNINGMAN | Dance_B13 | 32 | 0.53 | 低质版"好莱坞摇摆舞" | | +| 1808 | RUNNINGMAN | Dance_B14 | 34 | 0.57 | 低质版"好莱坞摇摆舞" | | +| 1809 | RUNNINGMAN | Dance_B15 | 32 | 0.53 | 低质版"好莱坞摇摆舞" | | +| 1810 | RUNNINGMAN | Dance_B16 | 34 | 0.57 | 低质版"好莱坞摇摆舞" | | +| 1779 | RUNNINGMAN | Dance_G1 | 32 | 0.53 | 标准版"好莱坞摇摆舞" | | +| 1780 | RUNNINGMAN | Dance_G2 | 34 | 0.57 | 标准版"好莱坞摇摆舞" | | +| 1781 | RUNNINGMAN | Dance_G3 | 32 | 0.53 | 标准版"好莱坞摇摆舞" | | +| 1782 | RUNNINGMAN | Dance_G4 | 34 | 0.57 | 标准版"好莱坞摇摆舞" | | +| 1783 | RUNNINGMAN | Dance_G5 | 32 | 0.53 | 标准版"好莱坞摇摆舞" | | +| 1784 | RUNNINGMAN | Dance_G6 | 34 | 0.57 | 标准版"好莱坞摇摆舞" | | +| 1785 | RUNNINGMAN | Dance_G7 | 32 | 0.53 | 标准版"好莱坞摇摆舞" | | +| 1786 | RUNNINGMAN | Dance_G8 | 34 | 0.57 | 标准版"好莱坞摇摆舞" | | +| 1787 | RUNNINGMAN | Dance_G9 | 32 | 0.53 | 标准版"好莱坞摇摆舞" | | +| 1788 | RUNNINGMAN | Dance_G10 | 34 | 0.57 | 标准版"好莱坞摇摆舞" | | +| 1789 | RUNNINGMAN | Dance_G11 | 32 | 0.53 | 标准版"好莱坞摇摆舞" | | +| 1790 | RUNNINGMAN | Dance_G12 | 34 | 0.57 | 标准版"好莱坞摇摆舞" | | +| 1791 | RUNNINGMAN | Dance_G13 | 32 | 0.53 | 标准版"好莱坞摇摆舞" | | +| 1792 | RUNNINGMAN | Dance_G14 | 34 | 0.57 | 标准版"好莱坞摇摆舞" | | +| 1793 | RUNNINGMAN | Dance_G15 | 32 | 0.53 | 标准版"好莱坞摇摆舞" | | +| 1794 | RUNNINGMAN | Dance_G16 | 34 | 0.57 | 标准版"好莱坞摇摆舞" | | +| 1811 | RUNNINGMAN | dance_loop | 70 | 1.17 | 舞蹈循环动作 | | +| 1387 | RUSTLER | Plane_align_LHS | 44 | 0.73 | 左侧进入飞机动作 | | +| 1388 | RUSTLER | Plane_close | 24 | 0.40 | 关闭飞机舱门动作 | | +| 1389 | RUSTLER | Plane_getin | 48 | 0.80 | 进入飞机动作 | | +| 1390 | RUSTLER | Plane_getout | 94 | 1.57 | 离开飞机动作 | | +| 1391 | RUSTLER | Plane_open | 42 | 0.70 | 开启飞机舱门动作 | | +| 1392 | RYDER | RYD_Beckon_01 | 74 | 1.23 | 召唤手势 01 | | +| 1393 | RYDER | RYD_Beckon_02 | 60 | 1.00 | 卡车倒车指示手势 | | +| 1394 | RYDER | RYD_Beckon_03 | 64 | 1.07 | 卡车倒车指示手势 | | +| 1395 | RYDER | RYD_Die_PT1 | 240 | 4.00 | Ryder 死亡动画第一部分 | | +| 1396 | RYDER | RYD_Die_PT2 | 476 | 7.93 | Ryder 死亡动画第二部分 | | +| 1397 | RYDER | Van_Crate_L | 40 | 0.67 | 左侧持箱动作 | | +| 1398 | RYDER | Van_Crate_R | 40 | 0.67 | 右侧持箱动作 | | +| 1399 | RYDER | Van_Fall_L | 28 | 0.47 | 货车左侧跌落动作 | | +| 1400 | RYDER | Van_Fall_R | 56 | 0.93 | 货车右侧跌落动作 | | +| 1401 | RYDER | Van_Lean_L | 40 | 0.67 | 货车左侧倚靠动作 | | +| 1402 | RYDER | Van_Lean_R | 40 | 0.67 | 货车右侧倚靠动作 | | +| 1403 | RYDER | VAN_PickUp_E | 110 | 1.83 | 转身拾取货箱动作 | | +| 1404 | RYDER | VAN_PickUp_S | 90 | 1.50 | 180 度转身拾取货箱 | | +| 1405 | RYDER | Van_Stand | 40 | 0.67 | 货车侧立待机姿势 | | +| 1406 | RYDER | Van_Stand_Crate | 40 | 0.67 | 持箱货车侧立姿势 | | +| 1407 | RYDER | Van_Throw | 82 | 1.37 | 投掷货箱动作 | | +| 1812 | SAMP | FishingIdle | | | 垂钓待机动画 | 新增于 SA-MP 0.3.7 | +| 1408 | SCRATCHING | scdldlp | 40 | 0.67 | DJ 搓盘动作(左手低位) | | +| 1409 | SCRATCHING | scdlulp | 40 | 0.67 | DJ 搓盘动作(左手上扬) | | +| 1410 | SCRATCHING | scdrdlp | 40 | 0.67 | DJ 搓盘动作(右手扶头) | | +| 1411 | SCRATCHING | scdrulp | 40 | 0.67 | DJ 搓盘动作(右手上扬) | | +| 1412 | SCRATCHING | sclng_l | 60 | 1.00 | 长搓盘动作(左侧) | | +| 1413 | SCRATCHING | sclng_r | 60 | 1.00 | 长搓盘动作(右侧) | | +| 1414 | SCRATCHING | scmid_l | 28 | 0.47 | 中速搓盘(左侧) | | +| 1415 | SCRATCHING | scmid_r | 28 | 0.47 | 中速搓盘(右侧) | | +| 1416 | SCRATCHING | scshrtl | 12 | 0.20 | 快速搓盘(左侧) | | +| 1417 | SCRATCHING | scshrtr | 12 | 0.20 | 快速搓盘(右侧) | | +| 1418 | SCRATCHING | sc_ltor | 40 | 0.67 | 左右交叉搓盘动作 | | +| 1419 | SCRATCHING | sc_rtol | 40 | 0.67 | 右左交叉搓盘动作 | | +| no | SEX | SEX_1to2_P | 60 | 1.00 | 男性从鹰式变换到蝶式体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_1to2_W | 60 | 1.00 | 女性从鹰式变换到蝶式体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_1_Cum_P | 400 | 6.67 | 男性高潮动画 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_1_Cum_W | 400 | 6.67 | 女性高潮动画 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_1_Fail_P | 320 | 5.33 | 男性鹰式体位(失败状态) | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_1_Fail_W | 320 | 5.33 | 女性鹰式体位(失败状态) | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_1_P | 20 | 0.33 | 男性鹰式基本体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_1_W | 20 | 0.33 | 女性鹰式基本体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_2to3_P | 90 | 1.50 | 男性从蝶式变换到后入式体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_2to3_W | 90 | 1.50 | 女性从蝶式变换到后入式体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_2_Fail_P | 380 | 6.33 | 男性蝶式体位(失败状态) | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_2_Fail_W | 380 | 6.33 | 女性蝶式体位(失败状态) | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_2_P | 20 | 0.33 | 男性蝶式基本体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_2_W | 20 | 0.33 | 女性蝶式基本体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_3to1_P | 60 | 1.00 | 男性从后入式变换到鹰式体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_3to1_W | 60 | 1.00 | 女性从后入式变换到鹰式体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_3_Fail_P | 260 | 4.33 | 男性后入式体位(失败状态) | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_3_Fail_W | 260 | 4.33 | 女性后入式体位(失败状态) | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_3_P | 20 | 0.33 | 男性后入式基本体位 | 在 SA-MP 中被屏蔽 | +| no | SEX | SEX_3_W | 20 | 0.33 | 女性后入式基本体位 | 在 SA-MP 中被屏蔽 | +| 1420 | SHAMAL | SHAMAL_align | 12 | 0.20 | 调整姿势进入 Shamal 飞机 | | +| 1421 | SHAMAL | SHAMAL_getin_LHS | 84 | 1.40 | 从左侧进入 Shamal 飞机 | | +| 1422 | SHAMAL | SHAMAL_getout_LHS | 82 | 1.37 | 从左侧离开 Shamal 飞机 | | +| 1423 | SHAMAL | SHAMAL_open | 36 | 0.60 | 打开 Shamal 舱门 | | +| 1424 | SHOP | ROB_2Idle | 70 | 1.17 | 抢劫待机动画 | | +| 1425 | SHOP | ROB_Loop | 160 | 2.67 | 抢劫循环动作 | | +| 1426 | SHOP | ROB_Loop_Threat | 120 | 2.00 | 持枪威胁循环动作 | | +| 1427 | SHOP | ROB_Shifty | 340 | 5.67 | 戴上面罩的隐蔽动作 | | +| 1428 | SHOP | ROB_StickUp_In | 32 | 0.53 | 开始持枪威胁动画 | | +| 1429 | SHOP | SHP_Duck | 40 | 0.67 | 柜台躲避动画 | | +| 1430 | SHOP | SHP_Duck_Aim | 20 | 0.33 | 躲避时瞄准动作 | | +| 1431 | SHOP | SHP_Duck_Fire | 50 | 0.83 | 躲避时射击动作 | | +| 1432 | SHOP | SHP_Gun_Aim | 38 | 0.63 | 持枪瞄准姿势 | | +| 1433 | SHOP | SHP_Gun_Duck | 30 | 0.50 | 持枪下蹲姿势 | | +| 1434 | SHOP | SHP_Gun_Fire | 52 | 0.87 | 持枪射击动作 | | +| 1435 | SHOP | SHP_Gun_Grab | 52 | 0.87 | 从柜台抢夺枪支动作 | | +| 1436 | SHOP | SHP_Gun_Threat | 50 | 0.83 | 持枪威胁姿势 | | +| 1437 | SHOP | SHP_HandsUp_Scr | 40 | 0.67 | 举手投降动作 | | +| 1438 | SHOP | SHP_Jump_Glide | 20 | 0.33 | 抬脚准备跳跃动作 | | +| 1439 | SHOP | SHP_Jump_Land | 42 | 0.70 | 跳上柜台并持枪瞄准动作 | | +| 1440 | SHOP | SHP_Jump_Launch | 34 | 0.57 | 持枪跳跃柜台动作 | | +| 1441 | SHOP | SHP_Rob_GiveCash | 230 | 3.83 | 店员递交现金动作 | | +| 1442 | SHOP | SHP_Rob_HandsUp | 160 | 2.67 | 店员举手投降动作 | | +| 1443 | SHOP | SHP_Rob_React | 160 | 2.67 | 对持枪威胁的反应动作 | | +| 1444 | SHOP | SHP_Serve_End | 330 | 5.50 | 结束商店服务动画 | | +| 1445 | SHOP | SHP_Serve_Idle | 300 | 5.00 | 商店服务待机动画 | | +| 1446 | SHOP | SHP_Serve_Loop | 250 | 4.17 | 收银机点钞循环动作 | | +| 1447 | SHOP | SHP_Serve_Start | 80 | 1.33 | 开始服务动画 | | +| 1448 | SHOP | Smoke_RYD | 400 | 6.67 | 倚靠抽烟动作 | | +| 1449 | SHOTGUN | shotgun_crouchfire | 88 | 1.47 | 霰弹枪蹲姿射击 | | +| 1450 | SHOTGUN | shotgun_fire | 88 | 1.47 | 霰弹枪站立射击 | | +| 1451 | SHOTGUN | shotgun_fire_poor | 90 | 1.50 | 低熟练度霰弹枪射击 | | +| 1452 | SILENCED | CrouchReload | 60 | 1.00 | 消音手枪蹲姿换弹 | | +| 1453 | SILENCED | SilenceCrouchfire | 56 | 0.93 | 消音手枪蹲姿射击 | | +| 1454 | SILENCED | Silence_fire | 52 | 0.87 | 消音手枪站立射击 | | +| 1455 | SILENCED | Silence_reload | 56 | 0.93 | 消音手枪站立换弹 | | +| 1456 | SKATE | skate_idle | 60 | 1.00 | 轮滑待机姿势 | | +| 1457 | SKATE | skate_run | 50 | 0.83 | 轮滑滑行动作 | | +| 1458 | SKATE | skate_sprint | 40 | 0.67 | 轮滑冲刺动作 | | +| 1459 | SMOKING | F_smklean_loop | 240 | 4.00 | 女性倚靠抽烟循环动作 | | +| 1460 | SMOKING | M_smklean_loop | 300 | 5.00 | 男性倚靠抽烟循环动作 | | +| 1461 | SMOKING | M_smkstnd_loop | 320 | 5.33 | 男性站立抽烟循环动作 | | +| 1462 | SMOKING | M_smk_drag | 220 | 3.67 | 吸烟吞吐动作 | | +| 1463 | SMOKING | M_smk_in | 400 | 6.67 | 开始抽烟动作 | | +| 1464 | SMOKING | M_smk_loop | 200 | 3.33 | 抽烟循环动作 | | +| 1465 | SMOKING | M_smk_out | 180 | 3.00 | 结束抽烟动作 | | +| 1466 | SMOKING | M_smk_tap | 180 | 3.00 | 轻弹烟灰动作 | | +| 1467 | SNIPER | WEAPON_sniper | 88 | 1.47 | 狙击步枪瞄准姿势 | | +| no | SnM | SnM_Caned_Idle_P | 120 | 2.00 | 男性 90 度弯腰准备受杖姿势 | | +| no | SnM | SnM_Caned_Idle_W | 120 | 2.00 | 女性持杖准备施罚姿势 | | +| no | SnM | SnM_Caned_P | 80 | 1.33 | 男性受杖惩罚姿势 | | +| no | SnM | SnM_Caned_W | 80 | 1.33 | 女性实施杖罚姿势 | | +| no | SnM | SnM_Cane_Idle_P | 120 | 2.00 | 男性持杖待机姿势 | | +| no | SnM | SnM_Cane_Idle_W | 120 | 2.00 | 女性 90 度弯腰准备受杖姿势 | | +| no | SnM | SnM_Cane_P | 80 | 1.33 | 男性实施杖罚动作 | | +| no | SnM | SnM_Cane_W | 80 | 1.33 | 女性受杖惩罚姿势 | | +| no | SnM | SpankedP | 80 | 1.33 | 男性受打屁股惩罚姿势 | | +| no | SnM | SpankedW | 80 | 1.33 | 女性实施打屁股动作 | | +| no | SnM | Spanked_IdleP | 80 | 1.33 | 男性准备被打屁股姿势 | | +| no | SnM | Spanked_IdleW | 80 | 1.33 | 女性准备打屁股姿势 | | +| no | SnM | SpankingP | 80 | 1.33 | 男性实施打屁股动作 | | +| no | SnM | SpankingW | 80 | 1.33 | 女性受打屁股惩罚姿势 | | +| no | SnM | Spanking_endP | 400 | 6.67 | 男性结束打屁股动作 | | +| no | SnM | Spanking_endW | 400 | 6.67 | 女性结束被打屁股动作 | | +| no | SnM | Spanking_IdleP | 80 | 1.33 | 男性打屁股准备姿势 | | +| no | SnM | Spanking_IdleW | 80 | 1.33 | 女性准备被打屁股姿势 | | +| no | SnM | Spanking_SittingIdleP | 80 | 1.33 | 男性坐姿打屁股准备 | | +| no | SnM | Spanking_SittingIdleW | 80 | 1.33 | 女性跪姿准备被打屁股 | | +| no | SnM | Spanking_SittingP | 60 | 1.00 | 男性坐姿打屁股动作 | | +| no | SnM | Spanking_SittingW | 60 | 1.00 | 女性跪姿受打屁股惩罚 | | +| 1468 | SPRAYCAN | spraycan_fire | 140 | 2.33 | 使用喷漆罐喷涂动作 | | +| 1469 | SPRAYCAN | spraycan_full | 270 | 4.50 | 取出喷漆罐完整动作 | | +| 1470 | STRIP | PLY_CASH | 100 | 1.67 | 玩家为舞女撒钱动作 | | +| 1471 | STRIP | PUN_CASH | 200 | 3.33 | 大额撒钱动作 | | +| 1472 | STRIP | PUN_HOLLER | 300 | 5.00 | 对舞女欢呼动作 | | +| 1473 | STRIP | PUN_LOOP | 116 | 1.93 | 观看脱衣舞循环动作 | | +| 1474 | STRIP | strip_A | 124 | 2.07 | 脱衣舞 A 型动作 | | +| 1475 | STRIP | strip_B | 60 | 1.00 | 脱衣舞 B 型动作 | | +| 1476 | STRIP | strip_C | 58 | 0.97 | 脱衣舞 C 型动作 | | +| 1477 | STRIP | strip_D | 114 | 1.90 | 脱衣舞 D 型动作 | | +| 1478 | STRIP | strip_E | 200 | 3.33 | 脱衣舞 E 型动作 | | +| 1479 | STRIP | strip_F | 62 | 1.03 | 脱衣舞 F 型动作 | | +| 1480 | STRIP | strip_G | 136 | 2.27 | 脱衣舞 G 型动作 | | +| 1481 | STRIP | STR_A2B | 240 | 4.00 | 脱衣舞 A 转 B 型过渡动作 | | +| 1482 | STRIP | STR_B2A | 30 | 0.50 | 脱衣舞 B 转 A 型过渡动作 | | +| 1483 | STRIP | STR_B2C | 300 | 5.00 | 脱衣舞 B 转 C 型过渡动作 | | +| 1484 | STRIP | STR_C1 | 360 | 6.00 | 脱衣舞 C1 型动作 | | +| 1485 | STRIP | STR_C2 | 360 | 6.00 | 脱衣舞 C2 型动作 | | +| 1486 | STRIP | STR_C2B | 60 | 1.00 | 脱衣舞 C 转 B 型过渡动作 | | +| 1487 | STRIP | STR_Loop_A | 60 | 1.00 | 脱衣舞 A 型循环动作 | | +| 1488 | STRIP | STR_Loop_B | 120 | 2.00 | 脱衣舞 B 型循环动作 | | +| 1489 | STRIP | STR_Loop_C | 180 | 3.00 | 脱衣舞 C 型循环动作 | | +| 1490 | SUNBATHE | batherdown | 236 | 3.93 | 躺下进行日光浴 | | +| 1491 | SUNBATHE | batherup | 738 | 12.30 | 日光浴后起身动作 | | +| 1492 | SUNBATHE | Lay_Bac_in | 140 | 2.33 | 男性开始日光浴动作 | | +| 1493 | SUNBATHE | Lay_Bac_out | 180 | 3.00 | 男性结束日光浴动作 | | +| 1494 | SUNBATHE | ParkSit_M_IdleA | 200 | 3.33 | 男性公园坐姿待机 A 型 | | +| 1495 | SUNBATHE | ParkSit_M_IdleB | 160 | 2.67 | 男性公园坐姿待机 B 型 | | +| 1496 | SUNBATHE | ParkSit_M_IdleC | 260 | 4.33 | 男性公园坐姿待机 C 型 | | +| 1497 | SUNBATHE | ParkSit_M_in | 140 | 2.33 | 开始公园坐姿动画 | | +| 1498 | SUNBATHE | ParkSit_M_out | 120 | 2.00 | 结束公园坐姿动画 | | +| 1499 | SUNBATHE | ParkSit_W_idleA | 200 | 3.33 | 女性公园坐姿待机 A 型 | | +| 1500 | SUNBATHE | ParkSit_W_idleB | 300 | 5.00 | 女性公园坐姿待机 B 型 | | +| 1501 | SUNBATHE | ParkSit_W_idleC | 180 | 3.00 | 女性公园坐姿待机 C 型 | | +| 1502 | SUNBATHE | ParkSit_W_in | 240 | 4.00 | 开始女性公园坐姿动画 | | +| 1503 | SUNBATHE | ParkSit_W_out | 160 | 2.67 | 结束女性公园坐姿动画 | | +| 1504 | SUNBATHE | SBATHE_F_LieB2Sit | 100 | 1.67 | 从躺姿转换为坐姿 | | +| 1505 | SUNBATHE | SBATHE_F_Out | 120 | 2.00 | 从坐姿转换为站姿 | | +| 1506 | SUNBATHE | SitnWait_in_W | 280 | 4.67 | 开始坐姿等待动画 | | +| 1507 | SUNBATHE | SitnWait_out_W | 160 | 2.67 | 结束坐姿等待动画 | | +| 1508 | SWAT | gnstwall_injurd | 120 | 2.00 | 受伤靠墙动画 | | +| 1509 | SWAT | JMP_Wall1m_180 | 70 | 1.17 | 跳跃矮墙并 180 度转身 | | +| 1510 | SWAT | Rail_fall | 180 | 3.00 | 从栏杆跌落动画 | | +| 1511 | SWAT | Rail_fall_crawl | 340 | 5.67 | 地面爬行濒死状态 | | +| 1512 | SWAT | swt_breach_01 | 328 | 5.47 | 特警破门动作 01 型 | | +| 1513 | SWAT | swt_breach_02 | 320 | 5.33 | 特警破门动作 02 型 | | +| 1514 | SWAT | swt_breach_03 | 258 | 4.30 | 特警破门动作 03 型 | | +| 1515 | SWAT | swt_go | 100 | 1.67 | 特警推进指令动作 | | +| 1516 | SWAT | swt_lkt | 180 | 3.00 | 特警后方警戒指令 | | +| 1517 | SWAT | swt_sty | 70 | 1.17 | 特警待命指令动作 | | +| 1518 | SWAT | swt_vent_01 | 284 | 4.73 | 通风管跳下动作(头朝下) | | +| 1519 | SWAT | swt_vent_02 | 266 | 4.43 | 通风管跳下动作(脚朝下) | | +| 1520 | SWAT | swt_vnt_sht_die | 40 | 0.67 | 通风管中弹死亡动画 | | +| 1521 | SWAT | swt_vnt_sht_in | 96 | 1.60 | 从通风管探头观察动作 | | +| 1522 | SWAT | swt_vnt_sht_loop | 16 | 0.27 | 通风管持续观察动作 | | +| 1523 | SWAT | swt_wllpk_L | 160 | 2.67 | 左侧掩体探头观察 | | +| 1524 | SWAT | swt_wllpk_L_back | 30 | 0.50 | 从左侧掩体撤回动作 | | +| 1525 | SWAT | swt_wllpk_R | 220 | 3.67 | 右侧掩体探头观察 | | +| 1526 | SWAT | swt_wllpk_R_back | 26 | 0.43 | 从右侧掩体撤回动作 | | +| 1527 | SWAT | swt_wllshoot_in_L | 60 | 1.00 | 进入左侧掩体射击位置 | | +| 1528 | SWAT | swt_wllshoot_in_R | 78 | 1.30 | 进入右侧掩体射击位置 | | +| 1529 | SWAT | swt_wllshoot_out_L | 120 | 2.00 | 离开左侧掩体射击位置 | | +| 1530 | SWAT | swt_wllshoot_out_R | 86 | 1.43 | 离开右侧掩体射击位置 | | +| 1531 | SWEET | ho_ass_slapped | 120 | 2.00 | 妓女被拍打臀部动作 | | +| 1532 | SWEET | LaFin_Player | 1600 | 26.67 | 跑向伤员并单膝跪地动作 | | +| 1533 | SWEET | LaFin_Sweet | 1600 | 26.67 | 腹部中枪痛苦姿势 | | +| 1534 | SWEET | plyr_hndshldr_01 | 240 | 4.00 | 被他人搭肩动作 | | +| 1535 | SWEET | sweet_ass_slap | 120 | 2.00 | 拍打妓女臀部动作 | | +| 1536 | SWEET | sweet_hndshldr_01 | 240 | 4.00 | 搭肩他人动作 | | +| 1537 | SWEET | Sweet_injuredloop | 120 | 2.00 | 受伤状态循环动画 | | +| 1538 | SWIM | Swim_Breast | 78 | 1.30 | 蛙泳动作 | | +| 1539 | SWIM | SWIM_crawl | 54 | 0.90 | 自由泳动作 | | +| 1540 | SWIM | Swim_Dive_Under | 64 | 1.07 | 潜水下潜动作 | | +| 1541 | SWIM | Swim_Glide | 88 | 1.47 | 水下滑行动作 | | +| 1542 | SWIM | Swim_jumpout | 20 | 0.33 | 跃出水面动作 | | +| 1543 | SWIM | Swim_Tread | 78 | 1.30 | 踩水待机动作 | | +| 1544 | SWIM | Swim_Under | 90 | 1.50 | 深潜游泳动作 | | +| 1545 | SWORD | sword_1 | 52 | 0.87 | 剑术挥砍 1 型 | | +| 1546 | SWORD | sword_2 | 64 | 1.07 | 剑术挥砍 2 型 | | +| 1547 | SWORD | sword_3 | 48 | 0.80 | 剑术挥砍 3 型 | | +| 1548 | SWORD | sword_4 | 66 | 1.10 | 剑术挥砍 4 型 | | +| 1549 | SWORD | sword_block | 28 | 0.47 | 剑术格挡动作 | | +| 1550 | SWORD | Sword_Hit_1 | 50 | 0.83 | 受剑击反应 1 型 | | +| 1551 | SWORD | Sword_Hit_2 | 62 | 1.03 | 受剑击反应 2 型 | | +| 1552 | SWORD | Sword_Hit_3 | 52 | 0.87 | 受剑击反应 3 型 | | +| 1553 | SWORD | sword_IDLE | 60 | 1.00 | 剑术待机姿势 | | +| 1554 | SWORD | sword_part | 40 | 0.67 | 冲刺剑击动作 | | +| 1555 | TANK | TANK_align_LHS | 86 | 1.43 | 调整姿势准备进入坦克左侧 | | +| 1556 | TANK | TANK_close_LHS | 20 | 0.33 | 关闭坦克左侧舱门 | | +| 1557 | TANK | TANK_doorlocked | 32 | 0.53 | 尝试打开锁定的坦克舱门 | | +| 1558 | TANK | TANK_getin_LHS | 26 | 0.43 | 从左侧进入坦克动作 | | +| 1559 | TANK | TANK_getout_LHS | 118 | 1.97 | 从左侧离开坦克动作 | | +| 1560 | TANK | TANK_open_LHS | 18 | 0.30 | 打开坦克左侧舱门 | | +| 1561 | TATTOOS | TAT_ArmL_In_O | 50 | 0.83 | 左臂纹身展示动作(存在 BUG) | | +| 1562 | TATTOOS | TAT_ArmL_In_P | 50 | 0.83 | 下拉左袖展示纹身 | | +| 1563 | TATTOOS | TAT_ArmL_In_T | 50 | 0.83 | 检查左前臂纹身 | | +| 1564 | TATTOOS | TAT_ArmL_Out_O | 56 | 0.93 | 左臂纹身隐藏动作(存在 BUG) | | +| 1565 | TATTOOS | TAT_ArmL_Out_P | 150 | 2.50 | 卷起左袖隐藏纹身 | | +| 1566 | TATTOOS | TAT_ArmL_Out_T | 56 | 0.93 | 停止检查左臂纹身 | | +| 1567 | TATTOOS | TAT_ArmL_Pose_O | 50 | 0.83 | 左臂纹身姿势(存在 BUG) | | +| 1568 | TATTOOS | TAT_ArmL_Pose_P | 50 | 0.83 | 左肩外露展示姿势 | | +| 1569 | TATTOOS | TAT_ArmL_Pose_T | 50 | 0.83 | 左臂伸展展示姿势 | | +| 1570 | TATTOOS | TAT_ArmR_In_O | 50 | 0.83 | 右臂纹身展示动作(存在 BUG) | | +| 1571 | TATTOOS | TAT_ArmR_In_P | 50 | 0.83 | 下拉右袖展示纹身 | | +| 1572 | TATTOOS | TAT_ArmR_In_T | 50 | 0.83 | 检查右前臂纹身 | | +| 1573 | TATTOOS | TAT_ArmR_Out_O | 60 | 1.00 | 右臂纹身隐藏动作(存在 BUG) | | +| 1574 | TATTOOS | TAT_ArmR_Out_P | 150 | 2.50 | 卷起右袖隐藏纹身 | | +| 1575 | TATTOOS | TAT_ArmR_Out_T | 60 | 1.00 | 停止检查右臂纹身 | | +| 1576 | TATTOOS | TAT_ArmR_Pose_O | 50 | 0.83 | 右臂纹身姿势(存在 BUG) | | +| 1577 | TATTOOS | TAT_ArmR_Pose_P | 50 | 0.83 | 右肩外露展示姿势 | | +| 1578 | TATTOOS | TAT_ArmR_Pose_T | 50 | 0.83 | 右臂伸展展示姿势 | | +| 1579 | TATTOOS | TAT_Back_In_O | 50 | 0.83 | 背部纹身展示动作(存在 BUG) | | +| 1580 | TATTOOS | TAT_Back_In_P | 50 | 0.83 | 背部纹身展示准备 | | +| 1581 | TATTOOS | TAT_Back_In_T | 50 | 0.83 | 背部纹身展示结束 | | +| 1582 | TATTOOS | TAT_Back_Out_O | 56 | 0.93 | 背部纹身隐藏动作(存在 BUG) | | +| 1583 | TATTOOS | TAT_Back_Out_P | 150 | 2.50 | 欣赏背部纹身动作 | | +| 1584 | TATTOOS | TAT_Back_Out_T | 56 | 0.93 | 结束欣赏背部纹身 | | +| 1585 | TATTOOS | TAT_Back_Pose_O | 50 | 0.83 | 背部纹身姿势(存在 BUG) | | +| 1586 | TATTOOS | TAT_Back_Pose_P | 50 | 0.83 | 背部展示姿势准备 | | +| 1587 | TATTOOS | TAT_Back_Pose_T | 50 | 0.83 | 背部展示姿势结束 | | +| 1588 | TATTOOS | TAT_Back_Sit_In_P | 50 | 0.83 | 坐姿调整准备展示 | | +| 1589 | TATTOOS | TAT_Back_Sit_Loop_P | 160 | 2.67 | 坐姿循环展示 | | +| 1590 | TATTOOS | TAT_Back_Sit_Out_P | 50 | 0.83 | 结束坐姿循环展示 | | +| 1591 | TATTOOS | TAT_Bel_In_O | 50 | 0.83 | 腹部纹身展示动作(存在 BUG) | | +| 1592 | TATTOOS | TAT_Bel_In_T | 50 | 0.83 | 腹部纹身展示准备 | | +| 1593 | TATTOOS | TAT_Bel_Out_O | 58 | 0.97 | 腹部纹身隐藏动作(存在 BUG) | | +| 1594 | TATTOOS | TAT_Bel_Out_T | 58 | 0.97 | 结束腹部纹身展示 | | +| 1595 | TATTOOS | TAT_Bel_Pose_O | 50 | 0.83 | 腹部纹身姿势(存在 BUG) | | +| 1596 | TATTOOS | TAT_Bel_Pose_T | 50 | 0.83 | 胸部纹身实施动作 | | +| 1597 | TATTOOS | TAT_Che_In_O | 50 | 0.83 | 胸部纹身展示动作(存在 BUG) | | +| 1598 | TATTOOS | TAT_Che_In_P | 50 | 0.83 | 开始胸部纹身展示 | | +| 1599 | TATTOOS | TAT_Che_In_T | 50 | 0.83 | 开始胸部纹身实施 | | +| 1600 | TATTOOS | TAT_Che_Out_O | 56 | 0.93 | 胸部纹身隐藏动作(存在 BUG) | | +| 1601 | TATTOOS | TAT_Che_Out_P | 150 | 2.50 | 欣赏胸部纹身动作 | | +| 1602 | TATTOOS | TAT_Che_Out_T | 56 | 0.93 | 结束胸部纹身展示 | | +| 1603 | TATTOOS | TAT_Che_Pose_O | 50 | 0.83 | 胸部纹身姿势(存在 BUG) | | +| 1604 | TATTOOS | TAT_Che_Pose_P | 50 | 0.83 | 胸部纹身展示姿势 | | +| 1605 | TATTOOS | TAT_Che_Pose_T | 50 | 0.83 | 身体部位纹身实施 | | +| 1606 | TATTOOS | TAT_Drop_O | 30 | 0.50 | 物品掉落动作(存在 BUG) | | +| 1607 | TATTOOS | TAT_Idle_Loop_O | 160 | 2.67 | 闲置循环动作(存在 BUG) | | +| 1608 | TATTOOS | TAT_Idle_Loop_T | 160 | 2.67 | 椅子上坐姿循环 | | +| 1609 | TATTOOS | TAT_Sit_In_O | 140 | 2.33 | 就座动作(存在 BUG) | | +| 1610 | TATTOOS | TAT_Sit_In_P | 140 | 2.33 | 行走后入座椅子动作 | | +| 1611 | TATTOOS | TAT_Sit_In_T | 140 | 2.33 | 纹身师接待客户动作 | | +| 1612 | TATTOOS | TAT_Sit_Loop_O | 160 | 2.67 | 就座循环(存在 BUG) | | +| 1613 | TATTOOS | TAT_Sit_Loop_P | 160 | 2.67 | 浏览纹身图样循环 | | +| 1614 | TATTOOS | TAT_Sit_Loop_T | 160 | 2.67 | 等待纹身订单循环 | | +| 1615 | TATTOOS | TAT_Sit_Out_O | 170 | 2.83 | 离座动作(存在 BUG) | | +| 1616 | TATTOOS | TAT_Sit_Out_P | 130 | 2.17 | 离座行走动作 | | +| 1617 | TATTOOS | TAT_Sit_Out_T | 170 | 2.83 | 纹身师送别客户动作 | | +| 1618 | TEC | TEC_crouchfire | 58 | 0.97 | Tec9 蹲姿射击 | | +| 1619 | TEC | TEC_crouchreload | 80 | 1.33 | Tec9 蹲姿换弹 | | +| 1620 | TEC | TEC_fire | 66 | 1.10 | Tec9 站立射击 | | +| 1621 | TEC | TEC_reload | 90 | 1.50 | Tec9 站立换弹 | | +| 1622 | TRAIN | tran_gtup | 190 | 3.17 | 攀爬火车动作 | | +| 1623 | TRAIN | tran_hng | 140 | 2.33 | 悬挂在火车外 | | +| 1624 | TRAIN | tran_ouch | 70 | 1.17 | 被钢梁撞击死亡动画 | | +| 1625 | TRAIN | tran_stmb | 140 | 2.33 | 火车上踉跄动作 | | +| 1626 | TRUCK | TRUCK_ALIGN_LHS | 34 | 0.57 | 左侧攀爬卡车准备动作 | | +| 1627 | TRUCK | TRUCK_ALIGN_RHS | 34 | 0.57 | 右侧攀爬卡车准备动作 | | +| 1628 | TRUCK | TRUCK_closedoor_LHS | 24 | 0.40 | 关闭卡车左侧车门 | | +| 1629 | TRUCK | TRUCK_closedoor_RHS | 24 | 0.40 | 关闭卡车右侧车门 | | +| 1630 | TRUCK | TRUCK_close_LHS | 44 | 0.73 | 关闭右侧车门 | | +| 1631 | TRUCK | TRUCK_close_RHS | 44 | 0.73 | 关闭左侧车门 | | +| 1632 | TRUCK | TRUCK_getin_LHS | 36 | 0.60 | 从左侧进入卡车 | | +| 1633 | TRUCK | TRUCK_getin_RHS | 36 | 0.60 | 从右侧进入卡车 | | +| 1634 | TRUCK | TRUCK_getout_LHS | 48 | 0.80 | 从左侧离开卡车 | | +| 1635 | TRUCK | TRUCK_getout_RHS | 48 | 0.80 | 从右侧离开卡车 | | +| 1636 | TRUCK | TRUCK_jackedLHS | 104 | 1.73 | 卡车左侧被劫持动作 | | +| 1637 | TRUCK | TRUCK_jackedRHS | 90 | 1.50 | 卡车右侧被劫持动作 | | +| 1638 | TRUCK | TRUCK_open_LHS | 32 | 0.53 | 打开卡车左侧车门 | | +| 1639 | TRUCK | TRUCK_open_RHS | 32 | 0.53 | 打开卡车右侧车门 | | +| 1640 | TRUCK | TRUCK_pullout_LHS | 54 | 0.90 | 将卡车司机从左侧拖出 | | +| 1641 | TRUCK | TRUCK_pullout_RHS | 54 | 0.90 | 将卡车乘客从右侧拖出 | | +| 1642 | TRUCK | TRUCK_Shuffle | 24 | 0.40 | 卡车内调整位置 | | +| 1643 | UZI | UZI_crouchfire | 38 | 0.63 | Uzi 蹲姿射击 | | +| 1644 | UZI | UZI_crouchreload | 82 | 1.37 | Uzi 蹲姿换弹 | | +| 1645 | UZI | UZI_fire | 34 | 0.57 | Uzi 站立射击 | | +| 1646 | UZI | UZI_fire_poor | 32 | 0.53 | 低熟练度 Uzi 射击 | | +| 1647 | UZI | UZI_reload | 84 | 1.40 | Uzi 站立换弹 | | +| 1648 | VAN | VAN_close_back_LHS | 20 | 0.33 | 关闭厢型车左后门 | | +| 1649 | VAN | VAN_close_back_RHS | 20 | 0.33 | 关闭厢型车右后门 | | +| 1650 | VAN | VAN_getin_Back_LHS | 36 | 0.60 | 进入厢型车左后座 | | +| 1651 | VAN | VAN_getin_Back_RHS | 36 | 0.60 | 进入厢型车右后座 | | +| 1652 | VAN | VAN_getout_back_LHS | 38 | 0.63 | 离开厢型车左后座 | | +| 1653 | VAN | VAN_getout_back_RHS | 38 | 0.63 | 离开厢型车右后座 | | +| 1654 | VAN | VAN_open_back_LHS | 58 | 0.97 | 打开厢型车左后门 | | +| 1655 | VAN | VAN_open_back_RHS | 58 | 0.97 | 打开厢型车右后门 | | +| 1656 | VENDING | VEND_Drink2_P | 200 | 3.33 | 从贩卖机二次饮用 | | +| 1657 | VENDING | VEND_Drink_P | 80 | 1.33 | 从贩卖机饮用 | | +| 1658 | VENDING | vend_eat1_P | 260 | 4.33 | 从贩卖机进食动作 | | +| 1659 | VENDING | VEND_Eat_P | 100 | 1.67 | 从贩卖机进食 | | +| 1660 | VENDING | VEND_Use | 156 | 2.60 | 使用贩卖机 | | +| 1661 | VENDING | VEND_Use_pt2 | 24 | 0.40 | 贩卖机使用后续动作 | | +| 1662 | VORTEX | CAR_jumpin_LHS | 60 | 1.00 | 从左侧进入旋涡车 | | +| 1663 | VORTEX | CAR_jumpin_RHS | 56 | 0.93 | 从右侧进入旋涡车 | | +| 1664 | VORTEX | vortex_getout_LHS | 60 | 1.00 | 从左侧离开旋涡车 | | +| 1665 | VORTEX | vortex_getout_RHS | 60 | 1.00 | 从右侧离开旋涡车 | | +| 1666 | WAYFARER | WF_Back | 6 | 0.10 | 旅行者摩托后仰动作 | | +| 1667 | WAYFARER | WF_drivebyFT | 12 | 0.20 | 旅行者前向行驶 | | +| 1668 | WAYFARER | WF_drivebyLHS | 12 | 0.20 | 旅行者左侧行驶 | | +| 1669 | WAYFARER | WF_drivebyRHS | 12 | 0.20 | 旅行者右侧行驶 | | +| 1670 | WAYFARER | WF_Fwd | 12 | 0.20 | 旅行者前倾动作 | | +| 1671 | WAYFARER | WF_getoffBACK | 104 | 1.73 | 高速脱离旅行者摩托 | | +| 1672 | WAYFARER | WF_getoffLHS | 54 | 0.90 | 从左侧离开旅行者摩托 | | +| 1673 | WAYFARER | WF_getoffRHS | 54 | 0.90 | 从右侧离开旅行者摩托 | | +| 1674 | WAYFARER | WF_hit | 2 | 0.03 | 旅行者摩托受击反应 | | +| 1675 | WAYFARER | WF_jumponL | 54 | 0.90 | 从左侧登上旅行者摩托 | | +| 1676 | WAYFARER | WF_jumponR | 54 | 0.90 | 从右侧登上旅行者摩托 | | +| 1677 | WAYFARER | WF_kick | 62 | 1.03 | 前踢动作上摩托 | | +| 1678 | WAYFARER | WF_Left | 8 | 0.13 | 旅行者左倾动作 | | +| 1679 | WAYFARER | WF_passenger | 2 | 0.03 | 旅行者乘客动画 | | +| 1680 | WAYFARER | WF_pushes | 58 | 0.97 | 旅行者倒车动作 | | +| 1681 | WAYFARER | WF_Ride | 2 | 0.03 | 旅行者骑行基础动画 | | +| 1682 | WAYFARER | WF_Right | 8 | 0.13 | 旅行者右倾动作 | | +| 1683 | WAYFARER | WF_Still | 2 | 0.03 | 旅行者静止骑行 | | +| 1684 | WEAPONS | SHP_1H_Lift | 60 | 1.00 | 店主单手举起手枪 | | +| 1685 | WEAPONS | SHP_1H_Lift_End | 20 | 0.33 | 店主将手枪放回柜台 | | +| 1686 | WEAPONS | SHP_1H_Ret | 50 | 0.83 | 店主收回手枪动作 | | +| 1687 | WEAPONS | SHP_1H_Ret_S | 20 | 0.33 | 店主快速收枪动作 | | +| 1688 | WEAPONS | SHP_2H_Lift | 56 | 0.93 | 店主双手举起防弹衣 | | +| 1689 | WEAPONS | SHP_2H_Lift_End | 20 | 0.33 | 店主将防弹衣放回柜台 | | +| 1690 | WEAPONS | SHP_2H_Ret | 54 | 0.90 | 店主收回防弹衣动作 | | +| 1691 | WEAPONS | SHP_2H_Ret_S | 20 | 0.33 | 店主快速收起防弹衣 | | +| 1692 | WEAPONS | SHP_Ar_Lift | 60 | 1.00 | 店主举起突击步枪 | | +| 1693 | WEAPONS | SHP_Ar_Lift_End | 20 | 0.33 | 店主将突击步枪放回柜台 | | +| 1694 | WEAPONS | SHP_Ar_Ret | 70 | 1.17 | 店主收回突击步枪动作 | | +| 1695 | WEAPONS | SHP_Ar_Ret_S | 20 | 0.33 | 店主快速放回突击步枪 | | +| 1696 | WEAPONS | SHP_G_Lift_In | 40 | 0.67 | 店主取起武器动作 | | +| 1697 | WEAPONS | SHP_G_Lift_Out | 40 | 0.67 | 店主将武器放置柜台 | | +| 1698 | WEAPONS | SHP_Tray_In | 40 | 0.67 | 店主开始展示姿势 | | +| 1699 | WEAPONS | SHP_Tray_Out | 40 | 0.67 | 店主结束展示姿势 | | +| 1700 | WEAPONS | SHP_Tray_Pose | 160 | 2.67 | 店主倚靠柜台姿势 | | +| 1729 | WOP | Dance_B1 | 68 | 1.13 | 糟糕的 Funky 总统舞 B1 型 | | +| 1730 | WOP | Dance_B2 | 70 | 1.17 | 糟糕的 Funky 总统舞 B2 型 | | +| 1731 | WOP | Dance_B3 | 68 | 1.13 | 糟糕的 Funky 总统舞 B3 型 | | +| 1732 | WOP | Dance_B4 | 70 | 1.17 | 糟糕的 Funky 总统舞 B4 型 | | +| 1733 | WOP | Dance_B5 | 68 | 1.13 | 糟糕的 Funky 总统舞 B5 型 | | +| 1734 | WOP | Dance_B6 | 70 | 1.17 | 糟糕的 Funky 总统舞 B6 型 | | +| 1735 | WOP | Dance_B7 | 68 | 1.13 | 糟糕的 Funky 总统舞 B7 型 | | +| 1736 | WOP | Dance_B8 | 70 | 1.17 | 糟糕的 Funky 总统舞 B8 型 | | +| 1737 | WOP | Dance_B9 | 68 | 1.13 | 糟糕的 Funky 总统舞 B9 型 | | +| 1738 | WOP | Dance_B10 | 70 | 1.17 | 糟糕的 Funky 总统舞 B10 型 | | +| 1739 | WOP | Dance_B11 | 68 | 1.13 | 糟糕的 Funky 总统舞 B11 型 | | +| 1740 | WOP | Dance_B12 | 70 | 1.17 | 糟糕的 Funky 总统舞 B12 型 | | +| 1741 | WOP | Dance_B13 | 68 | 1.13 | 糟糕的 Funky 总统舞 B13 型 | | +| 1742 | WOP | Dance_B14 | 70 | 1.17 | 糟糕的 Funky 总统舞 B14 型 | | +| 1743 | WOP | Dance_B15 | 68 | 1.13 | 糟糕的 Funky 总统舞 B15 型 | | +| 1744 | WOP | Dance_B16 | 70 | 1.17 | 糟糕的 Funky 总统舞 B16 型 | | +| 1713 | WOP | Dance_G1 | 68 | 1.13 | 优秀的 Funky 总统舞 G1 型 | | +| 1714 | WOP | Dance_G2 | 70 | 1.17 | 优秀的 Funky 总统舞 G2 型 | | +| 1715 | WOP | Dance_G3 | 68 | 1.13 | 优秀的 Funky 总统舞 G3 型 | | +| 1716 | WOP | Dance_G4 | 70 | 1.17 | 优秀的 Funky 总统舞 G4 型 | | +| 1717 | WOP | Dance_G5 | 68 | 1.13 | 优秀的 Funky 总统舞 G5 型 | | +| 1718 | WOP | Dance_G6 | 70 | 1.17 | 优秀的 Funky 总统舞 G6 型 | | +| 1719 | WOP | Dance_G7 | 68 | 1.13 | 优秀的 Funky 总统舞 G7 型 | | +| 1720 | WOP | Dance_G8 | 70 | 1.17 | 优秀的 Funky 总统舞 G8 型 | | +| 1721 | WOP | Dance_G9 | 68 | 1.13 | 优秀的 Funky 总统舞 G9 型 | | +| 1722 | WOP | Dance_G10 | 70 | 1.17 | 优秀的 Funky 总统舞 G10 型 | | +| 1723 | WOP | Dance_G11 | 68 | 1.13 | 优秀的 Funky 总统舞 G11 型 | | +| 1724 | WOP | Dance_G12 | 70 | 1.17 | 优秀的 Funky 总统舞 G12 型 | | +| 1725 | WOP | Dance_G13 | 68 | 1.13 | 优秀的 Funky 总统舞 G13 型 | | +| 1726 | WOP | Dance_G14 | 70 | 1.17 | 优秀的 Funky 总统舞 G14 型 | | +| 1727 | WOP | Dance_G15 | 68 | 1.13 | 优秀的 Funky 总统舞 G15 型 | | +| 1728 | WOP | Dance_G16 | 70 | 1.17 | 优秀的 Funky 总统舞 G16 型 | | +| 1745 | WOP | dance_loop | 70 | 1.17 | 舞蹈循环动作 | | +| 1701 | WUZI | CS_Dead_Guy | 304 | 5.07 | 过场动画死亡角色 | | +| 1702 | WUZI | CS_Plyr_pt1 | 226 | 3.77 | 玩家过场动画第一部分 | | +| 1703 | WUZI | CS_Plyr_pt2 | 580 | 9.67 | 玩家过场动画第二部分 | | +| 1704 | WUZI | CS_Wuzi_pt1 | 226 | 3.77 | 吴子过场动画第一部分 | | +| 1705 | WUZI | CS_Wuzi_pt2 | 580 | 9.67 | 吴子过场动画第二部分 | | +| 1706 | WUZI | Walkstart_Idle_01 | 190 | 3.17 | 吴子起步待机动作 | | +| 1707 | WUZI | Wuzi_follow | 180 | 3.00 | 吴子跟随动画 | | +| 1708 | WUZI | Wuzi_Greet_Plyr | 240 | 4.00 | 吴子向玩家致意动作 | | +| 1709 | WUZI | Wuzi_Greet_Wuzi | 240 | 4.00 | 吴子自我致意动作 | | +| 1710 | WUZI | Wuzi_grnd_chk | 240 | 4.00 | 吴子投掷手雷动作 | | +| 1711 | WUZI | Wuzi_stand_loop | 160 | 2.67 | 吴子站立待机循环 | | +| 1712 | WUZI | Wuzi_Walk | 70 | 1.17 | 吴子行走动作 | | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/bodyparts.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/bodyparts.md new file mode 100644 index 00000000000..d7e9fe073f0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/bodyparts.md @@ -0,0 +1,33 @@ +--- +title: 身体部位 +sidebar_label: 身体部位 +--- + +:::info + +以下条目是可用于以下回调的身体部位 ID: +[OnPlayerGiveDamage](../callbacks/OnPlayerGiveDamage)、[OnPlayerTakeDamage](../callbacks/OnPlayerTakeDamage) 和 [OnPlayerGiveDamageActor](../callbacks/OnPlayerGiveDamageActor) + +::: + +--- + +| ID | 身体部位 | +| --- | -------- | +| 3 | 躯干 | +| 4 | 腹部 | +| 5 | 左臂 | +| 6 | 右臂 | +| 7 | 左腿 | +| 8 | 右腿 | +| 9 | 头部 | + +--- + +:::note + +这些 ID 尚未 100%确认,且未在任何 SA-MP 头文件中定义——必须由脚本编写者自行定义。目前未知 ID 0、1 和 2 是否有任何用途。 + +::: + +![](https://assets.open.mp/assets/images/bodyParts/Body_parts.jpg) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/boneid.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/boneid.md new file mode 100644 index 00000000000..d3d622ce65a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/boneid.md @@ -0,0 +1,31 @@ +--- +title: 骨骼ID +sidebar_label: 骨骼ID +--- + +:::note + +本页面包含所有由[SetPlayerAttachedObject](../functions/SetPlayerAttachedObject)使用的骨骼 ID。 + +::: + +| ID | 骨骼名称 | +| --- | -------------- | +| 1 | 脊柱 | +| 2 | 头部 | +| 3 | 左上臂 | +| 4 | 右上臂 | +| 5 | 左手 | +| 6 | 右手 | +| 7 | 左大腿 | +| 8 | 右大腿 | +| 9 | 左脚 | +| 10 | 右脚 | +| 11 | 右小腿 | +| 12 | 左小腿 | +| 13 | 左前臂 | +| 14 | 右前臂 | +| 15 | 左锁骨(肩部) | +| 16 | 右锁骨(肩部) | +| 17 | 颈部 | +| 18 | 下颌 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/bullethittypes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/bullethittypes.md new file mode 100644 index 00000000000..802544e250a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/bullethittypes.md @@ -0,0 +1,24 @@ +--- +title: 子弹命中类型 +sidebar_label: 子弹命中类型 +--- + +:::info + +本页面包含所有由[OnPlayerWeaponShot](../callbacks/OnPlayerWeaponShot)使用的子弹命中类型。 + +::: + +| 值 | 定义 | +| --- | --------------------------------------------- | +| 0 | 无命中(BULLET_HIT_TYPE_NONE) | +| 1 | 命中玩家(BULLET_HIT_TYPE_PLAYER) | +| 2 | 命中车辆(BULLET_HIT_TYPE_VEHICLE) | +| 3 | 命中物体(BULLET_HIT_TYPE_OBJECT) | +| 4 | 命中玩家物体(BULLET_HIT_TYPE_PLAYER_OBJECT) | + +:::caution + +BULLET_HIT_TYPE_PLAYER 同样适用于 NPC。该回调会忽略角色(Actor)并检测为 BULLET_HIT_TYPE_NONE。 + +::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/callbacks-sequence.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/callbacks-sequence.md new file mode 100644 index 00000000000..96c5f7fa9d8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/callbacks-sequence.md @@ -0,0 +1,79 @@ +--- +title: 回调函数序列 +sidebar_label: 回调函数序列 +description: SA-MP/open.mp中可用的回调函数列表及其调用顺序 +tags: [] +--- + +以下是 SA-MP/open.mp 中可用的回调函数列表及其调用顺序。勾选框表示优先调用。 + +| 回调函数 | 滤镜脚本 | 游戏模式 | +| ----------------------------------------------------------------------- | -------- | -------- | +| [OnActorStreamIn](../callbacks/OnActorStreamIn) | ✅ | | +| [OnActorStreamOut](../callbacks/OnActorStreamOut) | ✅ | | +| [OnClientCheckResponse](../callbacks/OnClientCheckResponse) | ✅ | | +| [OnClientMessage](../callbacks/OnClientMessage) | ✅ | | +| [OnDialogResponse](../callbacks/OnDialogResponse) | ✅ | | +| [OnEnterExitModShop](../callbacks/OnEnterExitModShop) | ✅ | | +| [OnFilterScriptExit](../callbacks/OnFilterScriptExit) | ✅ | | +| [OnFilterScriptInit](../callbacks/OnFilterScriptInit) | ✅ | | +| [OnGameModeExit](../callbacks/OnGameModeExit) | ✅ | | +| [OnGameModeInit](../callbacks/OnGameModeInit) | ✅ | | +| [OnIncomingConnection](../callbacks/OnIncomingConnection) | ✅ | | +| [OnObjectMoved](../callbacks/OnObjectMoved) | ✅ | | +| [OnPlayerClickMap](../callbacks/OnPlayerClickMap) | | ✅ | +| [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer) | ✅ | | +| [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw) | ✅ | | +| [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) | ✅ | | +| [OnPlayerCommandText](../callbacks/OnPlayerCommandText) | ✅ | | +| [OnPlayerConnect](../callbacks/OnPlayerConnect) | ✅ | | +| [OnPlayerDeath](../callbacks/OnPlayerDeath) | ✅ | | +| [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect) | ✅ | | +| [OnPlayerEditAttachedObject](../callbacks/OnPlayerEditAttachedObject) | ✅ | | +| [OnPlayerEditObject](../callbacks/OnPlayerEditObject) | ✅ | | +| [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint) | ✅ | | +| [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint) | ✅ | | +| [OnPlayerEnterVehicle](../callbacks/OnPlayerEnterVehicle) | ✅ | | +| [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu) | | ✅ | +| [OnPlayerExitVehicle](../callbacks/OnPlayerExitVehicle) | ✅ | | +| [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading) | ✅ | | +| [OnPlayerGiveDamage](../callbacks/OnPlayerGiveDamage) | ✅ | | +| [OnPlayerGiveDamageActor](../callbacks/OnPlayerGiveDamageActor) | ✅ | | +| [OnPlayerInteriorChange](../callbacks/OnPlayerInteriorChange) | | ✅ | +| [OnPlayerKeyStateChange](../callbacks/OnPlayerKeyStateChange) | | ✅ | +| [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint) | ✅ | | +| [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint) | ✅ | | +| [OnPlayerObjectMoved](../callbacks/OnPlayerObjectMoved) | ✅ | | +| [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup) | | ✅ | +| [OnPickupStreamIn](../callbacks/OnPickupStreamIn) | ✅ | | +| [OnPickupStreamOut](../callbacks/OnPickupStreamOut) | ✅ | | +| [OnPlayerPickUpPlayerPickup](../callbacks/OnPlayerPickUpPlayerPickup) | | ✅ | +| [OnPlayerPickupStreamIn](../callbacks/OnPlayerPickupStreamIn) | ✅ | | +| [OnPlayerPickupStreamOut](../callbacks/OnPlayerPickupStreamOut) | ✅ | | +| [OnPlayerRequestClass](../callbacks/OnPlayerRequestClass) | ✅ | | +| [OnPlayerRequestDownload](../callbacks/OnPlayerRequestDownload) | ✅ | | +| [OnPlayerRequestSpawn](../callbacks/OnPlayerRequestSpawn) | ✅ | | +| [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow) | | ✅ | +| [OnPlayerSelectObject](../callbacks/OnPlayerSelectObject) | ✅ | | +| [OnPlayerSpawn](../callbacks/OnPlayerSpawn) | ✅ | | +| [OnPlayerStateChange](../callbacks/OnPlayerStateChange) | ✅ | | +| [OnPlayerStreamIn](../callbacks/OnPlayerStreamIn) | ✅ | | +| [OnPlayerStreamOut](../callbacks/OnPlayerStreamOut) | ✅ | | +| [OnPlayerTakeDamage](../callbacks/OnPlayerTakeDamage) | ✅ | | +| [OnPlayerText](../callbacks/OnPlayerText) | ✅ | | +| [OnPlayerUpdate](../callbacks/OnPlayerUpdate) | ✅ | | +| [OnPlayerWeaponShot](../callbacks/OnPlayerWeaponShot) | ✅ | | +| [OnRconCommand](../callbacks/OnRconCommand) | ✅ | | +| [OnRconLoginAttempt](../callbacks/OnRconLoginAttempt) | ✅ | | +| [OnRecordingPlaybackEnd](../callbacks/OnRecordingPlaybackEnd) | ✅ | | +| [OnTrailerUpdate](../callbacks/OnTrailerUpdate) | ✅ | | +| [OnUnoccupiedVehicleUpdate](../callbacks/OnUnoccupiedVehicleUpdate) | ✅ | | +| [OnVehicleDamageStatusUpdate](../callbacks/OnVehicleDamageStatusUpdate) | ✅ | | +| [OnVehicleDeath](../callbacks/OnVehicleDeath) | ✅ | | +| [OnVehicleMod](../callbacks/OnVehicleMod) | | ✅ | +| [OnVehiclePaintjob](../callbacks/OnVehiclePaintjob) | | ✅ | +| [OnVehicleRespray](../callbacks/OnVehicleRespray) | | ✅ | +| [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange) | ✅ | | +| [OnVehicleSpawn](../callbacks/OnVehicleSpawn) | ✅ | | +| [OnVehicleStreamIn](../callbacks/OnVehicleStreamIn) | ✅ | | +| [OnVehicleStreamOut](../callbacks/OnVehicleStreamOut) | ✅ | | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/cameracutstyles.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/cameracutstyles.md new file mode 100644 index 00000000000..32af326f366 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/cameracutstyles.md @@ -0,0 +1,18 @@ +--- +title: 视角切换样式 +sidebar_label: 视角切换样式 +--- + +:::info + +以下函数使用视角切换样式: +[SetPlayerCameraLookAt](../functions/SetPlayerCameraLookAt)、[InterpolateCameraPos](../functions/InterpolateCameraPos) 和 [InterpolateCameraLookAt](../functions/InterpolateCameraLookAt) + +::: + +## 切换样式 + +| ID | 样式 | 描述 | +| --- | ----------- | ------------------------------------------- | +| 1 | CAMERA_MOVE | 视角位置和/或目标会随时间推移移动到新位置 | +| 2 | CAMERA_CUT | 视角位置和/或目标会立即跳转到新位置 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/cameramodes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/cameramodes.md new file mode 100644 index 00000000000..845dfb46088 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/cameramodes.md @@ -0,0 +1,38 @@ +--- +title: 视角模式 +sidebar_label: 视角模式 +--- + +## 描述 + +以下视角模式由[GetPlayerCameraMode](../functions/GetPlayerCameraMode)函数使用。 + +:::note + +游戏中可能仍存在更多隐藏可用的 ID,且部分 ID 会对应多种使用场景。 + +::: + +## 可用视角模式列表 + +| ID | 定义 | 游戏文件中的名称 | 描述 | +| --- | -------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------- | +| 3 | CAM_MODE_BEHINDCAR | MODE_BEHINDCAR | 火车/电车视角 | +| 4 | CAM_MODE_FOLLOWPED | MODE_FOLLOWPED | 跟随玩家角色(标准第三人称视角),支持多种可变距离 | +| 7 | CAM_MODE_SNIPER | MODE_SNIPER | 狙击枪瞄准(狙击镜视角) | +| 8 | CAM_MODE_ROCKETLAUNCHER | MODE_ROCKETLAUNCHER | 火箭筒瞄准(火箭筒瞄准镜视角) | +| 15 | CAM_MODE_FIXED | MODE_FIXED | 固定视角(不可移动)——用于车库场景、追逐视角、进入建筑物、购买食物等场景 | +| 16 | CAM_MODE_1STPERSON | MODE_1STPERSON | 车辆第一人称视角(汽车前视/摩托车侧视) | +| 18 | CAM_MODE_CAM_ON_A_STRING | MODE_CAM_ON_A_STRING | 标准车辆视角(支持快艇/直升机/飞机),支持多种可变距离 | +| 22 | CAM_MODE_BEHINDBOAT | MODE_BEHINDBOAT | 标准船只视角 | +| 46 | CAM_MODE_CAMERA | MODE_CAMERA | 武器瞄准(武器准星视角) | +| 51 | CAM_MODE_ROCKETLAUNCHER_HS | MODE_ROCKETLAUNCHER_HS | 热追踪火箭筒瞄准 | +| 53 | CAM_MODE_AIMWEAPON | MODE_AIMWEAPON | 常规武器瞄准 | +| 55 | CAM_MODE_AIMWEAPON_FROMCAR | MODE_AIMWEAPON_FROMCAR | 车辆乘客射击视角(玩家进行乘车射击时) | +| 56 | CAM_MODE_DW_HELI_CHASE | MODE_DW_HELI_CHASE | 追逐视角:直升机/鸟瞰视角 | +| 57 | - | MODE_DW_CAM_MAN | 追逐视角:地面视角,会快速拉近并对准车辆 | +| 58 | - | MODE_DW_BIRDY | 追逐视角:水平飞越车辆的过场视角 | +| 59 | - | MODE_DW_PLANE_SPOTTER | 追逐视角(仅限飞行车辆):地面视角,仰视空中车辆 | +| 62 | - | MODE_DW_PLANECAM1 | 追逐视角(仅限飞行车辆):垂直飞越空中车辆的过场视角 | +| 63 | - | MODE_DW_PLANECAM2 | 追逐视角(仅限飞行车辆):水平飞越空中车辆的过场视角(类似 58 和 62) | +| 64 | - | MODE_DW_PLANECAM3 | 追逐视角(仅限飞行车辆):聚焦飞行员的视角,类似于步行时按下"向后看"键的效果,但应用于飞行车辆 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/carcomponentid.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/carcomponentid.md new file mode 100644 index 00000000000..885056f0839 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/carcomponentid.md @@ -0,0 +1,423 @@ +--- +title: 车辆组件ID +sidebar_label: 车辆组件ID +description: 关于车辆组件ID、模型名称、部件、类型、支持车辆及价格的信息。 +--- + +| ID | 模型名称 | 部件 | 类型 | 支持车辆 | 价格 | +| ---- | -------------- | -------- | ------------------- | -------------------------- | ----- | +| 1000 | spl_b_mar_m | 扰流板 | 专业版 | 特定 Transfender 车辆 | $400 | +| 1001 | spl_b_bab_m | 扰流板 | 胜利版 | 特定 Transfender 车辆 | $550 | +| 1002 | spl_b_bar_m | 扰流板 | 直线加速版 | 特定 Transfender 车辆 | $200 | +| 1003 | spl_b_mab_m | 扰流板 | 阿尔法版 | 特定 Transfender 车辆 | $250 | +| 1004 | bnt_b_sc_m | 引擎盖 | 冠军版进气口 | 特定 Transfender 车辆 | $100 | +| 1005 | bnt_b_sc_l | 引擎盖 | 狂暴版进气口 | 特定 Transfender 车辆 | $150 | +| 1006 | rf_b_sc_r | 车顶 | 车顶进气口 | 特定 Transfender 车辆 | $80 | +| 1007 | wg_l_b_ssk | 侧裙 | 右侧侧裙 | 特定 Transfender 车辆 | $500 | +| 1008 | nto_b_l | 氮气加速 | 5 次使用 | 多数车辆、多数飞机和直升机 | $500 | +| 1009 | nto_b_s | 氮气加速 | 2 次使用 | 多数车辆、多数飞机和直升机 | $200 | +| 1010 | nto_b_tw | 氮气加速 | 10 次使用 | 多数车辆、多数飞机和直升机 | $1000 | +| 1011 | bnt_b_sc_p_m | 引擎盖 | 竞赛版进气口 | 特定 Transfender 车辆 | $220 | +| 1012 | bnt_b_sc_p_l | 引擎盖 | 工作版进气口 | 特定 Transfender 车辆 | $250 | +| 1013 | lgt_b_rspt | 车灯 | 圆形雾灯 | 特定 Transfender 车辆 | $100 | +| 1014 | spl_b_bar_l | 扰流板 | 冠军版 | 特定 Transfender 车辆 | $400 | +| 1015 | spl_b_bbr_l | 扰流板 | 竞赛版 | 特定 Transfender 车辆 | $500 | +| 1016 | spl_b_bbr_m | 扰流板 | 工作版 | 特定 Transfender 车辆 | $200 | +| 1017 | wg_r_b_ssk | 侧裙 | 左侧侧裙 | 特定 Transfender 车辆 | $500 | +| 1018 | exh_b_ts | 排气管 | 上扬式 | 多数车辆 | $350 | +| 1019 | exh_b_t | 排气管 | 双出式 | 多数车辆 | $300 | +| 1020 | exh_b_l | 排气管 | 大型 | 多数车辆 | $250 | +| 1021 | exh_b_m | 排气管 | 中型 | 多数车辆 | $200 | +| 1022 | exh_b_s | 排气管 | 小型 | 多数车辆 | $150 | +| 1023 | spl_b_bbb_m | 扰流板 | 狂暴版 | 特定 Transfender 车辆 | $350 | +| 1024 | lgt_b_sspt | 车灯 | 方形雾灯 | 特定 Transfender 车辆 | $50 | +| 1025 | wheel_or1 | 轮毂 | 越野型 | 特定 Transfender 车辆 | $1000 | +| 1026 | wg_l_a_s | 侧裙 | 右侧外星人侧裙 | Sultan | $480 | +| 1027 | wg_r_a_s | 侧裙 | 左侧外星人侧裙 | Sultan | $480 | +| 1028 | exh_a_s | 排气管 | 外星人版 | Sultan | $770 | +| 1029 | exh_c_s | 排气管 | X-Flow 版 | Sultan | $680 | +| 1030 | wg_r_c_s | 侧裙 | 左侧 X-Flow 侧裙 | Sultan | $370 | +| 1031 | wg_l_c_s | 侧裙 | 右侧 X-Flow 侧裙 | Sultan | $370 | +| 1032 | rf_a_s | 车顶 | 外星人版车顶通风口 | Sultan | $170 | +| 1033 | rf_c_s | 车顶 | X-Flow 版车顶通风口 | Sultan | $120 | +| 1034 | exh_a_l | 排气管 | 外星人版 | Elegy | $790 | +| 1035 | rf_c_l | 车顶 | X-Flow 版车顶通风口 | Elegy | $150 | +| 1036 | wg_l_a_l | 侧裙 | 右侧外星人侧裙 | Elegy | $500 | +| 1037 | exh_c_l | 排气管 | X-Flow 版 | Elegy | $690 | +| 1038 | rf_a_l | 车顶 | 外星人版车顶通风口 | Elegy | $190 | +| 1039 | wg_l_c_l | 侧裙 | 左侧 X-Flow 侧裙 | Elegy | $390 | +| 1040 | wg_r_a_l | 侧裙 | 左侧外星人侧裙 | Elegy | $500 | +| 1041 | wg_r_c_l | 侧裙 | 右侧 X-Flow 侧裙 | Elegy | $390 | +| 1042 | wg_l_lr_br1 | 侧裙 | 右侧镀铬侧裙 | Broadway | $1000 | +| 1043 | exh_lr_br2 | 排气管 | 极速版 | Broadway | $500 | +| 1044 | exh_lr_br1 | 排气管 | 镀铬版 | Broadway | $500 | +| 1045 | exh_c_f | 排气管 | X-Flow 版 | Flash | $510 | +| 1046 | exh_a_f | 排气管 | 外星人版 | Flash | $710 | +| 1047 | wg_l_a_f | 侧裙 | 右侧外星人侧裙 | Flash | $670 | +| 1048 | wg_l_c_f | 侧裙 | 右侧 X-Flow 侧裙 | Flash | $530 | +| 1049 | spl_a_f_r | 扰流板 | 外星人版 | Flash | $810 | +| 1050 | spl_c_f_r | 扰流板 | X-Flow 版 | Flash | $620 | +| 1051 | wg_r_a_f | 侧裙 | 左侧外星人侧裙 | Flash | $670 | +| 1052 | wg_r_c_f | 侧裙 | 左侧 X-Flow 侧裙 | Flash | $530 | +| 1053 | rf_c_f | 车顶 | X-Flow 版 | Flash | $130 | +| 1054 | rf_a_f | 车顶 | 外星人版 | Flash | $210 | +| 1055 | rf_a_st | 车顶 | 外星人版 | Stratum | $230 | +| 1056 | wg_l_a_st | 侧裙 | 右侧外星人侧裙 | Stratum | $520 | +| 1057 | wg_l_c_st | 侧裙 | 右侧 X-Flow 侧裙 | Stratum | $430 | +| 1058 | spl_a_st_r | 扰流板 | 外星人版 | Stratum | $620 | +| 1059 | exh_c_st | 排气管 | X-Flow 版 | Stratum | $720 | +| 1060 | spl_c_st_r | 扰流板 | X-Flow 版 | Stratum | $530 | +| 1061 | rf_c_st | 车顶 | X-Flow 版 | Stratum | $180 | +| 1062 | wg_r_a_st | 侧裙 | 左侧外星人侧裙 | Stratum | $550 | +| 1063 | wg_r_c_st | 侧裙 | 左侧 X-Flow 侧裙 | Stratum | $430 | +| 1064 | exh_a_st | 排气管 | 外星人版 | Stratum | $830 | +| 1065 | exh_a_j | 排气管 | 外星人版 | Jester | $850 | +| 1066 | exh_c_j | 排气管 | X-Flow 版 | Jester | $750 | +| 1067 | rf_a_j | 车顶 | 外星人版 | Jester | $250 | +| 1068 | rf_c_j | 车顶 | X-Flow 版 | Jester | $200 | +| 1069 | wg_l_a_j | 侧裙 | 右侧外星人侧裙 | Jester | $550 | +| 1070 | wg_l_c_j | 侧裙 | 右侧 X-Flow 侧裙 | Jester | $450 | +| 1071 | wg_r_a_j | 侧裙 | 左侧外星人侧裙 | Jester | $550 | +| 1072 | wg_r_c_j | 侧裙 | 左侧 X-Flow 侧裙 | Jester | $450 | +| 1073 | wheel_sr6 | 轮毂 | 暗影版 | 多数车辆 | $1100 | +| 1074 | wheel_sr3 | 轮毂 | 巨型版 | 多数车辆 | $1030 | +| 1075 | wheel_sr2 | 轮毂 | 轮辋闪光版 | 多数车辆 | $980 | +| 1076 | wheel_lr4 | 轮毂 | 辐条版 | 多数车辆 | $1560 | +| 1077 | wheel_lr1 | 轮毂 | 经典版 | 多数车辆 | $1620 | +| 1078 | wheel_lr3 | 轮毂 | 扭曲版 | 多数车辆 | $1200 | +| 1079 | wheel_sr1 | 轮毂 | 切割版 | 多数车辆 | $1030 | +| 1080 | wheel_sr5 | 轮毂 | 切换版 | 多数车辆 | $900 | +| 1081 | wheel_sr4 | 轮毂 | 沟槽版 | 多数车辆 | $1230 | +| 1082 | wheel_gn1 | 轮毂 | 进口版 | 多数车辆 | $820 | +| 1083 | wheel_lr2 | 轮毂 | 美元版 | 多数车辆 | $1560 | +| 1084 | wheel_lr5 | 轮毂 | 恍惚版 | 多数车辆 | $1350 | +| 1085 | wheel_gn2 | 轮毂 | 原子版 | 多数车辆 | $770 | +| 1086 | stereo | 音响 | 立体声音响 | 多数车辆 | $100 | +| 1087 | hydralics | 液压系统 | 液压装置 | 多数车辆 | $1500 | +| 1088 | rf_a_u | 车顶 | 外星人版 | Uranus | $150 | +| 1089 | exh_c_u | 排气管 | X-Flow 版 | Uranus | $650 | +| 1090 | wg_l_a_u | 侧裙 | 右侧外星人侧裙 | Uranus | $450 | +| 1091 | rf_c_u | 车顶 | X-Flow 版 | Uranus | $100 | +| 1092 | exh_a_u | 排气管 | 外星人版 | Uranus | $750 | +| 1093 | wg_l_c_u | 侧裙 | 左侧 X-Flow 侧裙 | Uranus | $350 | +| 1094 | wg_r_a_u | 侧裙 | 左侧外星人侧裙 | Uranus | $450 | +| 1095 | wg_r_c_u | 侧裙 | 右侧 X-Flow 侧裙 | Uranus | $350 | +| 1096 | wheel_gn3 | 轮毂 | 阿哈布版 | 多数车辆 | $1000 | +| 1097 | wheel_gn4 | 轮毂 | 虚拟版 | 多数车辆 | $620 | +| 1098 | wheel_gn5 | 轮毂 | 入门版 | 多数车辆 | $1140 | +| 1099 | wg_r_lr_br1 | 侧裙 | 左侧镀铬侧裙 | Broadway | $1000 | +| 1100 | misc_c_lr_rem1 | 前保险杠 | 镀铬格栅 | Remington | $940 | +| 1101 | wg_r_lr_rem1 | 侧裙 | 左侧`镀铬火焰`侧裙 | Remington | $780 | +| 1102 | wg_r_lr_sv | 侧裙 | 左侧`镀铬条纹`侧裙 | Savanna | $830 | +| 1103 | rf_lr_bl2 | 车顶 | 敞篷版 | Blade | $3250 | +| 1104 | exh_lr_bl1 | 排气管 | 镀铬版 | Blade | $1610 | +| 1105 | exh_lr_bl2 | 排气管 | 极速版 | Blade | $1540 | +| 1106 | wg_l_lr_rem2 | 侧裙 | 右侧`镀铬拱门`侧裙 | Remington | $780 | +| 1107 | wg_r_lr_bl1 | 侧裙 | 左侧`镀铬条纹`侧裙 | Blade | $780 | +| 1108 | wg_l_lr_bl1 | 侧裙 | 右侧`镀铬条纹`侧裙 | Blade | $780 | +| 1109 | bbb_lr_slv1 | 后保险杠 | 镀铬版 | Slamvan | $1610 | +| 1110 | bbb_lr_slv2 | 后保险杠 | 极速版 | Slamvan | $1540 | +| 1111 | bnt_lr_slv1 | 前标牌 | 小标牌? | Slamvan | $0 | +| 1112 | bnt_lr_slv2 | 前标牌 | 小标牌? | Slamvan | $0 | +| 1113 | exh_lr_slv1 | 排气管 | 镀铬版 | Slamvan | $3340 | +| 1114 | exh_lr_slv2 | 排气管 | 极速版 | Slamvan | $3250 | +| 1115 | fbb_lr_slv1 | 前保险杠 | 镀铬版 | Slamvan | $2130 | +| 1116 | fbb_lr_slv2 | 前保险杠 | 极速版 | Slamvan | $2050 | +| 1117 | fbmp_lr_slv1 | 前保险杠 | 镀铬版 | Slamvan | $2040 | +| 1118 | wg_l_lr_slv1 | 侧裙 | 右侧`镀铬饰边`侧裙 | Slamvan | $780 | +| 1119 | wg_l_lr_slv2 | 侧裙 | 右侧`轮毂罩`侧裙 | Slamvan | $940 | +| 1120 | wg_r_lr_slv1 | 侧裙 | 左侧`镀铬饰边`侧裙 | Slamvan | $780 | +| 1121 | wg_r_lr_slv2 | 侧裙 | 左侧`轮毂罩`侧裙 | Slamvan | $940 | +| 1122 | wg_l_lr_rem1 | 侧裙 | 右侧`镀铬火焰`侧裙 | Remington | $780 | +| 1123 | misc_c_lr_rem2 | 前保险杠 | 镀铬横杆前保险杠 | Remington | $860 | +| 1124 | wg_r_lr_rem2 | 侧裙 | 左侧`镀铬拱门`侧裙 | Remington | $780 | +| 1125 | misc_c_lr_rem3 | 前保险杠 | 镀铬灯饰前保险杠 | Remington | $1120 | +| 1126 | exh_lr_rem1 | 排气管 | 镀铬排气管 | Remington | $3340 | +| 1127 | exh_lr_rem2 | 排气管 | 极速排气管 | Remington | $3250 | +| 1128 | rf_lr_bl1 | 车顶 | 乙烯基硬顶 | Blade | $3340 | +| 1129 | exh_lr_sv1 | 排气管 | 镀铬版 | Savanna | $1650 | +| 1130 | rf_lr_sv1 | 车顶 | 硬顶版 | Savanna | $3380 | +| 1131 | rf_lr_sv2 | 车顶 | 软顶版 | Savanna | $3290 | +| 1132 | exh_lr_sv2 | 排气管 | 极速版 | Savanna | $1590 | +| 1133 | wg_l_lr_sv | 侧裙 | 右侧`镀铬条纹`侧裙 | Savanna | $830 | +| 1134 | wg_l_lr_t1 | 侧裙 | 右侧`镀铬条纹`侧裙 | Tornado | $800 | +| 1135 | exh_lr_t2 | 排气管 | 极速版 | Tornado | $1500 | +| 1136 | exh_lr_t1 | 排气管 | 镀铬版 | Tornado | $1000 | +| 1137 | wg_r_lr_t1 | 侧裙 | 左侧`镀铬条纹`侧裙 | Tornado | $800 | +| 1138 | spl_a_s_b | 扰流板 | 外星人版 | Sultan | $580 | +| 1139 | spl_c_s_b | 扰流板 | X-Flow 版 | Sultan | $470 | +| 1140 | rbmp_c_s | 后保险杠 | X-Flow 版 | Sultan | $870 | +| 1141 | rbmp_a_s | 后保险杠 | 外星人版 | Sultan | $980 | +| 1142 | bntr_b_ov | 通风口 | 左侧椭圆通风口 | 特定 Transfender 车辆 | $150 | +| 1143 | bntl_b_ov | 通风口 | 右侧椭圆通风口 | 特定 Transfender 车辆 | $150 | +| 1144 | bntr_b_sq | 通风口 | 左侧方形通风口 | 特定 Transfender 车辆 | $100 | +| 1145 | bntl_b_sq | 通风口 | 右侧方形通风口 | 特定 Transfender 车辆 | $100 | +| 1146 | spl_c_l_b | 扰流板 | X-Flow 版 | Elegy | $490 | +| 1147 | spl_a_l_b | 扰流板 | 外星人版 | Elegy | $600 | +| 1148 | rbmp_c_l | 后保险杠 | X-Flow 版 | Elegy | $890 | +| 1149 | rbmp_a_l | 后保险杠 | 外星人版 | Elegy | $1000 | +| 1150 | rbmp_a_f | 后保险杠 | 外星人版 | Flash | $1090 | +| 1151 | rbmp_c_f | 后保险杠 | X-Flow 版 | Flash | $840 | +| 1152 | fbmp_c_f | 前保险杠 | X-Flow 版 | Flash | $910 | +| 1153 | fbmp_a_f | 前保险杠 | 外星人版 | Flash | $1200 | +| 1154 | rbmp_a_s | 后保险杠 | 外星人版 | Stratum | $1030 | +| 1155 | fbmp_a_st | 前保险杠 | 外星人版 | Stratum | $1030 | +| 1156 | rbmp_c_st | 后保险杠 | X-Flow 版 | Stratum | $920 | +| 1157 | fbmp_c_st | 前保险杠 | X-Flow 版 | Stratum | $930 | +| 1158 | spl_c_j_b | 扰流板 | X-Flow 版 | Jester | $550 | +| 1159 | rbmp_a_j | 后保险杠 | 外星人版 | Jester | $1050 | +| 1160 | fbmp_a_j | 前保险杠 | 外星人版 | Jester | $1050 | +| 1161 | rbmp_c_j | 后保险杠 | X-Flow 版 | Jester | $950 | +| 1162 | spl_a_j_b | 扰流板 | 外星人版 | Jester | $650 | +| 1163 | spl_c_u_b | 扰流板 | X-Flow 版 | Uranus | $450 | +| 1164 | spl_a_u_b | 扰流板 | 外星人版 | Uranus | $550 | +| 1165 | fbmp_c_u | 前保险杠 | X-Flow 版 | Uranus | $850 | +| 1166 | fbmp_a_u | 前保险杠 | 外星人版 | Uranus | $950 | +| 1167 | rbmp_c_u | 后保险杠 | X-Flow 版 | Uranus | $850 | +| 1168 | rbmp_a_u | 后保险杠 | 外星人版 | Uranus | $950 | +| 1169 | fbmp_a_s | 前保险杠 | 外星人版 | Sultan | $970 | +| 1170 | fbmp_c_s | 前保险杠 | X-Flow 版 | Sultan | $880 | +| 1171 | fbmp_a_l | 前保险杠 | 外星人版 | Elegy | $990 | +| 1172 | fbmp_c_l | 前保险杠 | X-Flow 版 | Elegy | $900 | +| 1173 | fbmp_c_j | 前保险杠 | X-Flow 版 | Jester | $950 | +| 1174 | fbmp_lr_br1 | 前保险杠 | 镀铬版 | Broadway | $1000 | +| 1175 | fbmp_lr_br2 | 前保险杠 | 极速版 | Broadway | $900 | +| 1176 | rbmp_lr_br1 | 后保险杠 | 镀铬版 | Broadway | $1000 | +| 1177 | rbmp_lr_br2 | 后保险杠 | 极速版 | Broadway | $900 | +| 1178 | rbmp_lr_rem2 | 后保险杠 | 极速版 | Remington | $2050 | +| 1179 | fbmp_lr_rem1 | 前保险杠 | 镀铬版 | Remington | $2150 | +| 1180 | rbmp_lr_rem1 | 后保险杠 | 镀铬版 | Remington | $2130 | +| 1181 | fbmp_lr_bl2 | 前保险杠 | 极速版 | Blade | $2050 | +| 1182 | fbmp_lr_bl1 | 前保险杠 | 镀铬版 | Blade | $2130 | +| 1183 | rbmp_lr_bl2 | 后保险杠 | 极速版 | Blade | $2040 | +| 1184 | rbmp_lr_bl1 | 后保险杠 | 镀铬版 | Blade | $2150 | +| 1185 | fbmp_lr_rem2 | 前保险杠 | 极速版 | Remington | $2040 | +| 1186 | rbmp_lr_sv2 | 后保险杠 | 极速版 | Savanna | $2095 | +| 1187 | rbmp_lr_sv1 | 后保险杠 | 镀铬版 | Savanna | $2175 | +| 1188 | fbmp_lr_sv2 | 前保险杠 | 极速版 | Savanna | $2080 | +| 1189 | fbmp_lr_sv1 | 前保险杠 | 镀铬版 | Savanna | $2200 | +| 1190 | fbmp_lr_t2 | 前保险杠 | 极速版 | Tornado | $1200 | +| 1191 | fbmp_lr_t1 | 前保险杠 | 镀铬版 | Tornado | $1040 | +| 1192 | rbmp_lr_t1 | 后保险杠 | 镀铬版 | Tornado | $940 | +| 1193 | rbmp_lr_t2 | 后保险杠 | 极速版 | Tornado | $1100 | + +## 各车辆可用组件对照表 + +| 车辆名称 | 车辆 ID | 支持组件 ID 列表 | +| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Landstalker | 400 | 1008, 1009, 1010, 1013, 1018, 1019, 1020, 1021, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Bravura | 401 | 1001, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1013, 1017, 1019, 1020, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Buffalo | 402 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Linerunner | 403 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Perrenial | 404 | 1000, 1002, 1007, 1008, 1009, 1010, 1013, 1016, 1017, 1019, 1020, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Sentinel | 405 | 1000, 1001, 1008, 1009, 1010, 1014, 1018, 1019, 1020, 1021, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Dumper | 406 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Firetruck | 407 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Trashmaster | 408 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Stretch | 409 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Manana | 410 | 1001, 1003, 1007, 1008, 1009, 1010, 1013, 1017, 1019, 1020, 1021, 1023, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Infernus | 411 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Voodoo | 412 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Pony | 413 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Mule | 414 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Cheetah | 415 | 1001, 1003, 1007, 1008, 1009, 1010, 1017, 1018, 1019, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Ambulance | 416 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Leviathan | 417 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Moonbeam | 418 | 1002, 1006, 1008, 1009, 1010, 1016, 1020, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Esperanto | 419 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Taxi | 420 | 1001, 1003, 1004, 1005, 1008, 1009, 1010, 1019, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Washington | 421 | 1000, 1008, 1009, 1010, 1014, 1016, 1018, 1019, 1020, 1021, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Bobcat | 422 | 1007, 1008, 1009, 1010, 1013, 1017, 1019, 1020, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Mr Whoopee | 423 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| BF Injection | 424 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Hunter | 425 | 无 | +| Premier | 426 | 1001, 1003, 1004, 1005, 1006, 1008, 1009, 1010, 1019, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Enforcer | 427 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Securicar | 428 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Banshee | 429 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Predator | 430 | 无 | +| Bus | 431 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Rhino | 432 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Barracks | 433 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Hotknife | 434 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Trailer 1 | 435 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Previon | 436 | 1001, 1003, 1006, 1007, 1008, 1009, 1010, 1013, 1017, 1019, 1020, 1021, 1022, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Coach | 437 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Cabbie | 438 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Stallion | 439 | 1001, 1003, 1007, 1008, 1009, 1010, 1013, 1017, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Rumpo | 440 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| RC Bandit | 441 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Romero | 442 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Packer | 443 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Monster | 444 | 无 | +| Admiral | 445 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Squalo | 446 | 无 | +| Seasparrow | 447 | 无 | +| Pizzaboy | 448 | 无 | +| Tram | 449 | 无 | +| Trailer 2 | 450 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Turismo | 451 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Speeder | 452 | 无 | +| Reefer | 453 | 无 | +| Tropic | 454 | 无 | +| Flatbed | 455 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Yankee | 456 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Caddy | 457 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Solair | 458 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Berkley's RC Van | 459 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Skimmer | 460 | 无 | +| PCJ-600 | 461 | 无 | +| Faggio | 462 | 无 | +| Freeway | 463 | 无 | +| RC Baron | 464 | 无 | +| RC Raider | 465 | 无 | +| Glendale | 466 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Oceanic | 467 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Sanchez | 468 | 无 | +| Sparrow | 469 | 无 | +| Patriot | 470 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Quad | 471 | 无 | +| Coastguard | 472 | 无 | +| Dinghy | 473 | 无 | +| Hermes | 474 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Sabre | 475 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Rustler | 476 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| ZR-350 | 477 | 1006, 1007, 1008, 1009, 1010, 1017, 1018, 1019, 1020, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Walton | 478 | 1004, 1005, 1008, 1009, 1010, 1012, 1013, 1020, 1021, 1022, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Regina | 479 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Comet | 480 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| BMX | 481 | 无 | +| Burrito | 482 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Camper | 483 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Marquis | 484 | 无 | +| Baggage | 485 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Dozer | 486 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Maverick | 487 | 无 | +| News Chopper | 488 | 无 | +| Rancher | 489 | 1000, 1002, 1004, 1005, 1006, 1008, 1009, 1010, 1013, 1016, 1018, 1019, 1020, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| FBI Rancher | 490 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Virgo | 491 | 1003, 1007, 1008, 1009, 1010, 1014, 1017, 1018, 1019, 1020, 1021, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Greenwood | 492 | 1000, 1004, 1005, 1006, 1008, 1009, 1010, 1016, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Jetmax | 493 | 无 | +| Hotring | 494 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Sandking | 495 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Blista Compact | 496 | 1001, 1002, 1003, 1006, 1007, 1008, 1009, 1010, 1011, 1017, 1019, 1020, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143 | +| Police Maverick | 497 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Boxville | 498 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Benson | 499 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Mesa | 500 | 1008, 1009, 1010, 1013, 1019, 1020, 1021, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| RC Goblin | 501 | 无 | +| Hotring Racer A | 502 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Hotring Racer B | 503 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Bloodring Banger | 504 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Rancher | 505 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Super GT | 506 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Elegant | 507 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Journey | 508 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Bike | 509 | 无 | +| Mountain Bike | 510 | 无 | +| Beagle | 511 | 无 | +| Cropdust | 512 | 无 | +| Stunt | 513 | 无 | +| Tanker | 514 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Roadtrain | 515 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Nebula | 516 | 1000, 1002, 1004, 1007, 1008, 1009, 1010, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Majestic | 517 | 1002, 1003, 1007, 1008, 1009, 1010, 1016, 1017, 1018, 1019, 1020, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Buccaneer | 518 | 1001, 1003, 1005, 1006, 1007, 1008, 1009, 1010, 1013, 1017, 1018, 1020, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Shamal | 519 | 无 | +| Hydra | 520 | 无 | +| FCR-900 | 521 | 无 | +| NRG-500 | 522 | 无 | +| HPV1000 | 523 | 无 | +| Cement Truck | 524 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Tow Truck | 525 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Fortune | 526 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Cadrona | 527 | 1001, 1007, 1008, 1009, 1010, 1014, 1015, 1017, 1018, 1020, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| FBI Truck | 528 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Willard | 529 | 1001, 1003, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1017, 1018, 1019, 1020, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Forklift | 530 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Tractor | 531 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Combine | 532 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Feltzer | 533 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Remington | 534 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1100, 1101, 1106, 1122, 1123, 1124, 1125, 1126, 1127, 1178, 1179, 1180, 1185 | +| Slamvan | 535 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1109, 1110, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121 | +| Blade | 536 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1103, 1104, 1105, 1107, 1108, 1128, 1181, 1182, 1183, 1184 | +| Freight | 537 | 无 | +| Streak | 538 | 无 | +| Vortex | 539 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Vincent | 540 | 1001, 1004, 1006, 1007, 1008, 1009, 1010, 1017, 1018, 1019, 1020, 1023, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Bullet | 541 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Clover | 542 | 1008, 1009, 1010, 1014, 1015, 1018, 1019, 1020, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1144, 1145 | +| Sadler | 543 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Firetruck LA | 544 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Hustler | 545 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Intruder | 546 | 1001, 1002, 1004, 1006, 1007, 1008, 1009, 1010, 1017, 1018, 1019, 1023, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Primo | 547 | 1000, 1003, 1008, 1009, 1010, 1016, 1018, 1019, 1020, 1021, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143 | +| Cargobob | 548 | 无 | +| Tampa | 549 | 1001, 1003, 1007, 1008, 1009, 1010, 1011, 1012, 1017, 1018, 1019, 1020, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Sunrise | 550 | 1001, 1003, 1004, 1005, 1006, 1008, 1009, 1010, 1018, 1019, 1020, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Merit | 551 | 1002, 1003, 1005, 1006, 1008, 1009, 1010, 1016, 1018, 1019, 1020, 1021, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Utility | 552 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Nevada | 553 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Yosemite | 554 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Windsor | 555 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Monster A | 556 | 无 | +| Monster B | 557 | 无 | +| Uranus | 558 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1163, 1164, 1165, 1166, 1167, 1168 | +| Jester | 559 | 1008, 1009, 1010, 1025, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1158, 1159, 1160, 1161, 1162, 1173 | +| Sultan | 560 | 1008, 1009, 1010, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1138, 1139, 1140, 1141, 1169, 1170 | +| Stratum | 561 | 1008, 1009, 1010, 1025, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1154, 1155, 1156, 1157 | +| Elegy | 562 | 1008, 1009, 1010, 1025, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1146, 1147, 1148, 1149, 1171, 1172 | +| Raindance | 563 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| RC Tiger | 564 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Flash | 565 | 1008, 1009, 1010, 1025, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1150, 1151, 1152, 1153 | +| Tahoma | 566 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Savanna | 567 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1102, 1129, 1130, 1131, 1132, 1133, 1186, 1187, 1188, 1189 | +| Bandito | 568 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Freight Flat | 569 | 无 | +| Streak Carriage | 570 | 无 | +| Kart | 571 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Mower | 572 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Duneride | 573 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Sweeper | 574 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Broadway | 575 | 1008, 1009, 1010, 1025, 1042, 1043, 1044, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1099, 1174, 1175, 1176, 1177 | +| Tornado | 576 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1134, 1135, 1136, 1137, 1190, 1191, 1192, 1193 | +| AT-400 | 577 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| DFT-30 | 578 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Huntley | 579 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Stafford | 580 | 1001, 1006, 1007, 1008, 1009, 1010, 1017, 1018, 1020, 1023, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| BF-400 | 581 | 无 | +| Newsvan | 582 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Tug | 583 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Trailer 3 | 584 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Emperor | 585 | 1000, 1001, 1002, 1003, 1006, 1007, 1008, 1009, 1010, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Wayfarer | 586 | 无 | +| Euros | 587 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Hotdog | 588 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Club | 589 | 1000, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1013, 1016, 1017, 1018, 1020, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1144, 1145 | +| Freight Carriage | 590 | 无 | +| Trailer 3 | 591 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Andromada | 592 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Dodo | 593 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| RC Cam | 594 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Launch | 595 | 无 | +| Police Car (LSPD) | 596 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Police Car (SFPD) | 597 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Police Car (LVPD) | 598 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Police Ranger | 599 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Picador | 600 | 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1013, 1017, 1018, 1020, 1022, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| S.W.A.T. Van | 601 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Alpha | 602 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Phoenix | 603 | 1001, 1006, 1007, 1008, 1009, 1010, 1017, 1018, 1019, 1020, 1023, 1024, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098, 1142, 1143, 1144, 1145 | +| Glendale | 604 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Sadler | 605 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Luggage Trailer A | 606 | 无 | +| Luggage Trailer B | 607 | 无 | +| Stair Trailer | 608 | 无 | +| Boxville | 609 | 1008, 1009, 1010, 1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1096, 1097, 1098 | +| Farm Plow | 610 | 无 | +| Utility Trailer | 611 | 无 | + +## 所有车辆费用均以逗号分隔 + +`400, 550, 200, 250, 100, 150, 80, 500, 500, 200, 1000, 220, 250, 100, 400, 500, 200, 500, 350, 300, 250, 200, 150, 350, 50, 1000, 480, 480, 770, 680, 370, 370, 170, 120, 790, 150, 500, 690, 190, 390, 500, 390, 1000, 500, 500, 510, 710, 670, 530, 810, 620, 670, 530, 130, 210, 230, 520, 430, 620, 720, 530, 180, 550, 430, 830, 850, 750, 250, 200, 550, 450, 550, 450, 1100, 1030, 980, 1560, 1620, 1200, 1030, 900, 1230, 820, 1560, 1350, 770, 100, 1500, 150, 650, 450, 100, 750, 350, 450, 350, 1000, 620, 1140, 1000, 940, 780, 830, 3250, 1610, 1540, 780, 780, 780, 1610, 1540, 0, 0, 3340, 3250, 2130, 2050, 2040, 780, 940, 780, 940, 780, 860, 780, 1120, 3340, 3250, 3340, 1650, 3380, 3290, 1590, 830, 800, 1500, 1000, 800, 580, 470, 870, 980, 150, 150, 100, 100, 490, 600, 890, 1000, 1090, 840, 910, 1200, 1030, 1030, 920, 930, 550, 1050, 1050, 950, 650, 450, 550, 850, 950, 850, 950, 970, 880, 990, 900, 950, 1000, 900, 1000, 900, 2050, 2150, 2130, 2050, 2130, 2040, 2150, 2040, 2095, 2175, 2080, 2200, 1200, 1040, 940, 1100` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/clicksources.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/clicksources.md new file mode 100644 index 00000000000..d85c2267161 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/clicksources.md @@ -0,0 +1,15 @@ +--- +title: 点击来源 +sidebar_label: 点击来源 +description: 点击来源 +--- + +:::info + +以下是[OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer)回调使用的点击来源列表。当前仅存在一种点击来源类型。 + +::: + +| 值 | 常量符号 | +| --- | --------------------------------------- | +| 0 | 点击来源记分牌(CLICK_SOURCE_SCOREBOARD) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/colorslist.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/colorslist.md new file mode 100644 index 00000000000..8792b2a4831 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/colorslist.md @@ -0,0 +1,222 @@ +--- +title: 颜色列表 +sidebar_label: 颜色列表 +description: 颜色在SA-MP中无处不在——车辆、玩家昵称与地图标记、文本绘图、游戏文本、聊天信息、3D文本和对话框(通过颜色嵌入)!以下是关于这些不同元素的详细信息。 +--- + +## 聊天文本与玩家颜色 + +SA-MP 中的颜色通常采用十六进制表示(也可使用整数值)。聊天文本或玩家颜色的格式为:0xRRGGBBAA。 + +_RR_ 表示红色分量,_GG_ 表示绿色分量,_BB_ 表示蓝色分量。_AA_ 为透明度值(Alpha 通道)。若使用 FF 则完全不透明,00 则为完全透明。 + +这些颜色的十六进制代码可参考[十六进制颜色表](hexcolors)页面。 + +--- + +### 透明度值 + +以下图片展示了使用白色方块作为玩家标记背景时不同透明度值的视觉效果。演示采用 0x11(十进制 17)的增量变化,实际可使用任意值。 + +![透明度矩阵图示](https://assets.open.mp/assets/images/colorList/transparency/trans_matrix.png) + +--- + +### 颜色运算 + +由于颜色本质是数值,可进行数学运算(尽管并非所有运算都有实际意义)。例如动态调整玩家地图标记的可见度: + +```c +SetPlayerMarkerVisibility(playerid, alpha = 0xFF) +{ + new oldcolor, newcolor; + + alpha = clamp(alpha, 0x00, 0xFF); // 若提供的值超出范围,在此修正 + oldcolor = GetPlayerColor(playerid); // 获取当前颜色(需已调用SetPlayerColor) + + newcolor = (oldcolor & ~0xFF) | alpha; // 剥离原透明度数据后应用新值 + return SetPlayerColor(playerid, newcolor); // 成功返回1,失败返回0 +} +``` + +--- + +### Pawn 中的字符串转颜色值 + +使用以下函数将"RRGGBBAA"格式字符串转换为颜色数值: + +```c +stock HexToInt(string[]) +{ + if (!string[0]) + { + return 0; + } + + new + cur = 1, + res = 0; + + for (new i = strlen(string); i > 0; i--) + { + res += cur * (string[i - 1] - ((string[i - 1] < 58) ? (48) : (55))); + cur = cur * 16; + } + return res; +} +``` + +调用 HexToInt("RRGGBBAA")可获得适用于[SetPlayerColor](../functions/SetPlayerColor)的数值。 + +--- + +### 颜色嵌入 + +可在以下场景使用内嵌颜色代码: + +- [SendClientMessage](../functions/SendClientMessage) +- [ShowPlayerDialog](../functions/ShowPlayerDialog) +- [Create3DTextLabel](../functions/Create3DTextLabel) +- [SetObjectMaterialText](../functions/SetObjectMaterialText) +- [SetVehicleNumberPlate](../functions/SetVehicleNumberPlate) + +该功能与[游戏文本颜色](../resources/gametextstyles)的用法相似,但支持自定义任意颜色值。 + +:::caution + +此方式不适用于文本绘图,详见[游戏文本样式](../resources/gametextstyles)。 + +::: + +--- + +#### 示例 + +```c +{FFFFFF}白色文本 {00FF00}绿色文本 {FF0000}红色文本 +``` + +效果: +![颜色嵌入示例1](https://assets.open.mp/assets/images/colorList/Example1.png) + +--- + +#### 进阶示例 + +![复杂颜色嵌入](https://assets.open.mp/assets/images/colorList/Cembed.png) +实现代码: + +```c +SendClientMessage(playerid, COLOR_WHITE, "欢迎来到 {00FF00}M{FFFFFF}a{FF0000}r{FFFFFF}c{00FF00}o{FFFFFF}'{FF0000}s {FFFFFF}B{00FF00}i{FFFFFF}s{FF0000}t{FFFFFF}r{00FF00}o{FFFFFF}!"); +``` + +颜色宏定义建议: + +```c +#define COLOR_RED_EMBED "{FF0000}" + +SendClientMessage(playerid, -1, "这是白色文本"COLOR_RED_EMBED"这是红色文本。"); +``` + +或者 + +```c +#define COLOR_RED_EMBED "FF0000" + +SendClientMessage(playerid, -1, "白色文本{"COLOR_RED_EMBED"}红色文本"); +``` + +第二个示例方案更优,因其能更清晰地体现颜色嵌入的用法。 + +--- + +#### 结合玩家颜色 + +要使用玩家的颜色作为嵌入颜色,你必须首先移除 alpha 值。为此,执行逻辑右移。 + +```c +new msg[128]; +format(msg, sizeof(msg), "{ffffff}白色文本 {%06x}玩家颜色文本", GetPlayerColor(playerid) >>> 8); +SendClientMessage(playerid, 0xffffffff, msg); +``` + +在格式化字符串中: + +- `%x` 是十六进制值的占位符 +- `6` 确保输出始终为 6 位字符长度 +- `0` 表示不足 6 位时用前导零填充 + +重要提示: +[GetPlayerColor](../functions/GetPlayerColor) 需在预先调用[SetPlayerColor](../functions/SetPlayerColor) 的情况下才能正确获取颜色值。 + +颜色嵌入使用的格式与常规 Pawn 十六进制颜色不同: + +- 不需要 `0x` 前缀 +- 不包含透明度通道(最后两位数字) + +--- + +### 颜色选择工具 + +- [SA-MP 调色板](http://www.gtavision.com/index.php?section=downloads&site=download&id=1974) +- [December 色表](http://www.december.com/html/spec/color.html) +- [RGB 拾取器](http://psyclops.com/tools/rgb) +- [Adobe 配色](https://kuler.adobe.com/create/color-wheel/) +- [配色设计器](http://colorschemedesigner.com/) + +--- + +## 游戏文本颜色 + +使用特殊标签设置游戏文本颜色: + +```c +~r~ 红 +~g~ 绿 +~b~ 蓝 +~w~ 白 +~y~ 黄 +~p~ 紫 +~l~ 黑 +~h~ 亮色 +``` + +通过叠加颜色标签可轻松创建渐变效果(注意以下颜色与基础标签颜色存在差异): + +```c +~y~ 纯黄 +~r~~h~ 浅红 +~r~~h~~h~ 粉红色 +~r~~h~~h~~h~ 深粉 +~r~~h~~h~~h~~h~ 浅粉红 +~r~~h~~h~~h~~h~~h~ 亮粉 +~g~~h~ 浅绿 +~g~~h~~h~ 淡草绿 +~g~~h~~h~~h~ 海绿色 +~g~~h~~h~~h~~h~ 米白色 +~b~~h~ 天蓝 +~b~~h~~h~ 蓝紫色 +~b~~h~~h~~h~ 淡蓝 +~y~~h~~h~ 乳白色 +~p~~h~ 玫粉色 +``` + +--- + +### 示例 + +```c +~w~白色 ~b~蓝色 ~r~红色 +``` + +效果: +![基础颜色示例](https://assets.open.mp/assets/images/colorList/Blueandred.png) + +添加`~h~`提亮颜色: + +```c +~w~白色 ~b~~h~亮蓝 ~r~~h~亮红 +``` + +效果: +![高亮颜色示例](https://assets.open.mp/assets/images/colorList/Blueandred2.png) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/connectionstatus.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/connectionstatus.md new file mode 100644 index 00000000000..ac3e71aebfb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/connectionstatus.md @@ -0,0 +1,23 @@ +--- +title: 连接状态 +sidebar_label: 连接状态 +description: NetStats_ConnectionStatus函数使用的连接状态 +--- + +## 描述 + +本页面包含[NetStats_ConnectionStatus](../functions/NetStats_ConnectionStatus)使用的连接状态常量。这些常量由 RakNet(SA-MP 使用的网络库)内部使用。 + +## 常用状态 + +| ID | 状态(英文常量) | 描述 | +| --- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| 0 | 无操作状态(CONNECTION_STATUS_NO_ACTION **/** CONNSTAT_NO_ACTION) | 当需要向客户端发送数据包时,该操作将由独立线程处理。在此线程发送数据包的过程中,服务器可能同时接收到断开连接的数据包(这种情况可能导致数据竞争,从而引发未定义行为)。为解决此问题,连接状态将切换为 CONNECTION_STATUS_NO_ACTION,此时对玩家 ID 的任何修改都将被暂停,直到更新线程向主线程发出"执行许可"信号。作为服务器开发者,此连接状态与您并无直接关联,因此您可能永远不需要主动处理该状态。 | +| 1 | 立即断开(CONNECTION_STATUS_DISCONNECT_ASAP **/** CONNSTAT_DISCONNECT_ASAP) | 客户端将被尽快强制断开连接。在断开流程中 NetStats_ConnectionStatus 可能返回此值,具体表现为:玩家尚未完成"实质"断开操作,但[OnPlayerDisconnect](../callbacks/OnPlayerDisconnect)回调可能已为此玩家触发。 | +| 2 | 静默断开(CONNECTION_STATUS_DISCONNECT_ASAP_SILENTLY **/** CONNSTAT_DISCONNECT_ASAP_SILNT) | 客户端将被立即断开且不发送 ID_DISCONNECTION_NOTIFICATION 数据包。SA-MP 在多种场景下触发此状态(尽管 SA-MP 核心逻辑层可能不直接使用,但 RakNet 底层网络库必定会处理),典型案例如:客户端输入错误的服务器密码时。 | +| 3 | 未确认断开(CONNECTION_STATUS_DISCONNECT_ON_NO_ACK **/** CONNSTAT_DISCONNECT_ON_NO_ACK) | 未明确用途。 | +| 4 | 连接请求(CONNECTION_STATUS_REQUESTED_CONNECTION **/** CONNSTAT_REQUESTED_CONNECTION) | 客户端已向服务器发起连接请求。 | +| 5 | 处理连接请求(CONNECTION_STATUS_HANDLING_CONNECTION_REQUEST **/** CONNSTAT_HANDLING_CONN_REQ) | 服务器当前正在处理客户端的连接请求。 | +| 6 | 未验证发送方(CONNECTION_STATUS_UNVERIFIED_SENDER **/** CONNSTAT_UNVERIFIED_SENDER) | 初始状态下,所有传入连接请求均标记为 UNVERIFIED_SENDER。在此状态持续期间,服务器仅会处理 ID_CONNECTION_REQUEST 类型的数据包。如果客户端发送其他类型的数据包,服务器将自动终止连接并将该客户端 IP 加入临时黑名单。目前尚不确定[NetStats_ConnectionStatus](../functions/NetStats_ConnectionStatus)是否可能返回此状态值。 | +| 7 | 加密设置(CONNECTION_STATUS_SET_ENCRYPTION_ON_MULTIPLE_16_BYTE_PACKET **/** CONNSTAT_SET_ENCRYPTION) | 未明确用途。 | +| 8 | 已连接(CONNECTION_STATUS_CONNECTED **/** CONNSTAT_CONNECTED) | 客户端已成功建立与服务器的连接。 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/constants.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/constants.md new file mode 100644 index 00000000000..63822d96737 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/constants.md @@ -0,0 +1,428 @@ +--- +title: 常量 +sidebar_label: 常量 +description: 标准库常量定义全集,包含各模块常量值及释义 +tags: [] +--- + +# a_samp + +## 系统限制 + +| 数值 | 常量名称 | 含义说明 | +| ----------------- | --------------------- | ------------------------ | +| 24 | MAX_PLAYER_NAME | 最长玩家昵称长度 | +| 1000 | MAX_PLAYERS | 最大玩家数量 | +| 2000 | MAX_VEHICLES | 最大车辆数量 | +| 1000 | MAX_ACTORS | 最大角色数量 | +| 1000 | MAX_OBJECTS | 最大物体数量 | +| 1024 | MAX_GANG_ZONES | 最大帮派区域数量 | +| Text:2048 | MAX_TEXT_DRAWS | 全局文本绘图最大数量 | +| PlayerText:256 | MAX_PLAYER_TEXT_DRAWS | 单个玩家文本绘图最大数量 | +| Menu:128 | MAX_MENUS | 最大菜单数量 | +| Text3D:1024 | MAX_3DTEXT_GLOBAL | 全局 3D 文本标签最大数量 | +| PlayerText3D:1024 | MAX_3DTEXT_PLAYER | 玩家 3D 文本标签最大数量 | +| 4096 | MAX_PICKUPS | 最大拾取物数量 | + +## 无效标识符 + +| 数值 | 常量名称 | 含义说明 | +| ------------------- | ------------------------ | ----------------------- | +| 255 | NO_TEAM | 无队伍标识 | +| 0xFFFF | INVALID_PLAYER_ID | 无效玩家 ID | +| 0xFFFF | INVALID_VEHICLE_ID | 无效车辆 ID | +| 0xFFFF | INVALID_ACTOR_ID | 无效角色 ID | +| 0xFFFF | INVALID_OBJECT_ID | 无效物体 ID | +| Menu:0xFF | INVALID_MENU | 无效菜单 ID | +| Text:0xFFFF | INVALID_TEXT_DRAW | 无效文本绘图 ID | +| PlayerText:0xFFFF | INVALID_PLAYER_TEXT_DRAW | 无效玩家文本绘图 ID | +| -1 | INVALID_GANG_ZONE | 无效帮派区域 ID | +| Text3D:0xFFFF | INVALID_3DTEXT_ID | 无效全局 3D 文本标签 ID | +| PlayerText3D:0xFFFF | INVALID_PLAYER_3DTEXT_ID | 无效玩家 3D 文本标签 ID | + +## 武器常量 + +| 数值 | 武器名称 | 常量名称 | 对应武器说明 | +| ---- | --------------- | ----------------------- | ---------------- | +| 0 | 拳头 | WEAPON_FIST | 徒手攻击 | +| 1 | 黄铜指虎 | WEAPON_BRASSKNUCKLE | 近战武器 | +| 2 | 高尔夫球杆 | WEAPON_GOLFCLUB | 钝器打击 | +| 3 | 警棍 | WEAPON_NITESTICK | 警用装备 | +| 4 | 匕首 | WEAPON_KNIFE | 刺伤武器 | +| 5 | 棒球棍 | WEAPON_BAT | 钝器打击 | +| 6 | 铁铲 | WEAPON_SHOVEL | 近战工具 | +| 7 | 台球杆 | WEAPON_POOLSTICK | 娱乐武器 | +| 8 | 武士刀 | WEAPON_KATANA | 冷兵器 | +| 9 | 电锯 | WEAPON_CHAINSAW | 高伤害近战 | +| 10 | 紫色按摩棒 | WEAPON_DILDO | 搞笑武器 | +| 11 | 白色按摩棒 | WEAPON_DILDO2 | 搞笑武器 | +| 12 | 振动器 | WEAPON_VIBRATOR | 搞笑武器 | +| 13 | 银色振动器 | WEAPON_VIBRATOR2 | 搞笑武器 | +| 14 | 花束 | WEAPON_FLOWER | 近战道具 | +| 15 | 手杖 | WEAPON_CANE | 钝器攻击 | +| 16 | 手榴弹 | WEAPON_GRENADE | 投掷爆炸物 | +| 17 | 催泪瓦斯 | WEAPON_TEARGAS | 范围控制武器 | +| 18 | 燃烧瓶 | WEAPON_MOLTOV | 燃烧效果投掷物 | +| 22 | 柯尔特 45 手枪 | WEAPON_COLT45 | 基础手枪 | +| 23 | 消音手枪 | WEAPON_SILENCED | 带消音器的手枪 | +| 24 | 沙漠之鹰 | WEAPON_DEAGLE | 高威力手枪 | +| 25 | 霰弹枪 | WEAPON_SHOTGUN | 近距离高伤害 | +| 26 | 短管霰弹枪 | WEAPON_SAWEDOFF | 双管霰弹枪 | +| 27 | 战斗霰弹枪 | WEAPON_SHOTGSPA | 连发霰弹枪 | +| 28 | UZI 冲锋枪 | WEAPON_UZI | 高射速微型冲锋枪 | +| 29 | MP5 冲锋枪 | WEAPON_MP5 | 标准冲锋枪 | +| 30 | AK-47 突击步枪 | WEAPON_AK47 | 高伤害自动步枪 | +| 31 | M4 卡宾枪 | WEAPON_M4 | 精准自动步枪 | +| 32 | TEC9 微型冲锋枪 | WEAPON_TEC9 | 便携式冲锋枪 | +| 33 | 猎枪 | WEAPON_RIFLE | 狙击步枪 | +| 34 | 狙击步枪 | WEAPON_SNIPER | 高倍镜远程武器 | +| 35 | 火箭发射器 | WEAPON_ROCKETLAUNCHER | 爆炸性范围伤害 | +| 36 | 热追踪导弹 | WEAPON_HEATSEEKER | 自动追踪火箭 | +| 37 | 火焰喷射器 | WEAPON_FLAMETHROWER | 持续火焰伤害 | +| 38 | 转轮机枪 | WEAPON_MINIGUN | 超高射速重武器 | +| 39 | 遥控炸弹包 | WEAPON_SATCHEL | 可放置的定时炸弹 | +| 40 | 炸弹 | WEAPON_BOMB | 即爆炸弹 | +| 41 | 喷漆罐 | WEAPON_SPRAYCAN | 涂鸦工具 | +| 42 | 灭火器 | WEAPON_FIREEXTINGUISHER | 灭火/推动效果 | +| 43 | 相机 | WEAPON_CAMERA | 拍照功能 | +| 46 | 降落伞 | WEAPON_PARACHUTE | 高空降落装备 | +| 49 | 车辆 | WEAPON_VEHICLE | 车辆碰撞伤害 | +| 53 | 溺水 | WEAPON_DROWN | 溺水死亡类型 | +| 54 | 碰撞 | WEAPON_COLLISION | 物理碰撞伤害类型 | + +## 玩家标记模式 + +| 数值 | 常量名称 | 显示模式说明 | +| ---- | ---------------------------- | ---------------------------- | +| 0 | PLAYER_MARKERS_MODE_OFF | 关闭玩家标记显示 | +| 1 | PLAYER_MARKERS_MODE_GLOBAL | 全局显示所有玩家标记 | +| 2 | PLAYER_MARKERS_MODE_STREAMED | 仅显示流加载范围内的玩家标记 | + +## 按键常量 + +| 数值 | 常量名称 | 对应操作说明 | +| ------ | -------------------- | ------------------------ | +| 1 | KEY_ACTION | 动作键(默认 F) | +| 2 | KEY_CROUCH | 蹲下键(默认 C) | +| 4 | KEY_FIRE | 开火键(鼠标左键) | +| 8 | KEY_SPRINT | 冲刺键(默认 Shift) | +| 16 | KEY_SECONDARY_ATTACK | 次要攻击键(鼠标右键) | +| 32 | KEY_JUMP | 跳跃键(默认空格) | +| 64 | KEY_LOOK_RIGHT | 向右看(默认数字键盘 6) | +| 128 | KEY_HANDBRAKE | 手刹键(默认空格) | +| 256 | KEY_LOOK_LEFT | 向左看(默认数字键盘 4) | +| 512 | KEY_SUBMISSION | 投降动作键 | +| 512 | KEY_LOOK_BEHIND | 向后看(默认数字键盘 5) | +| 1024 | KEY_WALK | 步行模式(默认 Alt) | +| 2048 | KEY_ANALOG_UP | 摇杆上方向 | +| 4096 | KEY_ANALOG_DOWN | 摇杆下方向 | +| 8192 | KEY_ANALOG_LEFT | 摇杆左方向 | +| 16384 | KEY_ANALOG_RIGHT | 摇杆右方向 | +| 65536 | KEY_YES | 确认键(默认 Y) | +| 131072 | KEY_NO | 取消键(默认 N) | +| 262144 | KEY_CTRL_BACK | 返回键(默认 Backspace) | + +## 对话框样式 + +| 数值 | 常量名称 | 界面样式说明 | +| ---- | ---------------------------- | -------------------- | +| 0 | DIALOG_STYLE_MSGBOX | 消息框样式(无输入) | +| 1 | DIALOG_STYLE_INPUT | 输入框样式 | +| 2 | DIALOG_STYLE_LIST | 列表选择样式 | +| 3 | DIALOG_STYLE_PASSWORD | 密码输入样式 | +| 4 | DIALOG_STYLE_TABLIST | 分页列表样式 | +| 5 | DIALOG_STYLE_TABLIST_HEADERS | 带表头的分页列表样式 | + +## 文本绘图字体 + +| 数值 | 常量名称 | 字体类型说明 | +| ---- | ---------------------------- | ------------------------ | +| 0 | TEXT_DRAW_FONT_0 | 标准游戏字体(GTA 样式) | +| 1 | TEXT_DRAW_FONT_1 | 带黑色描边的粗体字体 | +| 2 | TEXT_DRAW_FONT_2 | 细长型字体 | +| 3 | TEXT_DRAW_FONT_3 | 压缩数字字体 | +| 4 | TEXT_DRAW_FONT_SPRITE_DRAW | 精灵图字体 | +| 5 | TEXT_DRAW_FONT_MODEL_PREVIEW | 3D 模型预览字体 | + +## 文本绘图字体(open.mp 扩展) + +| 数值 | 常量名称 | 具体字体说明 | +| ---- | ------------------------------ | ---------------- | +| 0 | TEXT_DRAW_FONT_BECKETT_REGULAR | 标准贝克特字体 | +| 1 | TEXT_DRAW_FONT_AHARONI_BOLD | 阿哈龙尼粗体 | +| 2 | TEXT_DRAW_FONT_BANK_GOTHIC | 银行哥特字体 | +| 3 | TEXT_DRAW_FONT_PRICEDOWN | 价格标签专用字体 | +| 4 | TEXT_DRAW_FONT_SPRITE | 精灵图字体 | +| 5 | TEXT_DRAW_FONT_PREVIEW | 模型预览专用字体 | + +## 文本对齐方式 + +| 数值 | 常量名称 | 对齐模式说明 | +| ---- | ---------------------- | ------------------ | +| 1 | TEXT_DRAW_ALIGN_LEFT | 左对齐 | +| 2 | TEXT_DRAW_ALIGN_CENTRE | 居中对齐 | +| 2 | TEXT_DRAW_ALIGN_CENTER | 居中对齐(美式拼写) | +| 3 | TEXT_DRAW_ALIGN_RIGHT | 右对齐 | + +## 服务器变量类型 + +| 数值 | 常量名称 | 变量类型说明 | +| ---- | --------------------- | ------------ | +| 0 | SERVER_VARTYPE_NONE | 无类型 | +| 1 | SERVER_VARTYPE_INT | 整型变量 | +| 2 | SERVER_VARTYPE_STRING | 字符串变量 | +| 3 | SERVER_VARTYPE_FLOAT | 浮点型变量 | + +好的,我现在需要处理用户提供的关于 SA-MP(San Andreas Multiplayer)的常量文档翻译任务。用户希望我在每个常量值后面添加中文注释,说明其含义。首先,我需要仔细查看用户提供的文档结构,确保理解各个表格和常量的用途。 + +首先,我看到文档分为多个部分,包括 Artwork/Net Models、Click Sources、Edit Response Types 等,每个部分都有对应的常量表。我的任务是将这些表格中的常量名称和值翻译成中文,并在常量名称后添加注释,解释其具体含义。 + +接下来,我需要确保遵循用户之前的规则,比如保留 Markdown 格式,不修改 frontmatter,正确翻译表头,保留代码块和链接等。同时,要参考用户提供的专有名词翻译,如 GameMode 翻译为游戏模式,Vehicle 翻译为车辆等。此外,需要注意技术细节的准确性,确保翻译后的内容不丢失重要信息。 + +在处理每个表格时,我会逐行检查常量名称和值,查找对应的中文翻译。例如,"DOWNLOAD_REQUEST_EMPTY"需要翻译为“空下载请求”,并在后面注释其用途。对于某些可能不太直观的常量,如“BULLET_HIT_TYPE_PLAYER_OBJECT”,我需要确保注释清晰,说明这是子弹击中玩家创建的物体。 + +同时,需要注意一些重复或类似的常量,比如不同的 SPECIAL_ACTION,需要统一翻译风格,确保注释一致。例如,“SPECIAL_ACTION_DUCK”翻译为“蹲下动作”,而“SPECIAL_ACTION_USEJETPACK”则是“使用喷气背包”。 + +在处理车辆相关部分时,如 Car Mod Type 中的“CARMODTYPE_SPOILER”应译为“扰流板改装”,并注释说明这是车辆改装类型之一。对于 VEHICLE_PARAMS,需要区分“VEHICLE_PARAMS_UNSET”为“参数未设置”,“VEHICLE_PARAMS_OFF”为“关闭状态”等。 + +在物体材质部分,如 OBJECT_MATERIAL_SIZE_32x32 需要准确翻译尺寸,并说明这是材质纹理的尺寸。对于对齐方式,如“OBJECT_MATERIAL_TEXT_ALIGN_LEFT”翻译为“左对齐”,并注释其在文本显示中的应用。 + +HTTP 错误部分需要注意技术术语的准确性,如“HTTP_ERROR_BAD_HOST”译为“错误的主机地址”,并说明连接失败的原因。同时,确保所有错误代码的注释清晰,便于开发者理解。 + +整个过程中,我需要不断检查翻译的准确性和一致性,确保符合用户的要求,不遗漏任何常量,并且注释简洁明了。此外,还要注意表格的对齐和格式,避免因翻译导致格式混乱。最后,通读整个翻译文档,确保流畅自然,技术细节无误,符合信达雅的标准。 + +``` +## 美术资源/网络模型 + +| 数值 | 常量名称 | 功能说明 | +|------|-----------------------------|--------------------------------| +| 0 | DOWNLOAD_REQUEST_EMPTY | 空下载请求状态 | +| 1 | DOWNLOAD_REQUEST_MODEL_FILE | 模型文件下载请求 | +| 2 | DOWNLOAD_REQUEST_TEXTURE_FILE| 纹理文件下载请求 | + +## 点击来源 + +| 数值 | 常量名称 | 触发来源说明 | +|------|-----------------------|---------------------------| +| 0 | CLICK_SOURCE_SCOREBOARD | 来自记分牌的点击事件 | + +## 编辑响应类型 + +| 数值 | 常量名称 | 操作状态说明 | +|------|--------------------|---------------------------| +| 0 | EDIT_RESPONSE_CANCEL | 编辑操作被取消 | +| 1 | EDIT_RESPONSE_FINAL | 最终确认的编辑操作 | +| 2 | EDIT_RESPONSE_UPDATE | 编辑过程中的实时更新 | + +## 物体选择类型 + +| 数值 | 常量名称 | 选择范围说明 | +|------|---------------------------|---------------------------| +| 1 | SELECT_OBJECT_GLOBAL_OBJECT | 选择全局物体 | +| 2 | SELECT_OBJECT_PLAYER_OBJECT | 选择玩家私有物体 | + +## 子弹命中类型 + +| 数值 | 常量名称 | 命中目标类型说明 | +|------|-----------------------------|---------------------------| +| 0 | BULLET_HIT_TYPE_NONE | 未命中任何目标 | +| 1 | BULLET_HIT_TYPE_PLAYER | 命中其他玩家 | +| 2 | BULLET_HIT_TYPE_VEHICLE | 命中车辆 | +| 3 | BULLET_HIT_TYPE_OBJECT | 命中地图物体 | +| 4 | BULLET_HIT_TYPE_PLAYER_OBJECT | 命中玩家创建的物体 | + +# a_players + +## 玩家限制 + +| 数值 | 常量名称 | 系统限制说明 | +|------|---------------------------|---------------------------| +| 10 | MAX_PLAYER_ATTACHED_OBJECTS | 最大附加物体数量 | +| 144 | MAX_CHATBUBBLE_LENGTH | 聊天泡泡最大字符长度 | + +## 特殊动作 + +| 数值 | 常量名称 | 动作说明 | +|------|-------------------------------|---------------------------| +| 0 | SPECIAL_ACTION_NONE | 无特殊动作 | +| 1 | SPECIAL_ACTION_DUCK | 蹲下动作 | +| 2 | SPECIAL_ACTION_USEJETPACK | 使用喷气背包 | +| 3 | SPECIAL_ACTION_ENTER_VEHICLE | 进入车辆动作 | +| 4 | SPECIAL_ACTION_EXIT_VEHICLE | 离开车辆动作 | +| 5 | SPECIAL_ACTION_DANCE1 | 舞蹈动作1 | +| 6 | SPECIAL_ACTION_DANCE2 | 舞蹈动作2 | +| 7 | SPECIAL_ACTION_DANCE3 | 舞蹈动作3 | +| 8 | SPECIAL_ACTION_DANCE4 | 舞蹈动作4 | +| 10 | SPECIAL_ACTION_HANDSUP | 举手投降动作 | +| 11 | SPECIAL_ACTION_USECELLPHONE | 使用手机动作 | +| 12 | SPECIAL_ACTION_SITTING | 坐下动作 | +| 13 | SPECIAL_ACTION_STOPUSECELLPHONE | 停止使用手机动作 | +| 20 | SPECIAL_ACTION_DRINK_BEER | 喝啤酒动作 | +| 21 | SPECIAL_ACTION_SMOKE_CIGGY | 抽烟动作 | +| 22 | SPECIAL_ACTION_DRINK_WINE | 喝红酒动作 | +| 23 | SPECIAL_ACTION_DRINK_SPRUNK | 喝运动饮料动作 | +| 24 | SPECIAL_ACTION_CUFFED | 被铐住状态 | +| 25 | SPECIAL_ACTION_CARRY | 搬运物品状态 | +| 68 | SPECIAL_ACTION_PISSING | 小便动画 | + +## 格斗风格 + +| 数值 | 常量名称 | 战斗风格说明 | +|------|--------------------|---------------------------| +| 0 | FIGHT_STYLE_NORMAL | 普通格斗风格 | +| 1 | FIGHT_STYLE_BOXING | 拳击风格 | +| 2 | FIGHT_STYLE_KUNGFU | 功夫风格 | +| 3 | FIGHT_STYLE_KNEEHEAD | 膝撞攻击风格 | +| 4 | FIGHT_STYLE_GRABKICK | 抓踢组合风格 | +| 5 | FIGHT_STYLE_ELBOW | 肘击攻击风格 | + +## 武器技能 + +| 数值 | 常量名称 | 武器熟练度类型 | +|------|---------------------------|---------------------------| +| 0 | WEAPONSKILL_PISTOL | 手枪技能等级 | +| 1 | WEAPONSKILL_PISTOL_SILENCED | 消音手枪技能等级 | +| 2 | WEAPONSKILL_DESERT_EAGLE | 沙漠之鹰技能等级 | +| 3 | WEAPONSKILL_SHOTGUN | 霰弹枪技能等级 | +| 4 | WEAPONSKILL_SAWNOFF_SHOTGUN | 短管霰弹枪技能等级 | +| 5 | WEAPONSKILL_SPAS12_SHOTGUN | 战斗霰弹枪技能等级 | +| 6 | WEAPONSKILL_MICRO_UZI | 微型乌兹技能等级 | +| 7 | WEAPONSKILL_MP5 | MP5冲锋枪技能等级 | +| 8 | WEAPONSKILL_AK47 | AK-47技能等级 | +| 9 | WEAPONSKILL_M4 | M4卡宾枪技能等级 | +| 10 | WEAPONSKILL_SNIPERRIFLE | 狙击步枪技能等级 | + +## 武器状态 + +| 数值 | 常量名称 | 弹药状态说明 | +|------|------------------------|---------------------------| +| -1 | WEAPONSTATE_UNKNOWN | 未知武器状态 | +| 0 | WEAPONSTATE_NO_BULLETS | 弹匣已空 | +| 1 | WEAPONSTATE_LAST_BULLET | 最后一发子弹 | +| 2 | WEAPONSTATE_MORE_BULLETS | 仍有剩余弹药 | +| 3 | WEAPONSTATE_RELOADING | 正在换弹状态 | + +## 玩家变量类型 + +| 数值 | 常量名称 | 变量类型说明 | +|------|---------------------|---------------------------| +| 0 | PLAYER_VARTYPE_NONE | 无类型变量 | +| 1 | PLAYER_VARTYPE_INT | 整型玩家变量 | +| 2 | PLAYER_VARTYPE_STRING | 字符串玩家变量 | +| 3 | PLAYER_VARTYPE_FLOAT | 浮点型玩家变量 | + +## 地图图标类型 + +| 数值 | 常量名称 | 显示范围说明 | +|------|-------------------------|---------------------------| +| 0 | MAPICON_LOCAL | 本地可见图标 | +| 1 | MAPICON_GLOBAL | 全局可见图标 | +| 2 | MAPICON_LOCAL_CHECKPOINT | 本地检查点图标 | +| 3 | MAPICON_GLOBAL_CHECKPOINT | 全局检查点图标 | + +## 视角切换方式 + +| 数值 | 常量名称 | 视角移动类型 | +|------|-----------|---------------------------| +| 1 | CAMERA_MOVE | 平滑移动视角 | +| 2 | CAMERA_CUT | 直接切换视角 | + +## 观察模式 + +| 数值 | 常量名称 | 视角模式说明 | +|------|--------------------|---------------------------| +| 1 | SPECTATE_MODE_NORMAL | 自由视角观察 | +| 2 | SPECTATE_MODE_FIXED | 固定位置观察 | +| 3 | SPECTATE_MODE_SIDE | 侧面跟随视角 | + +## NPC录制类型 + +| 数值 | 常量名称 | 记录用途说明 | +|------|----------------------------|---------------------------| +| 1 | PLAYER_RECORDING_TYPE_NONE | 无录制状态 | +| 2 | PLAYER_RECORDING_TYPE_DRIVER | 车辆驾驶记录 | +| 3 | PLAYER_RECORDING_TYPE_ONFOOT | 步行动作记录 | + +# a_vehicles + +## 车辆改装类型 + +| 数值 | 常量名称 | 改装部件类型 | +|------|-----------------------|---------------------------| +| 0 | CARMODTYPE_SPOILER | 扰流板改装 | +| 1 | CARMODTYPE_HOOD | 引擎盖改装 | +| 2 | CARMODTYPE_ROOF | 车顶改装 | +| 3 | CARMODTYPE_SIDESKIRT | 侧裙改装 | +| 4 | CARMODTYPE_LAMPS | 车灯改装 | +| 5 | CARMODTYPE_NITRO | 氮气加速装置 | +| 6 | CARMODTYPE_EXHAUST | 排气管改装 | +| 7 | CARMODTYPE_WHEELS | 轮毂改装 | +| 8 | CARMODTYPE_STEREO | 音响系统改装 | +| 9 | CARMODTYPE_HYDRAULICS | 液压系统改装 | +| 10 | CARMODTYPE_FRONT_BUMPER | 前保险杠改装 | +| 11 | CARMODTYPE_REAR_BUMPER | 后保险杠改装 | +| 12 | CARMODTYPE_VENT_RIGHT | 右侧通风口改装 | +| 13 | CARMODTYPE_VENT_LEFT | 左侧通风口改装 | + +## 车辆参数状态 + +| 数值 | 常量名称 | 参数状态说明 | +|------|--------------------|---------------------------| +| 0 | VEHICLE_PARAMS_UNSET | 参数未设置 | +| 1 | VEHICLE_PARAMS_OFF | 参数关闭状态 | +| 2 | VEHICLE_PARAMS_ON | 参数启用状态 | + +## 车辆模型信息 + +| 数值 | 常量名称 | 模型数据信息 | +|------|---------------------------------|---------------------------| +| 1 | VEHICLE_MODEL_INFO_SIZE | 车辆模型尺寸 | +| 2 | VEHICLE_MODEL_INFO_FRONTSEAT | 前座坐标位置 | +| 3 | VEHICLE_MODEL_INFO_REARSEAT | 后座坐标位置 | +| 4 | VEHICLE_MODEL_INFO_PETROLCAP | 油箱盖位置 | +| 5 | VEHICLE_MODEL_INFO_WHEELSFRONT | 前轮位置参数 | +| 6 | VEHICLE_MODEL_INFO_WHEELSREAR | 后轮位置参数 | +| 7 | VEHICLE_MODEL_INFO_WHEELSMID | 中轮位置参数 | +| 8 | VEHICLE_MODEL_INFO_FRONT_BUMPER_Z | 前保险杠Z轴坐标 | +| 9 | VEHICLE_MODEL_INFO_REAR_BUMPER_Z | 后保险杠Z轴坐标 | + +# a_objects + +## 物体材质尺寸 + +| 数值 | 常量名称 | 材质尺寸说明 | +|------|----------------------------|---------------------------| +| 10 | OBJECT_MATERIAL_SIZE_32x32 | 32x32像素材质 | +| 20 | OBJECT_MATERIAL_SIZE_64x32 | 64x32像素材质 | +| 30 | OBJECT_MATERIAL_SIZE_64x64 | 64x64像素材质 | +| 40 | OBJECT_MATERIAL_SIZE_128x32 | 128x32像素材质 | +| 50 | OBJECT_MATERIAL_SIZE_128x64 | 128x64像素材质 | +| 60 | OBJECT_MATERIAL_SIZE_128x128 | 128x128像素材质 | +| 70 | OBJECT_MATERIAL_SIZE_256x32 | 256x32像素材质 | +| 80 | OBJECT_MATERIAL_SIZE_256x64 | 256x64像素材质 | +| 90 | OBJECT_MATERIAL_SIZE_256x128 | 256x128像素材质 | +| 100 | OBJECT_MATERIAL_SIZE_256x256 | 256x256像素材质 | +| 110 | OBJECT_MATERIAL_SIZE_512x64 | 512x64像素材质 | +| 120 | OBJECT_MATERIAL_SIZE_512x128 | 512x128像素材质 | +| 130 | OBJECT_MATERIAL_SIZE_512x256 | 512x256像素材质 | +| 140 | OBJECT_MATERIAL_SIZE_512x512 | 512x512像素材质 | + +## 物体文本对齐 + +| 数值 | 常量名称 | 对齐方式说明 | +|------|---------------------------------|---------------------------| +| 0 | OBJECT_MATERIAL_TEXT_ALIGN_LEFT | 文本左对齐 | +| 1 | OBJECT_MATERIAL_TEXT_ALIGN_CENTER | 文本居中对齐 | +| 2 | OBJECT_MATERIAL_TEXT_ALIGN_RIGHT | 文本右对齐 | + +# a_http + +| 数值 | 常量名称 | 错误类型说明 | +|------|-----------------------------|---------------------------| +| 1 | HTTP_ERROR_BAD_HOST | 错误的主机地址 | +| 2 | HTTP_ERROR_NO_SOCKET | 无法创建网络套接字 | +| 3 | HTTP_ERROR_CANT_CONNECT | 连接服务器失败 | +| 4 | HTTP_ERROR_CANT_WRITE | 数据写入失败 | +| 5 | HTTP_ERROR_CONTENT_TOO_BIG | 返回内容超过限制 | +| 6 | HTTP_ERROR_MALFORMED_RESPONSE | 服务器返回格式错误 | +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/crimelist.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/crimelist.md new file mode 100644 index 00000000000..3ce180834c3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/crimelist.md @@ -0,0 +1,33 @@ +--- +title: 犯罪类型清单 +sidebar_label: 犯罪类型清单 +description: 用于PlayCrimeReportForPlayer函数的犯罪类型清单 +--- + +:::info + +这里列出了[PlayCrimeReportForPlayer](../functions/PlayCrimeReportForPlayer)函数使用的所有犯罪 ID。 + +::: + +| 犯罪 ID | 十码代码 | 描述 | +| ------- | -------- | ---------------------------------------------- | +| 3 | 10-71 | 报告火情性质(建筑规模、类型、建筑物内的物品) | +| 4 | 10-37 | 需要紧急道路维修 | +| 5 | 10-81 | 酒精测试报告 | +| 6 | 10-24 | 任务完成 | +| 7 | 10-21 | 通过电话呼叫() | +| 8 | 10-21 | 通过电话呼叫() | +| 9 | 10-21 | 通过电话呼叫() | +| 10 | 10-17 | 与报案人见面 | +| 11 | 10-81 | 酒精测试报告 | +| 12 | 10-91 | 押送囚犯/嫌疑人 | +| 13 | 10-28 | 车辆注册信息查询 | +| 14 | 10-81 | 酒精测试 | +| 15 | 10-28 | 车辆注册信息 | +| 16 | 10-91 | 押送囚犯/嫌疑人 | +| 17 | 10-34 | 暴动事件 | +| 18 | 10-37 | 调查可疑车辆 | +| 19 | 10-81 | 酒精测试 | +| 21 | 10-7 | 暂停服务 | +| 22 | 10-7 | 暂停服务 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/damagestatus.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/damagestatus.md new file mode 100644 index 00000000000..e60d48dd297 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/damagestatus.md @@ -0,0 +1,86 @@ +--- +title: 损坏状态 +sidebar_label: 损坏状态 +description: 车辆损坏状态信息及代码示例 +--- + +:::note + +有关[GetVehicleDamageStatus](../functions/GetVehicleDamageStatus)和[UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus)函数使用的车辆损坏状态信息。 + +::: + +车辆损坏状态通过 4 个数值存储:**车身面板**、**车门**、**车灯**和**轮胎**。每个数值都使用位掩码来记录所有对应部件的状态,这意味着大多数情况下需要使用位运算进行处理。 + +例如,轮胎状态使用 4 个比特位表示 4 个轮胎。当轮胎爆胎时对应位为 1,正常则为 0。因此数值`1010`表示前轮爆胎而后轮正常。 + +:::note + +有关面板状态的更多信息,请参阅[面板状态](../resources/panelstates) +有关车门状态的更多信息,请参阅[车门状态](../resources/doorstates) +有关车灯状态的更多信息,请参阅[车灯状态](../resources/lightstates) +有关轮胎状态的更多信息,请参阅[轮胎状态](../resources/tirestates) + +::: + +为了方便处理这些状态,以下提供了一些编码和解码函数: + +```c +// 车身面板 +decode_panels(panels, &front_left_panel, &front_right_panel, &rear_left_panel, &rear_right_panel, &windshield, &front_bumper, &rear_bumper) +{ + front_left_panel = panels & 15; + front_right_panel = panels >> 4 & 15; + rear_left_panel = panels >> 8 & 15; + rear_right_panel = panels >> 12 & 15; + windshield = panels >> 16 & 15; + front_bumper = panels >> 20 & 15; + rear_bumper = panels >> 24 & 15; +} + +encode_panels(front_left_panel, front_right_panel, rear_left_panel, rear_right_panel, windshield, front_bumper, rear_bumper) +{ + return front_left_panel | (front_right_panel << 4) | (rear_left_panel << 8) | (rear_right_panel << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24); +} + +// 车门 +decode_doors(doors, &bonnet, &boot, &driver_door, &passenger_door) +{ + bonnet = doors & 7; + boot = doors >> 8 & 7; + driver_door = doors >> 16 & 7; + passenger_door = doors >> 24 & 7; +} + +encode_doors(bonnet, boot, driver_door, passenger_door) +{ + return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24); +} + +// 车灯 +decode_lights(lights, &front_left_light, &front_right_light, &back_lights) +{ + front_left_light = lights & 1; + front_right_light = lights >> 2 & 1; + back_lights = lights >> 6 & 1; +} + +encode_lights(front_left_light, front_right_light, back_lights) +{ + return front_left_light | (front_right_light << 2) | (back_lights << 6); +} + +// 轮胎 +decode_tires(tires, &rear_right_tire, &front_right_tire, &rear_left_tire, &front_left_tire) +{ + rear_right_tire = tires & 1; + front_right_tire = tires >> 1 & 1; + rear_left_tire = tires >> 2 & 1; + front_left_tire = tires >> 3 & 1; +} + +encode_tires(rear_right_tire, front_right_tire, rear_left_tire, front_left_tire) +{ + return rear_right_tire | (front_right_tire << 1) | (rear_left_tire << 2) | (front_left_tire << 3); +} +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md new file mode 100644 index 00000000000..5479752f139 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md @@ -0,0 +1,271 @@ +--- +title: 对话框样式 +sidebar_label: 对话框样式 +--- + +:::note + +- 在[OnDialogResponse](../callbacks/OnDialogResponse)回调中: + - 按下**button1**会将**response**设为**1** + - 按下**button2**会将**response**设为**0** +- 所有对话框都可选配按钮 2,留空则不显示(如首个示例)。玩家无法点击隐藏按钮,但按 ESC 键仍会触发[OnDialogResponse](../callbacks/OnDialogResponse)且**response**=**0** +- [ShowPlayerDialog](../functions/ShowPlayerDialog)支持在以下字符串中使用颜色嵌入:​**caption**​(标题)、**info**​(内容)、**button1**和**button2** + +::: + +- 本文说明[ShowPlayerDialog](../functions/ShowPlayerDialog)和[OnDialogResponse](../callbacks/OnDialogResponse)的行为规范 +- 各类限制详见[限制说明](../resources/limits) +- 响应示例均使用以下测试代码: + +```c +public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) +{ + printf("玩家id = %d, 对话框id = YOUR_DIALOGID, 响应 = %d, 列项 = %d, 输入文本 = '%s' (长度: %d)", playerid, response, listitem, inputtext, strlen(inputtext)); + return 1; +} +``` + +--- + +## 样式 0: `DIALOG_STYLE_MSGBOX` + +![](https://assets.open.mp/assets/images/dialogStyles/Dialog_style_msgbox.png) + +显示效果: + +:::note + +- ​**\t**​ 添加制表符(增加间距) +- ​**\n**​ 创建新行 +- [颜色嵌入](colorslist#color-embedding)效果在换行后依然持续 + +::: + +```c +ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_MSGBOX, "标题", "信息\n\t信息", "按钮 1", ""); +``` + +### 响应输出 + +:::note + +- ​**listitem**​ 固定为 ​**-1** +- ​**inputtext**​ 始终为空 + +::: + +```c +// 点击按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = -1, inputtext = '' (size: 0) + +// 按ESC键(当按钮2隐藏时) +playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = '' (size: 0) +``` + +--- + +## 样式 1: `DIALOG_STYLE_INPUT` + +![](https://assets.open.mp/assets/images/dialogStyles/Dialog_style_input.png) + +显示效果: + +:::note + +- ​**\t**​ 添加制表符(增加间距) +- ​**\n**​ 创建新行 +- [颜色嵌入](colorslist#color-embedding)效果在换行后依然持续 + +::: + +```c +ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_INPUT, "标题", "在下面输入信息:", "按钮 1", "按钮 2"); +``` + +### 响应输出 + +:::note + +- ​**listitem**​ 固定为 ​**-1** +- ​**inputtext**​ 包含用户输入的文本(含颜色代码) + +::: + +```c +// 输入"input"后点击左按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = -1, inputtext = '输入' (size: 5) + +// 输入"input"后点击右按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = '输入' (size: 5) +``` + +--- + +## 样式 2: `DIALOG_STYLE_LIST` + +![](https://assets.open.mp/assets/images/dialogStyles/Dialog_style_list.png) + +显示效果: + +:::note + +- ​**\t**​ 添加制表符(增加间距) +- ​**\n**​ 创建新行 +- [颜色嵌入](colorslist#color-embedding)效果在制表符后依然持续 + +::: + +```c +ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_LIST, "Caption", "项 0\n{FFFF00}项 1\n项 2", "按钮 1", "按钮 2"); +``` + +### 响应输出 + +:::note + +- ​**listitem**​ 表示选中项的索引(从 0 开始) +- ​**inputtext**​ 返回选中项的文本内容(不含颜色代码) + +::: + +```c +// 选择第一项后点击左按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = 0, inputtext = '项 0' (size: 6) + +// 选择第二项后点击右按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = '项 1' (size: 6) +``` + +--- + +## 样式 3: `DIALOG_STYLE_PASSWORD` + +:::note + +- 功能类似 ​**DIALOG_STYLE_INPUT** + +::: + +![](https://assets.open.mp/assets/images/dialogStyles/Dialog_style_password.png) + +显示效果: + +:::note + +- ​**\t**​ 添加制表符(增加间距) +- ​**\n**​ 创建新行 + +::: + +```c +ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_PASSWORD, "标题", "在下面输入私密信息:", "按钮 1", "按钮 2"); +``` + +### 响应输出 + +:::note + +- ​**listitem**​ 固定为 ​**-1** +- ​**inputtext**​ 返回用户输入的明文 + +::: + +```c +// 输入"input"后点击左按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = -1, inputtext = '输入' (size: 5) + +// 输入"input"后点击右按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = '输入' (size: 5) +``` + +--- + +## 样式 4: `DIALOG_STYLE_TABLIST` + +:::note + +- 功能类似 ​**DIALOG_STYLE_LIST** + +::: + +![](https://assets.open.mp/assets/images/dialogStyles/Dialog_style_tablist.png) + +显示效果: + +:::note + +- ​**\t**​ 创建新列 +- ​**\n**​ 创建新行 +- [颜色嵌入](colorslist#color-embedding)效果在换行/制表后重置 +- 首行内容作为表头显示 + +::: + +```c +ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_TABLIST, "标题", +"Deagle\t$5000\t100\n\ +{FF0000}Sawnoff\t{33AA33}$5000\t100\n\ +Pistol\t$1000\t50", +"按钮 1", "按钮 2"); +``` + +:::note + +- ​**listitem**​ 表示选中项的索引(从 0 开始) +- ​**inputtext**​ 返回选中项首列文本(不含颜色代码) + +::: + +```c +// 选择第一项后点击左按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = 0, inputtext = 'Deagle' (size: 6) + +// 选择第二项后点击右按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = 'Sawnoff' (size: 7) +``` + +--- + +## 样式 5: `DIALOG_STYLE_TABLIST_HEADERS` + +:::note + +- 功能类似 ​**DIALOG_STYLE_LIST** + +::: + +![](https://assets.open.mp/assets/images/dialogStyles/Dialog_style_tablist_headers.png) + +显示效果: + +:::note + +- ​**\t**​ 创建新列 +- ​**\n**​ 创建新行 +- [颜色嵌入](colorslist#color-embedding)效果在换行/制表后重置 +- 首行内容作为固定表头显示 + +::: + +```c +ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_TABLIST_HEADERS, "标题", +"表头 1\t表头 2\t表头 3\n\ +项 1 列 1\t项 1 列 2\t项 1 列 3\n\ +{FF0000}项 2 列 1\t{33AA33}项 2 列 2\t项 2 列 3", +"按钮 1", "按钮 2"); +``` + +:::note + +- ​**listitem**​ 表示选中项的索引(从 0 开始) +- ​**inputtext**​ 返回选中项首列文本(不含颜色代码) + +::: + +```c +// 选择第一项后点击左按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = 0, inputtext = '项 1 列 1' (size: 15) + +// 选择第二项后点击右按钮 +playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = '项 2 列 1' (size: 15) +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/doorstates.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/doorstates.md new file mode 100644 index 00000000000..b089347a9bd --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/doorstates.md @@ -0,0 +1,163 @@ +--- +title: 车门状态 +sidebar_label: 车门状态 +description: 字节大小与对应车门状态位的关联信息 +--- + +:::note + +车门状态信息适用于[GetVehicleDamageStatus](../functions/GetVehicleDamageStatus)和[UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus)等原生函数。 + +::: + +:::note + +两个后门的状态无法通过[GetVehicleDamageStatus](../functions/GetVehicleDamageStatus)和[UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus)进行处理。 + +::: + +## 位存储规则 + +每个车门(注:引擎盖和后备箱也视为车门)的损坏状态由 1 字节(8 位)存储。每次只能修改单个车门的某一位状态,若需同时设置车门损坏和开启状态需调用两次函数。 + +- ​**第 1 位**​ 表示车门是否**开启(值 1)​**或**关闭(值 0)​**。开启的车门仍可上锁(此时第一位会变为 0) +- ​**第 2 位**​ 表示车门是否**损坏(值 1)​**或**完好(值 0)​**。若需修复损坏车门,需先移除后重新附加 +- ​**第 3 位**​ 表示车门是否**移除(值 1)​**或**存在(值 0)​** +- 其余位暂未使用 + +似乎没有专门表示车门是否上锁的状态位。 + +注意:位计算从右向左,第一位为最右侧位。 + +--- + +## 字节存储规则 + +- ​**第 1 字节**​ 存储**引擎盖**状态 +- ​**第 2 字节**​ 存储**后备箱**状态 +- ​**第 3 字节**​ 存储**驾驶座车门**状态 +- ​**第 4 字节**​ 存储**副驾驶车门**状态 + +注意:字节计算从右向左,第一位为最右侧字节。 + +--- + +## 状态示例 + +以下二进制表示引擎盖被移除、前左车门损坏、前右车门开启、后备箱损坏且开启的状态: + +`00000001 00000010 00000011 00000100` + +SA-MP 实际返回十进制数值,需转换为二进制查看。上述示例将返回: + +`16909060` + +--- + +## 状态对照表 + +**图例说明:​** + +``` +静态部件 车门 引擎盖/后备箱 + +° - 车灯 | - 完好关闭 -- - 完好关闭 + -- - 完好开启 [] - 完好开启 + § - 损坏关闭 ~~ - 损坏关闭 + ww - 损坏开启 {} - 损坏开启 + - 缺失 - 缺失 +``` + +**第一字节(引擎盖):​** + +``` +0 (000) 1 (001) 2 (010) 3 (011) 4 (100) 5 (101) 6 (110) 7 (111) + °--° °[]° °~~° °{}° ° ° ° ° ° ° ° ° + | | | | | | | | | | | | | | | | + °--° °--° °--° °--° °--° °--° °--° °--° +``` + +**第二字节(后备箱):​** + +``` +0 (000) 1 (001) 2 (010) 3 (011) 4 (100) 5 (101) 6 (110) 7 (111) + °--° °--° °--° °--° °--° °--° °--° °--° + | | | | | | | | | | | | | | | | + °--° °[]° °--° °{}° ° ° ° ° ° ° ° ° +``` + +**第三字节(驾驶座车门):​** + +``` +0 (000) 1 (001) 2 (010) 3 (011) 4 (100) 5 (101) 6 (110) 7 (111) + °--° °--° °--° °--° °--° °--° °--° °--° + | | -- | § | ww | | | | | + °--° °--° °--° °--° °--° °--° °--° °--° +``` + +**第四字节(副驾驶车门):​** + +``` +0 (000) 1 (001) 2 (010) 3 (011) 4 (100) 5 (101) 6 (110) 7 (111) + °--° °--° °--° °--° °--° °--° °--° °--° + | | | -- | § | ww | | | | + °--° °--° °--° °--° °--° °--° °--° °--° +``` + +--- + +## 封装函数 + +简化位操作的工具代码: + +```c +enum Door +{ + DOOR_HOOD, + DOOR_TRUNK, + DOOR_DRIVER, + DOOR_PASSENGER +} + +enum DoorState(<<= 1) +{ + IS_OPENED = 1, + IS_DAMAGED, + IS_REMOVED +} + +stock GetDoorState(doorStates, Door:door, DoorState:doorState) +{ + return (doorStates >>> (8 * door)) & doorState; +} +``` + +--- + +## 使用示例 + +```c +new + VEHICLE_PANEL_STATUS:panels, + VEHICLE_DOOR_STATUS:doors, + VEHICLE_LIGHT_STATUS:lights, + VEHICLE_TIRE_STATUS:tires; + +GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); + +// 单一状态检测 +if (GetDoorState(_:doors, DOOR_DRIVER, IS_DAMAGED)) +{ + SendClientMessage(playerid, -1, "您的车辆驾驶座车门已损坏!"); +} + +// 组合状态检测 +if (GetDoorState(_:doors, DOOR_HOOD, IS_OPENED | IS_DAMAGED)) +{ + SendClientMessage(playerid, -1, "您的车辆引擎盖处于开启且损坏状态!"); +} +``` + +## 相关阅读 + +- [车辆门状态](../resources/vehicle-door-status) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/download-requests.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/download-requests.md new file mode 100644 index 00000000000..60c26cc1a40 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/download-requests.md @@ -0,0 +1,18 @@ +--- +title: 下载请求类型 +sidebar_label: 下载请求类型 +description: 下载请求类型定义(用于OnPlayerRequestDownload回调) +--- + +:::note + +这些定义适用于[OnPlayerRequestDownload](../callbacks/OnPlayerRequestDownload)回调函数。 + +::: + +| ID | 定义 | +| --- | ---------------- | +| -1 | 未知下载请求 | +| 0 | 空下载请求 | +| 1 | 模型文件下载请求 | +| 2 | 纹理文件下载请求 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/escapecodes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/escapecodes.md new file mode 100644 index 00000000000..7e4aded1f48 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/escapecodes.md @@ -0,0 +1,31 @@ +--- +title: 转义字符 +sidebar_label: 转义字符 +--- + +在创建字符串时,您可能会发现某些字符在脚本源代码中无法直接表达或极难表示,这时就需要使用转义字符——这些特殊符号可以帮助您表示此类字符。以下是 PAWN 语言支持的转义字符列表。 + +| 转义字符描述 | 代码 | +| --------------------------------------- | ------------- | +| 响铃(蜂鸣声,在服务器端触发) | \a (也可用\7) | +| 退格符 | \b | +| 转义符 | \e | +| 换页符 | \f | +| 换行符 | \n | +| 回车符 | \r | +| 水平制表符(Tab 键) | \t | +| 垂直制表符 | \v | +| 反斜杠符号(\) | \\ | +| 单引号(') | \' | +| 双引号(") | \" | +| 百分号 | \% | +| 十进制编码字符("ddd"表示十进制数) | \ddd; | +| 十六进制编码字符("hhh"表示十六进制数) | \xhhh; | + +:::note + +在\ddd;和\xhhh;转义序列中,结尾的分号是可选的。它的作用是在字符串常量中为转义序列提供明确的终止符号。 + +::: + +来源:[pawn-lang.pdf (第 99 页)](https://github.com/pawn-lang/compiler/raw/master/doc/pawn-lang.pdf) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/explosionlist.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/explosionlist.md new file mode 100644 index 00000000000..df39ea467f0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/explosionlist.md @@ -0,0 +1,33 @@ +--- +title: 爆炸类型列表 +sidebar_label: 爆炸类型列表 +--- + +:::info + +下表列出了可通过[CreateExplosion](../functions/CreateExplosion)和[CreateExplosionForPlayer](../functions/CreateExplosionForPlayer)函数使用的爆炸类型。 + +::: + +--- + +| 类型 | 可见性 | 分裂效果 | 生成火焰 | 物理冲击 | 音效 | 特殊说明 | 影响范围 | +| ---- | ------ | -------- | -------- | -------- | ---- | ------------------------------------------------ | -------- | +| 0 | 是 | -- | -- | 是 | 是 | 普通爆炸 | 大范围 | +| 1 | 是 | -- | 是 | -- | 是 | 常规爆炸 | 普通范围 | +| 2 | 是 | -- | 是 | 是 | 是 | 常规爆炸 | 大范围 | +| 3 | 是 | -- | 有时? | 是 | 是 | 常规爆炸 | 大范围 | +| 4 | 是 | 是 | -- | 是 | -- | 非常规爆炸,仅产生特殊燃烧特效并击飞物体,无音效 | 普通范围 | +| 5 | 是 | 是 | -- | 是 | -- | 非常规爆炸,仅产生特殊燃烧特效并击飞物体,无音效 | 普通范围 | +| 6 | 是 | -- | -- | 是 | 是 | 附带红色余辉特效 | 超大范围 | +| 7 | 是 | -- | -- | 是 | 是 | 附带红色余辉特效 | 极大范围 | +| 8 | -- | -- | -- | 是 | 是 | 隐形爆炸 | 普通范围 | +| 9 | -- | -- | 是 | 是 | 是 | 仅在地面生成火焰,爆炸效果不可见但可听见 | 普通范围 | +| 10 | 是 | -- | -- | 是 | 是 | 常规爆炸 | 大范围 | +| 11 | 是 | -- | -- | 是 | 是 | 常规爆炸 | 小范围 | +| 12 | 是 | -- | -- | 是 | 是 | 微型爆炸 | 极小范围 | +| 13 | -- | -- | -- | -- | -- | 仅在地面生成黑色燃烧痕迹,无任何伤害效果 | 大范围 | + +--- + +[点击此处查看所有爆炸类型的视觉演示](http://weedarr.wikidot.com/explosion) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/fightingstyles.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/fightingstyles.md new file mode 100644 index 00000000000..6083d623f81 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/fightingstyles.md @@ -0,0 +1,19 @@ +--- +title: 战斗风格 +sidebar_label: 战斗风格 +--- + +:::info + +以下列出了[SetPlayerFightingStyle](../functions/SetPlayerFightingStyle)和[GetPlayerFightingStyle](../functions/GetPlayerFightingStyle)函数使用的所有战斗风格。 + +::: + +| 数值 | 定义 | +| ---- | ------------ | +| 4 | 普通格斗风格 | +| 5 | 拳击风格 | +| 6 | 功夫风格 | +| 7 | 膝击风格 | +| 15 | 抓踢风格 | +| 16 | 肘击风格 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/file-modes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/file-modes.md new file mode 100644 index 00000000000..27e21f6ceb6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/file-modes.md @@ -0,0 +1,18 @@ +--- +title: 文件模式 +sidebar_label: 文件模式 +description: 文件打开模式说明 +--- + +:::note + +这些文件模式适用于[fopen](../functions/fopen)函数。 + +::: + +| 模式 | 描述 | +| ------------ | ------------------------------------------------ | +| io_read | 读取文件内容 | +| io_write | 写入文件(不存在则创建),会清空所有现有内容 | +| io_readwrite | 读写文件(不存在则创建) | +| io_append | 追加写入文件(仅写入模式),文件不存在时自动创建 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/file-seek-whence.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/file-seek-whence.md new file mode 100644 index 00000000000..0197570e978 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/file-seek-whence.md @@ -0,0 +1,17 @@ +--- +title: 文件定位基准 +sidebar_label: 文件定位基准 +description: 文件定位基准定义(用于fseek函数) +--- + +:::note + +这些定义适用于[fseek](../functions/fseek)函数。 + +::: + +| 定义 | 描述 | +| ------------ | ---------------------------------------------------------- | +| seek_start | 设置相对于文件起始位置的文件指针(定位参数必须为正值) | +| seek_current | 设置相对于当前文件位置的偏移量(定位参数将叠加到当前位置) | +| seek_end | 设置相对于文件末尾的位置(定位参数必须为零或负值) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/floatroundmodes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/floatroundmodes.md new file mode 100644 index 00000000000..ac79ad69e6e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/floatroundmodes.md @@ -0,0 +1,19 @@ +--- +title: 浮点数舍入模式 +sidebar_label: 浮点数舍入模式 +description: floatround函数使用的舍入模式说明 +--- + +:::info + +以下是[floatround](../functions/floatround)函数可使用的浮点数舍入模式列表。 + +::: + +| 模式 | 描述 | +| ------------------- | ------------------------------------------------------------------- | +| floatround_round | 四舍五入到最接近的整数。当小数部分正好为 0.5 时向上舍入(默认模式) | +| floatround_floor | 向下取整 | +| floatround_ceil | 向上取整 | +| floatround_tozero | 正数向下取整,负数向上取整("向零取整") | +| floatround_unbiased | 与 floatround_round 功能相同 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/gametextstyles.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/gametextstyles.md new file mode 100644 index 00000000000..249ac062f6d --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/gametextstyles.md @@ -0,0 +1,85 @@ +--- +title: 游戏文本样式 +sidebar_label: 游戏文本样式 +description: 文本绘图与游戏文本的样式说明 +--- + +本文详细说明在文本绘图(TextDraw)和玩家游戏文本(GameText)中使用的样式规则,主要应用于[GameTextForPlayer](../functions/GameTextForPlayer)和[GameTextForAll](../functions/GameTextForAll)函数。 + +--- + +## 文本颜色 + +通过颜色代码可以实现文本分段着色。使用格式为:\~颜色代码\~文本内容\~颜色代码\~(例如:\~y\~黄色文本\~y\~) + +| 代码 | 颜色示例 | 描述 | +| -------------------------------- | --------------------------------------------------------------- | ---------------------------- | +| 无 | ![](https://assets.open.mp/assets/images/gameTextStyles/-.png) | 默认颜色,无需代码 | +| `~h~` | ![](https://assets.open.mp/assets/images/gameTextStyles/h.png) | 默认色的浅色版本 | +| `~h~~h~` | ![](https://assets.open.mp/assets/images/gameTextStyles/hh.png) | 默认色的更浅版本 | +| `~r~` | ![](https://assets.open.mp/assets/images/gameTextStyles/r.png) | 红色(支持 5 级亮度调节) | +| `~r~~h~` 至 `~r~~h~~h~~h~~h~~h~` | 多级示例图 | 逐步增亮的红色变体 | +| `~g~` | ![](https://assets.open.mp/assets/images/gameTextStyles/g.png) | 绿色(支持 4 级亮度调节) | +| `~g~~h~` 至 `~g~~h~~h~~h~~h~` | 多级示例图 | 逐步增亮的绿色变体 | +| `~b~` | ![](https://assets.open.mp/assets/images/gameTextStyles/b.png) | 蓝色(支持 3 级亮度调节) | +| `~b~~h~` 至 `~b~~h~~h~~h~` | 多级示例图 | 逐步增亮的蓝色变体 | +| `~p~` | ![](https://assets.open.mp/assets/images/gameTextStyles/p.png) | 紫色(支持 2 级亮度调节) | +| `~p~~h~` 至 `~p~~h~~h~` | 多级示例图 | 逐步增亮的紫色变体 | +| `~y~` | ![](https://assets.open.mp/assets/images/gameTextStyles/y.png) | 黄色(支持 2 级亮度调节) | +| `~y~~h~` 至 `~y~~h~~h~` | 多级示例图 | 逐步增亮的黄色变体 | +| `~l~` | ![](https://assets.open.mp/assets/images/gameTextStyles/l.png) | 灰色(不可调节亮度) | +| `~w~` 或 `~s~` | ![](https://assets.open.mp/assets/images/gameTextStyles/w.png) | 白色(支持 1 级亮度调节) | +| `~w~~h~` 或 `~s~~h~` | ![](https://assets.open.mp/assets/images/gameTextStyles/wh.png) | 所有颜色过度提亮后的最终状态 | + +--- + +## 特殊字符 + +以下符号无需闭合标签,直接插入文本即可生效: + +| 代码 | 功能说明 | +| ----- | -------------------------------------------------------------------------------------------------------- | +| `~n~` | 换行符 | +| `~h~` | 颜色提亮标记(可在颜色代码中间使用,例如`~r~红色~h~提亮部分`) | +| `~u~` | 灰色上箭头符号 ↑ | +| `~d~` | 灰色下箭头符号 ↓ | +| `~<~` | 灰色左箭头符号 ← | +| `~>~` | 灰色右箭头符号 → | +| `~]~` | 星号符号 \*(仅限样式 3/4/5 使用) | +| `~k~` | 键盘按键映射(例如`~k~~VEHICLE_TURRETLEFT~`显示左炮塔键位),完整列表请查看[按键代码](../resources/keys) | + +:::danger + +警告:单个游戏文本中使用过多颜色代码或特殊字符可能导致玩家客户端崩溃。同时避免波浪号`~`的不对称使用,错误示例:`~~r~错误~g~示例` + +::: + +## 基础文本样式 + +| 样式 | 预览图 | 特性说明 | +| ------ | ------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| 样式 0 | ![](https://assets.open.mp/assets/images/gameTextStyles/style0.png) | 固定显示 9 秒(无视时间设置),会覆盖其他文本(通过 fixes.inc 修复) | +| 样式 1 | ![](https://assets.open.mp/assets/images/gameTextStyles/style1.png) | 8 秒后淡出,若设置时间更长将循环显示(通过 fixes.inc 修复) | +| 样式 2 | ![](https://assets.open.mp/assets/images/gameTextStyles/style2.png) | 无特殊说明 | +| 样式 3 | ![](https://assets.open.mp/assets/images/gameTextStyles/style3.png) | 无特殊说明 | +| 样式 4 | ![](https://assets.open.mp/assets/images/gameTextStyles/style4.png) | 无特殊说明 | +| 样式 5 | ![](https://assets.open.mp/assets/images/gameTextStyles/style5.png) | 固定显示 3 秒(无视时间设置),频繁调用会被屏蔽(通过 fixes.inc 修复) | +| 样式 6 | ![](https://assets.open.mp/assets/images/gameTextStyles/style6.png) | 无特殊说明 | + +--- + +## fixes.inc 扩展样式 + +通过[fixes.inc](https://github.com/pawn-lang/sa-mp-fixes)扩展的样式: + +| 样式 | 预览图 | 原型参照 | +| ------- | -------------------------------------------------------------------- | ------------------------------ | +| 样式 7 | ![](https://assets.open.mp/assets/images/gameTextStyles/style7.png) | 《圣安地列斯》车辆名称风格 | +| 样式 8 | ![](https://assets.open.mp/assets/images/gameTextStyles/style8.png) | 《圣安地列斯》地点名称风格 | +| 样式 9 | ![](https://assets.open.mp/assets/images/gameTextStyles/style9.png) | 《圣安地列斯》电台选择完成样式 | +| 样式 10 | ![](https://assets.open.mp/assets/images/gameTextStyles/style10.png) | 《圣安地列斯》电台切换中样式 | +| 样式 11 | ![](https://assets.open.mp/assets/images/gameTextStyles/style11.png) | 《圣安地列斯》资金增加提示 | +| 样式 12 | ![](https://assets.open.mp/assets/images/gameTextStyles/style12.png) | 《圣安地列斯》资金减少提示 | +| 样式 13 | ![](https://assets.open.mp/assets/images/gameTextStyles/style13.png) | 《圣安地列斯》特技奖励样式 | +| 样式 14 | ![](https://assets.open.mp/assets/images/gameTextStyles/style14.png) | 《圣安地列斯》游戏内时钟样式 | +| 样式 15 | ![](https://assets.open.mp/assets/images/gameTextStyles/style15.png) | 《圣安地列斯》系统通知弹窗样式 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/glossary.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/glossary.md new file mode 100644 index 00000000000..23fbf67bf43 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/glossary.md @@ -0,0 +1,21 @@ +--- +title: 术语表 +sidebar_label: 术语表 +description: 核心术语解释 +tags: [] +--- + +| 术语 | 解释 | +| ------------------------------------------------- | ----------------------------------------------------------- | +| PAWN | SA-MP 服务器脚本使用的编程语言 | +| 游戏模式 | 服务器运行的主脚本 | +| 滤镜脚本 | 与游戏模式协同运行的附加脚本 | +| 插件 | 通过.dll(Windows)或.so(Linux)文件扩展功能的模块 | +| 包含文件 | 通过`#include <文件名>`引入到滤镜脚本/游戏模式中的.inc 文件 | +| Pawno | 广泛使用的 PAWN 脚本编辑器 | +| [Qawno](https://github.com/openmultiplayer/qawno) | 开源的 PAWN 脚本编辑器 | +| Pawncc | 将.pwn 源码编译为.amx 字节码的编译器 | +| 主列表 | SA-MP 存储服务器数据的中央列表(如互联网服务器列表) | +| 死亡竞赛 | 以玩家互相对战为核心的竞技模式 | +| 角色扮演 | 模拟现实生活行为的游戏模式类型 | +| 真实生活 | 基于现实生活场景但无需严格角色扮演的游戏模式类型 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/hexcolors.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/hexcolors.md new file mode 100644 index 00000000000..3933a02537e --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/hexcolors.md @@ -0,0 +1,165 @@ +--- +title: 十六进制颜色 +sidebar_label: 十六进制颜色 +description: SA-MP中的十六进制颜色表示方法 +--- + +## 什么是十六进制? + +十六进制(简称 Hex)是一种采用 16 个不同符号的计数系统(即基数为 16)。相较于我们熟悉的十进制(基数为 10,使用 0-9 共 10 个符号),十六进制的符号组成如下: + +--- + +### 十进制(基数为 10) + +```c +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +``` + +--- + +### 十六进制(基数为 16) + +```c +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A //10 +B //11 +C //12 +D //13 +E //14 +F //15 +``` + +当数字符号用尽后,十六进制使用字母作为补充。字母 A-F 分别代表 10-15 的数值。 + +现在让我们看看一些更大的数字。 + +--- + +### 数值对比示例 + +#### 十进制(基数为 10) + +```c +255 +``` + +#### 十六进制(基数为 16) + +```c +FF +``` + +数字 255 很容易理解,但什么是“FF”?让我们看看两者的指数符号。 + +--- + +### 数值分解说明 + +:::caution + +**注意**​ | 下文中的"^"符号表示幂运算,非按位异或运算符。 + +::: + +#### 十进制解析 + +```c +2 * (10^2) + 5 * (10^1) + 5 * (10^0) += 200 + 50 + 5 += 255 +``` + +#### 十六进制解析 + +```c +F * (16^1) + F * (16^0) += 15 * 16 + 15 * 1 += 240 + 15 += 255 +``` + +--- + +--- + +title: 十六进制的使用场景与方法 +sidebar_label: 十六进制应用 +description: 十六进制在 PAWN 脚本中的具体应用解析 + +## 何时及如何使用十六进制 + +十六进制并没有唯一的应用场景,您可以在任何需要时使用它,但最常见的用途是颜色定义(我们将在后文详述)。部分开发者会将十六进制作为可视化辅助工具来提高代码可读性(例如 Y_Less 的代码风格): + +:::caution +**注意**​ | 以下为进阶示例,如暂时无法理解无需担忧 +::: + +```c +var = b & 0x04 +``` + +此写法清晰表明了需要获取变量 b 低字节中的第 3 个高位比特(二进制 00000100)。相较而言: + +```c +var = b & 4 +``` + +这种十进制写法在视觉上不够直观。 + +请注意"04"前的"0x"前缀。这是 PAWN 语言中专用于表示十六进制常量的标识符(如同"0b"用于表示二进制常量)。 + +--- + +## 颜色格式规范 + +SA-MP 采用 8 位十六进制颜色编码: + +```c +RR - 红色分量(FF为最大值,00为最小值) +GG - 绿色分量(FF为最大值,00为最小值) +BB - 蓝色分量(FF为最大值,00为最小值) +AA - 透明度(FF为完全透明,00为完全不透明) +``` + +--- + +## 颜色示例 + +### 基础色 + +```c +0x00000000 - 纯黑 +0xFF0000FF - 亮红 +0x00FF00FF - 亮绿 +0x0000FFFF - 亮蓝 +0xFFFFFFFF - 纯白 +``` + +### 混合色 + +```c +0xFFFF00FF - 亮黄 +0xFF00FFFF - 亮紫 +0x00FFFFFF - 亮青 +``` + +如需更多颜色代码,推荐使用在线转换工具:[颜色代码转换器](https://www.colorhexa.com/) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/http-error-response-codes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/http-error-response-codes.md new file mode 100644 index 00000000000..285ee7e7ca4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/http-error-response-codes.md @@ -0,0 +1,68 @@ +--- +title: HTTP 错误响应代码 +sidebar_label: HTTP 错误响应代码 +description: HTTP 错误响应代码说明 +--- + +:::note + +这些代码是对[HTTP](../functions/HTTP)函数返回的常规响应状态码的补充,可在'response_code'参数中获取 + +::: + +| 代码 | 错误类型 | 描述 | +| ---- | ----------------------------- | -------------------------------------------------------------------- | +| 1 | HTTP_ERROR_BAD_HOST | 表示 HTTP 请求中使用的 URL 无效或无法通过 DNS 服务器解析 | +| 2 | HTTP_ERROR_NO_SOCKET | 表示建立 HTTP 请求时网络套接字连接失败 | +| 3 | HTTP_ERROR_CANT_CONNECT | 表示客户端无法连接到服务器(可能由网络问题或服务器不可用导致) | +| 4 | HTTP_ERROR_CANT_WRITE | 表示 HTTP 请求期间数据写入失败(可能由客户端、服务器或网络问题引起) | +| 5 | HTTP_ERROR_CONTENT_TOO_BIG | 表示请求内容大小超过服务器允许的最大限制 | +| 6 | HTTP_ERROR_MALFORMED_RESPONSE | 表示服务器返回的 HTTP 响应格式异常(不符合 HTTP 协议标准) | + +## 常见 HTTP 状态码分类 + +### 1xx 信息响应 + +| 代码 | 状态 | +| ---- | -------- | +| 100 | 继续 | +| 101 | 切换协议 | +| 102 | 处理中 | + +### 2xx 成功响应 + +| 代码 | 状态 | +| ---- | -------- | +| 200 | 成功 | +| 201 | 已创建 | +| 204 | 无内容 | +| 206 | 部分内容 | + +### 3xx 重定向 + +| 代码 | 状态 | +| ---- | ---------------------- | +| 301 | 永久重定向 | +| 302 | 临时重定向 | +| 304 | 未修改 | +| 307 | 临时重定向(保持方法) | + +### 4xx 客户端错误 + +| 代码 | 状态 | +| ---- | ------------ | +| 400 | 错误请求 | +| 401 | 未授权 | +| 403 | 禁止访问 | +| 404 | 未找到 | +| 405 | 方法不被允许 | +| 429 | 请求过多 | + +### 5xx 服务端错误 + +| 代码 | 状态 | +| ---- | -------------- | +| 500 | 服务器内部错误 | +| 502 | 错误网关 | +| 503 | 服务不可用 | +| 504 | 网关超时 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/http-request-methods.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/http-request-methods.md new file mode 100644 index 00000000000..9aa2969a4ba --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/http-request-methods.md @@ -0,0 +1,17 @@ +--- +title: HTTP请求方法 +sidebar_label: HTTP请求方法 +description: HTTP请求类型说明 +--- + +:::note + +这些请求方法适用于[HTTP](../functions/HTTP)函数 + +::: + +| ID | 方法 | 描述 | +| --- | --------- | --------------------------------------------------------------------------------------------------------- | +| 1 | HTTP_GET | 发送常规 HTTP 请求
GET 方法用于从 Web 服务器读取/检索数据。成功时返回 HTTP 状态码**200(OK)​**​ | +| 2 | HTTP_POST | 发送带有 POST 数据的 HTTP 请求
POST 方法用于向服务器提交数据。成功创建资源时返回 HTTP 状态码**201**​ | +| 3 | HTTP_HEAD | 发送 HTTP 请求但忽略响应体数据(仅返回响应头)
HEAD 方法用于获取指定资源的响应头信息,不接收实际内容 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/interiorids.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/interiorids.md new file mode 100644 index 00000000000..883ef6fcecb --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/interiorids.md @@ -0,0 +1,234 @@ +--- +title: 室内场景列表 +sidebar_label: 室内场景 +description: SA-MP全室内场景坐标与ID对照表 +--- + +## 如何获取室内 ID + +在室内输入指令: + +```c +/interior +``` + +系统将显示当前室内宇宙 ID。使用[SetPlayerPos](../functions/SetPlayerPos)前,请先设置[SetPlayerInterior](../functions/SetPlayerInterior)和[LinkVehicleToInterior](../functions/LinkVehicleToInterior)。 + +## 便利店(24/7) + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| -------- | ------- | -------- | --------- | --------- | ------------------------------------------------------------------- | +| 24/7 1 | 17 | -25.7220 | -187.8216 | 1003.5469 | ![](https://assets.open.mp/assets/images/interiors/interior20.png) | +| 24/7 2 | 10 | 6.0856 | -28.8966 | 1003.5494 | ![](https://assets.open.mp/assets/images/interiors/interior28.png) | +| 24/7 3 | 18 | -30.9875 | -89.6806 | 1003.5469 | ![](https://assets.open.mp/assets/images/interiors/interior52.png) | +| 24/7 4 | 16 | -26.1856 | -140.9164 | 1003.5469 | ![](https://assets.open.mp/assets/images/interiors/interior71.png) | +| 24/7 5 | 4 | -27.844 | -26.6737 | 1003.5573 | ![](https://assets.open.mp/assets/images/interiors/interior97.png) | +| 24/7 6 | 6 | -26.8339 | -55.5846 | 1003.5469 | ![](https://assets.open.mp/assets/images/interiors/interior124.png) | + +## 改装店 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ----------------- | ------- | -------- | --------- | --------- | ------------------------------------------------------------------ | +| Loco Low Co. | 2 | 611.3536 | -77.5574 | 997.9995 | ![](https://assets.open.mp/assets/images/interiors/interior26.png) | +| Wheel Arch Angels | 3 | 612.2191 | -123.9028 | 997.9922 | ![](https://assets.open.mp/assets/images/interiors/interior11.png) | +| TransFender | 1 | 621.4528 | -23.7289 | 1000.9219 | ![](https://assets.open.mp/assets/images/interiors/interior30.png) | + +## 赌场 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ------------ | ------- | --------- | --------- | --------- | ------------------------------------------------------------------- | +| 四龙赌场 | 10 | 2016.1156 | 1017.1541 | 996.875 | ![](https://assets.open.mp/assets/images/interiors/interior41.png) | +| 红砂西区赌场 | 12 | 1000.6797 | 1133.35 | -7.8462 | ![](https://assets.open.mp/assets/images/interiors/interior62.png) | +| 卡利古拉赌场 | 1 | 2233.9363 | 1711.8038 | 1011.6312 | ![](https://assets.open.mp/assets/images/interiors/interior48.png) | +| 卡利古拉屋顶 | 1 | 2268.5156 | 1647.7682 | 1084.2344 | ![](https://assets.open.mp/assets/images/interiors/interior131.png) | + +## 服装店 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ------------- | ------- | -------- | --------- | --------- | ------------------------------------------------------------------ | +| 受害者服饰 | 5 | 225.0306 | -9.1838 | 1002.218 | ![](https://assets.open.mp/assets/images/interiors/interior25.png) | +| 地下都市 | 1 | 204.1174 | -46.8047 | 1001.8047 | ![](https://assets.open.mp/assets/images/interiors/interior33.png) | +| 拉链快销 | 18 | 161.4048 | -94.2416 | 1001.8047 | ![](https://assets.open.mp/assets/images/interiors/interior53.png) | +| 迪迪尔·萨克斯 | 14 | 204.1658 | -165.7678 | 1000.5234 | ![](https://assets.open.mp/assets/images/interiors/interior61.png) | +| 缤购服饰 | 15 | 207.5219 | -109.7448 | 1005.1328 | ![](https://assets.open.mp/assets/images/interiors/interior79.png) | +| 运动专家 | 3 | 206.4627 | -137.7076 | 1003.0938 | ![](https://assets.open.mp/assets/images/interiors/interior16.png) | + +## 餐厅与酒吧 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| -------------- | ------- | --------- | --------- | --------- | ------------------------------------------------------------------- | +| 披萨叠叠乐 | 5 | 372.5565 | -131.3607 | 1001.4922 | ![](https://assets.open.mp/assets/images/interiors/interior22.png) | +| 锈斑甜甜圈工坊 | 17 | 378.026 | -190.5155 | 1000.6328 | ![](https://assets.open.mp/assets/images/interiors/interior23.png) | +| 汉堡速递 | 10 | 366.0248 | -73.3478 | 1001.5078 | ![](https://assets.open.mp/assets/images/interiors/interior47.png) | +| Cluckin' Bell | 9 | 366.0002 | -9.4338 | 1001.8516 | ![](https://assets.open.mp/assets/images/interiors/interior129.png) | +| 酒吧 | 11 | 501.9578 | -70.5648 | 998.7578 | ![](https://assets.open.mp/assets/images/interiors/interior138.png) | +| Lil' Probe Inn | 18 | -227.5703 | 1401.5544 | 27.7656 | ![](https://assets.open.mp/assets/images/interiors/interior86.png) | + +## 特殊商店 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| -------- | ------- | --------- | -------- | --------- | ------------------------------------------------------------------- | +| 理发店 1 | 12 | 411.9707 | -51.9217 | 1001.8984 | ![](https://assets.open.mp/assets/images/interiors/interior107.png) | +| 理发店 2 | 2 | 414.2987 | -18.8044 | 1001.8047 | ![](https://assets.open.mp/assets/images/interiors/interior50.png) | +| 理发店 3 | 3 | 418.4666 | -80.4595 | 1001.8047 | ![](https://assets.open.mp/assets/images/interiors/interior13.png) | +| 纹身沙龙 | 3 | -201.2236 | -43.2465 | 1002.2734 | ![](https://assets.open.mp/assets/images/interiors/interior18.png) | +| 成人商店 | 3 | -100.2674 | -22.9376 | 1000.7188 | ![](https://assets.open.mp/assets/images/interiors/interior17.png) | + +## 盗窃任务房屋 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ----------- | ------- | --------- | --------- | --------- | ------------------------------------------------------------------- | +| 盗窃房屋 1 | 3 | 234.6087 | 1187.8195 | 1080.2578 | ![](https://assets.open.mp/assets/images/interiors/interior75.png) | +| 盗窃房屋 2 | 2 | 225.5707 | 1240.0643 | 1082.1406 | ![](https://assets.open.mp/assets/images/interiors/interior76.png) | +| 盗窃房屋 3 | 1 | 224.288 | 1289.1907 | 1082.1406 | ![](https://assets.open.mp/assets/images/interiors/interior77.png) | +| 盗窃房屋 4 | 5 | 239.2819 | 1114.1991 | 1080.9922 | ![](https://assets.open.mp/assets/images/interiors/interior78.png) | +| 盗窃房屋 5 | 15 | 295.1391 | 1473.3719 | 1080.2578 | ![](https://assets.open.mp/assets/images/interiors/interior80.png) | +| 盗窃房屋 6 | 2 | 446.626 | 1397.738 | 1084.3047 | ![](https://assets.open.mp/assets/images/interiors/interior91.png) | +| 盗窃房屋 7 | 5 | 227.7559 | 1114.3844 | 1080.9922 | ![](https://assets.open.mp/assets/images/interiors/interior93.png) | +| 盗窃房屋 8 | 4 | 261.1165 | 1287.2197 | 1080.2578 | ![](https://assets.open.mp/assets/images/interiors/interior94.png) | +| 盗窃房屋 9 | 10 | 24.3769 | 1341.1829 | 1084.375 | ![](https://assets.open.mp/assets/images/interiors/interior100.png) | +| 盗窃房屋 10 | 4 | 221.6766 | 1142.4962 | 1082.6094 | ![](https://assets.open.mp/assets/images/interiors/interior104.png) | +| 盗窃房屋 11 | 4 | -262.1759 | 1456.6158 | 1084.3672 | ![](https://assets.open.mp/assets/images/interiors/interior112.png) | +| 盗窃房屋 12 | 5 | 22.861 | 1404.9165 | 1084.4297 | ![](https://assets.open.mp/assets/images/interiors/interior113.png) | +| 盗窃房屋 13 | 5 | 140.3679 | 1367.8837 | 1083.8621 | ![](https://assets.open.mp/assets/images/interiors/interior114.png) | +| 盗窃房屋 14 | 6 | 234.2826 | 1065.229 | 1084.2101 | ![](https://assets.open.mp/assets/images/interiors/interior118.png) | +| 盗窃房屋 15 | 6 | -68.5145 | 1353.8485 | 1080.2109 | ![](https://assets.open.mp/assets/images/interiors/interior119.png) | +| 盗窃房屋 16 | 15 | -285.2511 | 1471.197 | 1084.375 | ![](https://assets.open.mp/assets/images/interiors/interior123.png) | +| 盗窃房屋 17 | 8 | -42.5267 | 1408.23 | 1084.4297 | ![](https://assets.open.mp/assets/images/interiors/interior139.png) | +| 盗窃房屋 18 | 9 | 84.9244 | 1324.2983 | 1083.8594 | ![](https://assets.open.mp/assets/images/interiors/interior141.png) | +| 盗窃房屋 19 | 9 | 260.7421 | 1238.2261 | 1084.2578 | ![](https://assets.open.mp/assets/images/interiors/interior142.png) | + +## 武器商店 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ---------- | ------- | -------- | --------- | --------- | ------------------------------------------------------------------- | +| 武器商店 1 | 7 | 315.244 | -140.8858 | 999.6016 | ![](https://assets.open.mp/assets/images/interiors/interior24.png) | +| 武器商店 2 | 1 | 285.8361 | -39.0166 | 1001.5156 | ![](https://assets.open.mp/assets/images/interiors/interior32.png) | +| 武器商店 3 | 4 | 291.7626 | -80.1306 | 1001.5156 | ![](https://assets.open.mp/assets/images/interiors/interior95.png) | +| 武器商店 4 | 6 | 297.144 | -109.8702 | 1001.5156 | ![](https://assets.open.mp/assets/images/interiors/interior121.png) | +| 武器商店 5 | 6 | 316.5025 | -167.6272 | 999.5938 | ![](https://assets.open.mp/assets/images/interiors/interior122.png) | + +## 安全屋 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ------------- | ------- | --------- | ---------- | --------- | ------------------------------------------------------------------- | +| 约翰逊的房子 | 3 | 2496.0549 | -1695.1749 | 1014.7422 | ![](https://assets.open.mp/assets/images/interiors/interior46.png) | +| 天使松拖车屋 | 2 | 1.1853 | -3.2387 | 999.4284 | ![](https://assets.open.mp/assets/images/interiors/interior51.png) | +| 废弃空调塔 | 10 | 419.8936 | 2537.1155 | 10.0000 | ![](https://assets.open.mp/assets/images/interiors/interior59.png) | +| 衣帽间/更衣室 | 14 | 256.9047 | -41.6537 | 1002.0234 | ![](https://assets.open.mp/assets/images/interiors/interior60.png) | +| 骆驼趾安全屋 | 1 | 2216.1282 | -1076.3052 | 1050.4844 | ![](https://assets.open.mp/assets/images/interiors/interior130.png) | +| 青翠崖安全屋 | 8 | 2365.1089 | -1133.0795 | 1050.875 | ![](https://assets.open.mp/assets/images/interiors/interior134.png) | +| 柳田安全屋 | 11 | 2282.9766 | -1140.2861 | 1050.8984 | ![](https://assets.open.mp/assets/images/interiors/interior140.png) | +| 安全屋 1 | 5 | 2233.6919 | -1112.8107 | 1050.8828 | ![](https://assets.open.mp/assets/images/interiors/interior67.png) | +| 安全屋 3 | 9 | 2319.1272 | -1023.9562 | 1050.2109 | ![](https://assets.open.mp/assets/images/interiors/interior68.png) | +| 安全屋 4 | 10 | 2261.0977 | -1137.8833 | 1050.6328 | ![](https://assets.open.mp/assets/images/interiors/interior69.png) | +| 未使用安全屋 | 12 | 2323.7063 | -1147.6509 | 1050.7101 | ![](https://assets.open.mp/assets/images/interiors/interior105.png) | + +## 女友相关场景 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| -------------- | ------- | -------- | -------- | --------- | ------------------------------------------------------------------ | +| 丹妮丝的房子 | 1 | 245.2307 | 304.7632 | 999.1484 | ![](https://assets.open.mp/assets/images/interiors/interior34.png) | +| 海伦娜的谷仓 | 3 | 290.623 | 309.0622 | 999.1484 | ![](https://assets.open.mp/assets/images/interiors/interior35.png) | +| 芭芭拉的"房子" | 5 | 322.5014 | 303.6906 | 999.1484 | ![](https://assets.open.mp/assets/images/interiors/interior36.png) | +| 凯蒂的房子 | 2 | 269.6405 | 305.9512 | 999.1484 | ![](https://assets.open.mp/assets/images/interiors/interior49.png) | +| 米歇尔的房子 | 4 | 306.1966 | 307.819 | 1003.3047 | ![](https://assets.open.mp/assets/images/interiors/interior99.png) | + +## 政府机构 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| -------------- | ------- | -------- | -------- | --------- | ------------------------------------------------------------------- | +| 规划局 | 3 | 386.5259 | 173.6381 | 1008.3828 | ![](https://assets.open.mp/assets/images/interiors/interior14.png) | +| 洛圣都警局 | 6 | 246.6695 | 65.8039 | 1003.6406 | ![](https://assets.open.mp/assets/images/interiors/interior110.png) | +| 拉斯云祖华警局 | 3 | 288.4723 | 170.0647 | 1007.1794 | ![](https://assets.open.mp/assets/images/interiors/interior15.png) | +| 圣费耶罗警局 | 10 | 246.0688 | 108.9703 | 1003.2188 | ![](https://assets.open.mp/assets/images/interiors/interior27.png) | + +## 体育场馆 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| -------------- | ------- | ---------- | --------- | --------- | ------------------------------------------------------------------- | +| 椭圆体育场 | 1 | -1402.6613 | 106.3897 | 1032.2734 | ![](https://assets.open.mp/assets/images/interiors/interior38.png) | +| 罪恶都市体育场 | 16 | -1401.067 | 1265.3706 | 1039.8672 | ![](https://assets.open.mp/assets/images/interiors/interior117.png) | +| 血腥碗体育场 | 15 | -1417.8927 | 932.4482 | 1041.5313 | ![](https://assets.open.mp/assets/images/interiors/interior81.png) | + +## 学校 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ---------- | ------- | ---------- | --------- | --------- | ------------------------------------------------------------------- | +| 摩托车驾校 | 3 | 1494.8589 | 1306.48 | 1093.2953 | ![](https://assets.open.mp/assets/images/interiors/interior115.png) | +| 汽车驾校 | 3 | -2031.1196 | -115.8287 | 1035.1719 | ![](https://assets.open.mp/assets/images/interiors/interior133.png) | + +## 健身房 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| -------------- | ------- | -------- | -------- | --------- | ------------------------------------------------------------------- | +| 甘顿健身房 | 5 | 770.8033 | -0.7033 | 1000.7267 | ![](https://assets.open.mp/assets/images/interiors/interior1.png) | +| 眼镜蛇健身房 | 3 | 773.8887 | -47.7698 | 1000.5859 | ![](https://assets.open.mp/assets/images/interiors/interior29.png) | +| 腰带之下健身房 | 1 | 773.7318 | -74.6957 | 1000.6542 | ![](https://assets.open.mp/assets/images/interiors/interior109.png) | + +## 夜总会与妓院 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ---------- | ------- | --------- | --------- | --------- | ------------------------------------------------------------------- | +| 妓院 1 | 3 | 974.0177 | -9.5937 | 1001.1484 | ![](https://assets.open.mp/assets/images/interiors/interior2.png) | +| 妓院 2 | 3 | 961.9308 | -51.9071 | 1001.1172 | ![](https://assets.open.mp/assets/images/interiors/interior3.png) | +| 大牧场 | 3 | 1212.1489 | -28.5388 | 1000.9531 | ![](https://assets.open.mp/assets/images/interiors/interior6.png) | +| 猪圈夜总会 | 2 | 1204.668 | -13.5429 | 1000.9219 | ![](https://assets.open.mp/assets/images/interiors/interior40.png) | +| 俱乐部 | 17 | 493.1443 | -24.2607 | 1000.6797 | ![](https://assets.open.mp/assets/images/interiors/interior64.png) | +| 范妮妓院 | 6 | 748.4623 | 1438.2378 | 1102.9531 | ![](https://assets.open.mp/assets/images/interiors/interior127.png) | + +## 仓库 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| -------- | ------- | --------- | ------- | --------- | ----------------------------------------------------------------- | +| 仓库 1 | 18 | 1290.4106 | 1.9512 | 1001.0201 | ![](https://assets.open.mp/assets/images/interiors/interior7.png) | +| 仓库 2 | 1 | 1412.1472 | -2.2836 | 1000.9241 | ![](https://assets.open.mp/assets/images/interiors/interior8.png) | + +## 过场动画与任务场景 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ---------------- | ------- | ---------- | ---------- | --------- | ------------------------------------------------------------------- | +| 室内赛道投注站 | 3 | 830.6016 | 5.9404 | 1004.1797 | ![](https://assets.open.mp/assets/images/interiors/interior4.png) | +| 爆蠢唱片行 | 3 | 1037.8276 | 0.397 | 1001.2845 | ![](https://assets.open.mp/assets/images/interiors/interior5.png) | +| B 杜普公寓 | 3 | 1527.0468 | -12.0236 | 1002.0971 | ![](https://assets.open.mp/assets/images/interiors/interior9.png) | +| B 杜普毒窝 | 2 | 1523.5098 | -47.8211 | 1002.2699 | ![](https://assets.open.mp/assets/images/interiors/interior10.png) | +| OG 洛克住宅 | 3 | 512.9291 | -11.6929 | 1001.5653 | ![](https://assets.open.mp/assets/images/interiors/interior12.png) | +| 莱德尔住宅 | 2 | 2447.8704 | -1704.4509 | 1013.5078 | ![](https://assets.open.mp/assets/images/interiors/interior43.png) | +| 斯威特住宅 | 1 | 2527.0176 | -1679.2076 | 1015.4986 | ![](https://assets.open.mp/assets/images/interiors/interior44.png) | +| 吴子穆场所 | 1 | -2158.6731 | 642.09 | 1052.375 | ![](https://assets.open.mp/assets/images/interiors/interior58.png) | +| 洛圣都机场 | 14 | -1864.9434 | 55.7325 | 1055.5276 | ![](https://assets.open.mp/assets/images/interiors/interior111.png) | +| 四龙赌场管理室 | 10 | 1893.0731 | 1017.8958 | 31.8828 | ![](https://assets.open.mp/assets/images/interiors/interior137.png) | +| 杰斐逊汽车旅馆 | 15 | 2217.281 | -1150.5349 | 1025.7969 | ![](https://assets.open.mp/assets/images/interiors/interior72.png) | +| 极速启动体育馆 | 14 | -1420.4277 | 1616.9221 | 1052.5313 | ![](https://assets.open.mp/assets/images/interiors/interior63.png) | +| 自由城 | 1 | -741.8495 | 493.0036 | 1371.9766 | ![](https://assets.open.mp/assets/images/interiors/interior42.png) | +| 弗朗西斯国际机场 | 14 | -1813.213 | -58.012 | 1058.9641 | ![](https://assets.open.mp/assets/images/interiors/interior116.png) | +| 欢乐穹顶 | 3 | -2638.8232 | 1407.3395 | 906.4609 | ![](https://assets.open.mp/assets/images/interiors/interior54.png) | +| RC 战场 | 10 | -1129.8909 | 1057.5424 | 1346.4141 | ![](https://assets.open.mp/assets/images/interiors/interior45.png) | +| 圣费耶罗车库 | 1 | -2041.2334 | 178.3969 | 28.8465 | ![](https://assets.open.mp/assets/images/interiors/interior37.png) | +| 欢迎加油站 | 1 | 681.6216 | -451.8933 | -25.6172 | ![](https://assets.open.mp/assets/images/interiors/interior74.png) | +| 8 字赛道体育馆 | 7 | -1403.0116 | -250.4526 | 1043.5341 | ![](https://assets.open.mp/assets/images/interiors/interior39.png) | +| 越野摩托体育馆 | 4 | -1421.5618 | -663.8262 | 1059.5569 | ![](https://assets.open.mp/assets/images/interiors/interior108.png) | +| 毒品屋 | 5 | 322.1117 | 1119.3270 | 1083.8830 | ![](https://assets.open.mp/assets/images/interiors/interior145.png) | +| 大斯莫克毒窝 | 2 | 2536.5322 | -1294.8425 | 1044.125 | ![](https://assets.open.mp/assets/images/interiors/interior56.png) | +| 零点遥控车店 | 6 | -2240.1028 | 136.973 | 1035.4141 | ![](https://assets.open.mp/assets/images/interiors/interior120.png) | +| 谢尔曼大坝 | 17 | -944.2402 | 1886.1536 | 5.0051 | ![](https://assets.open.mp/assets/images/interiors/interior70.png) | +| 罗森伯格办公室 | 2 | 2182.2017 | 1628.5848 | 1043.8723 | ![](https://assets.open.mp/assets/images/interiors/interior126.png) | +| 秘密山谷餐厅 | 6 | 442.1295 | -52.4782 | 999.7167 | ![](https://assets.open.mp/assets/images/interiors/interior125.png) | +| 世界公鸡餐厅 | 1 | 445.6003 | -6.9823 | 1000.7344 | ![](https://assets.open.mp/assets/images/interiors/interior31.png) | +| 杰氏餐厅 | 5 | 454.9853 | -107.2548 | 999.4376 | ![](https://assets.open.mp/assets/images/interiors/interior21.png) | +| 疯狗多克豪宅 | 5 | 1267.8407 | -776.9587 | 1091.9063 | ![](https://assets.open.mp/assets/images/interiors/interior55.png) | +| 弗尔伯格上校官邸 | 8 | 2807.3604 | -1171.7048 | 1025.5703 | ![](https://assets.open.mp/assets/images/interiors/interior128.png) | +| 燃烧欲望大厦 | 5 | 2350.1597 | -1181.0658 | 1027.9766 | ![](https://assets.open.mp/assets/images/interiors/interior57.png) | +| 中庭 | 18 | 1727.2853 | -1642.9451 | 20.2254 | ![](https://assets.open.mp/assets/images/interiors/interior65.png) | +| 辛达科屠宰场 | 1 | 963.0586 | 2159.7563 | 1011.0303 | ![](https://assets.open.mp/assets/images/interiors/interior101.png) | +| 喷气机内部 | 1 | 1.5491 | 23.3183 | 1199.5938 | ![](https://assets.open.mp/assets/images/interiors/interior73.png) | +| 安德罗玛达号 | 9 | 315.4544 | 976.5972 | 1960.8511 | ![](https://assets.open.mp/assets/images/interiors/interior136.png) | +| 帕洛米诺银行 | 0 | 2306.3826 | -15.2365 | 26.7496 | ![](https://assets.open.mp/assets/images/interiors/interior83.png) | +| 迪利磨坊加油站 | 0 | 663.0588 | -573.6274 | 16.3359 | ![](https://assets.open.mp/assets/images/interiors/interior85.png) | + +## 未分类场景 + +| 室内名称 | 室内 ID | X | Y | Z | 预览图 | +| ------------ | ------- | --------- | ---------- | --------- | ------------------------------------------------------------------- | +| 随机房屋 | 2 | 2236.6997 | -1078.9478 | 1049.0234 | ![](https://assets.open.mp/assets/images/interiors/interior132.png) | +| 经济旅馆房间 | 12 | 446.3247 | 509.9662 | 1001.4195 | ![](https://assets.open.mp/assets/images/interiors/interior82.png) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/keys.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/keys.md new file mode 100644 index 00000000000..316b3a11df1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/keys.md @@ -0,0 +1,61 @@ +--- +title: 按键定义 +sidebar_label: 按键定义 +--- + +:::note + +本文档提供[GetPlayerKeys](../functions/GetPlayerKeys)和[OnPlayerKeyStateChange](../callbacks/OnPlayerKeyStateChange)使用的按键常量信息。 + +SA-MP 使用位掩码技术检测按键状态,关于位掩码的详细说明请参阅:[位掩码技术解析]() + +::: + +--- + +| 宏定义 | 数值 | 步行嵌入代码 (6) | 车辆嵌入代码 (6) | 步行默认按键 | 车辆默认按键 | +| ----------------------------------- | -------------------- | --------------------------- | ----------------------------- | ---------------------- | ----------------------- | +| KEY_ACTION | 1 | \~k~\~PED_ANSWER_PHONE~ | \~k~\~VEHICLE_FIREWEAPON_ALT~ | TAB 键 | ALT GR/左 Ctrl/小键盘 0 | +| KEY_CROUCH | 2 | \~k~\~PED_DUCK~ | \~k~\~VEHICLE_HORN~ | C 键 | H 键/大写锁定键 | +| KEY_FIRE | 4 | \~k~\~PED_FIREWEAPON~ | \~k~\~VEHICLE_FIREWEAPON~ | 左 Ctrl 键/鼠标左键 | 左 Alt 键 | +| KEY_SPRINT | 8 | \~k~\~PED_SPRINT~ | \~k~\~VEHICLE_ACCELERATE~ | 空格键 | W 键 | +| KEY_SECONDARY_ATTACK | 16 | \~k~\~VEHICLE_ENTER_EXIT~ | \~k~\~VEHICLE_ENTER_EXIT~ | 回车键 | 回车键 | +| KEY_JUMP | 32 | \~k~\~PED_JUMPING~ | \~k~\~VEHICLE_BRAKE~ | 左 Shift 键 | S 键 | +| KEY_LOOK_RIGHT | 64 | - | \~k~\~VEHICLE_LOOKRIGHT~ | - | E 键 | +| KEY_HANDBRAKE/KEY_AIM(1) | 128 | \~k~\~PED_LOCK_TARGET~ | \~k~\~VEHICLE_HANDBRAKE~ | 鼠标右键 | 空格键 | +| KEY_LOOK_LEFT | 256 | - | \~k~\~VEHICLE_LOOKLEFT~ | - | Q 键 | +| KEY_LOOK_BEHIND | 512 | \~k~\~PED_LOOKBEHIND~ | \~k~\~VEHICLE_LOOKBEHIND~ | 小键盘 1/鼠标中键 | 2 键 | +| KEY_SUBMISSION | 512 | - | \~k~\~TOGGLE_SUBMISSIONS~ | 小键盘 1/鼠标中键 | 2 键/小键盘+ | +| KEY_WALK | 1024 | \~k~\~SNEAK_ABOUT~ | - | 左 Alt 键 | - | +| KEY_ANALOG_UP | 2048 | - | \~k~\~VEHICLE_TURRETUP~ | 小键盘 8(5) | 小键盘 8 | +| KEY_ANALOG_DOWN | 4096 | - | \~k~\~VEHICLE_TURRETDOWN~ | 小键盘 2(5) | 小键盘 2 | +| KEY_ANALOG_LEFT | 8192 | \~k~\~VEHICLE_LOOKLEFT~ | \~k~\~VEHICLE_TURRETLEFT~ | 小键盘 4 | 小键盘 4 | +| KEY_ANALOG_RIGHT | 16384 | \~k~\~VEHICLE_LOOKRIGHT~ | \~k~\~VEHICLE_TURRETRIGHT~ | 小键盘 6 | 小键盘 6 | +| KEY_YES(2) | 65536 | \~k~\~CONVERSATION_YES~ | \~k~\~CONVERSATION_YES~ | Y 键 | Y 键 | +| KEY_NO(2) | 131072 | \~k~\~CONVERSATION_NO~ | \~k~\~CONVERSATION_NO~ | N 键 | N 键 | +| KEY_CTRL_BACK(2) | 262144(4) | \~k~\~GROUP_CONTROL_BWD~ | \~k~\~GROUP_CONTROL_BWD~ | H 键 | H 键 | +| UNDEFINED(3) | - | \~k~\~GROUP_CONTROL_FWD~ | \~k~\~GROUP_CONTROL_FWD~ | G 键 | G 键 | +| KEY_UP | -128 | \~k~\~GO_FORWARD~ | \~k~\~VEHICLE_STEERUP~ | 上方向键 | 上方向键 | +| KEY_DOWN | 128 | \~k~\~GO_BACK~ | \~k~\~VEHICLE_STEERDOWN~ | 下方向键 | 下方向键 | +| KEY_LEFT | -128 | \~k~\~GO_LEFT~ | \~k~\~VEHICLE_STEERLEFT~ | 左方向键 | 左方向键 | +| KEY_RIGHT | 128 | \~k~\~GO_RIGHT~ | \~k~\~VEHICLE_STEERRIGHT~ | 右方向键 | 右方向键 | + +--- + +**(1)**​ 该宏未在 SA-MP 头文件中定义,需手动添加: + +```c +#define KEY_AIM KEY_HANDBRAKE +``` + +或直接使用 KEY_HANDBRAKE + +**(2)**​ 玩家处于[观战模式](../functions/TogglePlayerSpectating)时无法检测这些按键 + +**(3)**​ GROUP_CONTROL_FWD 在 SA-MP 中用于乘客进入车辆,无法直接检测,但其游戏文本定义仍存在 + +**(4)**​ 若键值 262144 无效,可使用键值 2 替代 + +**(5)**​ 仅在控制器设置为"JOYPAD"时生效 + +**(6)**​ 嵌入代码仅适用于[死亡信息](../functions/SendDeathMessage)、[文本绘图](../functions/TextDrawCreate)和[游戏文本](../functions/GameTextForPlayer) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/landinggearstate.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/landinggearstate.md new file mode 100644 index 00000000000..58d5364b642 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/landinggearstate.md @@ -0,0 +1,16 @@ +--- +title: 车辆起落架状态 +sidebar_label: 车辆起落架状态 +description: 车辆起落架状态说明 +--- + +:::note + +此状态参数用于[GetVehicleLandingGearState](../functions/GetVehicleLandingGearState)和[GetPlayerLandingGearState](../functions/GetPlayerLandingGearState)函数 + +::: + +| 状态定义 | ID | +| ----------------------- | --- | +| LANDING_GEAR_STATE_DOWN(起落架放下状态) | 0 | +| LANDING_GEAR_STATE_UP(起落架收起状态) | 1 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/lightstates.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/lightstates.md new file mode 100644 index 00000000000..ea92a64b07f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/lightstates.md @@ -0,0 +1,148 @@ +--- +title: 灯光状态 +sidebar_label: 灯光状态 +description: 关于字节大小及其对应灯光状态位的信息。 +--- + +:::note + +灯光状态被诸如[GetVehicleDamageStatus](../functions/GetVehicleDamageStatus)和[UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus)等原生函数使用。 + +::: + +:::note + +双轮车辆(因此有 2 个车灯)的灯光状态不可更改。 + +::: + +:::note + +车辆的两个后车灯无法单独更改。 + +::: + +## 比特位存储规则 + +所有车灯的损坏状态将被存储在一个字节中(共 8 比特)。每个比特位存储对应车灯的**损坏状态(值为 1)​**或**正常状态(值为 0)​**。 + +- ​**第一位**存储**左前**车灯状态 +- ​**第三位**存储**右前**车灯状态 +- ​**第七位**存储**后部**车灯状态 +- 其余比特位未使用 + +注意比特位从右向左计数,因此第一位是最右侧的比特位。 + +--- + +## 示例 + +以下代码表示前部两个车灯损坏,后部车灯正常: + +`0000 0101` + +然而 SA-MP 会返回十进制数字,因此您需要先将其转换为二进制才能得到上述结果。对于这个示例,SA-MP 将返回: + +`5` + +--- + +## 状态对照表 + +以下是灯光状态的视觉化表示。图示为车辆俯视图,上方数值表示车辆前部,下方数值表示车辆后部。 + +**图例:** + +``` + +o - 启用灯光 +x - 禁用灯光 + +``` + +0: (0000 0000) + +```c + o-o + | | + o-o +``` + +1: (0000 0001) + +```c + x-o + | | + o-o +``` + +4: (0000 0100) + +```c + o-x + | | + o-o +``` + +5: (0000 0101) + +```c + x-x + | | + o-o +``` + +64: (0100 0000) + +```c + o-o + | | + x-x +``` + +65: (0100 0001) + +```c + x-o + | | + x-x +``` + +68: (0100 0100) + +```c + o-x + | | + x-x +``` + +69: (0100 0101) + +```c + x-x + | | + x-x +``` + +未列出的其他值也可以改变车灯状态,但会产生重复效果(例如 15 与 5 的效果相同)。超过 255 的值会循环重置,256 将被设为 0,257 设为 1,依此类推。 + +--- + +## 使用示例 + +禁用车辆后部车灯同时保持前部状态不变: + +```c +new + VEHICLE_PANEL_STATUS:panels, + VEHICLE_DOOR_STATUS:doors, + VEHICLE_LIGHT_STATUS:lights, + VEHICLE_TIRE_STATUS:tires; + +GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); +UpdateVehicleDamageStatus(vehicleid, panels, doors, (lights | VEHICLE_LIGHT_STATUS:0b01000000), tires); // '0b'前缀表示后续数字为二进制格式,与'0x'表示十六进制同理 +``` + +## 相关阅读 + +- [车辆灯光状态](../resources/vehicle-light-status) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/limits.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/limits.md new file mode 100644 index 00000000000..c93b4bac452 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/limits.md @@ -0,0 +1,75 @@ +--- +title: 限制 +sidebar_label: 限制 +description: 游戏/服务器施加的所有限制列表。 +tags: [] +--- + +## 游戏内实体 + +| 类型 | 限制 (0.3.7) | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | +| 玩家 | 1000 | +| [车辆](../functions/CreateVehicle)(4)(6) | 2000 | +| [车辆模型](../functions/CreateVehicle)(1) | 无限制 | +| [物体](../functions/CreateObject)(4)(6) | 1000 | +| [虚拟世界](../functions/SetPlayerVirtualWorld) | 2,147,483,647 | +| [室内场景](../functions/SetPlayerInterior) | 256 | +| [角色职业](../functions/AddPlayerClass) | 320 | +| [地图图标](../functions/SetPlayerMapIcon)(4) | 100 | +| [竞速检查点](../functions/SetPlayerRaceCheckpoint)(4) | 1 | +| [检查点](../functions/SetPlayerCheckpoint)(4) | 1 | +| [拾取物](../functions/CreatePickup)(4) | 4096 | +| [全局 3D 标签](../functions/Create3DTextLabel)(4) | 1024 | +| [玩家专属 3D 文本标签](../functions/CreatePlayer3DTextLabel)(4) | 1024 | +| [聊天泡泡字符串](../functions/SetPlayerChatBubble) | 144 字符 | +| [SetObjectMaterialText](../functions/SetObjectMaterialText), [SetPlayerObjectMaterialText](../functions/SetPlayerObjectMaterialText) 文本长度 | 2048 字符 | +| [帮派区域](../functions/GangZoneCreate) | 1024 | +| [玩家专属帮派区域](../functions/CreatePlayerGangZone) | 1024 | +| [菜单](../functions/CreateMenu) | 128 | +| [玩家附加物体](../functions/SetPlayerAttachedObject) | 10 | +| [玩家变量](../functions/SetPVarInt) | 800 | +| [服务器变量 (0.3.7 R2/omp)](../functions/SetSVarInt) | 无限制 | +| [角色](../functions/CreateActor) (0.3.7 起)(4)(5) | 1000 | +| [爆炸效果](../functions/CreateExplosion) | 10 | + +## 服务器属性 - SA-MP / omp + +| 类型 | SA-MP 限制 (0.3.7) | omp | +| ------------------------------------------------------ | ------------------- | ------------------- | +| 游戏模式 | 16 | 无限制 | +| 滤镜脚本 | 16 | 无限制 | +| 文本输入(聊天/指令) | 128 单元 (512 字节) | 128 单元 (512 字节) | +| 文本输出 | 144 单元 (576 字节) | 128 单元 (512 字节) | +| 名称长度 ([SetPlayerName](../functions/SetPlayerName)) | 24 字符 | 24 字符 | + +## 文本绘图 + +| 类型 | 限制 (0.3.7) | +| ------------------------------------ | ------------ | +| 字符串长度(2) | 1024 字符 | +| 单个客户端屏幕显示数量(3) | 2048 + 256 | +| 单个客户端屏幕精灵图显示数量 | 100 | +| 服务器全局创建数量 | 2048 | +| 玩家专属创建数量 | 256 | + +## 对话框 + +| 类型 | 限制 (0.3.7) | +| ---------------------------------------------------- | ------------ | +| 对话框 ID | 32768 | +| 信息(主文本) | 4096 | +| 标题 | 64 | +| 输入文本框 (DIALOG_STYLE_INPUT/PASSWORD) | 128 | +| 选项卡列表列数 (DIALOG_STYLE_TABLIST(\_HEADERS)) | 4 | +| 选项卡列表列字符数 (DIALOG_STYLE_TABLIST(\_HEADERS)) | 128 | +| 选项卡列表行字符数 (DIALOG_STYLE_TABLIST(\_HEADERS)) | 256 | + +**注意事项:** + +1. 虽然 0.3 版本中车辆模型数量无限制,但使用大量车辆模型会影响客户端性能 +2. 尽管文本绘图字符串限制为 1024 字符,若在 255 字符后使用颜色代码(如~r~)可能导致客户端崩溃 +3. 理论上可为单个玩家同时显示所有文本绘图,但不建议这样做 +4. 可通过[流加载插件](https://github.com/samp-incognito/samp-streamer-plugin)突破这些限制,该插件通过仅在玩家附近创建实体等方式工作 +5. 受客户端限制,实际最多仅能显示 51 个角色 +6. 车辆 ID 从 1 开始编号,因此实际范围为 1-1999(即使 MAX_VEHICLES 设为 2000),物体和玩家专属物体 ID 编号规则相同 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/mapicons.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/mapicons.md new file mode 100644 index 00000000000..f4ee671d8e2 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/mapicons.md @@ -0,0 +1,78 @@ +--- +title: 地图图标 +sidebar_label: 地图图标 +description: 可用的地图图标列表。 +--- + +:::info + +本页面列出了所有可通过[SetPlayerMapIcon](../functions/SetPlayerMapIcon)函数使用的地图图标。 + +::: + +| ID | 图标 | 名称 | 备注 | +| --- | ------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------ | +| 0 | ![](https://assets.open.mp/assets/images/mapIcons/icon0.gif) | 彩色方框/三角(动态) | 可使用任意颜色。用于单人任务目标,当标记与玩家不处于同一地面高度时显示为三角形 | +| 1 | ![](https://assets.open.mp/assets/images/mapIcons/icon1.gif) | 白色方框 | 尺寸为 ID 0 的两倍且无边框 | +| 2 | ![](https://assets.open.mp/assets/images/mapIcons/icon2.gif) | 玩家位置 | 默认显示在小地图上 | +| 3 | ![](https://assets.open.mp/assets/images/mapIcons/icon3.gif) | 玩家(菜单地图) | 暂停菜单大地图中显示的角色位置 | +| 4 | ![](https://assets.open.mp/assets/images/mapIcons/icon4.gif) | 北方指示 | 始终在雷达上指向北方 | +| 5 | ![](https://assets.open.mp/assets/images/mapIcons/icon5.gif) | 航空站 | | +| 6 | ![](https://assets.open.mp/assets/images/mapIcons/icon6.gif) | 武器商店 | | +| 7 | ![](https://assets.open.mp/assets/images/mapIcons/icon7.gif) | 理发店 | | +| 8 | ![](https://assets.open.mp/assets/images/mapIcons/icon8.gif) | 斯莫克 | | +| 9 | ![](https://assets.open.mp/assets/images/mapIcons/icon9.gif) | 船坞 | | +| 10 | ![](https://assets.open.mp/assets/images/mapIcons/icon10.gif) | 汉堡店 | | +| 11 | ![](https://assets.open.mp/assets/images/mapIcons/icon11.gif) | 采石场 | | +| 12 | ![](https://assets.open.mp/assets/images/mapIcons/icon12.gif) | 卡塔琳娜 | | +| 13 | ![](https://assets.open.mp/assets/images/mapIcons/icon13.gif) | 塞萨尔 | | +| 14 | ![](https://assets.open.mp/assets/images/mapIcons/icon14.gif) | 炸鸡店 | | +| 15 | ![](https://assets.open.mp/assets/images/mapIcons/icon15.gif) | 卡尔·约翰逊 | | +| 16 | ![](https://assets.open.mp/assets/images/mapIcons/icon16.gif) | 特警队 | | +| 17 | ![](https://assets.open.mp/assets/images/mapIcons/icon17.gif) | 小餐馆 | | +| 18 | ![](https://assets.open.mp/assets/images/mapIcons/icon18.gif) | 埃米特 | | +| 19 | ![](https://assets.open.mp/assets/images/mapIcons/icon19.gif) | 敌人袭击 | | +| 20 | ![](https://assets.open.mp/assets/images/mapIcons/icon20.gif) | 火灾 | | +| 21 | ![](https://assets.open.mp/assets/images/mapIcons/icon21.gif) | 女友 | | +| 22 | ![](https://assets.open.mp/assets/images/mapIcons/icon22.gif) | 医院 | | +| 23 | ![](https://assets.open.mp/assets/images/mapIcons/icon23.gif) | 机车党 | | +| 24 | ![](https://assets.open.mp/assets/images/mapIcons/icon24.gif) | 疯狗多克 | | +| 25 | ![](https://assets.open.mp/assets/images/mapIcons/icon25.gif) | 卡里古拉赌场 | | +| 26 | ![](https://assets.open.mp/assets/images/mapIcons/icon26.gif) | 说唱明星 | | +| 27 | ![](https://assets.open.mp/assets/images/mapIcons/icon27.gif) | 改装店 | | +| 28 | ![](https://assets.open.mp/assets/images/mapIcons/icon28.gif) | OG 洛克 | | +| 29 | ![](https://assets.open.mp/assets/images/mapIcons/icon29.gif) | 披萨店 | | +| 30 | ![](https://assets.open.mp/assets/images/mapIcons/icon30.gif) | 警局 | | +| 31 | ![](https://assets.open.mp/assets/images/mapIcons/icon31.gif) | 待售房产 | 可自由购买的资产 | +| 32 | ![](https://assets.open.mp/assets/images/mapIcons/icon32.gif) | 非卖房产 | 不可购买的资产 | +| 33 | ![](https://assets.open.mp/assets/images/mapIcons/icon33.gif) | 竞速 | | +| 34 | ![](https://assets.open.mp/assets/images/mapIcons/icon34.gif) | 莱德尔 | | +| 35 | ![](https://assets.open.mp/assets/images/mapIcons/icon35.gif) | 安全屋 | 单人模式中用于保存游戏的存档点 | +| 36 | ![](https://assets.open.mp/assets/images/mapIcons/icon36.gif) | 驾校 | | +| 37 | ![](https://assets.open.mp/assets/images/mapIcons/icon37.gif) | 神秘事件 | | +| 38 | ![](https://assets.open.mp/assets/images/mapIcons/icon38.gif) | 斯威特 | | +| 39 | ![](https://assets.open.mp/assets/images/mapIcons/icon39.gif) | 纹身店 | | +| 40 | ![](https://assets.open.mp/assets/images/mapIcons/icon40.gif) | 真相 | | +| 41 | ![](https://assets.open.mp/assets/images/mapIcons/icon41.gif) | 路径点 | 玩家可通过在暂停菜单地图右键点击放置 | +| 42 | ![](https://assets.open.mp/assets/images/mapIcons/icon42.gif) | 托雷诺牧场 | | +| 43 | ![](https://assets.open.mp/assets/images/mapIcons/icon43.gif) | 三合会 | | +| 44 | ![](https://assets.open.mp/assets/images/mapIcons/icon44.gif) | 三合会赌场 | | +| 45 | ![](https://assets.open.mp/assets/images/mapIcons/icon45.gif) | 服装店 | | +| 46 | ![](https://assets.open.mp/assets/images/mapIcons/icon46.gif) | 吴子 | | +| 47 | ![](https://assets.open.mp/assets/images/mapIcons/icon47.gif) | 零 | | +| 48 | ![](https://assets.open.mp/assets/images/mapIcons/icon48.gif) | 迪斯科约会 | | +| 49 | ![](https://assets.open.mp/assets/images/mapIcons/icon49.gif) | 酒吧约会 | | +| 50 | ![](https://assets.open.mp/assets/images/mapIcons/icon50.gif) | 餐厅 | | +| 51 | ![](https://assets.open.mp/assets/images/mapIcons/icon51.gif) | 卡车运输 | | +| 52 | ![](https://assets.open.mp/assets/images/mapIcons/icon52.gif) | 抢劫 | 常用于银行场所 | +| 53 | ![](https://assets.open.mp/assets/images/mapIcons/icon53.gif) | 竞速锦标赛 | | +| 54 | ![](https://assets.open.mp/assets/images/mapIcons/icon54.gif) | 健身房 | | +| 55 | ![](https://assets.open.mp/assets/images/mapIcons/icon55.gif) | 扣押场 | | +| 56 | ![](https://assets.open.mp/assets/images/mapIcons/icon56.gif) | 灯光 | | +| 57 | ![](https://assets.open.mp/assets/images/mapIcons/icon57.gif) | 最近机场 | | +| 58 | ![](https://assets.open.mp/assets/images/mapIcons/icon58.gif) | 阿兹特克帮 | | +| 59 | ![](https://assets.open.mp/assets/images/mapIcons/icon59.gif) | 巴拉斯 | | +| 60 | ![](https://assets.open.mp/assets/images/mapIcons/icon60.gif) | 洛圣都流浪者 | | +| 61 | ![](https://assets.open.mp/assets/images/mapIcons/icon61.gif) | 圣菲耶罗里法 | | +| 62 | ![](https://assets.open.mp/assets/images/mapIcons/icon62.gif) | 葛洛夫街家族 | | +| 63 | ![](https://assets.open.mp/assets/images/mapIcons/icon63.gif) | 喷漆店 | | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/mapiconstyles.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/mapiconstyles.md new file mode 100644 index 00000000000..4348148e42a --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/mapiconstyles.md @@ -0,0 +1,18 @@ +--- +title: 地图图标样式 +sidebar_label: 地图图标样式 +description: 可用的地图图标样式列表 +--- + +:::info + +本页面列出了所有可通过[SetPlayerMapIcon](../functions/SetPlayerMapIcon)函数使用的地图图标样式。 + +::: + +| 数值 | 常量 | 含检查点标记 | 雷达地图范围 | +| ---- | ------------------------- | ------------ | ------------------------ | +| 0 | MAPICON_LOCAL | 否 | 仅限近距离 | +| 1 | MAPICON_GLOBAL | 否 | 在范围内时显示于雷达边缘 | +| 2 | MAPICON_LOCAL_CHECKPOINT | 是 | 仅限近距离 | +| 3 | MAPICON_GLOBAL_CHECKPOINT | 是 | 在范围内时显示于雷达边缘 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/markermodes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/markermodes.md new file mode 100644 index 00000000000..229c7c6ae94 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/markermodes.md @@ -0,0 +1,16 @@ +--- +title: 标记模式 +sidebar_label: 标记模式 +--- + +:::info + +此处可找到所有由[ShowPlayerMarkers](../functions/ShowPlayerMarkers)使用的玩家标记模式。 + +::: + +| ID | 定义 | +| --- | ---------------------------------- | +| 0 | PLAYER_MARKERS_MODE_OFF(关闭) | +| 1 | PLAYER_MARKERS_MODE_GLOBAL(全局) | +| 2 | PLAYER_MARKERS_MODE_STREAMED(流式) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/materialtextalignment.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/materialtextalignment.md new file mode 100644 index 00000000000..8c81c1bd0f8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/materialtextalignment.md @@ -0,0 +1,17 @@ +--- +title: 纹理文本对齐方式 +sidebar_label: 纹理文本对齐方式 +description: 纹理文本对齐方式列表。 +--- + +:::info + +[SetObjectMaterialText](../functions/SetObjectMaterialText) 函数包含两类参数——纹理文本对齐方式和纹理文本尺寸。本页面列出文本对齐方式参数。 + +::: + +| 数值 | 常量定义 | +| ---- | ------------------------------------------- | +| 0 | OBJECT_MATERIAL_TEXT_ALIGN_LEFT(左对齐) | +| 1 | OBJECT_MATERIAL_TEXT_ALIGN_CENTER(居中对齐) | +| 2 | OBJECT_MATERIAL_TEXT_ALIGN_RIGHT(右对齐) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/materialtextsizes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/materialtextsizes.md new file mode 100644 index 00000000000..2eab76adcdc --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/materialtextsizes.md @@ -0,0 +1,28 @@ +--- +title: 纹理文本尺寸 +sidebar_label: 纹理文本尺寸 +description: 纹理文本尺寸参数列表。 +--- + +:::info + +[SetObjectMaterialText](../functions/SetObjectMaterialText) 函数包含两类参数——纹理文本对齐方式和纹理文本尺寸。本页面列出文本尺寸参数。 + +::: + +| 数值 | 常量定义 | +| ---- | ---------------------------- | +| 10 | OBJECT_MATERIAL_SIZE_32x32 | +| 20 | OBJECT_MATERIAL_SIZE_64x32 | +| 30 | OBJECT_MATERIAL_SIZE_64x64 | +| 40 | OBJECT_MATERIAL_SIZE_128x32 | +| 50 | OBJECT_MATERIAL_SIZE_128x64 | +| 60 | OBJECT_MATERIAL_SIZE_128x128 | +| 70 | OBJECT_MATERIAL_SIZE_256x32 | +| 80 | OBJECT_MATERIAL_SIZE_256x64 | +| 90 | OBJECT_MATERIAL_SIZE_256x128 | +| 100 | OBJECT_MATERIAL_SIZE_256x256 | +| 110 | OBJECT_MATERIAL_SIZE_512x64 | +| 120 | OBJECT_MATERIAL_SIZE_512x128 | +| 130 | OBJECT_MATERIAL_SIZE_512x256 | +| 140 | OBJECT_MATERIAL_SIZE_512x512 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/networkstats.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/networkstats.md new file mode 100644 index 00000000000..89093b0d4c8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/networkstats.md @@ -0,0 +1,32 @@ +--- +title: 网络状态 +sidebar_label: 网络状态 +description: 连接服务器时按住F5键显示的网络状态信息。 +tags: [] +--- + +| 数据 | ​**说明**​ | +| ---------------------------------- | --------------------------------------------------------------------------- | +| 下载速率 | 从服务器下载数据的速率 | +| 上传速率 | 向服务器上传数据的速率 | +| 车辆 | 已为客户端流加载的车辆数量 | +| 车辆模型 | 已为客户端流加载的不同车辆模型种类数量 | +| 已加载车辆模型 | (预)加载的车辆模型总数 | +| 渲染物体数 | 当前渲染的物体数量 | +| 已用角色槽 | 已占用的角色槽数量(NPC/玩家都会占用'角色'槽) | +| 已用物体槽 | 已占用的物体槽数量 | +| 步行状态同步速率 | 步行状态数据同步频率(单位:毫秒)。可在 server.cfg 中设置 | +| 流内存使用量(同时显示总可用内存) | 当前使用的流内存容量及总可用容量 | +| 发送缓存中的消息数 | 等待发送的网络消息数量 | +| 已发送消息数 | 已发送的网络消息总数 | +| 已发送字节量 | 已发送的数据总量(单位:字节) | +| 已发送确认包 | 已发送的确认包数量(用于确认数据包接收) | +| 发送缓存中的确认包数 | 等待发送的确认包数量 | +| 等待确认的消息数 | 等待接收确认的消息数量 | +| 重发消息数 | 因未收到确认而重新发送的消息数量。客户端在重新发送 109 次消息后尝试重新连接 | +| 重发字节量 | 重新发送的数据总量(单位:字节) | +| 丢包率 | 已发送但未被接收端收到的数据包百分比 | +| 已接收消息数 | 从服务器接收的网络消息总数 | +| 已接收字节量 | 已接收的数据总量(单位:字节) | +| 已接收确认包 | 已接收的确认包数量 | +| 重复确认包接收数 | 已接收的重复确认包数量(已确认过的确认包) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/objecteditionresponsetypes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/objecteditionresponsetypes.md new file mode 100644 index 00000000000..e77b5f0bba4 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/objecteditionresponsetypes.md @@ -0,0 +1,16 @@ +--- +title: 物体编辑响应类型 +sidebar_label: 物体编辑响应类型 +--- + +:::info + +此处列出所有由[OnPlayerEditObject](../callbacks/OnPlayerEditObject)回调使用的物体编辑响应类型。 + +::: + +| 数值 | 定义 | 说明 | +| ---- | -------------------- | ------------------------------------ | +| 1 | EDIT_RESPONSE_CANCEL | 玩家按下 ESC 取消所有修改 | +| 2 | EDIT_RESPONSE_FINAL | 玩家确认最终修改并点击保存按钮 | +| 3 | EDIT_RESPONSE_UPDATE | 玩家仅移动了物体(编辑操作尚未结束) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/opcodes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/opcodes.md new file mode 100644 index 00000000000..6556268c6f6 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/opcodes.md @@ -0,0 +1,21 @@ +--- +title: 操作码 +sidebar_label: 操作码 +description: SendClientCheck的动作ID +tags: [] +--- + +:::note + +本页面包含[SendClientCheck](../functions/SendClientCheck)函数使用的所有动作/操作码 ID。 + +::: + +| 操作码 | 用途 | +| ------ | ------------------------------------------------------------------------------------------------------------------------------------- | +| 72 | 玩家的计算机运行时间 | +| 71 | 指定模型 ColModel 的校验和(CColModel 类中的数据) | +| 70 | 指定模型 CModelInfo 的校验和(CModelInfo 类中的数据) | +| 2 | 返回 CPhysical 中实体的 32 位标志(如果玩家在车辆中,则发送与车辆相关的数据;如果玩家处于步行状态,则发送玩家相关数据) | +| 5 | 从 arg + 偏移地址处(GTA 内存)的 size 字节计算校验和,并将结果返回至 response 参数,且 arg 应在 GTA 内存边界范围内 | +| 69 | 从 arg + 偏移地址处(SAMP 内存)的 size 字节计算校验和,并将结果返回至 response 参数,且 arg 应在 GTA 内存边界范围内(0x0 - 0xC3500) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/original-car-colors.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/original-car-colors.md new file mode 100644 index 00000000000..d0f7d0891d0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/original-car-colors.md @@ -0,0 +1,208 @@ +--- +title: 原版车辆颜色 +sidebar_label: 原版车辆颜色 +description: 单人模式中所有车辆的原版颜色配置列表。 +--- + +以下是单人模式中各类型车辆使用的原版颜色组合。 + +| 车辆名称 | 颜色组合 | +| -------- | -------------------------------------------------------------------------------- | +| admiral | `34,34`, `35,35`, `37,37`, `39,39`, `41,41`, `43,43`, `45,45`, `47,47` | +| alpha | `58,1`, `69,1`, `75,77`, `18,1`, `32,1`, `45,45`, `13,1`, `34,1` | +| ambulan | `1,3` | +| androm | `1,1` | +| artict1 | `1,1` | +| artict2 | `1,1` | +| artict3 | `1,1` | +| at400 | `1,3`, `8,7`, `8,10`, `8,16`, `23,31`, `40,44` | +| baggage | `1,73`, `1,74`, `1,75`, `1,76`, `1,77`, `1,78`, `1,79` | +| bandito | `2,39`, `9,39`, `17,1`, `21,1`, `33,0`, `37,0`, `41,29`, `56,29` | +| banshee | `12,12`, `13,13`, `14,14`, `1,2`, `2,1`, `1,3`, `3,1`, `10,10` | +| barracks | `43,0` | +| beagle | `3,90`, `4,90`, `7,68`, `8,66`, `12,60`, `27,97`, `34,51`, `37,51` | +| benson | `109,25`, `109,32`, `112,32`, `10,32`, `30,44`, `32,52`, `84,66`, `84,69` | +| bf400 | `54,1`, `58,1`, `66,1`, `72,1`, `75,1`, `87,1`, `101,1`, `36,1` | +| bfinject | `1,0`, `2,2`, `3,2`, `3,6`, `6,16`, `15,30`, `24,53`, `35,61` | +| bike | `7,1`, `74,1`, `61,1`, `16,1`, `25,1`, `30,1`, `36,1`, `53,1` | +| blade | `9,1`, `12,1`, `26,96`, `30,96`, `32,1`, `37,1`, `57,96`, `71,96` | +| blistac | `74,72`, `66,72`, `53,56`, `37,19`, `22,22`, `20,20`, `9,14`, `0,0` | +| bloodra | `51,39`, `57,38`, `45,29`, `34,9`, `65,9`, `14,1`, `12,9`, `26,1` | +| bmx | `1,1`, `3,3`, `6,6`, `46,46`, `65,9`, `14,1`, `12,9`, `26,1` | +| bobcat | `96,25`, `97,25`, `101,25`, `111,31`, `113,36`, `83,57`, `67,59` | +| boxburg | `36,36` | +| boxville | `11,123`, `13,120`, `20,117`, `24,112`, `27,107`, `36,105`, `37,107`, `43,93` | +| bravura | `41,41`, `47,47`, `52,52`, `66,66`, `74,74`, `87,87,91,91`, `113,113` | +| broadway | `12,1`, `19,96`, `31,64`, `25,96`, `38,1`, `51,96`, `57,1`, `66,96` | +| buccanee | `2,39`, `9,39`, `17,1`, `21,1`, `33,0`, `37,0`, `41,29`, `56,29` | +| buffalo | `10,10`, `13,13`, `22,22`, `30,30`, `39,39`, `90,90`, `98,98`, `110,110` | +| bullet | `51,1`, `58,8`, `60,1`, `68,8`, `2,1`, `13,8`, `22,1`, `36,8` | +| burrito | `41,41`, `48,48`, `52,52`, `64,64`, `71,71`, `85,85`, `10,10`, `62,62` | +| bus | `71,59`, `75,59`, `92,72`, `47,74`, `55,83`, `59,83`, `71,87`, `82,87` | +| cabbie | `6,76` | +| caddy | `58,1`, `2,1`, `63,1`, `18,1`, `32,1`, `45,1`, `13,1`, `34,1` | +| cadrona | `52,1`, `53,1`, `66,1`, `75,1`, `76,1`, `81,1`, `95,1`, `109,1` | +| cargobob | `1,1` | +| cheetah | `20,1`, `25,1`, `36,1`, `40,1 62,1`, `75,1`, `92,1`, `0,1` | +| clover | `13,118`, `24,118`, `31,93`, `32,92`, `45,92`, `113,92`, `119,113`, `122,113` | +| club | `37,37`, `31,31`, `23,23`, `22,22`, `7,7`, `124,124`, `114,114`, `112,112` | +| coach | `54,7`, `79,7`, `87,7`, `95,16`, `98,20`, `105,20`, `123,20`, `125,21` | +| coastg | `56,15`, `56,53` | +| come | `73,45`, `12,12`, `2,2`, `6,6`, `4,4`, `46,46`, `53,53` | +| copcarla | `0,1` | +| copcarsf | `0,1` | +| copcarvg | `0,1` | +| copcarru | `0,1` | +| cropdust | `17,39`, `15,123`, `32,112`, `45,88`, `52,71`, `57,67`, `61,96`, `96,96` | +| dft30 | `1,1` | +| dinghy | `56,15`, `56,53` | +| dodo | `51,1`, `58,8`, `60,1`, `68,8`, `2,1`, `13,8`, `22,1`, `36,8` | +| dozer | `1,1` | +| dumper | `1,1` | +| duneride | `91,38`, `115,43`, `85,6`, `79,7`, `78,8`, `77,18`, `79,18`, `86,24` | +| elegant | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| elegy | `36,1`, `35,1`, `17,1`, `11,1`, `116,1`, `113,1`, `101,1`, `92,1` | +| emperor | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| enforcer | `0,1` | +| esperant | `45,75`, `47,76`, `33,75`, `13,76`, `54,75`, `69,76`, `59,75`, `87,76` | +| euros | `36,1`, `40,1`, `43,1`, `53,1`, `72,1`, `75,1`, `95,1`, `101,1` | +| faggio | `12,12`, `13,13`, `14,14`, `1,2`, `2,1`, `1,3`, `3,1`, `10,10` | +| fbiranch | `0,0` | +| fcr900 | `74,74`, `75,13`, `87,118`, `92,3`, `115,118`, `25,118`, `36,0`, `118,118` | +| feltzer | `73,1`, `74,1`, `75,1`, `77,1`, `79,1`, `83,1`, `84,1`, `91,1` | +| firela | `3,1` | +| firetruk | `3,1` | +| flash | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| flatbed | `84,15`, `84,58`, `84,31`, `32,74`, `43,31`, `1,31`, `77,31`, `32,74` | +| forklift | `110,1`, `111,1`, `112,1`, `114,1`, `119,1`, `122,1`, `4,1`, `13,1` | +| fortune | `2,39`, `9,39`, `17,1`, `21,1`, `33,0`, `37,0`, `41,29`, `56,29` | +| freeway | `79,79`, `84,84`, `7,7`, `11,11`, `19,19`, `22,22`, `36,36`, `53,53` | +| freight | `1,1` | +| glendale | `67,76`, `68,76`, `78,76`, `2,76`, `16,76`, `18,76`, `25,76`, `45,88` | +| glenshit | `67,76`, `68,76`, `78,76`, `2,76`, `16,76`, `18,76`, `25,76`, `45,88` | +| greenwoo | `30,26`, `77,26`, `81,27`, `24,55`, `28,56`, `49,59`, `52,69`, `71,107` | +| hermes | `97,1`, `81,1`, `105,1`, `110,1`, `91,1`, `74,1`, `84,1`, `83,1` | +| hotdog | `1,1` | +| hotknife | `1,1`, `12,12`, `2,2`, `6,6`, `4,4`, `46,46`, `53,53` | +| hotrina | `7,94`, `36,88`, `51,75`, `53,75 ,58,67`, `75,67`, `75,61`, `79,62` | +| hotrinb | `83,66`, `87,74`, `87,75`, `98,83`, `101,100`, `103,101`, `117,116`, `123,36` | +| hotring | `36,117`, `36,13`, `42,30`, `42,33`, `54,36`, `75,79`, `92,101`, `98,109` | +| hunter | `43,0` | +| huntley | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| hustler | `50,1`, `47,1`, `44,96`, `40,96`, `39,1`, `30,1`, `28,96`, `9,96` | +| infernus | `12,1`, `64,1`, `123,1`, `116,1`, `112,1`, `106,1`, `80,1`, `75,1` | +| intruder | `62,37`, `78,38`, `2,62`, `3,87`, `2,78`, `113,78`, `119,62`, `7,78` | +| jester | `51,1`, `58,8`, `60,1`, `68,8`, `2,1`, `13,8`, `22,1`, `36,8` | +| jetmax | `36,13` | +| journey | `1,1` | +| kart | `2,35`, `36,2`, `51,53`, `91,2`, `11,22`, `40,35` | +| landstal | `4,1`, `123,1`, `113,1`, `101,1`, `75,1`, `62,1`, `40,1`, `36,1` | +| launch | `112,20` | +| linerun | `36,1`, `37,1`, `30,1`, `28,1`, `25,1`, `40,1`, `101,1`, `113,1` | +| quad | `120,117`, `103,111`, `120,114`, `74,91`, `120,112`, `74,83`, `120,113`, `66,71` | +| majestic | `37,36`, `36,36`, `40,36`, `43,41`, `47,41`, `51,72`, `54,75`, `55,84` | +| mtbike | `43,43`, `46,46`, `39,39`, `28,28`, `16,16`, `6,6`, `5,5`, `2,2` | +| manana | `4,1`, `9,1`, `10,1`, `25,1`, `36,1`, `40,1`, `45,1`, `84,1` | +| marquis | `12,35`, `50,32`, `40,26`, `66,36` | +| maverick | `26,14`, `29,42`, `26,57`, `54,29`, `26,3`, `3,29`, `12,39`, `74,35` | +| merit | `67,1`, `72,1`, `75,1`, `83,1`, `91,1`, `101,1`, `109,1`, `20,1` | +| mesa | `75,84`, `40,84`, `40,110`, `28,119`, `25,119`, `21,119`, `13,119`, `4,119` | +| monster | `32,36`, `32,42`, `32,53`, `32,66`, `32,14`, `32,32` | +| monstera | `1,1` | +| monsterb | `1,1` | +| moonbeam | `119,119`, `117,227`, `114,114`, `108,108`, `95,95`, `81,81`, `61,61`, `41,41` | +| mower | `94,1`, `101,1`, `116,1`, `117,1`, `4,1`, `25,1`, `30,1`, `37,1` | +| mrwhoop | `1,16`, `1,56`, `1,17`, `1,53`, `1,5`, `1,35` | +| mule | `25,1`, `28,1`, `43,1`, `67,1`, `72,1`, `9,1`, `95,1`, `24,1` | +| nebula | `116,1`, `119,1`, `122,1`, `4,1`, `9,1`, `24,1`, `27,1`, `36,1` | +| nevada | `38,9`, `55,23`, `61,74`, `71,87`, `91,87`, `98,114`, `102,119`, `111,3` | +| newsvan | `41,10`, `41,20`, `49,11`, `56,123`, `110,113`, `112,116`, `114,118`, `119,101` | +| nrg500 | `3,3`, `3,8`, `6,25`, `7,79`, `8,82`, `36,105`, `39,106`, `51,118` | +| oceanic | `51,1`, `58,8`, `60,1`, `68,8`, `2,1`, `13,8`, `22,1`, `36,8` | +| packer | `4,1`, `20,1`, `24,1`, `25,1`, `36,1`, `40,1`, `54,1`, `84,1` | +| patriot | `43,0` | +| pcj600 | `36,1`, `37,1`, `43,1`, `53,1`, `61,1`, `75,1`, `79,1`, `88,1` | +| peren | `113,39`, `119,50`, `123,92`, `109,100`, `101,101`, `95,105`, `83,110`, `66,25` | +| petro | `10,1`, `25,1`, `28,1`, `36,1`, `40,1`, `54,1`, `75,1`, `113,1` | +| petrotr | `1,1` | +| phoenix | `58,1`, `69,1`, `75,77`, `18,1`, `32,1`, `45,45`, `13,1`, `34,1` | +| picador | `81,8`, `32,8`, `43,8`, `67,8`, `11,11`, `8,90`, `2,2`, `83,13` | +| pizzaboy | `3,6` | +| polmav | `0,1` | +| pony | `87,1`, `88,1`, `91,1`, `105,1`, `109,1`, `119,1`, `4,1`, `25,1` | +| predator | `46,26` | +| premier | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| previon | `83,1`, `87,1`, `92,1`, `95,1`, `109,1`, `119,45`, `11,1` | +| primo | `122,1`, `123,1`, `125,1`, `10,1`, `24,1`, `37,1`, `55,1`, `66,1` | +| raindanc | `1,6` | +| rancher | `13,118`, `14,123`, `120,123`, `112,120`, `84,110`, `76,102` | +| rcbandit | `2,96`, `79,42`, `82,54`, `67,86`, `126,96`, `70,96`, `110,54`, `67,98` | +| rcbaron | `14,75` | +| rcraider | `14,75` | +| rcgoblin | `14,75` | +| rdtrain | `13,76`, `24,77`, `63,78`, `42,76`, `54,77`, `39,78`, `11,76`, `62,77` | +| reefer | `56,56` | +| regina | `27,36`, `59,36`, `60,35`, `55,41`, `54,31`, `49,23`, `45,32`, `40,29` | +| remingtn | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| rhino | `43,0` | +| rnchlure | `13,118`, `14,123`, `120,123`, `112,120`, `84,110`, `76,102` | +| romero | `0,0`, `11,105`, `25,109`, `36,0`, `40,36`, `75,36`, `0,36`, `0,109` | +| rumpo | `34,34`, `32,32`, `20,20`, `110,110`, `66,66`, `84,84`, `118,118`, `121,121` | +| rustler | `6,7`, `7,6`, `1,6`, `89,91`, `119,117`, `103,102`, `77,87`, `71,77` | +| sabre | `2,39`, `9,39`, `17,1`, `21,1`, `33,0`, `37,0`, `41,29`, `56,29` | +| sadler | `76,8`, `32,8`, `43,8`, `67,8`, `11,11`, `8,90`, `2,2`, `83,13` | +| sadlshit | `61,8`, `32,8`, `43,8`, `67,8`, `11,11`, `8,90`, `2,2`, `83,13` | +| sanchez | `6,6`, `46,46`, `53,53`, `3,3` | +| sandking | `123,124`, `119,122`, `118,117`, `116,115`, `114,108`, `101,106`, `88,99`, `5,6` | +| savanna | `97,96`, `88,64`, `90,96`, `93,64`, `97,96`, `99,81`, `102,114`, `114,1` | +| seaspar | `75,2` | +| securica | `4,75` | +| sentinel | `11,1`, `24,1`, `36,1`, `40,1`, `75,1`, `91,1`, `123,1`, `4,1` | +| shamal | `1,1` | +| streak | `1,1` | +| streakc | `1,1` | +| skimmer | `1,3`, `1,9`, `1,18`, `1,30`, `17,23`, `46,23`, `46,32`, `57,34` | +| slamvan | `3,1`, `28,1`, `31,1`, `55,1`, `66,1 97,1`, `123,1`, `118,1` | +| solair | `91,1`, `101,1`, `109,1`, `113,1`, `4,1`, `25,1`, `30,1`, `36,1` | +| sparrow | `1,3` | +| speeder | `1,3`, `1,5`, `1,16`, `1,22`, `1,35`, `1,44`, `1,53`, `1,57` | +| stafford | `92,92`, `81,81`, `67,67`, `66,66`, `61,61`, `53,53`, `51,51`, `47,47`, `43,43` | +| stallion | `57,8`, `8,17`, `43,21`, `54,38`, `67,8`, `37,78`, `65,79`, `25,78` | +| stratum | `57,8`, `8,17`, `43,21`, `54,38`, `67,8`, `37,78`, `65,79`, `25,78` | +| stretch | `1,1` | +| stunt | `38,51`, `21,36`, `21,34`, `30,34`, `54,34`, `55,20`, `48,18`, `51,6` | +| sultan | `52,39`, `9,39`, `17,1`, `21,1`, `33,0`, `37,0`, `41,29`, `56,29` | +| sunrise | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| supergt | `3,3`, `6,6`, `7,7`, `52,52`, `76,76` | +| swatvan | `1,1` | +| sweeper | `26,26` | +| tahoma | `109,1`, `30,8`, `95,1`, `84,8`, `83,1`, `72,8`, `71,1`, `52,8` | +| tampa | `74,39`, `72,39`, `75,39`, `79,39`, `83,36`, `84,36`, `89,35`, `91,35` | +| taxi | `6,1` | +| topfun | `26,26`, `28,28`, `44,44`, `51,51`, `57,57`, `72,72`, `106,106`, `112,112` | +| tornado | `67,1`, `68,96`, `72,1`, `74,8`, `75,96`, `76,8`, `79,1`, `84,96` | +| towtruck | `1,1`, `17,20`, `18,20`, `22,30`, `36,43`, `44,51`, `52,54` | +| tractor | `2,35`, `36,2`, `51,53`, `91,2`, `11,22`, `40,35` | +| tram | `1,74` | +| trash | `26,26` | +| tropic | `26,26` | +| tug | `1,1` | +| tugstair | `1,1` | +| turismo | `123,123`, `125,125`, `36,36`, `16,16`, `18,18`, `46,46`, `61,61`, `75,75` | +| uranus | `112,1`, `116,1`, `117,1`, `24,1`, `30,1`, `35,1`, `36,1`, `40,1` | +| utility | `56,56`, `49,49`, `26,124` | +| vcnmav | `2,26`, `2,29` | +| vincent | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| virgo | `40,65`, `71,72`, `52,66`, `64,72`, `30,72`, `60,72` | +| voodoo | `9,1`, `10,8`, `11,1`, `25,8`, `27,1`, `29,8`, `30,1`, `37,8` | +| vortex | `96,67`, `86,70`, `79,74`, `70,86`, `61,98`, `75,75`, `75,91` | +| walton | `72,1`, `66,1`, `59,1`, `45,1`, `40,1`, `39,1`, `35,1`, `20,1` | +| washing | `4,1`, `13,1`, `25,1`, `30,1`, `36,1`, `40,1`, `75,1`, `95,1` | +| wayfarer | `119,1`, `122,1`, `8,1`, `10,1`, `13,1`, `25,1`, `27,1`, `32,1` | +| willard | `37,37`, `42,42`, `53,53`, `62,62`, `7,7`, `10,10`, `11,11`, `15,15` | +| windsor | `51,1`, `58,1`, `60,1`, `68,1`, `2,1`, `13,1`, `22,1`, `36,1` | +| yankee | `84,63`, `91,63`, `102,65`, `105,72`, `110,93`, `121,93`, `12,95`, `23,1` | +| yosemite | `53,32`, `15,32`, `45,32`, `34,30`, `65,32`, `14,32`, `12,32`, `43,32` | +| zr350 | `92,1`, `94,1`, `101,1`, `121,1`, `0,1`, `22,1`, `36,1`, `75,1` | + +**camper**、**cement**​ 和 ​**squalo**​ 的配色数据不可用,因这些车型使用四组颜色 ID 而非常规的两组。 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/paintjobs.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/paintjobs.md new file mode 100644 index 00000000000..7aa3eaa5f1b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/paintjobs.md @@ -0,0 +1,59 @@ +--- +title: 车辆涂装 +sidebar_label: 车辆涂装 +description: 可应用于特定车辆的预设涂装方案。 +--- + +:::info + +本页面收录了所有可通过[ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob)函数使用的车辆涂装方案。 +每个涂装条目均包含对应的车辆 ID、名称及兼容性信息。 + +::: + +## 涂装数据表 + +| 预览图 | 涂装 ID | 模型 ID | 车辆名称 | 颜色方案 | 单人模式是否可用 | +| ----------------------------------------------------------------------------------- | ------- | ------- | --------- | -------------------- | ---------------- | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Camper_0.png) | 0 | 483 | Camper | 默认(无自定义颜色) | 否 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Remington_0.png) | 0 | 534 | Remington | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Remington_1.png) | 1 | 534 | Remington | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Remington_2.png) | 2 | 534 | Remington | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Slamvan_0.png) | 0 | 535 | Slamvan | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Slamvan_1.png) | 1 | 535 | Slamvan | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Slamvan_2.png) | 2 | 535 | Slamvan | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Blade_0.png) | 0 | 536 | Blade | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Blade_0.png) | 1 | 536 | Blade | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Blade_0.png) | 2 | 536 | Blade | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Uranus_0.png) | 0 | 558 | Uranus | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Uranus_0.png) | 1 | 558 | Uranus | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Uranus_0.png) | 2 | 558 | Uranus | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Jester_0.png) | 0 | 559 | Jester | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Jester_1.png) | 1 | 559 | Jester | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Jester_2.png) | 2 | 559 | Jester | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Sultan_0.png) | 0 | 560 | Sultan | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Sultan_1.png) | 1 | 560 | Sultan | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Sultan_2.png) | 2 | 560 | Sultan | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Stratum_0.png) | 0 | 561 | Stratum | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Stratum_1.png) | 1 | 561 | Stratum | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Stratum_2.png) | 2 | 561 | Stratum | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Elegy_0.png) | 0 | 562 | Elegy | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Elegy_1.png) | 1 | 562 | Elegy | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Elegy_2.png) | 2 | 562 | Elegy | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Flash_0.png) | 0 | 565 | Flash | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Flash_1.png) | 1 | 565 | Flash | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Flash_2.png) | 2 | 565 | Flash | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Savanna_0.png) | 0 | 567 | Savanna | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Savanna_1.png) | 1 | 567 | Savanna | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Savanna_2.png) | 2 | 567 | Savanna | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Broadway_0.png) | 0 | 575 | Broadway | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Broadway_1.png) | 1 | 575 | Broadway | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Tornado_0.png) | 0 | 576 | Tornado | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Tornado_1.png) | 1 | 576 | Tornado | 默认(无自定义颜色) | 是 | +| ![](https://assets.open.mp/assets/images/paintjobs/VehiclePaintjob_Tornado_2.png) | 2 | 576 | Tornado | 默认(无自定义颜色) | 是 | + +## 相关函数 + +- [ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob): 更换车辆涂装 +- [ChangeVehicleColor](ChangeVehicleColor): 设置车辆颜色 +- [OnVehiclePaintjob](../callbacks/OnVehiclePaintjob): 当车辆涂装被修改时触发 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/panelstates.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/panelstates.md new file mode 100644 index 00000000000..7cddfee38e1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/panelstates.md @@ -0,0 +1,62 @@ +--- +title: 面板状态 +sidebar_label: 面板状态 +description: 关于字节存储结构及其对应面板状态位的技术说明 +--- + +:::note + +面板状态信息通过[GetVehicleDamageStatus](../functions/GetVehicleDamageStatus)和[UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus)等原生函数进行操作。 + +::: + +## 半字节位域解析 + +- ​**第一个半字节**:存储汽车的**左前面板**状态,或飞机的**(左)引擎**状态 +- ​**第二个半字节**:存储汽车的**右前面板**状态,或飞机的**(右)引擎**状态 +- ​**第三个半字节**:存储汽车的**左后面板**状态,或飞机的**方向舵(位于垂直尾翼上)​**状态 +- ​**第四个半字节**:存储汽车的**右后面板**状态,或飞机的**升降舵(位于尾部)​**状态 +- ​**第五个半字节**:存储汽车的**挡风玻璃**状态,或飞机的**副翼(位于机翼)​**状态 +- ​**第六个半字节**:存储汽车的**前保险杠**状态 +- ​**第七个半字节**:存储汽车的**后保险杠**状态 + +注意并非所有车辆都支持上述所有面板部件。飞机部件的损坏程度会显著影响飞行操控性,受损部件会冒出黑烟。 + +多数面板支持 4 种状态:​**完好(值 0)​**、**压损(值 1)​**、**松动(值 2)​**、**脱落(值 3)​**。压损和松动状态存在显示异常(当从松动状态转为压损时,面板会同时显示松动和压损效果,需重新载入车辆流才能正常显示)。建议修复方法:先重置该面板的损坏状态,再应用新状态。此方法也可实现行驶中显示松动但无物理压痕的效果(直接从 0 设为 2,而非 0→1→2)。 + +当前仅挡风玻璃状态可被正确读取。设置该状态会更新服务器数据,但不会产生物理变化。 + +注意半字节从右向左计数,第一个半字节是最右侧的位域。 + +--- + +## 示例说明 + +以下二进制代码表示汽车前后保险杠已脱落: + +`00000011 00110000 00000000 00000000` + +由于 SA-MP 返回十进制数值,需先转换为二进制进行分析。上述示例对应的十进制返回值为: + +`53477376` + +--- + +## 应用实例 + +移除汽车前保险杠并保持其他部件状态不变: + +```c +new + VEHICLE_PANEL_STATUS:panels, + VEHICLE_DOOR_STATUS:doors, + VEHICLE_LIGHT_STATUS:lights, + VEHICLE_TIRE_STATUS:tires; + +GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); +UpdateVehicleDamageStatus(vehicleid, (panels | VEHICLE_PANEL_STATUS:0b00000000001100000000000000000000), doors, lights, tires); // '0b'前缀表示二进制数值,用法类似'0x'表示十六进制 +``` + +## 相关阅读 + +- [车辆面板状态](../resources/vehicle-panel-status) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pickupids.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pickupids.md new file mode 100644 index 00000000000..d51e6e63d5b --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pickupids.md @@ -0,0 +1,125 @@ +--- +title: 拾取物ID +sidebar_label: 拾取物ID +--- + +:::note + +任何有效物体模型均可用于[CreatePickup](../functions/CreatePickup)和[CreatePlayerPickup](../functions/CreatePlayerPickup)。本页面仅列出适合作为拾取物使用的常见物体模型。 + +::: + +## 拾取物模型 ID + +| ID | 预览图 | 描述 | +| ----- | -------------------------------------------------------------- | ---------------------- | +| 954 | ![](https://assets.open.mp/assets/images/pickups/pickup1.png) | 马蹄铁 | +| 1210 | ![](https://assets.open.mp/assets/images/pickups/pickup2.png) | 公文包 | +| 1212 | ![](https://assets.open.mp/assets/images/pickups/pickup3.png) | 现金 | +| 1213 | ![](https://assets.open.mp/assets/images/pickups/pickup4.png) | 地雷 | +| 1239 | ![](https://assets.open.mp/assets/images/pickups/pickup5.png) | 信息标识 | +| 1240 | ![](https://assets.open.mp/assets/images/pickups/pickup6.png) | 爱心 | +| 1241 | ![](https://assets.open.mp/assets/images/pickups/pickup7.png) | 药丸 | +| 1242 | ![](https://assets.open.mp/assets/images/pickups/pickup8.png) | 防弹衣 | +| 1247 | ![](https://assets.open.mp/assets/images/pickups/pickup9.png) | 星星 | +| 1248 | ![](https://assets.open.mp/assets/images/pickups/pickup10.png) | GTA III 标志 | +| 1252 | ![](https://assets.open.mp/assets/images/pickups/pickup11.png) | 爆炸油桶 | +| 1254 | ![](https://assets.open.mp/assets/images/pickups/pickup12.png) | 骷髅头 | +| 1272 | ![](https://assets.open.mp/assets/images/pickups/pickup13.png) | 房屋(蓝色) | +| 1273 | ![](https://assets.open.mp/assets/images/pickups/pickup14.png) | 房屋(绿色) | +| 1274 | ![](https://assets.open.mp/assets/images/pickups/pickup15.png) | 美元符号 | +| 1275 | ![](https://assets.open.mp/assets/images/pickups/pickup16.png) | T 恤 | +| 1276 | ![](https://assets.open.mp/assets/images/pickups/pickup17.png) | 图腾雕像 | +| 1277 | ![](https://assets.open.mp/assets/images/pickups/pickup18.png) | 存档磁盘 | +| 1279 | ![](https://assets.open.mp/assets/images/pickups/pickup19.png) | 克雷格包裹 | +| 1310 | ![](https://assets.open.mp/assets/images/pickups/pickup20.png) | 降落伞 | +| 1313 | ![](https://assets.open.mp/assets/images/pickups/pickup21.png) | 双骷髅(狂暴模式) | +| 1314 | ![](https://assets.open.mp/assets/images/pickups/pickup22.png) | 双人模式 | +| 1318 | ![](https://assets.open.mp/assets/images/pickups/pickup23.png) | 箭头 | +| 1550 | ![](https://assets.open.mp/assets/images/pickups/pickup24.png) | 钱袋 | +| 1575 | ![](https://assets.open.mp/assets/images/pickups/pickup25.png) | 毒品包裹(白色) | +| 1576 | ![](https://assets.open.mp/assets/images/pickups/pickup26.png) | 毒品包裹(橙色) | +| 1577 | ![](https://assets.open.mp/assets/images/pickups/pickup27.png) | 毒品包裹(黄色) | +| 1578 | ![](https://assets.open.mp/assets/images/pickups/pickup28.png) | 毒品包裹(绿色) | +| 1579 | ![](https://assets.open.mp/assets/images/pickups/pickup29.png) | 毒品包裹(蓝色) | +| 1580 | ![](https://assets.open.mp/assets/images/pickups/pickup30.png) | 毒品包裹(红色) | +| 1581 | ![](https://assets.open.mp/assets/images/pickups/pickup31.png) | 门禁卡 | +| 1582 | ![](https://assets.open.mp/assets/images/pickups/pickup32.png) | 披萨盒 | +| 1636 | ![](https://assets.open.mp/assets/images/pickups/pickup33.png) | 遥控炸弹 | +| 1650 | ![](https://assets.open.mp/assets/images/pickups/pickup34.png) | 汽油罐 | +| 1654 | ![](https://assets.open.mp/assets/images/pickups/pickup35.png) | 炸药 | +| 2057 | ![](https://assets.open.mp/assets/images/pickups/pickup36.png) | 火焰罐 | +| 2060 | ![](https://assets.open.mp/assets/images/pickups/pickup37.png) | 沙袋 | +| 2061 | ![](https://assets.open.mp/assets/images/pickups/pickup38.png) | 子弹 | +| 2690 | ![](https://assets.open.mp/assets/images/pickups/pickup39.png) | 灭火器 | +| 2710 | ![](https://assets.open.mp/assets/images/pickups/pickup40.png) | 手表 | +| 11736 | ![](https://assets.open.mp/assets/images/pickups/pickup41.png) | 医疗包 | +| 11738 | ![](https://assets.open.mp/assets/images/pickups/pickup42.png) | 医疗箱 | +| 19130 | ![](https://assets.open.mp/assets/images/pickups/pickup43.png) | 箭头(类型 1) | +| 19131 | ![](https://assets.open.mp/assets/images/pickups/pickup44.png) | 箭头(类型 2) | +| 19132 | ![](https://assets.open.mp/assets/images/pickups/pickup45.png) | 箭头(类型 3) | +| 19133 | ![](https://assets.open.mp/assets/images/pickups/pickup46.png) | 箭头(类型 4) | +| 19134 | ![](https://assets.open.mp/assets/images/pickups/pickup47.png) | 箭头(类型 5) | +| 19135 | ![](https://assets.open.mp/assets/images/pickups/pickup48.png) | 外部标记(动态) | +| 19197 | ![](https://assets.open.mp/assets/images/pickups/pickup49.png) | 外部标记(黄色,大型) | +| 19198 | ![](https://assets.open.mp/assets/images/pickups/pickup50.png) | 外部标记(黄色,小型) | +| 19320 | ![](https://assets.open.mp/assets/images/pickups/pickup51.png) | 南瓜 | +| 19522 | ![](https://assets.open.mp/assets/images/pickups/pickup52.png) | 房屋(红色) | +| 19523 | ![](https://assets.open.mp/assets/images/pickups/pickup53.png) | 房屋(橙色) | +| 19524 | ![](https://assets.open.mp/assets/images/pickups/pickup54.png) | 房屋(黄色) | +| 19602 | ![](https://assets.open.mp/assets/images/pickups/pickup55.png) | 地雷(类型 2) | +| 19605 | ![](https://assets.open.mp/assets/images/pickups/pickup56.png) | 外部标记(红色) | +| 19606 | ![](https://assets.open.mp/assets/images/pickups/pickup57.png) | 外部标记(绿色) | +| 19607 | ![](https://assets.open.mp/assets/images/pickups/pickup58.png) | 外部标记(蓝色) | +| 19832 | ![](https://assets.open.mp/assets/images/pickups/pickup59.png) | 武装国度弹药箱 | + +## 武器拾取物 + +| ID | 描述 | +| --- | ------------------------- | +| 321 | 普通假阳具 | +| 322 | 白色假阳具 | +| 323 | 按摩棒 | +| 324 | 另一种按摩棒 | +| 325 | 花束 | +| 326 | 手杖 | +| 330 | CJ 的手机 | +| 331 | 指节铜环 | +| 333 | 高尔夫球杆 | +| 334 | 警棍 | +| 335 | 战斗匕首 | +| 336 | 棒球棒 | +| 337 | 铁铲 | +| 338 | 台球杆 | +| 339 | 武士刀 | +| 341 | 电锯 | +| 342 | 破片手雷 | +| 343 | 催泪瓦斯 | +| 344 | 燃烧瓶 | +| 346 | 柯尔特 45 手枪 | +| 347 | 消音柯尔特 45 手枪 | +| 348 | 沙漠之鹰 | +| 349 | 普通霰弹枪 | +| 350 | 短管霰弹枪 | +| 351 | SPAS-12 霰弹枪 | +| 352 | MAC-10 冲锋枪(微型乌兹) | +| 353 | MP5 冲锋枪 | +| 354 | 九头蛇信号弹 | +| 355 | AK47 突击步枪 | +| 356 | M4 突击步枪 | +| 357 | 猎枪 | +| 358 | 狙击步枪 | +| 359 | 火箭发射器 | +| 360 | 热追踪火箭发射器 | +| 361 | 火焰喷射器 | +| 362 | 火神机枪 | +| 363 | 遥控炸药 | +| 364 | 起爆器 | +| 365 | 喷漆罐 | +| 366 | 灭火器 | +| 367 | 照相机 | +| 368 | 夜视仪 | +| 369 | 热成像仪 | +| 370 | 喷气背包 | +| 371 | 降落伞 | +| 372 | Tec-9 手枪 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pickuptypes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pickuptypes.md new file mode 100644 index 00000000000..07c9770b9d8 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pickuptypes.md @@ -0,0 +1,39 @@ +--- +title: 拾取物类型 +sidebar_label: 拾取物类型 +--- + +### 可用拾取类型 + +:::note + +以下类型参数适用于[CreatePickup](../functions/CreatePickup)和[CreatePlayerPickup](../functions/CreatePlayerPickup)函数。 + +::: + +:::note + +其他未列出的 ID 可能未被官方文档记录,或表现类似类型 1(但请勿仅因表面相似性使用,部分类型可能产生副作用,如类型 18 和 20)。 + +::: + +| ID | 特性描述 | +| --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 0 | 无特殊属性,不可被拾取。不会触发[OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup)或[OnPlayerPickUpPlayerPickup](../callbacks/OnPlayerPickUpPlayerPickup)回调,服务器关闭时也不会消失 | +| 1 | 永久存在。禁用马掌/生蚝等原生拾取脚本,仅允许脚本控制。可能因 SA-MP 漏洞导致每隔数秒重复触发拾取回调 | +| 2 | 拾取后消失,玩家距离 15 米外 30 秒后重生(适用于货币类拾取物) | +| 3 | 拾取后消失,玩家死亡后重生 | +| 4 | 20 秒后自动消失,玩家死亡后重生 | +| 5 | 120 秒后自动消失,玩家死亡后重生 | +| 8 | 拾取后消失但无实际效果(用于货币类拾取物) | +| 9 | 创建后 10 秒内与地面车辆接触即爆炸(适用于反车辆地雷) | +| 10 | 立即与地面车辆接触即爆炸(适用于反车辆地雷) | +| 11 | 创建后 10 秒内与船只接触即爆炸(适用于反舰水雷) | +| 12 | 立即与船只接触即爆炸(适用于反舰水雷) | +| 13 | 隐形状态。车辆接触时触发检查点音效,但不会触发拾取回调(悬浮拾取物) | +| 14 | 仅限车辆拾取,触发检查点音效后消失(悬浮拾取物) | +| 15 | 表现类似类型 2,但 12 分钟后重生。若模型 ID 为贿赂物品则 5 分钟重生 | +| 18 | 类似类型 1。按下 Tab 键(动作键)可使其消失但不会触发拾取回调(用于房产标记) | +| 19 | 拾取后永久消失,触发货币拾取音效 | +| 20 | 类似类型 1。使用照相机武器拍摄后消失,显示"快照# 0/0"提示,拍照操作不触发拾取回调(用于拍照点标记) | +| 22 | 表现同类型 3(用于任务物品) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/playerstates.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/playerstates.md new file mode 100644 index 00000000000..970461402be --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/playerstates.md @@ -0,0 +1,25 @@ +--- +title: 玩家状态 +sidebar_label: 玩家状态 +description: 通过GetPlayerState函数或OnPlayerStateChange回调使用的所有玩家状态列表。 +tags: ["玩家"] +--- + +本文档整理了[GetPlayerState](../functions/GetPlayerState)函数和[OnPlayerStateChange](../callbacks/OnPlayerStateChange)回调所使用的玩家状态列表。相关页面包含如何使用下列状态值的示例说明。 + +从服务器开发者角度,"玩家状态"与"特殊动作"的区分原则在于:前者用于同步机制(部分状态关联数据封包),描述通用行为状态;后者无封包关联,用于描述特定动作。 + +## 状态列表 + +| ID | 宏定义 | 状态描述 | +| --- | ------------------------------------ | ---------------------------------------------- | +| 0 | PLAYER_STATE_NONE | 初始化过程中使用的默认状态 | +| 1 | PLAYER_STATE_ONFOOT | 玩家处于步行状态 | +| 2 | PLAYER_STATE_DRIVER | 玩家正在驾驶车辆 | +| 3 | PLAYER_STATE_PASSENGER | 玩家作为车辆乘客 | +| 4 | PLAYER_STATE_EXIT_VEHICLE | 玩家正在离开车辆(主要用于内部处理) | +| 5 | PLAYER_STATE_ENTER_VEHICLE_DRIVER | 玩家正以驾驶员身份进入车辆(主要用于内部处理) | +| 6 | PLAYER_STATE_ENTER_VEHICLE_PASSENGER | 玩家正以乘客身份进入车辆(主要用于内部处理) | +| 7 | PLAYER_STATE_WASTED | 玩家处于死亡状态或角色选择界面 | +| 8 | PLAYER_STATE_SPAWNED | 玩家已重生 | +| 9 | PLAYER_STATE_SPECTATING | 玩家处于旁观者模式 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pvartypes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pvartypes.md new file mode 100644 index 00000000000..900587617f3 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/pvartypes.md @@ -0,0 +1,17 @@ +--- +title: 玩家专属变量类型 +sidebar_label: 玩家专属变量类型 +--- + +:::info + +本页列出[玩家专属变量系统](../../tutorials/perplayervariablesystem)中使用的玩家变量类型(即 pvar 类型)。 + +::: + +| ID | 定义 | +| --- | ------------------------------- | +| 0 | PLAYER_VARTYPE_NONE(无) | +| 1 | PLAYER_VARTYPE_INT(整型) | +| 2 | PLAYER_VARTYPE_STRING(字符串) | +| 3 | PLAYER_VARTYPE_FLOAT(浮点型) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/race-checkpoint-types.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/race-checkpoint-types.md new file mode 100644 index 00000000000..921389be6e7 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/race-checkpoint-types.md @@ -0,0 +1,24 @@ +--- +title: 竞速检查点类型 +sidebar_label: 竞速检查点类型 +description: 竞速检查点类型定义。 +--- + +:::note + +以下定义用于[SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint)函数。 + +::: + +| 定义 | 值 | 描述 | +| --------------------- | --- | ---------------------------------------- | +| UNKNOWN_CP_TYPE | -1 | 未知类型 | +| CP_TYPE_GROUND_NORMAL | 0 | 常规地面检查点 | +| CP_TYPE_GROUND_FINISH | 1 | 终点地面检查点 | +| CP_TYPE_GROUND_EMPTY | 2 | 空地面检查点(仅显示检查点,无其他元素) | +| CP_TYPE_AIR_NORMAL | 3 | 常规空中检查点 | +| CP_TYPE_AIR_FINISH | 4 | 终点空中检查点 | +| CP_TYPE_AIR_ROTATING | 5 | 旋转空中检查点(旋转后停止) | +| CP_TYPE_AIR_STROBING | 6 | 频闪空中检查点(渐强渐弱后消失) | +| CP_TYPE_AIR_SWINGING | 7 | 摆动空中检查点(向下摆动后上升) | +| CP_TYPE_AIR_BOBBING | 8 | 浮动空中检查点(上下摆动) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/recordtypes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/recordtypes.md new file mode 100644 index 00000000000..71184b441f1 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/recordtypes.md @@ -0,0 +1,18 @@ +--- +title: 记录类型 +sidebar_label: 记录类型 +description: 用于StartRecordingPlayerData的记录类型定义。 +tags: ["玩家"] +--- + +:::info + +本文列出[StartRecordingPlayerData](../functions/StartRecordingPlayerData)函数支持的所有记录类型。 + +::: + +| 数值 | 宏定义 | 描述 | +| ---- | ---------------------------- | -------------------- | +| 0 | PLAYER_RECORDING_TYPE_NONE | 无记录类型 | +| 1 | PLAYER_RECORDING_TYPE_DRIVER | 驾驶记录(车辆录制) | +| 2 | PLAYER_RECORDING_TYPE_ONFOOT | 步行记录(步行录制) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/samp_objects.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/samp_objects.md new file mode 100644 index 00000000000..d4dfc5d99ca --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/samp_objects.md @@ -0,0 +1,1829 @@ +--- +title: SA-MP物体 +sidebar_label: SA-MP物体 +description: 本页面包含由SA-MP添加的自定义物体列表。 +--- + +:::info + +您可以访问此[网站](https://dev.prineside.com/en/gtasa_samp_model_id/)查看所有支持物体的预览列表及其对应 ID。 + +::: + +## **自定义物体列表** + +本页面收录了 SA-MP 在 0.3c、0.3d、0.3e、0.3x 及 0.3.7 版本中新增的各类自定义物体。 + +--- + +## **0.3.7 RC4 版本新增物体(61 个物体)** + +下列物体(ID 11692 至 11753)为 SA-MP 0.3.7 RC4 版本新增内容,早期版本不可用! + +### **A51 基地地表替换** + +该物体用于替换 69 号区域(Area 51 基地)的地表模块(原物体 ID 16203)。可通过名为"a51_base"的滤镜脚本查看使用示例,该脚本位于 Windows 版 0.3.7 服务端包的"filterscripts"目录。 + +``` +11692 A51LandBit1 +``` + +### **山地地形** + +``` +11693 Hills250x250Grass1 +11694 Hill250x250Rocky1 +11695 Hill250x250Rocky2 +11696 Hill250x250Rocky3 +``` + +### **模块化绳索桥** + +``` +11697 RopeBridgePart1 +11698 RopeBridgePart2 +``` + +### **扩展道路标识** + +下方限速标识包含透明材质覆盖层(索引 3),可配合 SetObjectMaterialText()或 SetPlayerObjectMaterialText()函数使用。 + +``` +11698 SAMPRoadSign46 +11700 SAMPRoadSign47 +``` + +### **救护车灯光** + +第一个物体为灯光开启状态,第二个为关闭状态。 + +``` +11701 AmbulanceLights1 +11702 AmbulanceLights2 +``` + +### **电磁起重机** + +该物体与 ID 1382 物体相同,但 GTASA 不会自动为其附加吊索和电磁铁。 + +``` +11703 MagnoCrane_03_2 +``` + +### **提取物品系列 2** + +``` +11704 BDupsMask1 +11705 BlackTelephone1 +11706 SmallWasteBin1 +11707 TowelRack1 +11708 BrickSingle1 +11709 AbattoirSink1 +11710 FireExitSign1 +11711 ExitSign1 +11712 Cross1 +11713 FireExtPanel1 +11714 MaintenanceDoors1 +11715 MetalFork1 +11716 MetalKnife1 +11717 WooziesCouch1 +11718 SweetsSaucepan1 +11719 SweetsSaucepan2 +11720 SweetsBed1 +11721 Radiator1 +11722 SauceBottle1 +11723 SauceBottle2 +11724 FireplaceSurround1 +11725 Fireplace1 +11726 HangingLight1 +11727 PaperChaseLight1 +11728 PaperChasePhone1 +11729 GymLockerClosed1 +11730 GymLockerOpen1 +11731 WHeartBed1 +11732 WHeartBath1 +11733 WRockingHorse1 +11734 WRockingChair1 +11735 WBoot1 +11736 MedicalSatchel1 +11737 RockstarMat1 +11738 MedicCase1 +``` + +### **从 Marco's Bistro 提取** + +``` +11739 MCake1 +11740 MCake2 +11741 MCake3 +11742 MCakeSlice1 +11743 MCoffeeMachine1 +11744 MPlate1 +``` + +### **收纳包(改良版)** + +该物体与 ID 2919 物体相同,但体积更小且不具备动态属性。 + +``` +11745 HoldAllEdited1 +``` + +### **杂项物品 3** + +``` +11746 DoorKey1 +11747 Bandage1 +11748 BandagePack1 +``` + +### **过场动画手铐** + +``` +11749 CSHandcuffs1 +``` + +下方手铐与上述物体相同,但采用对折设计以便悬挂于警员腰带。 + +``` +11750 CSHandcuffs2 +``` + +### **区域边界标识** + +``` +11751 AreaBoundary50m +11752 AreaBoundary10m +11753 AreaBoundary1m +``` + +--- + +## **0.3.7 RC3 版本新增物体(138 个物体)** + +``` +19871 CordonStand1 +19872 CarFixerRamp2 +19873 ToiletPaperRoll1 +19874 SoapBar1 +``` + +此门与 ID 2947 物体相同,但移除了动态属性(不可破坏)并调整了枢轴点位置。 + +``` +19875 CRDoor01New +``` + +### **迪利莫尔加油站** + +替换原有 ID 12853 和 12854 物体为可进入式加油站。可通过名为"dillimore_gas"的滤镜脚本查看使用示例,该脚本位于 Windows 版 0.3.7 服务端包的"filterscripts"目录。 + +``` +19876 DillimoreGasExt1 +19877 DillimoreGasInt1 +``` + +### **GTASA 滑板** + +经过改造可作为常规物体使用,并添加了顶点着色功能。 + +``` +19878 Skateboard1 +``` + +### **LS 富国银行大楼** + +该建筑替换了原 ID 4007 的富国银行大楼,新增可进入式停车场。可通过名为"ls_wellsfargo"的滤镜脚本查看示例,脚本位于 Windows 版 0.3.7 服务端包的"filterscripts"目录。 + +``` +19879 WellsFargoBuild1 +19880 WellsFargoGrgDoor1 +``` + +### **凯莉谷仓修复版** + +此谷仓与 ID 14871 物体相同,但修复了碰撞体积问题。可通过"kylies_barn"滤镜脚本查看示例,该脚本位于服务端包的"filterscripts"目录。 + +``` +19881 KylieBarnFixed1 +``` + +### **烹饪版马可牛排** + +该牛排与 ID 19582 物体相同,但呈现为已烹饪状态。 + +``` +19882 MarcosSteak2 +``` + +### **面包切片** + +``` +19883 BreadSlice1 +``` + +### **扩展水滑道** + +这些物体可与旧版 ID 19070-19073 物体配合使用。旧版物体已更新优化外观并修复半透明渲染问题。 + +``` +19884 WSBend45Deg2 +19885 WSStraight2 +19886 WSStraight3 +19887 WSStart1 +19888 WSBend45Deg3 +19889 WSBend45Deg4 +19890 WSStraight4 +``` + +下方物体用于连接水滑道与管道: + +``` +19891 WSTubeJoiner1 +``` + +下方物体用于连接水滑道与模块化道路: + +``` +19892 WSRoadJoiner1 +``` + +### **旧式笔记本电脑** + +提供开启与闭合两种状态。可通过 SetObjectMaterial()函数修改索引 1 的屏幕材质,TXD 文件包含三种屏幕样式(参见下图): + +- LaptopScreen1 = GTASA 地图界面(默认) +- LaptopScreen2 = 文本界面 +- LaptopScreen3 = 警方数据库界面 + +``` +19893 LaptopSAMP1 +19894 LaptopSAMP2 +``` + +![Image:SAMP-Laptop-1.png](https://assets.open.mp/assets/images/objects/SAMP-Laptop-1.png) + +### **云梯消防车灯光** + +专为云梯消防车顶部设计的灯光,仅在夜晚可见。 + +``` +19895 LadderFireTruckLts1 +``` + +### **杂项物品** + +``` +19896 CigarettePack1 +19897 CigarettePack2 +19898 OilFloorStain1 +19899 ToolCabinet1 +19900 ToolCabinet2 +``` + +### **动画物体** + +以下为 ANIM 物体(含动画),最初发布于 SA-MP 0.3c 并在 0.3.7 版本更新: + +``` +19901 AnimTube +19902 EnExMarker4 +``` + +### **扩展杂项物品** + +``` +19903 MechanicComputer1 +19904 ConstructionVest1 +``` + +### **51 区(69 号基地)建筑群** + +这些建筑在保留原外观基础上新增内部空间。可通过"a51_base"滤镜脚本查看基地大门开合示例,脚本位于 Windows 0.3.7 服务端包的"filterscripts"目录。 + +``` +19905 A51Building1 +19906 A51Building1GrgDoor +19907 A51Building2 +19908 A51Building2GrgDoor +19909 A51Building3 +19910 A51Building3GrgDoor +``` + +下方门体专为 51 区军用机库(ID 3268)设计,需双门配合关闭入口: + +``` +19911 A51HangarDoor1 +``` + +### **金属闸门及大型围栏** + +此闸门与 ID 980 物体相同,但移除了表面标识并调整枢轴点至边缘。 + +``` +19912 SAMPMetalGate1 +``` + +适用于活动场地围蔽的大型金属围栏: + +``` +19913 SAMPBigFence1 +``` + +### **过场动画提取物 2(已编辑)** + +``` +19914 CutsceneBat1 +19915 CutsceneCooker1 +19916 CutsceneFridge1 +19917 CutsceneEngine1 +19918 CutsceneBox1 +19919 CutscenePerch1 +19920 CutsceneRemote1 +19921 CutsceneToolBox1 +``` + +### **模块化厨房** + +可通过以下物体自由组合模块化厨房空间: + +``` +19922 MKTable1 +19923 MKIslandCooker1 +19924 MKExtractionHood1 +19925 MKWorkTop1 +19926 MKWorkTop2 +19927 MKWorkTop3 +19928 MKWorkTop4 +19929 MKWorkTop5 +19930 MKWorkTop6 +19931 MKWorkTop7 +19932 MKWallOvenCabinet1 +19933 MKWallOven1 +19934 MKCupboard1 +19935 MKCupboard2 +19936 MKCupboard3 +19937 MKCupboard4 +19938 MKShelf1 +19939 MKShelf2 +19940 MKShelf3 +``` + +### **扩展杂项物品 2** + +``` +19941 GoldBar1 +19942 PoliceRadio1 +19943 StonePillar1 +19944 BodyBag1 +``` + +### **新型检查点** + +可作为替代常规检查点的物体: + +``` +19945 CPSize16Red +19946 CPSize16Green +19947 CPSize16Blue +``` + +![Image:SAMP-New-Checkpoints.png](https://assets.open.mp/assets/images/objects/SAMP-New-Checkpoints.png) + +### **道路标识系列** + +收录多种道路标识。 + +``` +19948 SAMPRoadSign1 +19949 SAMPRoadSign2 +19950 SAMPRoadSign3 +19951 SAMPRoadSign4 +19952 SAMPRoadSign5 +19953 SAMPRoadSign6 +19954 SAMPRoadSign7 +19955 SAMPRoadSign8 +19956 SAMPRoadSign9 +19957 SAMPRoadSign10 +19958 SAMPRoadSign11 +19959 SAMPRoadSign12 +19960 SAMPRoadSign13 +19961 SAMPRoadSign14 +19962 SAMPRoadSign15 +19963 SAMPRoadSign16 +19964 SAMPRoadSign17 +19965 SAMPRoadSign18 +19966 SAMPRoadSign19 +19967 SAMPRoadSign20 +19968 SAMPRoadSign21 +19969 SAMPRoadSign22 +19970 SAMPRoadSign23 +19971 SAMPRoadSign24 +19972 SAMPRoadSign25 +19973 SAMPRoadSign26 +19974 SAMPRoadSign27 +19975 SAMPRoadSign28 +19976 SAMPRoadSign29 +19977 SAMPRoadSign30 +19978 SAMPRoadSign31 +19979 SAMPRoadSign32 +``` + +以下两个标识包含透明材质覆盖层(索引 3),可配合 SetObjectMaterialText()或 SetPlayerObjectMaterialText()函数使用: + +``` +19980 SAMPRoadSign33 +19981 SAMPRoadSign34 +``` + +限速标识系列: + +``` +19982 SAMPRoadSign35 +19983 SAMPRoadSign36 +19984 SAMPRoadSign37 +19985 SAMPRoadSign38 +19986 SAMPRoadSign39 +19987 SAMPRoadSign40 +19988 SAMPRoadSign41 +19989 SAMPRoadSign42 +19990 SAMPRoadSign43 +19991 SAMPRoadSign44 +19992 SAMPRoadSign45 +``` + +![Image:SAMP-Road-Signs.png](https://assets.open.mp/assets/images/objects/SAMP-Road-Signs.png) + +### **过场动画提取物 3(已编辑)** + +``` +19993 CutsceneBowl1 +19994 CutsceneChair1 +19995 CutsceneAmmoClip1 +19996 CutsceneFoldChair1 +19997 CutsceneGrgTable1 +19998 CutsceneLighterFl +19999 CutsceneChair2 +``` + +### **过场动画提取物 3(续)** + +``` +11682 CutsceneCouch1 +11683 CutsceneCouch2 +11684 CutsceneCouch3 +11685 CutsceneCouch4 +``` + +### **红沙西赌场提取物(已编辑)** + +``` +11686 CBarSection1 +11687 CBarStool1 +11688 CWorkTop1 +11689 CBoothSeat1 +11690 CTable1 +11691 CTable2 +``` + +--- + +## **0.3.7 RC2 版本新增物体(82 个物体)** + +### **模块化岛屿道路转角** + +``` +19788 15x15RoadCorner1 +``` + +### **立方体** + +``` +19789 Cube1mx1m +19790 Cube5mx5m +19791 Cube10mx10m +``` + +### **标准尺寸门禁卡** + +``` +19792 SAMPKeycard1 +``` + +### **木柴堆** + +``` +19793 FireWoodLog1 +``` + +### **LS 监狱围墙及闸门** + +该系列物体用于替换 LS 监狱原有围墙和闸门,支持自定义可操作门体。可通过"ls_prisonwalls"滤镜脚本查看示例(仅 Windows 版 0.3.7 服务端包的 Filterscripts 目录包含该脚本)。 + +``` +19794 LSPrisonWalls1 +19795 LSPrisonGateEast +19796 LSPrisonGateSouth +``` + +### **警用遮阳板频闪灯** + +设计用于车辆遮阳板内部(如便衣警车),采用 UV 动画技术实现昼夜可见的闪烁效果。 + +``` +19797 PoliceVisorStrobe1 +``` + +### **LS 公寓停车场** + +该停车场物体需配合 LS 公寓楼替换模块(ID:19595)使用。示例脚本"ls_apartments1"位于服务端包的"filterscripts"目录。 + +``` +19798 LSACarPark1 +``` + +### **卡里古拉赌场金库门(改良版** + +优化枢轴点以适配 MoveObject()函数,并修复夜间顶点着色问题。原物体 ID 为 2634。 + +``` +19799 CaligulasVaultDoor +``` + +### **LS 海滨停车场** + +配合 LS 海滨建筑替换模块(ID 19596-19597)使用。示例脚本"ls_beachside"展示建筑使用方法,该物体默认通过 SAMP.IPL 文件定义生成。 + +``` +19800 LSACarPark1 +``` + +### **面罩** + +``` +19801 Balaclava1 +``` + +### **静态门体** + +与 ID 1502 物体相同但改为静态属性,可通过 MoveObject()函数实现开关动画。 + +``` +19802 GenDoorINT04Static +``` + +### **拖车灯光** + +专为拖车顶部设计的灯光系统(由 Vince 设计灯光配置),仅在夜间可见。 + +``` +19803 TowTruckLights1 +``` + +### **挂锁** + +``` +19804 Padlock1 +``` + +### **提取物品系列** + +下方白板物体包含透明材质覆盖层(索引 1),可配合 SetObjectMaterialText()或 SetPlayerObjectMaterialText()函数使用: + +``` +19805 Whiteboard1 +19806 Chandelier1 +19807 Telephone1 +19808 Keyboard1 +19809 MetalTray1 +19810 StaffOnlySign1 +19811 BurgerBox1 +19812 BeerKeg1 +19813 ElectricalOutlet1 +19814 ElectricalOutlet2 +19815 ToolBoard1 +19816 OxygenCylinder1 +19817 CarFixerRamp1 +19818 WineGlass1 +19819 CocktailGlass1 +19820 AlcoholBottle1 +19821 AlcoholBottle2 +19822 AlcoholBottle3 +19823 AlcoholBottle4 +19824 AlcoholBottle5 +19825 SprunkClock1 +19826 LightSwitch1 +19827 LightSwitch2 +19828 LightSwitch3Off +19829 LightSwitch3On +19830 Blender1 +19831 Barbeque1 +19832 AmmoBox1 +19833 Cow1 +19834 PoliceLineTape1 +19835 CoffeeCup1 +``` + +### ​**使用 Particle.TXD 材质的物体** + +以下物体使用 GTASA 的 Particle.TXD 纹理文件。草丛物体可用于模拟除草作业场景。 + +``` +19836 BloodPool1 +19837 GrassClump1 +19838 GrassClump2 +19839 GrassClump3 +``` + +### ​**动态瀑布** + +通过 UV 动画技术实现水流效果,适用于瀑布/河流场景搭建。 + +``` +19840 WaterFall1 +19841 WaterFall2 +19842 WaterFallWater1 +``` + +### ​**金属面板系列** + +``` +19843 MetalPanel1 +19844 MetalPanel2 +19845 MetalPanel3 +19846 MetalPanel4 +``` + +### ​**火腿腿** + +``` +19847 LegHam1 +``` + +### ​**货运波比平台** + +该平台可通过 AttachObjectToVehicle 函数附加至货运波比直升机侧部,用于载人运输。 + +``` +19848 CargoBobPlatform1 +``` + +### ​**模块化岛屿房屋 1** + +这些物体需配合前述模块化岛屿物体(ID:19529-19552)使用。示例脚本"modular_houses"位于 Windows 版 0.3.7 服务端包的"滤镜脚本目录"。 + +``` +19849 MIHouse1Land +19850 MIHouse1Land2 +19851 MIHouse1Land3 +19852 MIHouse1Land4 +19853 MIHouse1Land5 +19854 MIHouse1Outside +19855 MIHouse1Inside +19856 MIHouse1IntWalls1 +19857 MIHouse1Door1 +19858 MIHouse1Door2 +19859 MIHouse1Door3 +19860 MIHouse1Door4 +19861 MIHouse1GarageDoor1 +19862 MIHouse1GarageDoor2 +19863 MIHouse1GarageDoor3 +19864 MIHouse1GarageDoor4 +19865 MIFenceWood1 +19866 MIFenceBlocks1 +``` + +### ​**不可破坏邮箱** + +与 ID 1478 物体相同,但移除动态属性(不可破坏)并修复夜间顶点着色(NVC)。 + +``` +19867 MailBox1 +``` + +### ​**不可破坏网状围栏及闸门** + +以下围栏与 ID 1411-1412 物体相同,但改为不可破坏属性: + +``` +19868 MeshFence1 +19869 MeshFence2 +``` + +此金属闸门与 ID 3036 物体相同,但改为不可破坏属性: + +``` +19870 MeshFence1 +``` + +--- + +## ​**0.3.7 RC1 版本新增物体(265 个物体)​** + +``` +19305 sec_keypad2 +19306 kmb_goflag2 +19307 kmb_goflag3 +``` + +--- + +## ​**0.3.7 版本新增物体(3 个物体)​** + +``` +19305 sec_keypad2 +19306 kmb_goflag2 +19307 kmb_goflag3 +``` + +--- + +## ​**0.3x RC2-4 版本新增物体(6 个物体)​** + +``` +19516 Hair2_nc +19517 Hair3_nc +19518 Hair5_nc +19519 Hair1_nc +19520 pilotHat01 +19521 policeHat01 +``` + +--- + +## ​**0.3e RC7 版本新增物体(31 个物体)​** + +``` +19475 Plane001 +19476 Plane002 +19477 Plane003 +19478 Plane004 +19479 Plane005 +19480 Plane006 +19481 Plane007 +19482 Plane008 +19483 Plane009 +19484 landbit01_01 +19485 Groundbit84_SFS_01 +19486 burg_SFS_01 +19487 tophat02 +19488 HatBowler6 +19489 sfhouse1 +19490 sfhouse1int +19491 sfhouse2 +19492 sfhouse2int +19493 sfhouse3 +19494 sfhouse3int +19495 sfhouse4 +19496 sfhouse4int +19497 lvhouse1 +19498 lvhouse1int +19499 lvhouse2 +19500 lvhouse2int +19501 lvhouse3 +19502 lvhouse3int +19503 lvhouse4 +19504 lvhouse4int +19505 lshouse1 +19506 lshouse1int +19507 lshouse2 +19508 lshouse2int +19509 lshouse3 +19510 lshouse3int +19511 lshouse4 +19512 lshouse4int +19513 whitephone +19514 SWATHgrey +19515 SWATAgrey +``` + +--- + +## ​**0.3e RC6 版本新增物体(5 个物体)​** + +``` +19470 forsale01 +19471 forsale02 +19472 gasmask01 +19473 grassplant01 +19474 pokertable01 +``` + +--- + +## ​**0.3e RC4 版本新增物体(44 个物体)​** + +``` +19426 wall066 +19427 wall067 +19428 wall068 +19429 wall069 +19430 wall070 +19431 wall071 +19432 wall072 +19433 wall073 +19434 wall074 +19435 wall075 +19436 wall076 +19437 wall077 +19438 wall078 +19439 wall079 +19440 wall080 +19441 wall081 +19442 wall082 +19443 wall083 +19444 wall084 +19445 wall085 +19446 wall086 +19447 wall087 +19448 wall088 +19449 wall089 +19450 wall090 +19451 wall091 +19452 wall092 +19453 wall093 +19454 wall094 +19455 wall095 +19456 wall096 +19457 wall097 +19458 wall098 +19459 wall099 +19460 wall100 +19461 wall101 +19462 wall102 +19463 wall103 +19464 wall104 +19465 wall105 +19466 window001 +19467 vehicle_barrier01 +19468 bucket01 +19469 scarf01 +``` + +--- + +## ​**0.3e RC3 版本新增物体(54 个物体)​** + +``` +19372 wall020 +19373 wall021 +19374 wall022 +19375 wall023 +19376 wall024 +19377 wall025 +19378 wall026 +19379 wall027 +19380 wall028 +19381 wall029 +19382 wall030 +19383 wall031 +19384 wall032 +19385 wall033 +19386 wall034 +19387 wall035 +19388 wall036 +19389 wall037 +19390 wall038 +19391 wall039 +19392 wall040 +19393 wall041 +19394 wall042 +19395 wall043 +19396 wall044 +19397 wall045 +19398 wall046 +19399 wall047 +19400 wall048 +19401 wall049 +19402 wall050 +19403 wall051 +19404 wall052 +19405 wall053 +19406 wall054 +19407 wall055 +19408 wall056 +19409 wall057 +19410 wall058 +19411 wall059 +19412 wall060 +19413 wall061 +19414 wall062 +19415 wall063 +19416 wall064 +19417 wall065 +19418 handcuffs01 +19419 police_lights01 +19420 police_lights02 +19421 headphones01 +19422 headphones02 +19423 headphones03 +19424 headphones04 +19425 speed_bump01 +``` + +--- + +## ​**0.3e RC1 版本新增物体(25 个物体)​** + +``` +19347 badge01 +19348 cane01 +19349 monocle01 +19350 moustache01 +19351 moustache02 +19352 tophat01 +19353 wall001 +19354 wall002 +19355 wall003 +19356 wall004 +19357 wall005 +19358 wall006 +19359 wall007 +19360 wall008 +19361 wall009 +19362 wall010 +19363 wall011 +19364 wall012 +19365 wall013 +19366 wall014 +19367 wall015 +19368 wall016 +19369 wall017 +19370 wall018 +19371 wall019 +``` + +--- + +## ​**0.3d 版本新增物体(8 个物体)​** + +``` +19339 coffin01 +19340 cslab01 +19341 easter_egg01 +19342 easter_egg02 +19343 easter_egg03 +19344 easter_egg04 +19345 easter_egg05 +19346 hotdog01 +``` + +--- + +## ​**0.3d RC7 版本新增物体(16 个物体)​** + +``` +19322 mallb_laW02 +19323 lsmall_shop01 +19325 lsmall_window01 +19326 7_11_sign01 +19327 7_11_sign02 +19328 7_11_sign03 +19329 7_11_sign04 +19330 fire_hat01 +19331 fire_hat02 +19332 Hot_Air_Balloon01 +19333 Hot_Air_Balloon02 +19334 Hot_Air_Balloon03 +19335 Hot_Air_Balloon04 +19336 Hot_Air_Balloon05 +19337 Hot_Air_Balloon06 +19338 Hot_Air_Balloon07 +``` + +--- + +## ​**0.3d RC3-3 版本新增物体(14 个物体)​** + +``` +19308 taxi01 +19309 taxi02 +19310 taxi03 +19311 taxi04 +19312 a51fencing +19313 a51fensin +19314 bullhorns01 +19315 deer01 +19316 FerrisCageBit01 +19317 bassguitar01 +19318 flyingv01 +19319 warlock01 +19320 pumpkin01 +19321 cuntainer +``` + +--- + +## ​**0.3d RC3-3 版本新增物体(4 个物体)​** + +``` +19301 mp_sfpd_nocell +19302 pd_jail_door01 +19303 pd_jail_door02 +19304 pd_jail_door_top01 +``` + +## ​**GTALC 移植桥梁** + +以下物体(19300 至 19307)已在 SA:MP 0.3d 版本中移除 + +``` +19300 bridge_liftsec +19301 subbridge01 +19302 subbridge07 +19303 subbridge19 +19304 subbridge20 +19305 subbridge_lift +19306 verticalift_bridg2 +19307 verticalift_bridge +``` + +--- + +## ​**0.3c RC5 版本新增物体(143 个物体)​** + +``` +19164 GTASAMap1 +19165 GTASAMap2 +19166 GTASAMap3 +19167 GTASAMap4 +19168 GTASAMap5 +19169 GTASAMap6 +19170 GTASAMap7 +19171 GTASAMap8 +19172 SAMPPicture1 +19173 SAMPPicture2 +19174 SAMPPicture3 +19175 SAMPPicture4 +19176 LSOffice1Door1 +19177 MapMarkerNew1 +19178 MapMarkerNew2 +19179 MapMarkerNew3 +19180 MapMarkerNew4 +19181 MapMarkerNew5 +19182 MapMarkerNew6 +19183 MapMarkerNew7 +19184 MapMarkerNew8 +19185 MapMarkerNew9 +19186 MapMarkerNew10 +19187 MapMarkerNew11 +19188 MapMarkerNew12 +19189 MapMarkerNew13 +19190 MapMarkerNew14 +19191 MapMarkerNew15 +19192 MapMarkerNew16 +19193 MapMarkerNew17 +19194 MapMarkerNew18 +19195 MapMarkerNew19 +19196 MapMarkerNew20 +19197 EnExMarker2 +19198 EnExMarker3 +19200 PoliceHelmet1 +19201 MapMarker1 +19202 MapMarker2 +19203 MapMarker3 +19204 MapMarker4 +19205 MapMarker5 +19206 MapMarker6 +19207 MapMarker7 +19208 MapMarker8 +19209 MapMarker9 +19210 MapMarker10 +19211 MapMarker11 +19212 MapMarker12 +19213 MapMarker13 +19214 MapMarker14 +19215 MapMarker15 +19216 MapMarker16 +19217 MapMarker17 +19218 MapMarker18 +19219 MapMarker19 +19220 MapMarker20 +19221 MapMarker21 +19222 MapMarker22 +19223 MapMarker23 +19224 MapMarker24 +19225 MapMarker25 +19226 MapMarker26 +19227 MapMarker27 +19228 MapMarker28 +19229 MapMarker29 +19230 MapMarker30 +19231 MapMarker31 +19232 MapMarker32 +19233 MapMarker33 +19234 MapMarker34 +19235 MapMarker35 +19236 MapMarker36 +19237 MapMarker37 +19238 MapMarker38 +19239 MapMarker39 +19240 MapMarker40 +19241 MapMarker41 +19242 MapMarker42 +19243 MapMarker43 +19244 MapMarker44 +19245 MapMarker45 +19246 MapMarker46 +19247 MapMarker47 +19248 MapMarker48 +19249 MapMarker49 +19250 MapMarker50 +19251 MapMarker51 +19252 MapMarker52 +19253 MapMarker53 +19254 MapMarker54 +19255 MapMarker55 +19256 MapMarker56 +19257 MapMarker57 +19258 MapMarker58 +19259 MapMarker59 +19260 MapMarker60 +19261 MapMarker61 +19262 MapMarker62 +19263 MapMarker63 +19264 MapMarker1a +19265 MapMarker1b +19266 MapMarker31a +19267 MapMarker31b +19268 MapMarker31c +19269 MapMarker31d +19270 MapMarkerFire1 +19271 MapMarkerLight1 +19272 DMCage3 +19273 KeypadNonDynamic +19274 Hair5 +19275 SAMPLogo2 +19276 SAMPLogo3 +19277 LiftType1 +19278 LiftPlatform1 +19279 LCSmallLight1 +19280 CarRoofLight1 +19281 PointLight1 +19282 PointLight2 +19283 PointLight3 +19284 PointLight4 +19285 PointLight5 +19286 PointLight6 +19287 PointLight7 +19288 PointLight8 +19289 PointLight9 +19290 PointLight10 +19291 PointLight11 +19292 PointLight12 +19293 PointLight13 +19294 PointLight14 +19295 PointLight15 +19296 PointLight16 +19297 PointLight17 +19298 PointLight18 +19299 PointLightMoon1 +``` + +--- + +## ​**0.3c RC4 版本新增物体(109 个物体)​** + +``` +19054 XmasBox1 +19055 XmasBox2 +19056 XmasBox3 +19057 XmasBox4 +19058 XmasBox5 +19059 XmasOrb1 +19060 XmasOrb2 +19061 XmasOrb3 +19062 XmasOrb4 +19063 XmasOrb5 +19064 SantaHat1 +19065 SantaHat2 +19066 SantaHat3 +19067 HoodyHat1 +19068 HoodyHat2 +19069 HoodyHat3 +19070 WSDown1 +19071 WSStraight1 +19072 WSBend45Deg1 +19073 WSRocky1 +19074 Cage20mx20mx10mv2 +19075 Cage5mx5mx3mv2 +19076 XmasTree1 +19077 Hair3 +19078 TheParrot1 +19079 TheParrot2 +19080 LaserPointer2 +19081 LaserPointer3 +19082 LaserPointer4 +19083 LaserPointer5 +19084 LaserPointer6 +19085 EyePatch1 +19086 ChainsawDildo1 +19087 Rope1 +19088 Rope2 +19089 Rope3 +19090 PomPomBlue +19091 PomPomRed +19092 PomPomGreen +19093 HardHat2 +19094 BurgerShotHat1 +19095 CowboyHat1 +19096 CowboyHat3 +19097 CowboyHat4 +19098 CowboyHat5 +19099 PoliceCap2 +19100 PoliceCap3 +19101 ArmyHelmet1 +19102 ArmyHelmet2 +19103 ArmyHelmet3 +19104 ArmyHelmet4 +19105 ArmyHelmet5 +19106 ArmyHelmet6 +19107 ArmyHelmet7 +19108 ArmyHelmet8 +19109 ArmyHelmet9 +19110 ArmyHelmet10 +19111 ArmyHelmet11 +19112 ArmyHelmet12 +19113 SillyHelmet1 +19114 SillyHelmet2 +19115 SillyHelmet3 +19116 PlainHelmet1 +19117 PlainHelmet2 +19118 PlainHelmet3 +19119 PlainHelmet4 +19120 PlainHelmet5 +19121 BollardLight1 +19122 BollardLight2 +19123 BollardLight3 +19124 BollardLight4 +19125 BollardLight5 +19126 BollardLight6 +19127 BollardLight7 +19128 DanceFloor1 +19129 DanceFloor2 +19130 ArrowType1 +19131 ArrowType2 +19132 ArrowType3 +19133 ArrowType4 +19134 ArrowType5 +19135 EnExMarker1 +19136 Hair4 +19137 CluckinBellHat1 +19138 PoliceGlasses1 +19139 PoliceGlasses2 +19140 PoliceGlasses3 +19141 SWATHelmet1 +19142 SWATArmour1 +19143 PinSpotLight1 +19144 PinSpotLight2 +19145 PinSpotLight3 +19146 PinSpotLight4 +19147 PinSpotLight5 +19148 PinSpotLight6 +19149 PinSpotLight7 +19150 PinSpotLight8 +19151 PinSpotLight9 +19152 PinSpotLight10 +19153 PinSpotLight11 +19154 PinSpotLight12 +19155 PinSpotLight13 +19156 PinSpotLight14 +19157 MetalLightBars1 +19158 MetalLightBars2 +19159 MirrorBall1 +19160 HardHat3 +19161 PoliceHat1 +19162 PoliceHat2 +19163 GimpMask1 +19901 animtube +``` + +--- + +## **0.3c RC2 与 RC3 版本新增物体(154 个物体)** + +``` +18851 TubeToRoad1 +18852 Tube100m1 +18853 Tube100m45Bend1 +18854 Tube100m90Bend1 +18855 Tube100m180Bend1 +18856 Cage5mx5mx3m +18857 Cage20mx20mx10m +18858 FoamHoop1 +18859 QuarterPipe1 +18860 skyscrpunbuilt2 +18861 scaffoldlift +18862 GarbagePileRamp1 +18863 SnowArc1 +18864 FakeSnow1 +18865 MobilePhone1 +18866 MobilePhone2 +18867 MobilePhone3 +18868 MobilePhone4 +18869 MobilePhone5 +18870 MobilePhone6 +18871 MobilePhone7 +18872 MobilePhone8 +18873 MobilePhone9 +18874 MobilePhone10 +18875 Pager1 +18876 BigGreenGloop1 +18877 FerrisWheelBit +18878 FerrisBaseBit +18879 FerrisCageBit +18880 SpeedCamera1 +18881 SkyDivePlatform2 +18882 HugeBowl1 +18883 HugeBowl2 +18884 HugeBowl3 +18885 GunVendingMachine1 +18886 ElectroMagnet1 +18887 ForceField1 +18888 ForceField2 +18889 ForceField3 +18890 Rake1 +18891 Bandana1 +18892 Bandana2 +18893 Bandana3 +18894 Bandana4 +18895 Bandana5 +18896 Bandana6 +18897 Bandana7 +18898 Bandana8 +18899 Bandana9 +18900 Bandana10 +18901 Bandana11 +18902 Bandana12 +18903 Bandana13 +18904 Bandana14 +18905 Bandana15 +18906 Bandana16 +18907 Bandana17 +18908 Bandana18 +18909 Bandana19 +18910 Bandana20 +18911 Mask1 +18912 Mask2 +18913 Mask3 +18914 Mask4 +18915 Mask5 +18916 Mask6 +18917 Mask7 +18918 Mask8 +18919 Mask9 +18920 Mask10 +18921 Beret1 +18922 Beret2 +18923 Beret3 +18924 Beret4 +18925 Beret5 +18926 Hat1 +18927 Hat2 +18928 Hat3 +18929 Hat4 +18930 Hat5 +18931 Hat6 +18932 Hat7 +18933 Hat8 +18934 Hat9 +18935 Hat10 +18936 Helmet1 +18937 Helmet2 +18938 Helmet3 +18939 CapBack1 +18940 CapBack2 +18941 CapBack3 +18942 CapBack4 +18943 CapBack5 +18944 HatBoater1 +18945 HatBoater2 +18946 HatBoater3 +18947 HatBowler1 +18948 HatBowler2 +18949 HatBowler3 +18950 HatBowler4 +18951 HatBowler5 +18952 BoxingHelmet1 +18953 CapKnit1 +18954 CapKnit2 +18955 CapOverEye1 +18956 CapOverEye2 +18957 CapOverEye3 +18958 CapOverEye4 +18959 CapOverEye5 +18960 CapRimUp1 +18961 CapTrucker1 +18962 CowboyHat2 +18963 CJElvisHead +18964 SkullyCap1 +18965 SkullyCap2 +18966 SkullyCap3 +18967 HatMan1 +18968 HatMan2 +18969 HatMan3 +18970 HatTiger1 +18971 HatCool1 +18972 HatCool2 +18973 HatCool3 +18974 MaskZorro1 +18975 Hair2 +18976 MotorcycleHelmet2 +18977 MotorcycleHelmet3 +18978 MotorcycleHelmet4 +18979 MotorcycleHelmet5 +18980 Concrete1mx1mx25m +18981 Concrete1mx25mx25m +18982 Tube100m3 +18983 Tube100m4 +18984 Tube100m5 +18985 Tube100m6 +18986 TubeToPipe1 +18987 Tube25m1 +18988 Tube25mCutEnd1 +18989 Tube25m45Bend1 +18990 Tube25m90Bend1 +18991 Tube25m180Bend1 +18992 Tube10m45Bend1 +18993 Tube10m90Bend1 +18994 Tube10m180Bend1 +18995 Tube5m1 +18996 Tube5m45Bend1 +18997 Tube1m1 +18998 Tube200m1 +18999 Tube200mBendy1 +19000 Tube200mBulge1 +19001 VCWideLoop1 +19002 FireHoop1 +19003 LAOfficeFloors1 +19004 RoundBuilding1 +19005 RampT4 +19006 GlassesType1 +19007 GlassesType2 +19008 GlassesType3 +19009 GlassesType4 +19010 GlassesType5 +19011 GlassesType6 +19012 GlassesType7 +19013 GlassesType8 +19014 GlassesType9 +19015 GlassesType10 +19016 GlassesType11 +19017 GlassesType12 +19018 GlassesType13 +19019 GlassesType14 +19020 GlassesType15 +19021 GlassesType16 +19022 GlassesType17 +19023 GlassesType18 +19024 GlassesType19 +19025 GlassesType20 +19026 GlassesType21 +19027 GlassesType22 +19028 GlassesType23 +19029 GlassesType24 +19030 GlassesType25 +19031 GlassesType26 +19032 GlassesType27 +19033 GlassesType28 +19034 GlassesType29 +19035 GlassesType30 +19036 HockeyMask1 +19037 HockeyMask2 +19038 HockeyMask3 +19039 WatchType1 +19040 WatchType2 +19041 WatchType3 +19042 WatchType4 +19043 WatchType5 +19044 WatchType6 +19045 WatchType7 +19046 WatchType8 +19047 WatchType9 +19048 WatchType10 +19049 WatchType11 +19050 WatchType12 +19051 WatchType13 +19052 WatchType14 +19053 WatchType15 +``` + +--- + +## **0.3c RC1 版本新增物体** + +下列物体为 0.3c RC1 版本新增内容。 + +### **手持物品** + +``` +18632 FishingRod +18633 GTASAWrench1 +18634 GTASACrowbar1 +18635 GTASAHammer1 +18636 PoliceCap1 +18637 PoliceShield1 +18638 HardHat1 +18639 BlackHat1 +18640 Hair1 +18641 Flashlight1 +18642 Taser1 +18643 LaserPointer1 +18644 Screwdriver1 +18645 MotorcycleHelmet1 +``` + +### **灯光** + +``` +18646 PoliceLight1 +18647 RedNeonTube1 +18648 BlueNeonTube1 +18649 GreenNeonTube1 +18650 YellowNeonTube1 +18651 PinkNeonTube1 +18652 WhiteNeonTube1 +18653 DiscoLightRed +18654 DiscoLightGreen +18655 DiscoLightBlue +18656 LightBeamWhite +18657 LightBeamRed +18658 LightBeamBlue +``` + +### **喷漆标识** + +``` +18659 SprayTag1 +18660 SprayTag2 +18661 SprayTag3 +18662 SprayTag4 +18663 SprayTag5 +18664 SprayTag6 +18665 SprayTag7 +18666 SprayTag8 +18667 SprayTag9 +``` + +### **粒子特效** + +``` +18668 blood_heli +18669 boat_prop +18670 camflash +18671 carwashspray +18672 cementp +18673 cigarette_smoke +18674 cloudfast +18675 coke_puff +18676 coke_trail +18677 exhale +18678 explosion_barrel +18679 explosion_crate +18680 explosion_door +18681 explosion_fuel_car +18682 explosion_large +18683 explosion_medium +18684 explosion_molotov +18685 explosion_small +18686 explosion_tiny +18687 extinguisher +18688 fire +18689 fire_bike+ +18690 fire_car +18691 fire_large +18692 fire_med +18693 Flame99 +18694 flamethrower +18695 gunflash +18696 gunsmoke +18697 heli_dust +18698 insects +18699 jetpack +18700 jetthrust +18701 molotov_flame +18702 nitro +18703 overheat_car +18704 overheat_car_elec +18705 petrolcan +18706 prt_blood +18707 prt_boatsplash +18708 prt_bubble +18709 prt_cardebris +18710 prt_collisionsmoke +18711 prt_glass +18712 prt_gunshell +18713 prt_sand2 +18714 prt_sand +18715 prt_smoke_huge +18716 prt_smoke_expand +18717 prt_spark +18718 prt_spark_2 +18719 prt_wake +18720 prt_watersplash +18721 prt_wheeldirt +18722 puke +18723 riot_smoke +18724 shootlight +18725 smoke30lit +18726 smoke30m +18727 smoke50lit +18728 smoke_flare +18729 spraycan +18730 tank_fire +18731 teargas99 +18732 teargasAD +18733 tree_hit_fir +18734 tree_hit_palm +18735 vent2 +18736 vent +18737 wallbust +18738 water_fnt_tme +18739 water_fountain +18740 water_hydrant +18741 water_ripples +18742 water_speed +18743 water_splash +18744 water_splash_big +18745 water_splsh_sml +18746 water_swim +18747 waterfall_end +18748 WS_factorysmoke +``` + +### **SA:MP 标识** + +``` +18749 SAMPLogoSmall +18750 SAMPLogoBig +``` + +### **地形模块** + +``` +18751 IslandBase1 +18752 Volcano +``` + +### **基础模块** + +``` +18753 Base125mx125m1 +18754 Base250mx250m1 +``` + +### **VC 移植电梯系统** + +``` +18755 VCElevator1 +18756 ElevatorDoor1 +18757 ElevatorDoor2 +18758 VCElevatorFront1 +``` + +### **死亡竞赛笼子** + +``` +18759 DMCage1 +18760 DMCage2 +``` + +### **竞速** + +``` +18761 RaceFinishLine1 +``` + +### **跑酷模块** + +``` +18762 Concrete1mx1mx5m +18763 Concrete3mx3mx5m +18764 Concrete5mx5mx5m +18765 Concrete10mx10mx5m +18766 Concrete10mx1mx5m +18767 ConcreteStair1 +``` + +### **跳伞平台** + +``` +18768 SkyDivePlatform1 +18769 SkyDivePlatform1a +18770 SkyDivePlatform1b +18771 SpiralStair1 +``` + +### **隧道片段** + +``` +18772 TunnelSection1 +18773 TunnelJoinSection1 +18774 TunnelJoinSection2 +18775 TunnelJoinSection3 +18776 TunnelJoinSection4 +18777 TunnelSpiral1 +``` + +### **斜坡系列** + +``` +18778 RampT1 +18779 RampT2 +18780 RampT3 +18781 MeshRampBig +18782 CookieRamp1 +18783 FunBoxTop1 +18784 FunBoxRamp1 +18785 FunBoxRamp2 +18786 FunBoxRamp3 +18787 FunBoxRamp4 +``` + +### **模块化道路片段** + +``` +18788 MRoad40m +18789 MRoad150m +18790 MRoadBend180Deg1 +18791 MRoadBend45Deg +18792 MRoadTwist15DegL +18793 MRoadTwist15DegR +18794 MRoadBend15Deg1 +18795 MRoadBend15Deg2 +18796 MRoadBend15Deg3 +18797 MRoadBend15Deg4 +18798 MRoadB45T15DegL +18799 MRoadB45T15DegR +18800 MRoadHelix1 +18801 MRoadLoop1 +``` + +### **模块化桥梁片段** + +``` +18802 MBridgeRamp1 +18803 MBridge150m1 +18804 MBridge150m2 +18805 MBridge150m3 +18806 MBridge150m4 +18807 MBridge75mHalf +``` + +### **管道与漏斗** + +``` +18808 Tube50m1 +18809 Tube50mGlass1 +18810 Tube50mBulge1 +18811 Tube50mGlassBulge1 +18812 Tube50mFunnel1 +18813 Tube50mGlassFunnel1 +18814 Tube50mFunnel2 +18815 Tube50mFunnel3 +18816 Tube50mFunnel4 +18817 Tube50mTSection1 +18818 Tube50mGlassT1 +18819 Tube50mPlus1 +18820 Tube50mGlassPlus1 +18821 Tube50m45Bend1 +18822 Tube50mGlass45Bend1 +18823 Tube50m90Bend1 +18824 Tube50mGlass90Bend1 +18825 Tube50m180Bend1 +18826 Tube50mGlass180Bend +18827 Tube100m2 +18828 SpiralTube1 +18829 RTexturetube +18830 RTexturebridge +18831 RT25mBend90Tube1 +18832 RT25mBend180Tube1 +18833 RT50mBend45Tube1 +18834 RT50mBend180Tube1 +18835 RBFunnel +18836 RBHalfpipe +18837 RB25mBend90Tube +18838 RB25mBend180Tube +18839 RB50mBend45Tube +18840 RB50mBend90Tube +18841 RB50mBend180Tube +18842 RB50mTube +``` + +### **球形** + +``` +18843 GlassSphere1 +18844 WaterUVAnimSphere1 +18845 RTexturesphere +``` + +### **其他扩展** + +``` +18846 BigCesar(已在SA-MP 0.3d RC3-3版本移除) +18847 HugeHalfPipe1 +18848 SamSiteNonDynamic +18849 ParaDropNonDynamic +18850 HeliPad1 +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/selectobjecttypes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/selectobjecttypes.md new file mode 100644 index 00000000000..5a6e3ba7400 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/selectobjecttypes.md @@ -0,0 +1,15 @@ +--- +title: 选择物体类型 +sidebar_label: 选择物体类型 +--- + +:::info + +本页面列出[OnPlayerSelectObject](../callbacks/OnPlayerSelectObject)回调使用的所有物体选择类型。 + +::: + +| 数值 | 宏定义 | 描述 | +| ---- | --------------------------- | -------------------- | +| 1 | SELECT_OBJECT_GLOBAL_OBJECT | 全局物体(地图物体) | +| 2 | SELECT_OBJECT_PLAYER_OBJECT | 玩家私有物体 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/shopnames.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/shopnames.md new file mode 100644 index 00000000000..a6f69ede581 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/shopnames.md @@ -0,0 +1,21 @@ +--- +title: 商店名称 +sidebar_label: 商店名称 +--- + +:::note + +在 GTA: SA(及 SA-MP)中,当玩家进入特定室内场景时会触发预设脚本。多数商店场景使用外部脚本加载机制。[SetPlayerShopName](../functions/SetPlayerShopName)函数支持按需加载这些脚本,需使用有效的商店名称(或空字符串卸载当前脚本)。完整室内场景信息请参阅[室内场景文档](../resources/interiorids)。 + +::: + +| 商店名称 | GXT 名称 | 描述 | 坐标 | +| -------- | ------------- | --------------------- | ------------------------------ | +| FDPIZA | Pizza Stack | 标准披萨栈室内场景 | 374.0000, -119.6410, 1001.4922 | +| FDCHICK | Cluckin' Bell | 标准炸鸡钟室内场景 | 368.7890, -6.8570, 1001.8516 | +| FDBURG | Burger Shot | 标准汉堡店室内场景 | 375.5660, -68.2220, 1001.5151 | +| AMMUN1 | Ammunation | 武装国度 1 号分店场景 | 296.5395, -38.2739, 1001.515 | +| AMMUN2 | Ammunation | 武装国度 2 号分店场景 | 295.7359, -80.6865, 1001.5156 | +| AMMUN3 | Ammunation | 武装国度 3 号分店场景 | 290.2011, -109.5698, 1001.5156 | +| AMMUN4 | Ammunation | 武装国度 4 号分店场景 | 308.1619, -141.2549, 999.6016 | +| AMMUN5 | Ammunation | 武装国度 5 号分店场景 | 312.7883, -166.0069, 999.6010 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/skins.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/skins.md new file mode 100644 index 00000000000..12fe62df23c --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/skins.md @@ -0,0 +1,334 @@ +--- +title: 皮肤 +sidebar_label: 皮肤 +description: 本页面包含《圣安地列斯多人联机》中所有可用皮肤。 +--- + +## 皮肤列表 + +本页面包含[SetPlayerSkin](../functions/SetPlayerSkin)和[GetPlayerSkin](../functions/GetPlayerSkin)函数使用的全部可用皮肤。 + +| 皮肤 ID | 预览图 | 模型名称 | 皮肤名称/类型 | 单人模式出现地点 | 性别 | +| ------- | ----------------------------------------------------------------- | -------- | -------------------------------- | ---------------------------------------- | ---- | +| 0 | ![皮肤ID 0](https://assets.open.mp/assets/images/skins/0.png) | cj | 卡尔·约翰逊(主角) | 全地图 | 男性 | +| 1 | ![皮肤ID 1](https://assets.open.mp/assets/images/skins/1.png) | truth | 真理先生 | 圣菲耶罗和拉斯文图拉斯 | 男性 | +| 2 | ![皮肤ID 2](https://assets.open.mp/assets/images/skins/2.png) | maccer | 麦瑟 | 拉斯文图拉斯和洛圣都 | 男性 | +| 3 | ![皮肤ID 3](https://assets.open.mp/assets/images/skins/3.png) | andre | 安德烈 | 未知 | 男性 | +| 4 | ![皮肤ID 4](https://assets.open.mp/assets/images/skins/4.png) | bbthin | 巴里·"大熊"·索恩(瘦体型) | 洛圣都 | 男性 | +| 5 | ![皮肤ID 5](https://assets.open.mp/assets/images/skins/5.png) | bb | 巴里·"大熊"·索恩(壮体型) | 洛圣都 | 男性 | +| 6 | ![皮肤ID 6](https://assets.open.mp/assets/images/skins/6.png) | emmet | 埃米特 | 洛圣都 | 男性 | +| 7 | ![皮肤ID 7](https://assets.open.mp/assets/images/skins/7.png) | male01 | 出租车司机/火车司机 | 圣安地列斯 | 男性 | +| 8 | ![皮肤ID 8](https://assets.open.mp/assets/images/skins/8.png) | janitor | 清洁工 | 四龙赌场 | 男性 | +| 9 | ![皮肤ID 9](https://assets.open.mp/assets/images/skins/9.png) | bfori | 普通市民 | 圣安地列斯 | 女性 | +| 10 | ![皮肤ID 10](https://assets.open.mp/assets/images/skins/10.png) | bfost | 老妇人 | 圣安地列斯 | 女性 | +| 11 | ![皮肤ID 11](https://assets.open.mp/assets/images/skins/11.png) | vbfycrp | 赌场荷官 | 拉斯文图拉斯赌场 | 女性 | +| 12 | ![皮肤ID 12](https://assets.open.mp/assets/images/skins/12.png) | bfyri | 贵妇 | 圣安地列斯 | 女性 | +| 13 | ![皮肤ID 13](https://assets.open.mp/assets/images/skins/13.png) | bfyst | 街头女孩 | 圣安地列斯 | 女性 | +| 14 | ![皮肤ID 14](https://assets.open.mp/assets/images/skins/14.png) | bmori | 普通市民 | 圣安地列斯 | 男性 | +| 15 | ![皮肤ID 15](https://assets.open.mp/assets/images/skins/15.png) | bmost | 惠特克先生(RS Haul 老板) | 圣安地列斯 | 男性 | +| 16 | ![皮肤ID 16](https://assets.open.mp/assets/images/skins/16.png) | bmyap | 机场地勤人员 | 各机场 | 男性 | +| 17 | ![皮肤ID 17](https://assets.open.mp/assets/images/skins/17.png) | bmybu | 商人 | 圣安地列斯 | 男性 | +| 18 | ![皮肤ID 18](https://assets.open.mp/assets/images/skins/18.png) | bmybe | 海滩游客 | SA 各海滩 | 男性 | +| 19 | ![皮肤ID 19](https://assets.open.mp/assets/images/skins/19.png) | bmydj | DJ | 圣安地列斯 | 男性 | +| 20 | ![皮肤ID 20](https://assets.open.mp/assets/images/skins/20.png) | bmyri | 富豪(疯狗多克的经纪人) | 圣安地列斯 | 男性 | +| 21 | ![皮肤ID 21](https://assets.open.mp/assets/images/skins/21.png) | bmycr | 普通市民 | 圣安地列斯 | 男性 | +| 22 | ![皮肤ID 22](https://assets.open.mp/assets/images/skins/22.png) | bmyst | 普通市民 | 圣安地列斯 | 男性 | +| 23 | ![皮肤ID 23](https://assets.open.mp/assets/images/skins/23.png) | wmybmx | BMX 骑手 | 洛圣都 | 男性 | +| 24 | ![皮肤ID 24](https://assets.open.mp/assets/images/skins/24.png) | wbdyg1 | 疯狗多克保镖 | 疯狗多克庄园 | 男性 | +| 25 | ![皮肤ID 25](https://assets.open.mp/assets/images/skins/25.png) | wbdyg2 | 疯狗多克保镖 | 疯狗多克庄园 | 男性 | +| 26 | ![皮肤ID 26](https://assets.open.mp/assets/images/skins/26.png) | wmybp | 背包客 | 圣安地列斯 | 男性 | +| 27 | ![皮肤ID 27](https://assets.open.mp/assets/images/skins/27.png) | wmycon | 建筑工人 | 多赫蒂 | 男性 | +| 28 | ![皮肤ID 28](https://assets.open.mp/assets/images/skins/28.png) | bmydrug | 毒贩 | 洛圣都 | 男性 | +| 29 | ![皮肤ID 29](https://assets.open.mp/assets/images/skins/29.png) | wmydrug | 毒贩 | 圣菲耶罗 | 男性 | +| 30 | ![皮肤ID 30](https://assets.open.mp/assets/images/skins/30.png) | hmydrug | 毒贩 | 拉斯文图拉斯 | 男性 | +| 31 | ![皮肤ID 31](https://assets.open.mp/assets/images/skins/31.png) | dwfolc | 农场镇居民 | 圣安地列斯 | 女性 | +| 32 | ![皮肤ID 32](https://assets.open.mp/assets/images/skins/32.png) | dwmolc1 | 农场镇居民 | 圣安地列斯 | 男性 | +| 33 | ![皮肤ID 33](https://assets.open.mp/assets/images/skins/33.png) | dwmolc2 | 农场镇居民 | 圣安地列斯 | 男性 | +| 34 | ![皮肤ID 34](https://assets.open.mp/assets/images/skins/34.png) | dwmylc1 | 农场镇居民 | 圣安地列斯 | 男性 | +| 35 | ![皮肤ID 35](https://assets.open.mp/assets/images/skins/35.png) | hmogar | 园丁 | 圣安地列斯 | 男性 | +| 36 | ![皮肤ID 36](https://assets.open.mp/assets/images/skins/36.png) | wmygol1 | 高尔夫球手 | 圣安地列斯 | 男性 | +| 37 | ![皮肤ID 37](https://assets.open.mp/assets/images/skins/37.png) | wmygol2 | 高尔夫球手 | 圣安地列斯 | 男性 | +| 38 | ![皮肤ID 38](https://assets.open.mp/assets/images/skins/38.png) | hfori | 普通市民 | 圣安地列斯 | 女性 | +| 39 | ![皮肤ID 39](https://assets.open.mp/assets/images/skins/39.png) | hfost | 普通市民 | 圣安地列斯 | 女性 | +| 40 | ![皮肤ID 40](https://assets.open.mp/assets/images/skins/40.png) | hfyri | 普通市民 | 圣安地列斯 | 女性 | +| 41 | ![皮肤ID 41](https://assets.open.mp/assets/images/skins/41.png) | hfyst | 普通市民 | 圣安地列斯 | 女性 | +| 42 | ![皮肤ID 42](https://assets.open.mp/assets/images/skins/42.png) | jethro | 杰斯罗 | 圣菲耶罗 | 男性 | +| 43 | ![皮肤ID 43](https://assets.open.mp/assets/images/skins/43.png) | hmori | 普通市民 | 圣安地列斯 | 男性 | +| 44 | ![皮肤ID 44](https://assets.open.mp/assets/images/skins/44.png) | hmost | 普通市民 | 圣安地列斯 | 男性 | +| 45 | ![皮肤ID 45](https://assets.open.mp/assets/images/skins/45.png) | hmybe | 海滩游客 | SA 各海滩 | 男性 | +| 46 | ![皮肤ID 46](https://assets.open.mp/assets/images/skins/46.png) | hmyri | 普通市民 | 圣安地列斯 | 男性 | +| 47 | ![皮肤ID 47](https://assets.open.mp/assets/images/skins/47.png) | hmycr | 普通市民 | 圣安地列斯 | 男性 | +| 48 | ![皮肤ID 48](https://assets.open.mp/assets/images/skins/48.png) | hmyst | 普通市民 | 圣安地列斯 | 男性 | +| 49 | ![皮肤ID 49](https://assets.open.mp/assets/images/skins/49.png) | omokung | 蛇头(岘港帮) | 圣安地列斯 | 男性 | +| 50 | ![皮肤ID 50](https://assets.open.mp/assets/images/skins/50.png) | wmymech | 机械师 | 圣安地列斯 | 男性 | +| 51 | ![皮肤ID 51](https://assets.open.mp/assets/images/skins/51.png) | bmymoun | 山地自行车手 | 圣安地列斯 | 男性 | +| 52 | ![皮肤ID 52](https://assets.open.mp/assets/images/skins/52.png) | wmymoun | 山地自行车手 | 圣安地列斯 | 男性 | +| 53 | ![皮肤ID 53](https://assets.open.mp/assets/images/skins/53.png) | ofori | 未知 | 圣安地列斯 | 女性 | +| 54 | ![皮肤ID 54](https://assets.open.mp/assets/images/skins/54.png) | ofost | 普通市民 | 圣安地列斯 | 女性 | +| 55 | ![皮肤ID 55](https://assets.open.mp/assets/images/skins/55.png) | ofyri | 普通市民 | 圣安地列斯 | 女性 | +| 56 | ![皮肤ID 56](https://assets.open.mp/assets/images/skins/56.png) | ofyst | 普通市民 | 圣安地列斯 | 女性 | +| 57 | ![皮肤ID 57](https://assets.open.mp/assets/images/skins/57.png) | omori | 东方市民 | 圣安地列斯 | 男性 | +| 58 | ![皮肤ID 58](https://assets.open.mp/assets/images/skins/58.png) | omost | 东方市民 | 圣安地列斯 | 男性 | +| 59 | ![皮肤ID 59](https://assets.open.mp/assets/images/skins/59.png) | omyri | 普通市民 | 圣安地列斯 | 男性 | +| 60 | ![皮肤ID 60](https://assets.open.mp/assets/images/skins/60.png) | omyst | 普通市民 | 圣安地列斯 | 男性 | +| 61 | ![皮肤ID 61](https://assets.open.mp/assets/images/skins/61.png) | wmyplt | 飞行员 | 圣安地列斯 | 男性 | +| 62 | ![皮肤ID 62](https://assets.open.mp/assets/images/skins/62.png) | wmopj | 富尔伯格上校 | 圣安地列斯 | 男性 | +| 63 | ![皮肤ID 63](https://assets.open.mp/assets/images/skins/63.png) | bfypro | 妓女 | 圣安地列斯 | 女性 | +| 64 | ![皮肤ID 64](https://assets.open.mp/assets/images/skins/64.png) | hfypro | 妓女 | 圣安地列斯 | 女性 | +| 65 | ![皮肤ID 65](https://assets.open.mp/assets/images/skins/65.png) | kendl | 肯达尔·约翰逊 | 洛圣都和圣菲耶罗 | 女性 | +| 66 | ![皮肤ID 66](https://assets.open.mp/assets/images/skins/66.png) | bmypol1 | 台球玩家 | 酒吧 | 男性 | +| 67 | ![皮肤ID 67](https://assets.open.mp/assets/images/skins/67.png) | bmypol2 | 台球玩家 | 迪利摩尔加油站工作 | 男性 | +| 68 | ![皮肤ID 68](https://assets.open.mp/assets/images/skins/68.png) | wmoprea | 牧师/传教士 | 拉斯文图拉斯 | 男性 | +| 69 | ![皮肤ID 69](https://assets.open.mp/assets/images/skins/69.png) | sbfyst | 普通市民 | 圣安地列斯 | 女性 | +| 70 | ![皮肤ID 70](https://assets.open.mp/assets/images/skins/70.png) | wmosci | 科学家 | 69 区 | 男性 | +| 71 | ![皮肤ID 71](https://assets.open.mp/assets/images/skins/71.png) | wmysgrd | 安保人员 | 机场岗亭 | 男性 | +| 72 | ![皮肤ID 72](https://assets.open.mp/assets/images/skins/72.png) | swmyhp1 | 嬉皮士 | 圣安地列斯 | 男性 | +| 73 | ![皮肤ID 73](https://assets.open.mp/assets/images/skins/73.png) | swmyhp2 | 嬉皮士 | 圣菲耶罗 | 男性 | +| 75 | ![皮肤ID 75](https://assets.open.mp/assets/images/skins/75.png) | swfopro | 妓女 | 圣安地列斯 | 女性 | +| 76 | ![皮肤ID 76](https://assets.open.mp/assets/images/skins/76.png) | wfystew | 空乘人员 | 圣安地列斯 | 女性 | +| 77 | ![皮肤ID 77](https://assets.open.mp/assets/images/skins/77.png) | swmotr1 | 流浪者 | 圣安地列斯 | 女性 | +| 78 | ![皮肤ID 78](https://assets.open.mp/assets/images/skins/78.png) | wmotr1 | 流浪者 | 圣安地列斯 | 男性 | +| 79 | ![皮肤ID 79](https://assets.open.mp/assets/images/skins/79.png) | bmotr1 | 流浪者 | 圣安地列斯 | 男性 | +| 80 | ![皮肤ID 80](https://assets.open.mp/assets/images/skins/80.png) | vbmybox | 拳击手 | 圣安地列斯健身房 | 男性 | +| 81 | ![皮肤ID 81](https://assets.open.mp/assets/images/skins/81.png) | vwmybox | 拳击手 | 圣安地列斯健身房 | 男性 | +| 82 | ![皮肤ID 82](https://assets.open.mp/assets/images/skins/82.png) | vhmyelv | 黑色猫王 | 拉斯云祖华 | 男 | +| 83 | ![皮肤ID 83](https://assets.open.mp/assets/images/skins/83.png) | vbmyelv | 白色猫王 | 拉斯云祖华 | 男 | +| 84 | ![皮肤ID 84](https://assets.open.mp/assets/images/skins/84.png) | vimyelv | 蓝色猫王 | 拉斯云祖华 | 男 | +| 85 | ![皮肤ID 85](https://assets.open.mp/assets/images/skins/85.png) | vwfypro | 妓女 | 圣安地列斯 | 女 | +| 86 | ![皮肤ID 86](https://assets.open.mp/assets/images/skins/86.png) | ryder3 | 戴抢劫面具的莱德尔 | 洛圣都 | 男 | +| 87 | ![皮肤ID 87](https://assets.open.mp/assets/images/skins/87.png) | vwfyst1 | 脱衣舞女 | 圣安地列斯 | 女 | +| 88 | ![皮肤ID 88](https://assets.open.mp/assets/images/skins/88.png) | wfori | 普通行人 | 圣安地列斯 | 女 | +| 89 | ![皮肤ID 89](https://assets.open.mp/assets/images/skins/89.png) | wfost | 普通行人 | 圣安地列斯 | 女 | +| 90 | ![皮肤ID 90](https://assets.open.mp/assets/images/skins/90.png) | wfyjg | 慢跑者 | 圣安地列斯 | 女 | +| 91 | ![皮肤ID 91](https://assets.open.mp/assets/images/skins/91.png) | wfyri | 贵妇人 | 圣安地列斯 | 女 | +| 92 | ![皮肤ID 92](https://assets.open.mp/assets/images/skins/92.png) | wfyro | 轮滑者 | 圣安地列斯海滩 | 女 | +| 93 | ![皮肤ID 93](https://assets.open.mp/assets/images/skins/93.png) | wfyst | 普通行人 | 圣安地列斯 | 女 | +| 94 | ![皮肤ID 94](https://assets.open.mp/assets/images/skins/94.png) | wmori | 普通行人 | 圣安地列斯 | 男 | +| 95 | ![皮肤ID 95](https://assets.open.mp/assets/images/skins/95.png) | wmost | 普通行人 | 迪利莫尔加油站员工(圣安地列斯) | 男 | +| 96 | ![皮肤ID 96](https://assets.open.mp/assets/images/skins/96.png) | wmyjg | 慢跑者 | 圣安地列斯 | 男 | +| 97 | ![皮肤ID 97](https://assets.open.mp/assets/images/skins/97.png) | wmylg | 救生员 | 海滩区域 | 男 | +| 98 | ![皮肤ID 98](https://assets.open.mp/assets/images/skins/98.png) | wmyri | 普通行人 | 圣安地列斯 | 男 | +| 99 | ![皮肤ID 99](https://assets.open.mp/assets/images/skins/99.png) | wmyro | 轮滑者 | 圣安地列斯 | 男 | +| 100 | ![皮肤ID 100](https://assets.open.mp/assets/images/skins/100.png) | wmycr | 机车党 | 圣安地列斯 | 男 | +| 101 | ![皮肤ID 101](https://assets.open.mp/assets/images/skins/101.png) | wmyst | 普通行人 | 圣安地列斯 | 男 | +| 102 | ![皮肤ID 102](https://assets.open.mp/assets/images/skins/102.png) | ballas1 | 巴拉斯帮成员 | 洛圣都 | 男 | +| 103 | ![皮肤ID 103](https://assets.open.mp/assets/images/skins/103.png) | ballas2 | 巴拉斯帮成员 | 洛圣都 | 男 | +| 104 | ![皮肤ID 104](https://assets.open.mp/assets/images/skins/104.png) | ballas3 | 巴拉斯帮成员 | 洛圣都 | 男 | +| 105 | ![皮肤ID 105](https://assets.open.mp/assets/images/skins/105.png) | fam1 | 格罗夫街家族成员 | 洛圣都 | 男 | +| 106 | ![皮肤ID 106](https://assets.open.mp/assets/images/skins/106.png) | fam2 | 格罗夫街家族成员 | 洛圣都 | 男 | +| 107 | ![皮肤ID 107](https://assets.open.mp/assets/images/skins/107.png) | fam3 | 格罗夫街家族成员 | 洛圣都 | 男 | +| 108 | ![皮肤ID 108](https://assets.open.mp/assets/images/skins/108.png) | lsv1 | 洛圣都瓦戈斯帮 | 洛圣都 | 男 | +| 109 | ![皮肤ID 109](https://assets.open.mp/assets/images/skins/109.png) | lsv2 | 洛圣都瓦戈斯帮 | 洛圣都 | 男 | +| 110 | ![皮肤ID 110](https://assets.open.mp/assets/images/skins/110.png) | lsv3 | 洛圣都瓦戈斯帮 | 洛圣都 | 男 | +| 111 | ![皮肤ID 111](https://assets.open.mp/assets/images/skins/111.png) | maffa | 俄罗斯黑手党 | 圣安地列斯全域 | 男 | +| 112 | ![皮肤ID 112](https://assets.open.mp/assets/images/skins/112.png) | maffb | 俄罗斯黑手党 | 圣安地列斯全域 | 男 | +| 113 | ![皮肤ID 113](https://assets.open.mp/assets/images/skins/113.png) | mafboss | 俄罗斯黑手党头目 | 圣安地列斯全域 | 男 | +| 114 | ![皮肤ID 114](https://assets.open.mp/assets/images/skins/114.png) | vla1 | 洛斯阿兹特克帮 | 洛圣都 | 男 | +| 115 | ![皮肤ID 115](https://assets.open.mp/assets/images/skins/115.png) | vla2 | 洛斯阿兹特克帮 | 洛圣都 | 男 | +| 116 | ![皮肤ID 116](https://assets.open.mp/assets/images/skins/116.png) | vla3 | 洛斯阿兹特克帮 | 洛圣都 | 男 | +| 117 | ![皮肤ID 117](https://assets.open.mp/assets/images/skins/117.png) | triada | 三合会成员 | 圣菲耶罗 | 男 | +| 118 | ![皮肤ID 118](https://assets.open.mp/assets/images/skins/118.png) | triadb | 三合会成员 | 圣菲耶罗 | 男 | +| 119 | ![皮肤ID 119](https://assets.open.mp/assets/images/skins/119.png) | sindaco | 强尼·辛达科 | 拉斯云祖华 | 男 | +| 120 | ![皮肤ID 120](https://assets.open.mp/assets/images/skins/120.png) | triboss | 三合会老大 | 圣菲耶罗 | 男 | +| 121 | ![皮肤ID 121](https://assets.open.mp/assets/images/skins/121.png) | dnb1 | 岘港男孩成员 | 圣菲耶罗 | 男 | +| 122 | ![皮肤ID 122](https://assets.open.mp/assets/images/skins/122.png) | dnb2 | 岘港男孩成员 | 圣菲耶罗 | 男 | +| 123 | ![皮肤ID 123](https://assets.open.mp/assets/images/skins/123.png) | dnb3 | 岘港男孩成员 | 圣菲耶罗 | 男 | +| 124 | ![皮肤ID 124](https://assets.open.mp/assets/images/skins/124.png) | vmaff1 | 黑手党成员 | 拉斯云祖华 | 男 | +| 125 | ![皮肤ID 125](https://assets.open.mp/assets/images/skins/125.png) | vmaff2 | 黑手党成员 | 拉斯云祖华 | 男 | +| 126 | ![皮肤ID 126](https://assets.open.mp/assets/images/skins/126.png) | vmaff3 | 黑手党成员 | 拉斯云祖华 | 男 | +| 127 | ![皮肤ID 127](https://assets.open.mp/assets/images/skins/127.png) | vmaff4 | 黑手党成员 | 拉斯云祖华 | 男 | +| 128 | ![皮肤ID 128](https://assets.open.mp/assets/images/skins/128.png) | dnmylc | 农场居民 | 圣安地列斯 | 男 | +| 129 | ![皮肤ID 129](https://assets.open.mp/assets/images/skins/129.png) | dnfolc1 | 农场居民 | 圣安地列斯 | 女 | +| 130 | ![皮肤ID 130](https://assets.open.mp/assets/images/skins/130.png) | dnfolc2 | 农场居民 | 圣安地列斯 | 女 | +| 131 | ![皮肤ID 131](https://assets.open.mp/assets/images/skins/131.png) | dnfylc | 农场居民 | 圣安地列斯 | 女 | +| 132 | ![皮肤ID 132](https://assets.open.mp/assets/images/skins/132.png) | dnmolc1 | 农场居民 | 圣安地列斯 | 男 | +| 133 | ![皮肤ID 133](https://assets.open.mp/assets/images/skins/133.png) | dnmolc2 | 农场居民 | 圣安地列斯 | 男 | +| 134 | ![皮肤ID 134](https://assets.open.mp/assets/images/skins/134.png) | sbmotr2 | 流浪汉 | 圣安地列斯 | 男 | +| 135 | ![皮肤ID 135](https://assets.open.mp/assets/images/skins/135.png) | swmotr2 | 流浪汉 | 圣安地列斯 | 男 | +| 136 | ![皮肤ID 136](https://assets.open.mp/assets/images/skins/136.png) | sbmytr3 | 普通行人 | 圣安地列斯 | 男 | +| 137 | ![皮肤ID 137](https://assets.open.mp/assets/images/skins/137.png) | swmotr3 | 流浪汉 | 圣安地列斯 | 男 | +| 138 | ![皮肤ID 138](https://assets.open.mp/assets/images/skins/138.png) | wfybe | 海滩游客 | 圣安地列斯海滩 | 女 | +| 139 | ![皮肤ID 139](https://assets.open.mp/assets/images/skins/139.png) | bfybe | 海滩游客 | 圣安地列斯海滩 | 女 | +| 140 | ![皮肤ID 140](https://assets.open.mp/assets/images/skins/140.png) | hfybe | 海滩游客 | 圣安地列斯海滩 | 女 | +| 141 | ![皮肤ID 141](https://assets.open.mp/assets/images/skins/141.png) | sofybu | 女商人 | 圣安地列斯 | 女 | +| 142 | ![皮肤ID 142](https://assets.open.mp/assets/images/skins/142.png) | sbmyst | 出租车司机 | 圣菲耶罗 | 男 | +| 143 | ![皮肤ID 143](https://assets.open.mp/assets/images/skins/143.png) | sbmycr | 毒贩 | 圣安地列斯 | 男 | +| 144 | ![皮肤ID 144](https://assets.open.mp/assets/images/skins/144.png) | bmycg | 毒贩 | 圣安地列斯 | 男 | +| 145 | ![皮肤ID 145](https://assets.open.mp/assets/images/skins/145.png) | wfycrk | 毒贩 | 圣安地列斯海滩 | 女 | +| 146 | ![皮肤ID 146](https://assets.open.mp/assets/images/skins/146.png) | hmycm | 毒贩 | 圣安地列斯海滩 | 男 | +| 147 | ![皮肤ID 147](https://assets.open.mp/assets/images/skins/147.png) | wmybu | 商人 | 圣安地列斯 | 男 | +| 148 | ![皮肤ID 148](https://assets.open.mp/assets/images/skins/148.png) | bfybu | 女商人 | 圣安地列斯 | 女 | +| 149 | ![皮肤ID 149](https://assets.open.mp/assets/images/skins/149.png) | smokev | 装甲版大斯莫克 | 洛圣都 | 男 | +| 150 | ![皮肤ID 150](https://assets.open.mp/assets/images/skins/150.png) | wfybu | 女商人 | 圣安地列斯 | 女 | +| 151 | ![皮肤ID 151](https://assets.open.mp/assets/images/skins/151.png) | dwfylc1 | 普通行人 | 圣安地列斯 | 女 | +| 152 | ![皮肤ID 152](https://assets.open.mp/assets/images/skins/152.png) | wfypro | 妓女 | 圣安地列斯 | 女 | +| 153 | ![皮肤ID 153](https://assets.open.mp/assets/images/skins/153.png) | wmyconb | 建筑工人 | 圣安地列斯 | 男 | +| 154 | ![皮肤ID 154](https://assets.open.mp/assets/images/skins/154.png) | wmybe | 海滩游客 | 圣安地列斯海滩 | 男 | +| 155 | ![皮肤ID 155](https://assets.open.mp/assets/images/skins/155.png) | wmypizz | 披萨店员工 | 美味披萨公司 | 男 | +| 156 | ![皮肤ID 156](https://assets.open.mp/assets/images/skins/156.png) | bmobar | 理发师 | 圣安地列斯 | 男 | +| 157 | ![皮肤ID 157](https://assets.open.mp/assets/images/skins/157.png) | cwfyhb | 乡巴佬 | 圣安地列斯 | 女 | +| 158 | ![皮肤ID 158](https://assets.open.mp/assets/images/skins/158.png) | cwmofr | 农民 | 圣安地列斯 | 男 | +| 159 | ![皮肤ID 159](https://assets.open.mp/assets/images/skins/159.png) | cwmohb1 | 乡巴佬 | 圣安地列斯 | 男 | +| 160 | ![皮肤ID 160](https://assets.open.mp/assets/images/skins/160.png) | cwmohb2 | 乡巴佬 | 圣安地列斯 | 男 | +| 161 | ![皮肤ID 161](https://assets.open.mp/assets/images/skins/161.png) | cwmyfr | 农民 | 圣安地列斯 | 男 | +| 162 | ![皮肤ID 162](https://assets.open.mp/assets/images/skins/162.png) | cwmyhb1 | 乡巴佬 | 圣安地列斯 | 男 | +| 163 | ![皮肤ID 163](https://assets.open.mp/assets/images/skins/163.png) | bmyboun | 黑人保镖 | 圣安地列斯 | 男 | +| 164 | ![皮肤ID 164](https://assets.open.mp/assets/images/skins/164.png) | wmyboun | 白人保镖 | 圣安地列斯 | 男 | +| 165 | ![皮肤ID 165](https://assets.open.mp/assets/images/skins/165.png) | wmomib | 黑衣人组织成员(白) | 圣安地列斯 | 男 | +| 166 | ![皮肤ID 166](https://assets.open.mp/assets/images/skins/166.png) | bmymib | 黑色 MIB 探员 | 圣安地列斯 | 男 | +| 167 | ![皮肤ID 167](https://assets.open.mp/assets/images/skins/167.png) | wmybell | 克拉克因钟餐厅员工 | Cluckin' Bell | 男 | +| 168 | ![皮肤ID 168](https://assets.open.mp/assets/images/skins/168.png) | bmochil | 热狗/辣肠摊贩 | 热狗车与辣肠推车 | 男 | +| 169 | ![皮肤ID 169](https://assets.open.mp/assets/images/skins/169.png) | sofyri | 普通行人 | 圣安地列斯 | 女 | +| 170 | ![皮肤ID 170](https://assets.open.mp/assets/images/skins/170.png) | somyst | 普通行人 | 圣安地列斯 | 男 | +| 171 | ![皮肤ID 171](https://assets.open.mp/assets/images/skins/171.png) | vwmybjd | 21 点发牌员 | 赌场 | 男 | +| 172 | ![皮肤ID 172](https://assets.open.mp/assets/images/skins/172.png) | vwfycrp | 赌场荷官 | 赌场 | 女 | +| 173 | ![皮肤ID 173](https://assets.open.mp/assets/images/skins/173.png) | sfr1 | 圣费耶罗里法帮成员 | 圣费耶罗 | 男 | +| 174 | ![皮肤ID 174](https://assets.open.mp/assets/images/skins/174.png) | sfr2 | 圣费耶罗里法帮成员 | 圣费耶罗 | 男 | +| 175 | ![皮肤ID 175](https://assets.open.mp/assets/images/skins/175.png) | sfr3 | 圣费耶罗里法帮成员 | 圣费耶罗 | 男 | +| 176 | ![皮肤ID 176](https://assets.open.mp/assets/images/skins/176.png) | bmybar | 理发师 | 圣安地列斯 | 男 | +| 177 | ![皮肤ID 177](https://assets.open.mp/assets/images/skins/177.png) | wmybar | 理发师 | 圣安地列斯 | 男 | +| 178 | ![皮肤ID 178](https://assets.open.mp/assets/images/skins/178.png) | wfysex | 妓女 | 圣安地列斯 | 女 | +| 179 | ![皮肤ID 179](https://assets.open.mp/assets/images/skins/179.png) | wmyammo | 弹药销售员 | 武装国度 | 男 | +| 180 | ![皮肤ID 180](https://assets.open.mp/assets/images/skins/180.png) | bmytatt | 纹身师 | 纹身店 | 男 | +| 181 | ![皮肤ID 181](https://assets.open.mp/assets/images/skins/181.png) | vwmycr | 朋克族 | 圣安地列斯 | 男 | +| 182 | ![皮肤ID 182](https://assets.open.mp/assets/images/skins/182.png) | vbmocd | 出租车司机 | 圣安地列斯 | 男 | +| 183 | ![皮肤ID 183](https://assets.open.mp/assets/images/skins/183.png) | vbmycr | 普通行人 | 圣安地列斯 | 男 | +| 184 | ![皮肤ID 184](https://assets.open.mp/assets/images/skins/184.png) | vhmycr | 普通行人 | 圣安地列斯 | 男 | +| 185 | ![皮肤ID 185](https://assets.open.mp/assets/images/skins/185.png) | sbmyri | 普通行人 | 圣安地列斯 | 男 | +| 186 | ![皮肤ID 186](https://assets.open.mp/assets/images/skins/186.png) | somyri | 普通行人 | 圣安地列斯 | 男 | +| 187 | ![皮肤ID 187](https://assets.open.mp/assets/images/skins/187.png) | somybu | 商人 | 圣安地列斯 | 男 | +| 188 | ![皮肤ID 188](https://assets.open.mp/assets/images/skins/188.png) | swmyst | 普通行人 | 圣安地列斯 | 男 | +| 189 | ![皮肤ID 189](https://assets.open.mp/assets/images/skins/189.png) | wmyva | 泊车员 | 圣费耶罗 | 男 | +| 190 | ![皮肤ID 190](https://assets.open.mp/assets/images/skins/190.png) | copgrl3 | 芭芭拉·斯特恩瓦特 | El Quebrados | 女 | +| 191 | ![皮肤ID 191](https://assets.open.mp/assets/images/skins/191.png) | gungrl3 | 海伦娜·万克斯坦 | 蓝莓镇 | 女 | +| 192 | ![皮肤ID 192](https://assets.open.mp/assets/images/skins/192.png) | mecgrl3 | 米歇尔·坎恩斯 | 圣费耶罗 | 女 | +| 193 | ![皮肤ID 193](https://assets.open.mp/assets/images/skins/193.png) | nurgrl3 | 凯蒂·詹 | 圣费耶罗 | 女 | +| 194 | ![皮肤ID 194](https://assets.open.mp/assets/images/skins/194.png) | crogrl3 | 米莉·帕金斯 | 拉斯文图拉斯 | 女 | +| 195 | ![皮肤ID 195](https://assets.open.mp/assets/images/skins/195.png) | gangrl3 | 丹妮丝·罗宾逊 | 洛圣都 | 女 | +| 196 | ![皮肤ID 196](https://assets.open.mp/assets/images/skins/196.png) | cwfofr | 农场镇居民 | 圣安地列斯 | 女 | +| 197 | ![皮肤ID 197](https://assets.open.mp/assets/images/skins/197.png) | cwfohb | 乡巴佬 | 圣安地列斯 | 女 | +| 198 | ![皮肤ID 198](https://assets.open.mp/assets/images/skins/198.png) | cwfyfr1 | 农场镇居民 | 圣安地列斯 | 女 | +| 199 | ![皮肤ID 199](https://assets.open.mp/assets/images/skins/199.png) | cwfyfr2 | 农场镇居民 | 圣安地列斯 | 女 | +| 200 | ![皮肤ID 200](https://assets.open.mp/assets/images/skins/200.png) | cwmyhb2 | 乡巴佬 | 圣安地列斯 | 男 | +| 201 | ![皮肤ID 201](https://assets.open.mp/assets/images/skins/201.png) | dwfylc2 | 农民 | 圣安地列斯 | 女 | +| 202 | ![皮肤ID 202](https://assets.open.mp/assets/images/skins/202.png) | dwmylc2 | 农民 | 圣安地列斯 | 男 | +| 203 | ![皮肤ID 203](https://assets.open.mp/assets/images/skins/203.png) | omykara | 空手道教练 | 圣费耶罗健身房 | 男 | +| 204 | ![皮肤ID 204](https://assets.open.mp/assets/images/skins/204.png) | wmykara | 空手道教练 | 圣费耶罗健身房 | 男 | +| 205 | ![皮肤ID 205](https://assets.open.mp/assets/images/skins/205.png) | wfyburg | 汉堡店收银员 | 汉堡店 | 女 | +| 206 | ![皮肤ID 206](https://assets.open.mp/assets/images/skins/206.png) | vwmycd | 出租车司机 | 圣安地列斯 | 男 | +| 207 | ![皮肤ID 207](https://assets.open.mp/assets/images/skins/207.png) | vhfypro | 妓女 | 圣安地列斯 | 女 | +| 208 | ![皮肤ID 208](https://assets.open.mp/assets/images/skins/208.png) | suzie | 苏西·穆 | 圣费耶罗 | 男 | +| 209 | ![皮肤ID 209](https://assets.open.mp/assets/images/skins/209.png) | omonood | 东方面摊摊主 | 面摊 | 男 | +| 210 | ![皮肤ID 210](https://assets.open.mp/assets/images/skins/210.png) | omoboat | 东方驾船学校教练 | 驾船学校 | 男 | +| 211 | ![皮肤ID 211](https://assets.open.mp/assets/images/skins/211.png) | wfyclot | 服装店员工 | 服装店 | 女 | +| 212 | ![皮肤ID 212](https://assets.open.mp/assets/images/skins/212.png) | vwmotr1 | 流浪汉 | 圣安地列斯 | 男 | +| 213 | ![皮肤ID 213](https://assets.open.mp/assets/images/skins/213.png) | vwmotr2 | 怪异老人 | 圣安地列斯 | 男 | +| 214 | ![皮肤ID 214](https://assets.open.mp/assets/images/skins/214.png) | vwfywai | 女服务员(玛丽亚·拉托雷) | 卡里古拉赌场(仅过场动画) | 女 | +| 215 | ![皮肤ID 215](https://assets.open.mp/assets/images/skins/215.png) | sbfori | 普通行人 | 圣安地列斯 | 女 | +| 216 | ![皮肤ID 216](https://assets.open.mp/assets/images/skins/216.png) | swfyri | 普通行人 | 圣安地列斯 | 女 | +| 217 | ![皮肤ID 217](https://assets.open.mp/assets/images/skins/217.png) | wmyclot | 服装店员工 | 服装店 | 男 | +| 218 | ![皮肤ID 218](https://assets.open.mp/assets/images/skins/218.png) | sbfost | 普通行人 | 圣安地列斯 | 女 | +| 219 | ![皮肤ID 219](https://assets.open.mp/assets/images/skins/219.png) | sbfyri | 富婆 | 圣安地列斯 | 女 | +| 220 | ![皮肤ID 220](https://assets.open.mp/assets/images/skins/220.png) | sbmocd | 出租车司机 | 圣费耶罗 | 男 | +| 221 | ![皮肤ID 221](https://assets.open.mp/assets/images/skins/221.png) | sbmori | 普通行人 | 圣安地列斯 | 男 | +| 222 | ![皮肤ID 222](https://assets.open.mp/assets/images/skins/222.png) | sbmost | 普通行人 | 圣安地列斯 | 男 | +| 223 | ![皮肤ID 223](https://assets.open.mp/assets/images/skins/223.png) | shmycr | 普通行人 | 圣安地列斯 | 男 | +| 224 | ![皮肤ID 224](https://assets.open.mp/assets/images/skins/224.png) | sofori | 普通行人 | 圣安地列斯 | 女 | +| 225 | ![皮肤ID 225](https://assets.open.mp/assets/images/skins/225.png) | sofost | 普通行人 | 圣安地列斯 | 女 | +| 226 | ![皮肤ID 226](https://assets.open.mp/assets/images/skins/226.png) | sofyst | 普通行人 | 圣安地列斯 | 女 | +| 227 | ![皮肤ID 227](https://assets.open.mp/assets/images/skins/227.png) | somobu | 东方商人 | 圣安地列斯 | 男 | +| 228 | ![皮肤ID 228](https://assets.open.mp/assets/images/skins/228.png) | somori | 东方行人 | 圣安地列斯 | 男 | +| 229 | ![皮肤ID 229](https://assets.open.mp/assets/images/skins/229.png) | somost | 东方行人 | 圣安地列斯 | 男 | +| 230 | ![皮肤ID 230](https://assets.open.mp/assets/images/skins/230.png) | swmotr5 | 流浪汉 | 圣安地列斯 | 男 | +| 231 | ![皮肤ID 231](https://assets.open.mp/assets/images/skins/231.png) | swfori | 普通行人 | 圣安地列斯 | 女 | +| 232 | ![皮肤ID 232](https://assets.open.mp/assets/images/skins/232.png) | swfost | 普通行人 | 圣安地列斯 | 女 | +| 233 | ![皮肤ID 233](https://assets.open.mp/assets/images/skins/233.png) | swfyst | 普通行人 | 圣安地列斯 | 女 | +| 234 | ![皮肤ID 234](https://assets.open.mp/assets/images/skins/234.png) | swmocd | 出租车司机 | 圣安地列斯 | 男 | +| 235 | ![皮肤ID 235](https://assets.open.mp/assets/images/skins/235.png) | swmori | 普通行人 | 圣安地列斯 | 男 | +| 236 | ![皮肤ID 236](https://assets.open.mp/assets/images/skins/236.png) | swmost | 普通行人 | 圣安地列斯 | 男 | +| 237 | ![皮肤ID 237](https://assets.open.mp/assets/images/skins/237.png) | shfypro | 妓女 | 圣安地列斯 | 女 | +| 238 | ![皮肤ID 238](https://assets.open.mp/assets/images/skins/238.png) | sbfypro | 妓女 | 圣安地列斯 | 女 | +| 239 | ![皮肤ID 239](https://assets.open.mp/assets/images/skins/239.png) | swmotr4 | 流浪汉 | 圣安地列斯 | 男 | +| 240 | ![皮肤ID 240](https://assets.open.mp/assets/images/skins/240.png) | swmyri | 地方检察官 | 圣费耶罗 | 男 | +| 241 | ![皮肤ID 241](https://assets.open.mp/assets/images/skins/241.png) | smyst | 非裔美国人 | 圣安地列斯 | 男 | +| 242 | ![皮肤ID 242](https://assets.open.mp/assets/images/skins/242.png) | smyst2 | 墨西哥人 | 圣安地列斯 | 男 | +| 243 | ![皮肤ID 243](https://assets.open.mp/assets/images/skins/243.png) | sfypro | 妓女 | 圣安地列斯 | 女 | +| 244 | ![皮肤ID 244](https://assets.open.mp/assets/images/skins/244.png) | vbfyst2 | 脱衣舞娘 | 圣安地列斯 | 女 | +| 245 | ![皮肤ID 245](https://assets.open.mp/assets/images/skins/245.png) | vbfypro | 妓女 | 圣安地列斯 | 女 | +| 246 | ![皮肤ID 246](https://assets.open.mp/assets/images/skins/246.png) | vhfyst3 | 脱衣舞娘 | 圣安地列斯 | 女 | +| 247 | ![皮肤ID 247](https://assets.open.mp/assets/images/skins/247.png) | bikera | 机车手 | 圣安地列斯 | 男 | +| 248 | ![皮肤ID 248](https://assets.open.mp/assets/images/skins/248.png) | bikerb | 机车手 | 圣安地列斯 | 男 | +| 249 | ![皮肤ID 249](https://assets.open.mp/assets/images/skins/249.png) | bmypimp | 皮条客 | 圣费耶罗 | 男 | +| 250 | ![皮肤ID 250](https://assets.open.mp/assets/images/skins/250.png) | swmycr | 普通行人 | 圣安地列斯 | 男 | +| 251 | ![皮肤ID 251](https://assets.open.mp/assets/images/skins/251.png) | wfylg | 救生员 | 海滩 | 女 | +| 252 | ![皮肤ID 252](https://assets.open.mp/assets/images/skins/252.png) | wmyva2 | 裸体泊车员 | 圣费耶罗(仅任务中) | 男 | +| 253 | ![皮肤ID 253](https://assets.open.mp/assets/images/skins/253.png) | bmosec | 巴士司机 | 圣费耶罗 | 男 | +| 254 | ![皮肤ID 254](https://assets.open.mp/assets/images/skins/254.png) | bikdrug | 机车手毒贩 | 圣安地列斯 | 男 | +| 255 | ![皮肤ID 255](https://assets.open.mp/assets/images/skins/255.png) | wmych | 专职司机(豪华轿车司机) | 圣安地列斯 | 男 | +| 256 | ![皮肤ID 256](https://assets.open.mp/assets/images/skins/256.png) | sbfystr | 脱衣舞娘 | 圣安地列斯 | 女 | +| 257 | ![皮肤ID 257](https://assets.open.mp/assets/images/skins/257.png) | swfystr | 脱衣舞娘 | 圣安地列斯 | 女 | +| 258 | ![皮肤ID 258](https://assets.open.mp/assets/images/skins/258.png) | heck1 | 挑衅者 | 圣安地列斯 | 男 | +| 259 | ![皮肤ID 259](https://assets.open.mp/assets/images/skins/259.png) | heck2 | 挑衅者 | 圣安地列斯 | 男 | +| 260 | ![皮肤ID 260](https://assets.open.mp/assets/images/skins/260.png) | bmycon | 建筑工人 | 圣费耶罗 | 男 | +| 261 | ![皮肤ID 261](https://assets.open.mp/assets/images/skins/261.png) | wmycd1 | 出租车司机 | 圣安地列斯 | 男 | +| 262 | ![皮肤ID 262](https://assets.open.mp/assets/images/skins/262.png) | bmocd | 出租车司机 | 圣安地列斯 | 男 | +| 263 | ![皮肤ID 263](https://assets.open.mp/assets/images/skins/263.png) | vwfywa2 | 普通行人 | 圣安地列斯 | 女 | +| 264 | ![皮肤ID 264](https://assets.open.mp/assets/images/skins/264.png) | wmoice | 小丑(冰淇淋车司机) | 圣安地列斯(驾驶冰淇淋车(Mr.Whoopee)) | 男 | +| 265 | ![皮肤ID 265](https://assets.open.mp/assets/images/skins/265.png) | tenpen | 弗兰克·坦彭尼警官(腐败警察) | 任务 | 男 | +| 266 | ![皮肤ID 266](https://assets.open.mp/assets/images/skins/266.png) | pulaski | 埃迪·普拉斯基警官(腐败警察) | 任务 | 男 | +| 267 | ![皮肤ID 267](https://assets.open.mp/assets/images/skins/267.png) | hern | 吉米·埃尔南德斯警官 | 任务 | 男 | +| 268 | ![皮肤ID 268](https://assets.open.mp/assets/images/skins/268.png) | dwayne | 德韦恩 | 圣费耶罗(任务) | 男 | +| 269 | ![皮肤ID 269](https://assets.open.mp/assets/images/skins/269.png) | smoke | 梅尔文·"大烟"·哈里斯(任务角色) | 洛圣都 | 男 | +| 270 | ![皮肤ID 270](https://assets.open.mp/assets/images/skins/270.png) | sweet | 肖恩·"斯威特"·约翰逊 | 洛圣都/圣费耶罗(任务) | 男 | +| 271 | ![皮肤ID 271](https://assets.open.mp/assets/images/skins/271.png) | ryder | 兰斯·"莱德尔"·威尔逊 | 洛圣都/圣费耶罗(任务) | 男 | +| 272 | ![皮肤ID 272](https://assets.open.mp/assets/images/skins/272.png) | forelli | 黑手党老大 | 洛圣都 | 男 | +| 273 | ![皮肤ID 273](https://assets.open.mp/assets/images/skins/273.png) | tbone | T 骨·门德斯 | 圣费耶罗 | 男 | +| 274 | ![皮肤ID 274](https://assets.open.mp/assets/images/skins/274.png) | laemt1 | 急救员(紧急医疗技术人员) | 洛圣都 | 男 | +| 275 | ![皮肤ID 275](https://assets.open.mp/assets/images/skins/275.png) | lvemt1 | 急救员(紧急医疗技术人员) | 拉斯文图拉斯 | 男 | +| 276 | ![皮肤ID 276](https://assets.open.mp/assets/images/skins/276.png) | sfemt1 | 急救员(紧急医疗技术人员) | 圣费耶罗 | 男 | +| 277 | ![皮肤ID 277](https://assets.open.mp/assets/images/skins/277.png) | lafd1 | 消防员 | 洛圣都 | 男 | +| 278 | ![皮肤ID 278](https://assets.open.mp/assets/images/skins/278.png) | lvfd1 | 消防员 | 拉斯文图拉斯 | 男 | +| 279 | ![皮肤ID 279](https://assets.open.mp/assets/images/skins/279.png) | sffd1 | 消防员 | 圣费耶罗 | 男 | +| 280 | ![皮肤ID 280](https://assets.open.mp/assets/images/skins/280.png) | lapd1 | 洛圣都警察 | 洛圣都 | 男 | +| 281 | ![皮肤ID 281](https://assets.open.mp/assets/images/skins/281.png) | sfpd1 | 圣费耶罗警察 | 圣费耶罗 | 男 | +| 282 | ![皮肤ID 282](https://assets.open.mp/assets/images/skins/282.png) | lvpd1 | 拉斯云祖华警察 | 拉斯文图拉斯 | 男 | +| 283 | ![皮肤ID 283](https://assets.open.mp/assets/images/skins/283.png) | csher | 郡治安官 | 乡村地区 | 男 | +| 284 | ![皮肤ID 284](https://assets.open.mp/assets/images/skins/284.png) | lapdm1 | LSPD 摩托骑警 | 圣安地列斯 | 男 | +| 285 | ![皮肤ID 285](https://assets.open.mp/assets/images/skins/285.png) | swat | 特警队 | 圣安地列斯 | 男 | +| 286 | ![皮肤ID 286](https://assets.open.mp/assets/images/skins/286.png) | fbi | FBI 探员 | 圣安地列斯 | 男 | +| 287 | ![皮肤ID 287](https://assets.open.mp/assets/images/skins/287.png) | army | 圣安地列斯陆军士兵 | 圣安地列斯 | 男 | +| 288 | ![皮肤ID 288](https://assets.open.mp/assets/images/skins/288.png) | dsher | 沙漠治安官 | 沙漠地区 | 男 | +| 289 | ![皮肤ID 289](https://assets.open.mp/assets/images/skins/289.png) | zero | 零式 | 圣费耶罗 | 男 | +| 290 | ![皮肤ID 290](https://assets.open.mp/assets/images/skins/290.png) | rose | 肯·罗森伯格 | 拉斯云祖华赌场 | 男 | +| 291 | ![皮肤ID 291](https://assets.open.mp/assets/images/skins/291.png) | paul | 肯特·保罗 | LV/LS | 男 | +| 292 | ![皮肤ID 292](https://assets.open.mp/assets/images/skins/292.png) | cesar | 塞萨尔·维亚潘多 | LS/SF | 男 | +| 293 | ![皮肤ID 293](https://assets.open.mp/assets/images/skins/293.png) | ogloc | 杰弗里·"OG Loc"·马丁/克罗斯 | 洛圣都 汉堡店 | 男 | +| 294 | ![皮肤ID 294](https://assets.open.mp/assets/images/skins/294.png) | wuzimu | 吴梓穆(吴子) | 圣费耶罗 与拉斯云祖华 | 男 | +| 295 | ![皮肤ID 295](https://assets.open.mp/assets/images/skins/295.png) | torino | 迈克·托雷诺(麦克) | 拉斯云祖华与 圣费耶罗 | 男 | +| 296 | ![皮肤ID 296](https://assets.open.mp/assets/images/skins/296.png) | jizzy | 吉兹·B | 圣费耶罗 欢乐宫 | 男 | +| 297 | ![皮肤ID 297](https://assets.open.mp/assets/images/skins/297.png) | maddogg | 疯狗多克 | 疯狗多克庄园(洛圣都) | 男 | +| 298 | ![皮肤ID 298](https://assets.open.mp/assets/images/skins/298.png) | cat | 卡塔琳娜 | 蕨岭 | 女 | +| 299 | ![皮肤ID 299](https://assets.open.mp/assets/images/skins/299.png) | claude | 克劳德·斯皮德 | 仅过场动画 | 男 | + +## 附加皮肤 + +:::warning + +这些皮肤 (300-311) 于 SA-MP 0.3.7 RC3 版本新增,在早期版本中不可用! + +::: + +| 皮肤 ID | 预览 | Skin Model Name | 皮肤名称/类型 | 单人模式位置 | 性别 | +| ------- | ----------------------------------------------------------------- | --------------- | -------------------------------- | ------------ | ---- | +| 300 | ![皮肤ID 300](https://assets.open.mp/assets/images/skins/300.png) | lapdna | 洛圣都警察(无枪套) | - | 男性 | +| 301 | ![皮肤ID 301](https://assets.open.mp/assets/images/skins/301.png) | sfpdna | 圣费耶罗警察(无枪套) | - | 男性 | +| 302 | ![皮肤ID 302](https://assets.open.mp/assets/images/skins/302.png) | lvpdna | 拉斯云祖华警察(无枪套) | - | 男性 | +| 303 | ![皮肤ID 303](https://assets.open.mp/assets/images/skins/303.png) | lapdpc | 洛圣都警察(无制服) | - | 男性 | +| 304 | ![皮肤ID 304](https://assets.open.mp/assets/images/skins/304.png) | lapdpd | 洛圣都警察(无制服) | - | 男性 | +| 305 | ![皮肤ID 305](https://assets.open.mp/assets/images/skins/305.png) | lvpdpc | 拉斯云祖华警察(无制服) | - | 男性 | +| 306 | ![皮肤ID 306](https://assets.open.mp/assets/images/skins/306.png) | wfyclpd | 洛圣都警察 | - | 女性 | +| 307 | ![皮肤ID 307](https://assets.open.mp/assets/images/skins/307.png) | vbfycpd | 圣费耶罗警察 | - | 女性 | +| 308 | ![皮肤ID 308](https://assets.open.mp/assets/images/skins/308.png) | wfyclem | 圣费耶罗急救员(紧急医疗技术员) | - | 女性 | +| 309 | ![皮肤ID 309](https://assets.open.mp/assets/images/skins/309.png) | wfycllv | 拉斯云祖华警察 | - | 女性 | +| 310 | ![皮肤ID 310](https://assets.open.mp/assets/images/skins/310.png) | csherna | 乡村警长(无帽子) | - | 男性 | +| 311 | ![皮肤ID 311](https://assets.open.mp/assets/images/skins/311.png) | dsherna | 沙漠警长(无帽子) | - | 男性 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/sound-ids.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/sound-ids.md new file mode 100644 index 00000000000..9b276b60fb0 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/sound-ids.md @@ -0,0 +1,635 @@ +--- +title: 声音ID列表 +sidebar_label: 声音ID列表 +description: PlayerPlaySound使用的声音ID列表 +--- + +这里列出了所有[PlayerPlaySound](../functions/PlayerPlaySound)函数使用的声音 ID。 + +如需[犯罪报告声音 ID](../functions/PlayCrimeReportForPlayer)请查阅[此页面](crimelist)。 + +:::note + +必须使用声音 ID ​**0**​ 来停止当前正在播放的声音。 + +::: + +:::caution 自**0.3.7-R2**起: + +- 声音 ID ​**1**​ 可用于禁用[默认的 0 号室内环境音效](../functions/SetPlayerInterior)(风声背景音)。_提示:有助于创建更逼真的虚拟室内场景_ +- 声音 ID ​**0**​ 可额外用于恢复游戏正常户外环境音效 + +::: + +## 0.3.7-R2 新增音效(由 Vince 和 BigETI 发现) + +``` +2 - 59 警用电台 +66 - 134 电台广告 +135 - 136 通风系统音效 +137 枪械店室内音效 +138 51区室内音效 +139 颁奖典礼音乐 +140 迪斯科(摇滚) +141 "Let's Get Ready to Bumble"音乐 +142 与1185相同 +143 马可小馆音乐 +144 餐厅音乐 +145 与1097相同 +146 赌场音乐 +147 迪斯科(电子乐) +148 飞机舱内引擎声 +149 与1183相同 +150 与1068相同 +151 风扇声 +152 酒吧(户外?) +153 与1062相同 +154 通风系统音效 +155, 156 飞机舱内引擎声 +157 迪斯科(嘻哈) +158 通风系统音效 +159 - 160 赛马音效 +161 与1187相同 +162 迪斯科(嘻哈) +163 通风系统音效 +164, 165 航空母舰升降机 +166 暴动音效 +167 雨声 +168 机舱音效 +169 特技比赛音效 +170 脱衣舞俱乐部音效 +171 迪斯科(摇滚):枪与玫瑰 - Welcome To The Jungle +172 黑暗主题音效 +173 传送带音效? +174 水声 +175 迪斯科音效 +176 SA开场音乐 +177 - 179 迪斯科音效 +179 低底盘车挑战赛 +180 低底盘车挑战赛 +181 低底盘车挑战赛 +182 任务完成/资产购买音乐 +183 任务通过音乐 +184 语音台词 +185 - 314 Playback FM电台 +315 - 469 K-ROSE电台 +470 - 625 K-DST电台(534 Rod Stewart - Young hearts be free tonight) +626 - 668 语音采样 +669 女友约会失败音乐("去你的,我才不会照你说的做") +670 女友约会成功音乐 +671 - 766 语音台词(743 - Big Smoke点餐) +767 - 945 Bounce FM电台 +946 - 999 SF-UR电台 +``` + +--- + +:::note + +以下声音 ID 仅适用于 0.3d 及以上版本! + +::: + +所有可用声音 ID 可在 GTA San Andreas 文件夹的`/data/AudioEvents.txt`文件中找到 + +#### 特殊声音 ID + +- 1000 - 禁用直升机音效 +- 1001 - 启用直升机音效(可用于修复直升机音效错误) + +## 0.3d 声音 ID(由 WackoX 发现) + +#### 警用电台 + +``` +2200 - "黑色" +2201 - "蓝色" +2202 - "棕色" +2203 - "铜色" +2204 - "定制" +2205 - "自定义" +2206 - "深色" +2207 - "金色" +2208 - "绿色" +2209 - "灰色" +2210 - "浅色" +2211 - "粉色" +2212 - "红色" +2213 - "银色" +2214 - "白色" + +2400 - "中心区" +2401 - "东区" +2402 - "北区" +2403 - "南区" +2404 - "西区" + +2600 - "前往10-" +2601 - "在" +2602 - "水中" +2603 - "在" +2604 - "步行" +2605 - "响应10-" +2606 - "嫌犯在水中" +2607 - "嫌犯最后出现" +2608 - "我们接到10-" + +2800 - "17号区域" +2801 - "21号区域" +2802 - "24号区域" +2803 - "28号区域" +2804 - "34号区域" +2805 - "37号区域" +2806 - "7号区域" +2807 - "71号区域" +2808 - "81号区域" +2809 - "90号区域" +2810 - "91号区域" +2811-2813: 10/尝试相关??? + +3000 - "双门" +3001 - "四门" +3002 - "救护车" +3003 - "铰接式卡车" +3004 - "沙滩车" +3005 - "自行车" +3006 - "船只" +3007 - "越野车" +3008 - "推土机" +3009 - "巴士" +3010 - "房车" +3011 - "长途客车" +3012 - "联合收割机" +3013 - "紧凑型" +3014 - "敞篷车" +3015 - "轿跑" +3016 - "巡洋舰" +3017 - "消防车" +3018 - "叉车" +3019 - "货运列车" +3020 - "垃圾车" +3021 - "油罐车" +3022 - "高尔夫车" +3023 - "卡丁车" +3024 - "灵车" +3025 - "直升机" +3026 - "气垫船" +3027 - "冰淇淋车" +3028 - "吉普车" +3029 - "割草机" +3030 - "豪华轿车" +3031 - "低底盘车" +3032 - "助力车" +3033 - "摩托车" +3034 - "越野车" +3035 - "多人座" +3036 - "皮卡" +3037 - "飞机" +3038 - "警车" +3039 - "警用厢型车" +3040 - "四轮摩托" +3041 - "橡皮艇" +3042 - "沙地越野车" +3043 - "水上飞机" +3044 - "雪地车" +3045 - "快艇" +3046 - "运动型" +3047 - "跑车" +3048 - "运动摩托" +3049 - "旅行车" +3050 - "SUV" +3051 - "坦克" +3052 - "出租车" +3053 - "拖拉机" +3054 - "火车" +3055 - "有轨电车" +3056 - "卡车" +3057 - "厢型车" +``` + +#### 赌场音效 + +``` +4200 - 老虎机启动音效 +4201 - 硬币掉落音效 +4202 - 提示音 +4203 - 提示音 +``` + +#### 健身房教练 + +``` +4800 - "哟,想学点新招式吗?" +4801 - "随便你,但街上可不好混啊兄弟" +4802 - "老兄你太弱了,先去练点肌肉吧" +4803 - "嘿想和我过两招吗?" +4804 - "注意看,说不定能学到东西" +4805 - "冲上去干翻对手!" +4806 - "确保对手彻底倒下!" +4807 - "永远别给对手喘息机会" +``` + +#### 游戏音效 + +``` +5200 - 持续蜂鸣音 +5201 - 叮当声 +5202 - 小蜜蜂游戏受伤音效 +5203 - 小蜜蜂游戏结束音效 +5204 - 小蜜蜂游戏射击音效 +5205 - 小蜜蜂游戏提示音 +5206 - 小蜜蜂游戏死亡音效 +``` + +#### 赌场女郎 + +``` +5400 - "请下注!" +5401 - "女士们先生们请下注" +5402 - "先生,已为您提供信用额度" +5403 - "赌场愿意为您提供信用额度" +5404 - "赌场认可先生的信用评级" +5405 - "先生没有足够资金继续下注" +5406 - "抱歉先生,您的资金不足" +5407 - "您的资金似乎不足以继续投注" +5408 - "停止下注!" +5409 - "女士们先生们请停止下注" +5410 - "停止接受投注" +5411-5447: 轮盘数字播报,例如"黑色,26号!" +5448 - "您赢了!" +5449 - "恭喜先生获胜" +5450 - "祝贺先生!" +5451 - "抱歉先生,仅限常客" +5452 - "赌场不认可您在本桌的限额" +5453 - "感谢光临,祝您愉快!" +5454 - "感谢您的参与!" +5455 - "1美元赔付!" +5456 - "2美元赔付!" +5457 - "5美元赔付!" +5458 - "10美元赔付!" +5459 - "20美元赔付!" +5460 - "40美元赔付!" +5461 - "头奖!" +5462 - "先生再次获胜!" +5463 - "恭喜先生,您手气正旺" +5464 - "祝先生好运常在!" +``` + +#### 驾船学校 + +``` +6200 - 海鸥叫声 +6201 - "欢迎来到驾船学校" +6202 - "要通过测试,所有五项考核必须达到铜牌或以上" +6203 - "查看测试演示请使用那边的电视" +6204 - "通过当前测试将解锁后续测试" +6205 - "您可以随时回来查看成绩或进行新测试" +``` + +#### 随机/额外音效 + +``` +3200 - 汽笛声 +3201 - 长鸣汽笛 +3400 - 空调声 +3401 - 持续响铃 +3600 - 呼叫提示音 +3800 - 录像带运转声 +4400 - 理发店电推剪声 +6000 - 防爆门滑动声 +6001 - 重复警报声(每2秒一次) +6002 - 重型门声 +6003 - 电流声(可用于电击枪) +6400 - 提示音(游戏文件中标注为'门铃') +6401 - 电梯铃声 +39000 - "你母亲会怎么想?" +39002 - "像你这种下流胚子只能花钱买春!" +``` + +#### 0.3d 声音 ID + +``` +"罪恶村庄" - 2000 +"天使松林" - 2001 +"西部拱门" - 2002 +"黄蜂乡村俱乐部" - 2003 +"天涯海角" - 2004 +"巴特里角" - 2005 +"海湾码头" - 2006 +"海湾船坞" - 2007 +"海湾隧道" - 2008 +"灯塔山" - 2009 +"黑原" - 2010 +"黑原教堂" - 2011 +"黑原十字路口" - 2012 +"蓝莓庄园" - 2013 +"蓝莓镇" - 2014 +"骨镇" - 2015 +"卡里古拉赌场" - 2016 +"卡尔顿高地" - 2017 +"唐人街" - 2018 +"市政厅" - 2019 +"科莫洛特" - 2020 +"商业区" - 2021 +"会议中心" - 2022 +"蔓越莓车站" - 2023 +"迪利摩尔" - 2024 +"多尔蒂" - 2025 +"市中心" - 2026 +"洛斯桑托斯市中心" - 2027 +"东洛圣都" - 2028 +"东海滩" - 2029 +"东部盆地" - 2030 +"东部湾机场" - 2031 +"东部湾化工厂" - 2032 +"东部隧道" - 2033 +"恶魔城堡" - 2034 +"电晕区" - 2035 +"埃尔克布拉多斯" - 2036 +"滨海东道" - 2037 +"滨海北道" - 2038 +"断树镇" - 2039 +"法洛桥" - 2040 +"蕨岭" - 2041 +"金融区" - 2042 +"渔夫湖" - 2043 +"燧石郡" - 2044 +"燧石十字路口" - 2045 +"燧石山脉" - 2046 +"燧石水域" - 2047 +"福特卡森" - 2048 +"福斯特谷" - 2049 +"弗雷德里克桥" - 2050 +"甘顿" - 2051 +"甘特桥" - 2052 +"加西亚" - 2053 +"加弗桥" - 2054 +"格伦公园" - 2055 +"绿玻学院" - 2056 +"绿棕榈" - 2057 +"汉普顿谷仓" - 2058 +"汉基庞基角" - 2059 +"哈里黄金公路" - 2060 +"哈希莓" - 2061 +"山顶农场" - 2062 +"猎人采石场" - 2063 +"艾德伍德" - 2064 +"朱利叶斯东高速" - 2065 +"朱利叶斯北高速" - 2066 +"朱利叶斯南高速" - 2067 +"朱利叶斯西高速" - 2068 +"杜松山" - 2069 +"杜松谷" - 2070 +"KACC军事燃料库" - 2071 +"金凯德桥" - 2072 +"国王区" - 2073 +"拉斯巴兰卡斯" - 2074 +"拉斯布鲁哈斯" - 2075 +"拉斯帕亚萨达斯" - 2076 +"最后硬币汽车旅馆" - 2077 +"拉斯云祖华" - 2078 +"绿荫谷" - 2079 +"小飞碟旅馆" - 2080 +"林登区" - 2081 +"林登车站" - 2082 +"小墨西哥" - 2083 +"拉斯科林纳斯" - 2084 +"洛斯弗洛雷斯" - 2085 +"洛斯桑托斯" - 2086 +"洛斯桑托斯湾" - 2087 +"洛斯桑托斯国际机场" - 2088 +"洛斯塞普尔克罗斯" - 2089 +"拉斯云祖华机场" - 2090 +"LVA货运站" - 2091 +"滨海区" - 2092 +"市场区" - 2093 +"市场车站" - 2094 +"马丁桥" - 2095 +"传教士山" - 2096 +"蒙哥马利" - 2097 +"蒙哥马利十字路口" - 2098 +"奇力耶德山" - 2099 +"穆赫兰道" - 2100 +"穆赫兰十字路口" - 2101 +"北极星岩" - 2102 +"海洋码头" - 2103 +"海洋公寓" - 2104 +"辛烷泉" - 2105 +"老云祖华大道" - 2106 +"公海" - 2107 +"帕利塞兹" - 2108 +"帕洛米诺溪" - 2109 +"天堂岛" - 2110 +"皮尔格林溪" - 2111 +"皮尔森十字路口" - 2112 +"塞维利亚海滩" - 2113 +"松针镇" - 2114 +"皇后区" - 2115 +"伦道夫工业区" - 2116 +"红郡" - 2117 +"红沙东" - 2118 +"红沙西" - 2119 +"普通汤姆" - 2120 +"富人区" - 2121 +"罗卡埃斯卡兰特" - 2122 +"东岩岸" - 2123 +"西岩岸" - 2124 +"罗迪欧" - 2125 +"皇家赌场" - 2126 +"圣安地列斯之声" - 2127 +"圣费耶罗" - 2128 +"圣费耶罗湾" - 2129 +"圣塔弗洛拉" - 2130 +"圣玛丽亚海滩" - 2131 +"阴暗溪" - 2132 +"谢尔曼水库" - 2133 +"索贝尔铁路站场" - 2134 +"荆棘床" - 2135 +"海星赌场" - 2136 +"阳光区" - 2137 +"圣殿区" - 2138 +"大耳朵射电望远镜" - 2139 +"骆驼趾" - 2140 +"小丑口袋" - 2141 +"翡翠岛" - 2142 +"农场" - 2143 +"四龙赌场" - 2144 +"豪赌客" - 2145 +"马可跨度" - 2146 +"全景监狱" - 2147 +"粉红天鹅" - 2148 +"穿男裤的海盗" - 2149 +"谢尔曼大坝" - 2150 +"面容区" - 2151 +"提拉罗巴达" - 2152 +"联合车站" - 2153 +"隐秘谷" - 2154 +"绿茵崖" - 2155 +"绿茵草场" - 2156 +"维罗纳海滩" - 2157 +"葡萄园" - 2158 +"磨刀石" - 2159 +"白木庄园" - 2160 +"柳田区" - 2161 +"黄铃铛高尔夫球场" - 2162 +"黄铃铛车站" - 2163 +``` + +--- + +:::note + +以下声音 ID 适用于所有版本! + +::: + +| 名称 | ID | +| ---------------------------------- | ----------- | +| SOUND_CEILING_VENT_LAND | 1002 | +| SOUND_BONNET_DENT | 1009 | +| SOUND_WHEEL_OF_FORTUNE_CLACKER | 1027 | +| SOUND_SHUTTER_DOOR_START | 1035 | +| SOUND_SHUTTER_DOOR_STOP | 1036 | +| SOUND_PARACHUTE_OPEN | 1039 | +| SOUND_AMMUNATION_BUY_WEAPON | 1052 | +| SOUND_AMMUNATION_BUY_WEAPON_DENIED | 1053 | +| SOUND_SHOP_BUY | 1054 | +| SOUND_SHOP_BUY_DENIED | 1055 | +| SOUND_RACE_321 | 1056 | +| SOUND_RACE_GO | 1057 | +| SOUND_PART_MISSION_COMPLETE | 1058 | +| SOUND_GOGO_TRACK_START | 1062 (音乐) | +| SOUND_GOGO_TRACK_STOP | 1063 (音乐) | +| SOUND_DUAL_TRACK_START | 1068 (音乐) | +| SOUND_DUAL_TRACK_STOP | 1069 (音乐) | +| SOUND_BEE_TRACK_START | 1076 (音乐) | +| SOUND_BEE_TRACK_STOP | 1077 (音乐) | +| SOUND_ROULETTE_ADD_CASH | 1083 | +| SOUND_ROULETTE_REMOVE_CASH | 1084 | +| SOUND_ROULETTE_NO_CASH | 1085 | +| SOUND_BIKE_PACKER_CLUNK | 1095 | +| SOUND_AWARD_TRACK_START | 1097 (音乐) | +| SOUND_AWARD_TRACK_STOP | 1098 (音乐) | +| SOUND_MESH_GATE_OPEN_START | 1100 | +| SOUND_MESH_GATE_OPEN_STOP | 1101 | +| SOUND_PUNCH_PED | 1130 | +| SOUND_AMMUNATION_GUN_COLLISION | 1131 | +| SOUND_CAMERA_SHOT | 1132 | +| SOUND_BUY_CAR_MOD | 1133 | +| SOUND_BUY_CAR_RESPRAY | 1134 | +| SOUND_BASEBALL_BAT_HIT_PED | 1135 | +| SOUND_STAMP_PED | 1136 | +| SOUND_CHECKPOINT_AMBER | 1137 | +| SOUND_CHECKPOINT_GREEN | 1138 | +| SOUND_CHECKPOINT_RED | 1139 | +| SOUND_CAR_SMASH_CAR | 1140 | +| SOUND_CAR_SMASH_GATE | 1141 | +| SOUND_OTB_TRACK_START | 1142 | +| SOUND_OTB_TRACK_STOP | 1143 | +| SOUND_PED_HIT_WATER_SPLASH | 1144 | +| SOUND_RESTAURANT_TRAY_COLLISION | 1145 | +| SOUND_SWEETS_HORN | 1147 | +| SOUND_MAGNET_VEHICLE_COLLISION | 1148 | +| SOUND_PROPERTY_PURCHASED | 1149 | +| SOUND_PICKUP_STANDARD | 1150 | +| SOUND_GARAGE_DOOR_START | 1153 | +| SOUND_GARAGE_DOOR_STOP | 1154 | +| SOUND_PED_COLLAPSE | 1163 | +| SOUND_SHUTTER_DOOR_SLOW_START | 1165 | +| SOUND_SHUTTER_DOOR_SLOW_STOP | 1166 | +| SOUND_RESTAURANT_CJ_PUKE | 1169 | +| SOUND_DRIVING_AWARD_TRACK_START | 1183 (音乐) | +| SOUND_DRIVING_AWARD_TRACK_STOP | 1184 | +| SOUND_BIKE_AWARD_TRACK_START | 1185 (音乐) | +| SOUND_BIKE_AWARD_TRACK_STOP | 1186 | +| SOUND_PILOT_AWARD_TRACK_START | 1187 (音乐) | +| SOUND_PILOT_AWARD_TRACK_STOP | 1188 | +| SOUND_SLAP | 1190 | + +--- + +## jbeta 旧版列表 + +``` +1002 轻微撞击声 +1009 碰撞声 +1020 持续机械噪音 +1021 机械运转声 +1022 引擎熄火声 +1027 较弱撞击声 +1035 车库门开启声 +1039 降落伞开启声(Maxx提供) +1052 提示音A +1053 提示音B +1054 提示音A(同1052) +1055 提示音B(同1053) +1056 倒计时321 +1057 比赛开始音效 +1058 选择确认音 +1062 *电子游戏音乐:前进太空猴* +1068 *电子游戏音乐:双重性* +1076 *电子游戏音乐:准备出击* +1083 地图标记放置音 +1084 地图标记移除音 +1085 提示音C +1095 重击声 +1097 *背景音乐* +1100 金属围栏晃动声A +1101 金属围栏晃动声B +1130 挥拳声A +1131 木质物体撞击声 +1132 相机快门声 +1133 改装店组件安装音效 +1134 喷漆罐音效 +1135 击打声 +1136 挥拳声B +1137 高频提示音A +1138 高频提示音A +1139 高频提示音A +1140 碰撞声A +1141 碰撞声B +1142 体育场背景噪音 +1144 水花溅起声 +1145 投掷炸药声 +1147 汽车喇叭声 +1148 碰撞声C +1149 提示音(同1052?) +1150 选择确认音 +1153 车库门开启声(同1035) +1159 爆炸声 +1163 双脚落地声(跳跃后) +1165 大型机库门声 +1183 *驾驶学校奖励音乐* +1185 *驾船/摩托学校奖励音乐* +1187 *飞行学校奖励音乐* +1190 掌掴声 +``` + +``` +39047 "我的手机在哪!!" +39051 "对,把手放那儿" +39052 "卧槽找到手机了" +39074 "我在听..." +39076 "啊哈,真有意思" +50002 "来啊混蛋!试试看!" +50004 "你现在归我管了!" +50050 "告诉我老婆我爱她" +50051 "我要进去了" +50052 "搞什么鬼!" +50053 "呃,我的咖啡" +50094 "等等,想想你在做什么" +100001 "快点,时间就是金钱" +100005 "别动这辆车!" +100006 "老板会杀了我的" +100007 "又少一笔小费" +100008 "哦不兄弟!" +100009 "今天糟透了" +100010 "情况不妙" +100011 "你个白痴" +100012 "小心!" +100013 "你在干什么?!" +100014 "嘿——" +100015 "哦该死" +100016 "什么鬼东西" +100017 "喂老兄!" +``` diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/specialactions.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/specialactions.md new file mode 100644 index 00000000000..58a630bcd8f --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/specialactions.md @@ -0,0 +1,37 @@ +--- +title: 特殊动作 +sidebar_label: 特殊动作 +description: 包含所有玩家特殊动作的列表,适用于GetPlayerSpecialAction和SetPlayerSpecialAction函数 +tags: ["玩家"] +--- + +本页整理了[GetPlayerSpecialAction](../functions/GetPlayerSpecialAction)和[SetPlayerSpecialAction](../functions/SetPlayerSpecialAction)函数使用的所有玩家特殊动作。这两个页面都包含如何使用下列参数的示例。 + +:::warning + +标注 \* 的特殊动作无法通过[SetPlayerSpecialAction](../functions/SetPlayerSpecialAction)设置 + +::: + +| ID | 动作名称 | 描述 | +| --- | ------------------------------- | -------------------------------------------------------------------- | +| 0 | SPECIAL_ACTION_NONE | 清除玩家所有特殊动作 | +| 2 | SPECIAL_ACTION_USEJETPACK | 使玩家使用喷气背包 | +| 5 | SPECIAL_ACTION_DANCE1 | 播放舞蹈动画 1 | +| 6 | SPECIAL_ACTION_DANCE2 | 播放舞蹈动画 2 | +| 7 | SPECIAL_ACTION_DANCE3 | 播放舞蹈动画 3 | +| 8 | SPECIAL_ACTION_DANCE4 | 播放舞蹈动画 4 | +| 10 | SPECIAL_ACTION_HANDSUP | 使玩家举手投降 | +| 11 | SPECIAL_ACTION_USECELLPHONE | 使玩家使用手机通话 | +| 12 | SPECIAL_ACTION_SITTING \* | 检测玩家是否处于坐下状态 | +| 13 | SPECIAL_ACTION_STOPUSECELLPHONE | 使玩家停止使用手机 | +| 1 | SPECIAL_ACTION_DUCK \* | 检测玩家是否处于蹲下状态 | +| 3 | SPECIAL_ACTION_ENTER_VEHICLE \* | 检测玩家是否正在通过动画进入车辆 | +| 4 | SPECIAL_ACTION_EXIT_VEHICLE \* | 检测玩家是否正在通过动画离开车辆 | +| 20 | SPECIAL_ACTION_DRINK_BEER | 使用后会增加玩家醉酒值 | +| 21 | SPECIAL_ACTION_SMOKE_CIGGY | 使玩家抽雪茄 | +| 22 | SPECIAL_ACTION_DRINK_WINE | 使玩家饮用葡萄酒瓶并进入醉酒状态 | +| 23 | SPECIAL_ACTION_DRINK_SPRUNK | 使玩家饮用 Sprunk 饮料 | +| 68 | SPECIAL_ACTION_PISSING | 播放小便动画并显示尿液效果(**该宏未包含在 SA-MP 头文件中**) | +| 24 | SPECIAL_ACTION_CUFFED | 强制玩家做出被拷动作(双手背在身后)(在 CJ 皮肤上无效) | +| 25 | SPECIAL_ACTION_CARRY | 使玩家呈现"搬运"动画,并使其无法冲刺、跳跃或挥拳(在 CJ 皮肤上无效) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/spectatemodes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/spectatemodes.md new file mode 100644 index 00000000000..f7748efb172 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/spectatemodes.md @@ -0,0 +1,18 @@ +--- +title: 旁观模式 +sidebar_label: 旁观模式 +description: PlayerSpectatePlayer和PlayerSpectateVehicle函数使用的旁观模式 +tags: [] +--- + +:::info + +[PlayerSpectatePlayer](../functions/PlayerSpectatePlayer) 和 [PlayerSpectateVehicle](../functions/PlayerSpectateVehicle) 函数使用的观察视角模式 + +::: + +| 模式类型 | 效果描述 | +| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SPECTATE_MODE_NORMAL | 普通旁观模式(第三人称视角)。视角角度不可调整 | +| SPECTATE_MODE_FIXED | 使用[SetPlayerCameraPos](../functions/SetPlayerCameraPos)定位玩家视角位置后,该模式会自动追踪通过[PlayerSpectatePlayer](../functions/PlayerSpectatePlayer)/[PlayerSpectateVehicle](../functions/PlayerSpectateVehicle)设置的目标玩家/车辆 | +| SPECTATE_MODE_SIDE | 视角将附着在目标玩家/车辆侧面(类似摩托车第一人称视角进行翘轮特技时的观察视角) | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/spectatetypes.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/spectatetypes.md new file mode 100644 index 00000000000..a8afbee02f5 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/spectatetypes.md @@ -0,0 +1,18 @@ +--- +title: 旁观类型 +sidebar_label: 旁观类型 +description: GetPlayerSpectateType使用的旁观类型 +tags: [] +--- + +:::info + +[GetPlayerSpectateType](../functions/GetPlayerSpectateType) 函数使用的旁观类型 + +::: + +| 类型 | 值 | +| ---- | --- | +| 无 | 0 | +| 车辆 | 1 | +| 玩家 | 2 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/sqlite-open-flags.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/sqlite-open-flags.md new file mode 100644 index 00000000000..c65cb0e2820 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/sqlite-open-flags.md @@ -0,0 +1,43 @@ +--- +title: SQLite 打开标志 +sidebar_label: SQLite 打开标志 +description: SQLite 数据库打开标志定义 +--- + +:::note + +这些标志用于 [DB_Open](../functions/db_open) 函数 + +::: + +| 定义标识符 | 描述 | +| ------------------------- | -------------- | +| UNKNOWN_SQLITE_OPEN | 未知打开模式 | +| SQLITE_OPEN_READONLY | 只读模式 | +| SQLITE_OPEN_READWRITE | 读写模式 | +| SQLITE_OPEN_CREATE | 创建数据库 | +| SQLITE_OPEN_DELETEONCLOSE | 需要 VFS 支持 | +| SQLITE_OPEN_EXCLUSIVE | 需要 VFS 支持 | +| SQLITE_OPEN_AUTOPROXY | 需要 VFS 支持 | +| SQLITE_OPEN_URI | URI 访问模式 | +| SQLITE_OPEN_MEMORY | 内存数据库模式 | +| SQLITE_OPEN_MAIN_DB | 需要 VFS 支持 | +| SQLITE_OPEN_TEMP_DB | 需要 VFS 支持 | +| SQLITE_OPEN_TRANSIENT_DB | 需要 VFS 支持 | +| SQLITE_OPEN_MAIN_JOURNAL | 需要 VFS 支持 | +| SQLITE_OPEN_TEMP_JOURNAL | 需要 VFS 支持 | +| SQLITE_OPEN_SUBJOURNAL | 需要 VFS 支持 | +| SQLITE_OPEN_SUPER_JOURNAL | 需要 VFS 支持 | +| SQLITE_OPEN_NOMUTEX | 非互斥锁模式 | +| SQLITE_OPEN_FULLMUTEX | 完全互斥锁模式 | +| SQLITE_OPEN_SHAREDCACHE | 共享缓存模式 | +| SQLITE_OPEN_PRIVATECACHE | 私有缓存模式 | +| SQLITE_OPEN_WAL | 需要 VFS 支持 | +| SQLITE_OPEN_NOFOLLOW | 禁止符号链接 | +| SQLITE_OPEN_EXRESCODE | 扩展错误码 | + +:::note + +关于 VFS 的详细信息请参考:https://www.sqlite.org/c3ref/vfs.html + +::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/start.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/start.md new file mode 100644 index 00000000000..aba43809a71 --- /dev/null +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/start.md @@ -0,0 +1,714 @@ +--- +title: 脚本基础 +sidebar_label: 脚本基础 +description: 一份简短教程,引导您了解Pawn语言及SA-MP/open.mp API的基础知识。 +--- + +以下是一个可实现的最基础脚本示例: + +```c +#include + +main() +{ + print("Hello World!"); + return 1; +} +``` + +我们将逐一解析各个组成部分,首先从第一行开始。 + +--- + +## 头文件包含 + +```c +#include +``` + +该指令将 pawno/includes/a_samp.inc 文件内容载入脚本,使其所有功能可用。该文件本身包含: + +```c +#include +#include +#include +#include +#include