From cbd4520e12702631efdbabe86d568e223aff0f81 Mon Sep 17 00:00:00 2001 From: zomo Date: Sun, 27 Jun 2021 20:27:03 -0500 Subject: [PATCH] init --- 2take1.d.ts | 32 +++ D3D.d.ts | 22 ++ Events.d.ts | 18 ++ Hooks.d.ts | 16 ++ Input.d.ts | 25 ++ Menu.d.ts | 26 ++ RAGE/AI.d.ts | 500 +++++++++++++++++++++++++++++++++++++++ RAGE/Audio.d.ts | 15 ++ RAGE/Cam.d.ts | 14 ++ RAGE/Control.d.ts | 15 ++ RAGE/Cutscene.d.ts | 14 ++ RAGE/Decorator.d.ts | 15 ++ RAGE/Entity.d.ts | 73 ++++++ RAGE/Fire.d.ts | 13 + RAGE/Gameplay.d.ts | 35 +++ RAGE/Graphics.d.ts | 55 +++++ RAGE/Interior.d.ts | 15 ++ RAGE/Network.d.ts | 27 +++ RAGE/Object.d.ts | 13 + RAGE/Ped.d.ts | 83 +++++++ RAGE/Player.d.ts | 74 ++++++ RAGE/Script.d.ts | 16 ++ RAGE/ScriptDraw.d.ts | 33 +++ RAGE/Stats.d.ts | 16 ++ RAGE/Streaming.d.ts | 32 +++ RAGE/System.d.ts | 12 + RAGE/Time.d.ts | 14 ++ RAGE/UI.d.ts | 49 ++++ RAGE/Utils.d.ts | 25 ++ RAGE/Vehicle.d.ts | 132 +++++++++++ RAGE/Water.d.ts | 13 + RAGE/Weapon.d.ts | 34 +++ RAGE/Worldprobe.d.ts | 23 ++ package.json | 12 + readme.md | 3 + structs/Feat.d.ts | 103 ++++++++ structs/MenuKey.d.ts | 24 ++ structs/PlayerFeat.d.ts | 42 ++++ structs/Regex.d.ts | 27 +++ structs/RegexResult.d.ts | 39 +++ structs/v2.d.ts | 33 +++ structs/v3.d.ts | 54 +++++ 42 files changed, 1836 insertions(+) create mode 100644 2take1.d.ts create mode 100644 D3D.d.ts create mode 100644 Events.d.ts create mode 100644 Hooks.d.ts create mode 100644 Input.d.ts create mode 100644 Menu.d.ts create mode 100644 RAGE/AI.d.ts create mode 100644 RAGE/Audio.d.ts create mode 100644 RAGE/Cam.d.ts create mode 100644 RAGE/Control.d.ts create mode 100644 RAGE/Cutscene.d.ts create mode 100644 RAGE/Decorator.d.ts create mode 100644 RAGE/Entity.d.ts create mode 100644 RAGE/Fire.d.ts create mode 100644 RAGE/Gameplay.d.ts create mode 100644 RAGE/Graphics.d.ts create mode 100644 RAGE/Interior.d.ts create mode 100644 RAGE/Network.d.ts create mode 100644 RAGE/Object.d.ts create mode 100644 RAGE/Ped.d.ts create mode 100644 RAGE/Player.d.ts create mode 100644 RAGE/Script.d.ts create mode 100644 RAGE/ScriptDraw.d.ts create mode 100644 RAGE/Stats.d.ts create mode 100644 RAGE/Streaming.d.ts create mode 100644 RAGE/System.d.ts create mode 100644 RAGE/Time.d.ts create mode 100644 RAGE/UI.d.ts create mode 100644 RAGE/Utils.d.ts create mode 100644 RAGE/Vehicle.d.ts create mode 100644 RAGE/Water.d.ts create mode 100644 RAGE/Weapon.d.ts create mode 100644 RAGE/Worldprobe.d.ts create mode 100644 package.json create mode 100644 readme.md create mode 100644 structs/Feat.d.ts create mode 100644 structs/MenuKey.d.ts create mode 100644 structs/PlayerFeat.d.ts create mode 100644 structs/Regex.d.ts create mode 100644 structs/RegexResult.d.ts create mode 100644 structs/v2.d.ts create mode 100644 structs/v3.d.ts diff --git a/2take1.d.ts b/2take1.d.ts new file mode 100644 index 0000000..fd97d60 --- /dev/null +++ b/2take1.d.ts @@ -0,0 +1,32 @@ +/** + * Menu Functions + * @public + */ + +type Entity = number; +type Ped = Entity; +type Player = Ped; +type Vehicle = Entity; +type Group = number; +type Hash = number; +type Pickup = Hash; +type Ptfx = number; + +type Thread = number; + +type Feature = number; + +// C++ Types +type vector = object; +type uint8_t = number; +type uint32_t = number; +type int32_t = number; +type uint64_t = number; +type integer = number; +type int = number; +type float = number; +type BYTE = number; +//type wstring = string; + +// lua C++ adjacent types +type table = vector; \ No newline at end of file diff --git a/D3D.d.ts b/D3D.d.ts new file mode 100644 index 0000000..976dd9a --- /dev/null +++ b/D3D.d.ts @@ -0,0 +1,22 @@ +/** + * D3D Functions + * + * These functions should only be used from renderers: feature, which can be set through the renderer property + * + * Renderer callbacks are executed from the d3d thread + * @example + * menu.add_feature("d3d renderer", "toggle", 0, nil).renderer = d3d_draw + * @public + * @noSelf + */ +declare namespace d3d { + + function draw_text(text: string, pos: v2, size: v2, scale: float, color: int, flags: int): void; + function register_sprite(path: string): int; + function draw_sprite(id: int, pos: v2, scale: float, rot: float, color: int): void; + function get_sprite_origin(id: int): v2; + function get_sprite_size(id: int): v2; + function draw_line(start: v2, end: v2, size: int, color: int): void; + function draw_rect(pos: v2, size: v2, color: int): void; + +} \ No newline at end of file diff --git a/Events.d.ts b/Events.d.ts new file mode 100644 index 0000000..ac8b6f4 --- /dev/null +++ b/Events.d.ts @@ -0,0 +1,18 @@ +/** + * Hook Functions + * @public + * @noSelf + */ +declare namespace hook { + + type eventNames = "exit"|"chat"|"player_join"|"player_leave"|"script"; + + function add_event_listener(eventName: "exit", callback: (code: integer) => void|never): int; + function add_event_listener(eventName: "chat", callback: (player: integer, body: string) => void|never): int; + function add_event_listener(eventName: "player_join", callback: (player: integer) => void|never): int; + function add_event_listener(eventName: "player_leave", callback: (player: integer) => void|never): int; + function add_event_listener(eventName: "script", callback: (id: integer, params: vector) => void|never): int; + + function remove_event_listener(eventName: eventNames, id: int): boolean; + +} \ No newline at end of file diff --git a/Hooks.d.ts b/Hooks.d.ts new file mode 100644 index 0000000..0624f6d --- /dev/null +++ b/Hooks.d.ts @@ -0,0 +1,16 @@ +/** + * Hook Functions + * @public + * @noSelf + */ +declare namespace hook { + + type script_event_hook = (source: Player, target: Player, params: int[], count: int) => false|null; + type net_event_hook = (source: Player, target: Player, eventId: int) => false|null; + + function register_script_event_hook(callback: script_event_hook): int + function remove_script_event_hook(id: int): boolean + function register_net_event_hook(callback: net_event_hook): int + function remove_net_event_hook(id: int): boolean + +} \ No newline at end of file diff --git a/Input.d.ts b/Input.d.ts new file mode 100644 index 0000000..afba4a0 --- /dev/null +++ b/Input.d.ts @@ -0,0 +1,25 @@ +/** + * Input Functions + * @public + * @noSelf + */ +declare namespace input { + + enum resonse { + SUCCESS = 0, + PENDING, + FAILED + } + + enum types { + ASCII = 0, + ALPHA, + ALPHA_NUM, + NUM, + NUM_DOT, + FLOAT + } + + function get(title: string, default_value: string, len: int, type: types): [resonse, string]; + +} \ No newline at end of file diff --git a/Menu.d.ts b/Menu.d.ts new file mode 100644 index 0000000..8c418bf --- /dev/null +++ b/Menu.d.ts @@ -0,0 +1,26 @@ + + +/** + * Menu Functions + * @public + * @noSelf + */ +declare namespace menu { + + type featureTypes = "parent"|"toggle"|"action"|"value_i"|"action_value_i"|"autoaction_value_i"; + + function add_feature(name: string, type: featureTypes, parent: Feature, script_handler: (feat: Feat) => void|never): Feat; + function delete_feature(id: int): boolean; + function set_menu_can_navigate(): void; + function get_version(): void; + function add_player_feature(name: string, type: string, parent: integer, script_handler: (feat: Feat) => void|never): PlayerFeat + function get_player_feature(i: uint32_t): PlayerFeat + function is_threading_mode(mode: int): boolean + /** + * @privateRemarks callback declaration may be wrong + */ + function create_thread(callback: (() => void|never), context: any): Thread + function has_thread_finished(id: Thread): boolean + function delete_thread(id: Thread): boolean + +} \ No newline at end of file diff --git a/RAGE/AI.d.ts b/RAGE/AI.d.ts new file mode 100644 index 0000000..3badc40 --- /dev/null +++ b/RAGE/AI.d.ts @@ -0,0 +1,500 @@ +/** + * AI Functions + * @remarks https://pastebin.com/2gFqJ3Px + * @public + * @noSelf + */ +declare namespace ai { + + /** + * @remarks https://pastebin.com/2gFqJ3Px + */ + enum CTask { + HandsUp = 0, + ClimbLadder = 1, + ExitVehicle = 2, + CombatRoll = 3, + AimGunOnFoot = 4, + MovePlayer = 5, + PlayerOnFoot = 6, + Weapon = 8, + PlayerWeapon = 9, + PlayerIdles = 10, + AimGun = 12, + Complex = 12, + FSMClone = 12, + MotionBase = 12, + Move = 12, + MoveBase = 12, + NMBehaviour = 12, + NavBase = 12, + Scenario = 12, + SearchBase = 12, + SearchInVehicleBase = 12, + ShockingEvent = 12, + TrainBase = 12, + VehicleFSM = 12, + VehicleGoTo = 12, + VehicleMissionBase = 12, + VehicleTempAction = 12, + Pause = 14, + DoNothing = 15, + GetUp = 16, + GetUpAndStandStill = 17, + FallOver = 18, + FallAndGetUp = 19, + Crawl = 20, + ComplexOnFire = 25, + DamageElectric = 26, + TriggerLookAt = 28, + ClearLookAt = 29, + SetCharDecisionMaker = 30, + SetPedDefensiveArea = 31, + UseSequence = 32, + MoveStandStill = 34, + ComplexControlMovement = 35, + MoveSequence = 36, + AmbientClips = 38, + MoveInAir = 39, + NetworkClone = 40, + UseClimbOnRoute = 41, + UseDropDownOnRoute = 42, + UseLadderOnRoute = 43, + SetBlockingOfNonTemporaryEvents = 44, + ForceMotionState = 45, + SlopeScramble = 46, + GoToAndClimbLadder = 47, + ClimbLadderFully = 48, + Rappel = 49, + Vault = 50, + DropDown = 51, + AffectSecondaryBehaviour = 52, + AmbientLookAtEvent = 53, + OpenDoor = 54, + ShovePed = 55, + SwapWeapon = 56, + GeneralSweep = 57, + Police = 58, + PoliceOrderResponse = 59, + PursueCriminal = 60, + ArrestPed = 62, + ArrestPed2 = 63, + Busted = 64, + FirePatrol = 65, + HeliOrderResponse = 66, + HeliPassengerRappel = 67, + AmbulancePatrol = 68, + PoliceWantedResponse = 69, + Swat = 70, + SwatWantedResponse = 72, + SwatOrderResponse = 73, + SwatGoToStagingArea = 74, + SwatFollowInLine = 75, + Witness = 76, + GangPatrol = 77, + Army = 78, + ShockingEventWatch = 80, + ShockingEventGoto = 82, + ShockingEventHurryAway = 83, + ShockingEventReactToAircraft = 84, + ShockingEventReact = 85, + ShockingEventBackAway = 86, + ShockingPoliceInvestigate = 87, + ShockingEventStopAndStare = 88, + ShockingNiceCarPicture = 89, + ShockingEventThreatResponse = 90, + TakeOffHelmet = 92, + CarReactToVehicleCollision = 93, + CarReactToVehicleCollisionGetOut = 95, + DyingDead = 97, + WanderingScenario = 100, + WanderingInRadiusScenario = 101, + MoveBetweenPointsScenario = 103, + ChatScenario = 104, + CowerScenario = 106, + DeadBodyScenario = 107, + SayAudio = 114, + WaitForSteppingOut = 116, + CoupleScenario = 117, + UseScenario = 118, + UseVehicleScenario = 119, + Unalerted = 120, + StealVehicle = 121, + ReactToPursuit = 122, + HitWall = 125, + Cower = 126, + Crouch = 127, + Melee = 128, + MoveMeleeMovement = 129, + MeleeActionResult = 130, + MeleeUpperbodyAnims = 131, + MoVEScripted = 133, + ScriptedAnimation = 134, + SynchronizedScene = 135, + ComplexEvasiveStep = 137, + WalkRoundCarWhileWandering = 138, + ComplexStuckInAir = 140, + WalkRoundEntity = 141, + MoveWalkRoundVehicle = 142, + ReactToGunAimedAt = 144, + DuckAndCover = 146, + AggressiveRubberneck = 147, + InVehicleBasic = 150, + CarDriveWander = 151, + LeaveAnyCar = 152, + ComplexGetOffBoat = 153, + CarSetTempAction = 155, + BringVehicleToHalt = 156, + CarDrive = 157, + PlayerDrive = 159, + EnterVehicle = 160, + EnterVehicleAlign = 161, + OpenVehicleDoorFromOutside = 162, + EnterVehicleSeat = 163, + CloseVehicleDoorFromInside = 164, + InVehicleSeatShuffle = 165, + ExitVehicleSeat = 167, + CloseVehicleDoorFromOutside = 168, + ControlVehicle = 169, + MotionInAutomobile = 170, + MotionOnBicycle = 171, + MotionOnBicycleController = 172, + MotionInVehicle = 173, + MotionInTurret = 174, + ReactToBeingJacked = 175, + ReactToBeingAskedToLeaveVehicle = 176, + TryToGrabVehicleDoor = 177, + GetOnTrain = 178, + GetOffTrain = 179, + RideTrain = 180, + MountThrowProjectile = 190, + GoToCarDoorAndStandStill = 195, + MoveGoToVehicleDoor = 196, + SetPedInVehicle = 197, + SetPedOutOfVehicle = 198, + VehicleMountedWeapon = 199, + VehicleGun = 200, + VehicleProjectile = 201, + SmashCarWindow = 204, + MoveGoToPoint = 205, + MoveAchieveHeading = 206, + MoveFaceTarget = 207, + ComplexGoToPointAndStandStillTimed = 208, + MoveGoToPointAndStandStill = 208, + MoveFollowPointRoute = 209, + MoveSeekEntity_CEntitySeekPosCalculatorStandard = 210, + MoveSeekEntity_CEntitySeekPosCalculatorLastNavMeshIntersection = 211, + //MoveSeekEntity_CEntitySeekPosCalculatorLastNavMeshIntersection = 212, + MoveSeekEntity_CEntitySeekPosCalculatorXYOffsetFixed = 213, + //MoveSeekEntity_CEntitySeekPosCalculatorXYOffsetFixed = 214, + ExhaustedFlee = 215, + GrowlAndFlee = 216, + ScenarioFlee = 217, + SmartFlee = 218, + FlyAway = 219, + WalkAway = 220, + Wander = 221, + WanderInArea = 222, + FollowLeaderInFormation = 223, + GoToPointAnyMeans = 224, + TurnToFaceEntityOrCoord = 225, + FollowLeaderAnyMeans = 226, + FlyToPoint = 228, + FlyingWander = 229, + GoToPointAiming = 230, + GoToScenario = 231, + SeekEntityAiming = 233, + SlideToCoord = 234, + SwimmingWander = 235, + MoveTrackingEntity = 237, + MoveFollowNavMesh = 238, + MoveGoToPointOnRoute = 239, + EscapeBlast = 240, + MoveWander = 241, + MoveBeInFormation = 242, + MoveCrowdAroundLocation = 243, + MoveCrossRoadAtTrafficLights = 244, + MoveWaitForTraffic = 245, + MoveGoToPointStandStillAchieveHeading = 246, + MoveGetOntoMainNavMesh = 251, + MoveSlideToCoord = 252, + MoveGoToPointRelativeToEntityAndStandStill = 253, + HelicopterStrafe = 254, + GetOutOfWater = 256, + MoveFollowEntityOffset = 259, + FollowWaypointRecording = 261, + MotionPed = 264, + MotionPedLowLod = 265, + HumanLocomotion = 268, + MotionBasicLocomotionLowLod = 269, + MotionStrafing = 270, + MotionTennis = 271, + MotionAiming = 272, + BirdLocomotion = 273, + FlightlessBirdLocomotion = 274, + FishLocomotion = 278, + QuadLocomotion = 279, + MotionDiving = 280, + MotionSwimming = 281, + MotionParachuting = 282, + MotionDrunk = 283, + RepositionMove = 284, + MotionAimingTransition = 285, + ThrowProjectile = 286, + Cover = 287, + MotionInCover = 288, + AimAndThrowProjectile = 289, + Gun = 290, + AimFromGround = 291, + AimGunVehicleDriveBy = 295, + AimGunScripted = 296, + ReloadGun = 298, + WeaponBlocked = 299, + EnterCover = 300, + ExitCover = 301, + AimGunFromCoverIntro = 302, + AimGunFromCoverOutro = 303, + AimGunBlindFire = 304, + CombatClosestTargetInArea = 307, + CombatAdditionalTask = 308, + InCover = 309, + AimSweep = 313, + SharkCircle = 318, + SharkAttack = 319, + Agitated = 320, + AgitatedAction = 321, + Confront = 322, + Intimidate = 323, + Shove = 324, + Shoved = 325, + CrouchToggle = 327, + Revive = 328, + Parachute = 334, + ParachuteObject = 335, + TakeOffPedVariation = 336, + CombatSeekCover = 339, + CombatFlank = 341, + Combat = 342, + CombatMounted = 343, + MoveCircle = 344, + MoveCombatMounted = 345, + Search = 346, + SearchOnFoot = 347, + SearchInAutomobile = 348, + SearchInBoat = 349, + SearchInHeli = 350, + ThreatResponse = 351, + Investigate = 352, + StandGuardFSM = 353, + Patrol = 354, + ShootAtTarget = 355, + SetAndGuardArea = 356, + StandGuard = 357, + Separate = 358, + StayInCover = 359, + VehicleCombat = 360, + VehiclePersuit = 361, + VehicleChase = 362, + DraggingToSafety = 363, + DraggedToSafety = 364, + VariedAimPose = 365, + MoveWithinAttackWindow = 366, + MoveWithinDefensiveArea = 367, + ShootOutTire = 368, + ShellShocked = 369, + BoatChase = 370, + BoatCombat = 371, + BoatStrafe = 372, + HeliChase = 373, + HeliCombat = 374, + SubmarineCombat = 375, + SubmarineChase = 376, + PlaneChase = 377, + TargetUnreachable = 378, + TargetUnreachableInInterior = 379, + TargetUnreachableInExterior = 380, + StealthKill = 381, + Writhe = 382, + Advance = 383, + Charge = 384, + MoveToTacticalPoint = 385, + ToHurtTransit = 386, + AnimatedHitByExplosion = 387, + NMRelax = 388, + NMPose = 390, + NMBrace = 391, + NMBuoyancy = 392, + NMInjuredOnGround = 393, + NMShot = 394, + NMHighFall = 395, + NMBalance = 396, + NMElectrocute = 397, + NMPrototype = 398, + NMExplosion = 399, + NMOnFire = 400, + NMScriptControl = 401, + NMJumpRollFromRoadVehicle = 402, + NMFlinch = 403, + NMSit = 404, + NMFallDown = 405, + BlendFromNM = 406, + NMControl = 407, + NMDangle = 408, + NMGenericAttach = 411, + NMDrunk = 412, + NMDraggingToSafety = 413, + NMThroughWindscreen = 414, + NMRiverRapids = 415, + NMSimple = 416, + RageRagdoll = 417, + JumpVault = 420, + Jump = 421, + Fall = 422, + ReactAimWeapon = 424, + Chat = 425, + MobilePhone = 426, + ReactToDeadPed = 427, + SearchForUnknownThreat = 429, + Bomb = 431, + Detonator = 432, + AnimatedAttach = 434, + CutScene = 440, + ReactToExplosion = 441, + ReactToImminentExplosion = 442, + DiveToGround = 443, + ReactAndFlee = 444, + Sidestep = 445, + CallPolice = 446, + ReactInDirection = 447, + ReactToBuddyShot = 448, + VehicleGoToAutomobileNew = 453, + VehicleGoToPlane = 454, + VehicleGoToHelicopter = 455, + VehicleGoToSubmarine = 456, + VehicleGoToBoat = 457, + VehicleGoToPointAutomobile = 458, + VehicleGoToPointWithAvoidanceAutomobile = 459, + VehiclePursue = 460, + VehicleRam = 461, + VehicleSpinOut = 462, + VehicleApproach = 463, + VehicleThreePointTurn = 464, + VehicleDeadDriver = 465, + VehicleCruiseNew = 466, + VehicleCruiseBoat = 467, + VehicleStop = 468, + VehiclePullOver = 469, + VehiclePassengerExit = 470, + VehicleFlee = 471, + VehicleFleeAirborne = 472, + VehicleFleeBoat = 473, + VehicleFollowRecording = 474, + VehicleFollow = 475, + VehicleBlock = 476, + VehicleBlockCruiseInFront = 477, + VehicleBlockBrakeInFront = 478, + VehicleBlockBackAndForth = 479, + VehicleCrash = 480, + VehicleLand = 481, + VehicleLandPlane = 482, + VehicleHover = 483, + VehicleAttack = 484, + VehicleAttackTank = 485, + VehicleCircle = 486, + VehiclePoliceBehaviour = 487, + VehiclePoliceBehaviourHelicopter = 488, + VehiclePoliceBehaviourBoat = 489, + VehicleEscort = 490, + VehicleHeliProtect = 491, + VehiclePlayerDriveAutomobile = 493, + VehiclePlayerDriveBike = 494, + VehiclePlayerDriveBoat = 495, + VehiclePlayerDriveSubmarine = 496, + VehiclePlayerDriveSubmarineCar = 497, + VehiclePlayerDrivePlane = 498, + VehiclePlayerDriveHeli = 499, + VehiclePlayerDriveAutogyro = 500, + VehiclePlayerDriveDiggerArm = 501, + VehiclePlayerDriveTrain = 502, + VehiclePlaneChase = 503, + VehicleNoDriver = 504, + VehicleAnimation = 505, + VehicleConvertibleRoof = 506, + VehicleParkNew = 507, + VehicleFollowWaypointRecording = 508, + VehicleGoToNavmesh = 509, + VehicleReactToCopSiren = 510, + VehicleGotoLongRange = 511, + VehicleWait = 512, + VehicleReverse = 513, + VehicleBrake = 514, + VehicleHandBrake = 515, + VehicleTurn = 516, + VehicleGoForward = 517, + VehicleSwerve = 518, + VehicleFlyDirection = 519, + VehicleHeadonCollision = 520, + VehicleBoostUseSteeringAngle = 521, + VehicleShotTire = 522, + VehicleBurnout = 523, + VehicleRevEngine = 524, + VehicleSurfaceInSubmarine = 525, + VehiclePullAlongside = 526, + VehicleTransformToSubmarine = 527, + AnimatedFallback = 528 + } + + function task_goto_entity(e: Entity, target: Entity, duration: int, distance: float, speed: float): void; + function task_combat_ped(ped: Ped, target: Ped, a3: int, a4: int): boolean; + function task_go_to_coord_by_any_means(ped: Ped, coords: v3, speed: float, p4: any, p5: boolean, walkStyle: int, a7: float): any; + function task_wander_standard(ped: Ped, unk0: float, unk1: boolean): boolean; + function task_vehicle_drive_wander(ped: Ped, vehicle: Vehicle, speed: float, driveStyle: int): void; + function task_start_scenario_in_place(ped: Ped, name: string, unkDelay: int, playEnterAnim: boolean): void; + function task_start_scenario_at_position(ped: Ped, name: string, coord: v3, heading: float, duration: int, sittingScenario: boolean, teleport: boolean): void; + function task_stand_guard(ped: Ped, coord: v3, heading: float, name: string): void; + function play_anim_on_running_scenario(ped: Ped, dict: string, name: string): void; + function does_scenario_group_exist(name: string): boolean; + function is_scenario_group_enabled(name: string): boolean; + function set_scenario_group_enabled(name: string, b: boolean): boolean; + function reset_scenario_groups_enabled(): void; + function set_exclusive_scenario_group(name: string): boolean; + function reset_exclusive_scenario_group(): boolean; + function is_scenario_type_enabled(name: string): boolean; + function set_scenario_type_enabled(name: string, b: boolean): boolean; + function reset_scenario_types_enabled(): void; + function is_ped_active_in_scenario(ped: Ped): boolean; + function task_follow_to_offset_of_entity(ped: Ped, entity: Entity, offset: v3, speed: float, timeout: int, stopRange: float, persistFollowing: boolean): void; + function task_vehicle_drive_to_coord_longrange(ped: Ped, vehicle: Vehicle, pos: v3, speed: float, mode: int, stopRange: float): void; + function task_shoot_at_entity(entity: Entity, target: Entity, duration: int, firingPattern: Hash): void; + function task_vehicle_escort(ped: Ped, vehicle: Vehicle, targetVehicle: Vehicle, mode: int, speed: float, drivingStyle: int, minDistance: float, a8: int, noRoadsDistance: float): void; + function task_vehicle_follow(driver: Ped, vehicle: Vehicle, targetEntity: Entity, speed: float, drivingStyle: int, minDistance: int): void; + function task_vehicle_drive_to_coord(ped: Ped, vehicle: Vehicle, coord: v3, speed: float, a5: int, vehicleModel: Hash, driveMode: int, stopRange: float, a9: float): void; + function task_vehicle_shoot_at_coord(ped: Ped, coord: v3, a3: float): void; + function task_vehicle_shoot_at_ped(ped: Ped, target: Ped, a3: float): void; + function task_vehicle_aim_at_coord(ped: Ped, coord: v3): void; + function task_vehicle_aim_at_ped(ped: Ped, target: Ped): void; + function task_stay_in_cover(ped: Ped): void; + function task_go_to_coord_while_aiming_at_coord(ped: Ped, gotoCoord: v3, aimCoord: v3, moveSpeed: float, a5: boolean, a6: float, a7: float, a8: boolean, flags: any, a10: boolean, firingPattern: Hash): void; + function task_go_to_coord_while_aiming_at_entity(ped: Ped, gotoCoord: v3, target: Entity, moveSpeed: float, a5: boolean, a6: float, a7: float, a8: boolean, flags: any, a10: boolean, firingPattern: Hash): void; + function task_go_to_entity_while_aming_at_coord(ped: Ped, gotoEntity: Entity, aimCoord: v3, a4: float, shoot: boolean, a6: float, a7: float, a8: boolean, a9: boolean, firingPattern: Hash): void; + function task_go_to_entity_while_aiming_at_entity(ped: Ped, gotoEntity: Entity, target: Entity, a4: float, shoot: boolean, a6: float, a7: float, a8: boolean, a9: boolean, firingPattern: Hash): void; + function task_open_vehicle_door(ped: Ped, vehicle: Vehicle, timeOut: int, doorIndex: int, speed: float): void; + function task_enter_vehicle(ped: Ped, vehicle: Vehicle, timeout: int, seat: int, speed: float, flag: uint32_t, p6: any): void; + function task_leave_vehicle(ped: Ped, vehicle: Vehicle, flag: uint32_t): void; + function task_sky_dive(ped: Ped, a2: boolean): void; + function task_parachute(ped: Ped, a2: boolean, a3: boolean): void; + function task_parachute_to_target(ped: Ped, coord: v3): void; + function set_parachute_task_target(ped: Ped, coord: v3): void; + function set_parachute_task_thrust(ped: Ped, thrust: float): void; + function task_rappel_from_heli(ped: Ped, a2: float): void; + function task_vehicle_chase(driver: Ped, target: Entity): void; + function set_task_vehicle_chase_behaviour_flag(ped: Ped, flag: int, set: boolean): void; + function set_task_vehicle_chase_ideal_persuit_distance(ped: Ped, dist: float): void; + function task_shoot_gun_at_coord(ped: Ped, coord: v3, duration: int, firingPattern: Hash): void; + function task_aim_gun_at_coord(ped: Ped, coord: v3, time: int, a4: boolean, a5: boolean): void; + function task_turn_ped_to_face_entity(ped: Ped, entity: Entity, duration: int): void; + function task_aim_gun_at_entity(ped: Ped, entity: Entity, duration: int, a4: boolean): void; + function is_task_active(ped: Ped, taskId: any): boolean; + +} + diff --git a/RAGE/Audio.d.ts b/RAGE/Audio.d.ts new file mode 100644 index 0000000..07bb296 --- /dev/null +++ b/RAGE/Audio.d.ts @@ -0,0 +1,15 @@ +/** + * Audio Functions + * @public + * @noSelf + */ +declare namespace audio { + + function play_sound(soundId: int, audioName: string, audioRef: string, p4: boolean, p5: any, p6: boolean): void; + function play_sound_frontend(soundId: int, audioName: string, audioRef: string, p4: boolean): void; + function play_sound_from_entity(soundId: int, audioName: string, entity: Entity, audioRef: string): void; + function play_sound_from_coord(soundId: int, audioName: string, pos: v3, audioRef: string, a5: boolean, range: int, a7: boolean): void; + function stop_sound(soundId: int): void; + +} + diff --git a/RAGE/Cam.d.ts b/RAGE/Cam.d.ts new file mode 100644 index 0000000..76cf430 --- /dev/null +++ b/RAGE/Cam.d.ts @@ -0,0 +1,14 @@ +/** + * Cam Functions + * @public + * @noSelf + */ +declare namespace cam { + + function get_gameplay_cam_rot(): v3; + function get_gameplay_cam_pos(): v3; + function get_gameplay_cam_relative_pitch(): float; + function get_gameplay_cam_relative_yaw(): float; + +} + diff --git a/RAGE/Control.d.ts b/RAGE/Control.d.ts new file mode 100644 index 0000000..3f133ae --- /dev/null +++ b/RAGE/Control.d.ts @@ -0,0 +1,15 @@ +/** + * Control Functions + * @public + * @noSelf + */ +declare namespace control { + + function disable_control_action(inputGroup: int, control: int, disable: boolean): boolean; + function is_control_just_pressed(inputGroup: int, control: int): boolean; + function is_disabled_control_just_pressed(inputGroup: int, control: int): boolean; + function is_control_pressed(inputGroup: int, control: int): boolean; + function is_disabled_control_pressed(inputGroup: int, control: int): boolean; + +} + diff --git a/RAGE/Cutscene.d.ts b/RAGE/Cutscene.d.ts new file mode 100644 index 0000000..92d772b --- /dev/null +++ b/RAGE/Cutscene.d.ts @@ -0,0 +1,14 @@ +/** + * Cutscene Functions + * @public + * @noSelf + */ +declare namespace cutscene { + + function stop_cutscene_immediately(): void; + function remove_cutscene(): void; + function is_cutscene_active(): boolean; + function is_cutscene_playing(): boolean; + +} + diff --git a/RAGE/Decorator.d.ts b/RAGE/Decorator.d.ts new file mode 100644 index 0000000..6c44d88 --- /dev/null +++ b/RAGE/Decorator.d.ts @@ -0,0 +1,15 @@ +/** + * Decorator Functions + * @public + * @noSelf + */ +declare namespace decorator { + + function decor_register(name: string, type: int): void; + function decor_exists_on(e: Entity, decor: string): boolean; + function decor_remove(e: Entity, decor: string): boolean; + function decor_get_int(entity: Entity, name: string): int; + function decor_set_int(entity: Entity, name: string, value: int) : boolean; + +} + diff --git a/RAGE/Entity.d.ts b/RAGE/Entity.d.ts new file mode 100644 index 0000000..8606f9b --- /dev/null +++ b/RAGE/Entity.d.ts @@ -0,0 +1,73 @@ +/** + * Entity Functions + * @public + * @noSelf + */ +declare namespace entity { + + function get_entity_coords(entity: Entity): v3; + function set_entity_coords_no_offset(entity: Entity, pos: v3): boolean; + function get_entity_rotation(entity: Entity): v3; + function set_entity_rotation(entity: Entity, rot: v3): boolean; + function set_entity_heading(entity: Entity, heading: float): boolean; + function set_entity_velocity(entity: Entity, velocity: v3): boolean; + function get_entity_velocity(entity: Entity): v3; + function is_an_entity(entity: Entity): boolean; + function is_entity_a_ped(entity: Entity): boolean; + function is_entity_a_vehicle(entity: Entity): boolean; + function is_entity_an_object(entity: Entity): boolean; + function is_entity_dead(entity: Entity): boolean; + function is_entity_on_fire(entity: Entity): boolean; + function is_entity_visible(entity: Entity): boolean; + function is_entity_attached(entity: Entity): boolean; + function set_entity_visible(entity: Entity, toggle: boolean): boolean; + function get_entity_type(entity: Entity): int; + function set_entity_gravity(entity: Entity, gravity: boolean): boolean; + function apply_force_to_entity(ped: Ped, forceType: int, x: float, y: float, z: float, rx: float, ry: float, rz: float, isRel: boolean, highForce: boolean): void; + function get_entity_attached_to(entity: Entity): Entity; + function detach_entity(e: Entity): boolean; + function get_entity_model_hash(e: Entity): Hash; + function get_entity_heading(entity: Entity): float; + function attach_entity_to_entity(subject: Entity, target: Entity, boneIndex: int, offset: v3, rot: v3, softPinning: boolean, collision: boolean, isPed: boolean, vertexIndex: int, fixedRot: boolean): boolean; + function set_entity_as_mission_entity(entity: Entity, toggle: boolean, unk: boolean): void; + function set_entity_collision(entity: Entity, toggle: boolean, physics: boolean, unk0: boolean): boolean; + function is_entity_in_air(entity: Entity): boolean; + function set_entity_as_no_longer_needed(entity: Entity): boolean; + function set_entity_no_collsion_entity(entity: Entity, target: Entity, unk: boolean): boolean; + function freeze_entity(entity: Entity, toggle: boolean): void; + function get_entity_offset_from_coords(lEntity: Entity, coords: v3): [boolean, v3]; + function get_entity_offset_from_entity(lEntity: Entity, lEntity2: Entity): [boolean, v3]; + function set_entity_alpha(entity: Entity, alpha: int, skinput: boolean): void; + function reset_entity_alpha(entity: Entity): void; + function delete_entity(e: Entity): boolean; + function set_entity_god_mode(entity: Entity, toggle: boolean): void; + function get_entity_god_mode(entity: Entity): boolean; + function is_entity_in_water(entity: Entity): boolean; + function get_entity_speed(entity: Entity): float; + function set_entity_lights(entity: Entity, toggle: boolean): void; + function set_entity_max_speed(entity: Entity, speed: float): void; + function get_entity_pitch(entity: Entity): float; + function get_entity_roll(e: Entity): float; + function get_entity_physics_rotation(e: Entity): v3; + function get_entity_physics_heading(e: Entity): float; + function get_entity_physics_pitch(e: Entity): float; + function get_entity_physics_roll(e: Entity): float; + function does_entity_have_physics(entity: Entity): boolean; + function get_entity_rotation_velocity(entity: Entity): v3; + function get_entity_submerged_level(entity: Entity): float; + function get_entity_population_type(entity: Entity): int32_t; + function is_entity_static(entity: Entity): boolean; + function is_entity_in_zone(entity: Entity, zone: string): boolean; + function is_entity_upright(entity: Entity, angle: float): boolean; + function is_entity_upside_down(entity: Entity): boolean; + function has_entity_been_damaged_by_any_object(entity: Entity): boolean; + function has_entity_been_damaged_by_any_vehicle(entity: Entity): boolean; + function has_entity_been_damaged_by_any_ped(entity: Entity): boolean; + function has_entity_been_damaged_by_entity(e1: Entity, e2: Entity): boolean; + function does_entity_have_drawable(entity: Entity): boolean; + function has_entity_collided_with_anything(entity: Entity): boolean; + function get_entity_entity_has_collided_with(entity: Entity): Entity; + function get_entity_bone_index_by_name(entity: Entity, name: string): int; + +} + diff --git a/RAGE/Fire.d.ts b/RAGE/Fire.d.ts new file mode 100644 index 0000000..204b76d --- /dev/null +++ b/RAGE/Fire.d.ts @@ -0,0 +1,13 @@ +/** + * Fire Functions + * @public + * @noSelf + */ +declare namespace fire { + + function add_explosion(pos: v3, type: int, isAudible: boolean, isInvis: boolean, fCamShake: float, owner: Ped): boolean; + function start_entity_fire(ped: Ped): Ped; + function stop_entity_fire(ped: Ped): void; + +} + diff --git a/RAGE/Gameplay.d.ts b/RAGE/Gameplay.d.ts new file mode 100644 index 0000000..f2076f1 --- /dev/null +++ b/RAGE/Gameplay.d.ts @@ -0,0 +1,35 @@ +/** + * Gameplay Functions + * @public + * @noSelf + */ +declare namespace gameplay { + + function get_hash_key(input: string): Hash; + function display_onscreen_keyboard(title: string, default_text: string, maxLength: int): void; + function update_onscreen_keyboard(): boolean; + function get_onscreen_keyboard_result(): string; + function is_onscreen_keyboard_active(): boolean; + function set_override_weather(weatherIndex: int): void; + function clear_override_weather(): void; + function set_blackout(toggle: boolean): void; + function set_mobile_radio(toggle: boolean): void; + function get_game_state(): int; + function is_game_state(num: int): boolean; + function clear_area_of_objects(coord: v3, radius: float, flags: int): void; + function clear_area_of_vehicles(coord: v3, radius: float, a3: boolean, a4: boolean, a5: boolean, a6: boolean, a7: boolean): void; + function clear_area_of_peds(coord: v3, radius: float, a3: boolean): void; + function clear_area_of_cops(coord: v3, radius: float, a3: boolean): void; + function set_cloud_hat_opacity(opacity: float): void; + function get_cloud_hat_opacity(): float; + function preload_cloud_hat(szName: string): void; + function clear_cloud_hat(): void; + function load_cloud_hat(szName: string, transitionTime: float): void; + function unload_cloud_hat(szName: string, a2: float): void; + function get_ground_z(pos: v3): [boolean,float]; + function get_frame_count(): uint64_t; + function get_frame_time(): float; + function shoot_single_bullet_between_coords(start: v3, end: v3, damage: int32_t, weapon: Hash, owner: Ped, audible: boolean, invisible: boolean, speed: float): boolean; + +} + diff --git a/RAGE/Graphics.d.ts b/RAGE/Graphics.d.ts new file mode 100644 index 0000000..927538f --- /dev/null +++ b/RAGE/Graphics.d.ts @@ -0,0 +1,55 @@ +/** + * Graphics Functions + * @public + * @noSelf + */ +declare namespace graphics { + + function get_screen_height(): int; + function get_screen_width(): int; + function request_named_ptfx_asset(asset: string): void; + function has_named_ptfx_asset_loaded(asset: string): boolean; + function set_next_ptfx_asset(asset: string): void; + function set_next_ptfx_asset_by_hash(hash: Hash): void; + function start_ptfx_looped_on_entity(name: string, e: Entity, offset: v3, rot: v3, scale: float): Ptfx; + function start_ptfx_non_looped_on_entity(name: string, e: Entity, offset: v3, rot: v3, scale: float): boolean; + function remove_ptfx_from_entity(entity: Entity): void; + function does_looped_ptfx_exist(ptfx: Ptfx): boolean; + function start_particle_fx_looped_at_coord(name: string, pos: v3, rot: v3, scale: float, xAxis: boolean, yAxis: boolean, zAxis: boolean, a8: boolean): Ptfx; + function start_particle_fx_non_looped_at_coord(name: string, pos: v3, rot: v3, scale: float, xAxis: boolean, yAxis: boolean, zAxis: boolean): boolean; + function start_networked_particle_fx_non_looped_at_coord(name: string, pos: v3, rot: v3, scale: float, xAxis: boolean, yAxis: boolean, zAxis: boolean): boolean; + function remove_particle_fx(ptfx: Ptfx, a2: boolean): void; + function remove_particle_fx_in_range(pos: v3, range: float): void; + function set_particle_fx_looped_offsets(ptfx: Ptfx, pos: v3, rot: v3): void; + function set_particle_fx_looped_evolution(ptfx: Ptfx, propertyName: string, amount: float, a4: boolean): void; + function set_particle_fx_looped_color(ptfx: Ptfx, r: float, b: float, g: float, a5: boolean): void; + function set_particle_fx_looped_alpha(ptfx: Ptfx, a: float): void; + function set_particle_fx_looped_scale(ptfx: Ptfx, scale: float): void; + function set_particle_fx_looped_far_clip_dist(ptfx: Ptfx, dist: float): void; + function enable_clown_blood_vfx(toggle: boolean): void; + function enable_alien_blood_vfx(toggle: boolean): void; + function animpostfx_play(effect: Hash, duration: int32_t, looped: boolean): void; + function animpostfx_stop(effect: Hash): void; + function animpostfx_is_running(effect: Hash): boolean; + function animpostfx_stop_all(): void; + function request_scaleform_movie(szName: string): any; + function begin_scaleform_movie_method(scaleform: any, szMethod: string): boolean; + function scaleform_movie_method_add_param_texture_name_string(val: string): void; + function scaleform_movie_method_add_param_int(val: int32_t): void; + function scaleform_movie_method_add_param_float(val: float): void; + function scaleform_movie_method_add_param_boolean(val: boolean): void; + function draw_scaleform_movie_fullscreen(scaleform: any, r: int, g: int, b: int, a: int, a6: int): void; + function draw_scaleform_movie(scaleform: any, x: float, y: float, w: float, h: float, r: int, g: int, b: int, a: int, a10: int): void; + function end_scaleform_movie_method(): void; + function draw_marker(type: any, pos: v3, dir: v3, rot: v3, scale: v3, red: int, green: int, blue: int, alpha: int, bobUpAndDown: boolean, faceCam: boolean, a12: int, rotate: boolean, textureDict: string|null, textureName: string|null, drawOntEnts: boolean): void; + function create_checkpoint(type: any, thisPos: v3, nextPos: v3, radius: float, red: int, green: int, blue: int, alpha: int, reserved: int): any; + function set_checkpoint_icon_height(checkpoint: any, height: float): void; + function set_checkpoint_cylinder_height(checkpoint: any, nearHeight: float, farHeight: float, radius: float): void; + function set_checkpoint_rgba(checkpoint: any, r: int, g: int, b: int, a: int): void; + function set_checkpoint_icon_rgba(checkpoint: any, r: int, g: int, b: int, a: int): void; + function delete_checkpoint(checkpoint: any): void; + function has_scaleform_movie_loaded(scaleform: any): boolean; + function set_scaleform_movie_as_no_longer_needed(scaleform: any): void; + +} + diff --git a/RAGE/Interior.d.ts b/RAGE/Interior.d.ts new file mode 100644 index 0000000..8b93f69 --- /dev/null +++ b/RAGE/Interior.d.ts @@ -0,0 +1,15 @@ +/** + * Interior Functions + * @public + * @noSelf + */ +declare namespace interior { + + function get_interior_from_entity(entity: Entity): any; + function get_interior_at_coords_with_type(coords: v3, interiorType: string): any; + function enable_interior_prop(id: any, prop: string): void; + function disable_interior_prop(id: any, prop: string): void; + function refresh_interior(id: any): void; + +} + diff --git a/RAGE/Network.d.ts b/RAGE/Network.d.ts new file mode 100644 index 0000000..7c843ae --- /dev/null +++ b/RAGE/Network.d.ts @@ -0,0 +1,27 @@ +/** + * Network Functions + * @public + * @noSelf + */ +declare namespace network { + + function network_is_host(): boolean; + function has_control_of_entity(entity: Entity): boolean; + function request_control_of_entity(entity: Entity): boolean; + function is_session_started(): boolean; + function network_session_kick_player(player: Player): void; + function is_friend_online(name: string): boolean; + function is_friend_in_multiplayer(name: string): boolean; + function get_friend_scid(name: string): uint32_t; + function get_friend_count(): uint32_t; + function get_max_friends(): uint32_t; + function network_hash_from_player(player: Player): Hash; + function get_friend_index_name(index: uint32_t): string|null; + function is_friend_index_online(index: uint32_t): boolean; + function is_scid_friend(scid: uint32_t): boolean; + function get_entity_player_is_spectating(player: Player): Entity|null; + function get_player_player_is_spectating(player: Player): Player|null; + function send_chat_message(msg: string, teamOnly: boolean): boolean; + +} + diff --git a/RAGE/Object.d.ts b/RAGE/Object.d.ts new file mode 100644 index 0000000..3395b2f --- /dev/null +++ b/RAGE/Object.d.ts @@ -0,0 +1,13 @@ +/** + * Object Functions + * @public + * @noSelf + */ +declare namespace object { + + function create_object(model: Hash, pos: v3, networked: boolean, dynamic: boolean): Object ; + function get_all_objects(): vector; + function get_all_pickups(): vector; + +} + diff --git a/RAGE/Ped.d.ts b/RAGE/Ped.d.ts new file mode 100644 index 0000000..a0181fe --- /dev/null +++ b/RAGE/Ped.d.ts @@ -0,0 +1,83 @@ +/** + * Ped Functions + * @public + * @noSelf + */ +declare namespace ped { + + function is_ped_in_any_vehicle(ped: Ped): boolean; + function set_group_formation(group: Ped, formation: int): boolean; + function set_ped_as_group_member(ped: Ped, groupId: int): boolean; + function get_ped_group(ped: Ped): Group; + function get_group_size(group: int): int; + function get_ped_health(ped: Ped): float; + function set_ped_health(ped: Ped, value: float): boolean; + function is_ped_ragdoll(ped: Ped): boolean; + function is_ped_a_player(ped: Ped): boolean; + function get_current_ped_weapon(ped: Ped): Hash; + function set_ped_into_vehicle(ped: Ped, vehicle: Vehicle, seat: int): boolean; + function get_ped_drawable_variation(ped: Ped, group: int): int; + function get_ped_texture_variation(ped: Ped, group: int): int; + function get_ped_prop_index(ped: Ped, group: int): int; + function get_ped_prop_texture_index(ped: Ped, group: int): int; + function set_ped_component_variation(ped: Ped, component: int, drawable: int, texture: int, pallette: int): boolean; + function set_ped_prop_index(ped: Ped, component: int, drawable: int, texture: int, unk: int): boolean; + function set_ped_can_switch_weapons(ped: Ped, toggle: boolean): void; + function is_ped_shooting(ped: Ped): boolean; + function get_ped_bone_index(ped: Ped, bone: int): int; + function get_ped_bone_coords(ped: Ped, boneId: Hash, offset: v3): [boolean, v3]; + function get_ped_relationship_group_hash(ped: Ped): Hash; + function set_ped_relationship_group_hash(ped: Ped, hash: Hash): void; + function get_vehicle_ped_is_using(ped: Ped): Vehicle; + function clear_all_ped_props(ped: Ped): void; + function clear_ped_tasks_immediately(ped: Ped): int; + function clear_ped_blood_damage(ped: Ped): void; + function is_ped_in_vehicle(ped: Ped, vehicle: Vehicle): boolean; + function is_ped_using_any_scenario(ped: Ped): boolean; + function set_ped_to_ragdoll(ped: Ped, time1: int, time2: int, type: int): boolean; + function set_ped_can_ragdoll(ped: Ped, toggle: boolean): boolean; + function can_ped_ragdoll(ped: Ped): boolean; + function get_ped_last_weapon_impact(ped: Ped): [boolean, v3]; + function set_ped_combat_ability(ped: Ped, ability: BYTE): boolean; + function get_ped_max_health(entity: Entity): float; + function set_ped_max_health(entity: Entity, health: float): boolean; + function resurrect_ped(ped: Ped): boolean; + function set_ped_combat_movement(ped: Ped, type: int): void; + function set_ped_combat_range(ped: Ped, type: int): void; + function set_ped_combat_attributes(ped: Ped, attr: int, toggle: boolean): void; + function set_ped_accuracy(ped: Ped, accuracy: int): void; + function create_ped(type: int, model: Hash, pos: v3, heading: float, isNetworked: boolean, unk1: boolean): Ped; + function get_number_of_ped_drawable_variations(ped: Ped, comp: int): int; + function get_number_of_ped_texture_variations(ped: Ped, comp: int, draw: int): int; + function get_number_of_ped_prop_drawable_variations(ped: Ped, groupId: int): int; + function get_number_of_ped_prop_texture_variations(ped: Ped, groupId: int, drawId: int): int; + function set_ped_random_component_variation(ped: Ped): void; + function set_ped_default_component_variation(ped: Ped): void; + function set_ped_movement_clipset(ped: Ped, szClipset: string): void; + function reset_ped_movement_clipset(ped: Ped, unk0: boolean): void; + function clone_ped(ped: Ped): Ped; + function set_ped_config_flag(ped: Ped, flag: int, value: uint8_t): boolean; + function set_ped_ragdoll_blocking_flags(ped: Ped, flags: int): boolean; + function reset_ped_ragdoll_blocking_flags(ped: Ped, flags: int): boolean; + function set_ped_density_multiplier_this_frame(mult: float): void; + function set_scenario_ped_density_multiplier_this_frame(m1: float, m2: float): void; + function get_all_peds(): vector; + function create_group(): Group; + function remove_group(group: Group): void; + function set_ped_as_group_leader(ped: Ped, group: Group): void; + function remove_ped_from_group(ped: Ped): void; + function is_ped_group_member(ped: Ped, group: Group): boolean; + function set_group_formation_spacing(group: Group, a2: float, a3: float, a4: float): boolean; + function reset_group_formation_default_spacing(group: Group): boolean; + function set_ped_never_leaves_group(ped: Ped, toggle: boolean): void; + function does_group_exist(group: Group): boolean; + function is_ped_in_group(ped: Ped): boolean; + function set_create_random_cops(t: boolean): void; + function can_create_random_cops(): boolean; + function is_ped_swimming(ped: Ped): boolean; + function is_ped_swimming_underwater(ped: Ped): boolean; + function clear_relationship_between_groups(group1: Hash, group2: Hash): void; + function set_relationship_between_groups(relation: int, group1: Hash, group2: Hash): void; + +} + diff --git a/RAGE/Player.d.ts b/RAGE/Player.d.ts new file mode 100644 index 0000000..00962ba --- /dev/null +++ b/RAGE/Player.d.ts @@ -0,0 +1,74 @@ +/** + * Player Functions + * @public + * @noSelf + */ +declare namespace player { + + enum eModderDetectionFlags { + MDF_MANUAL = 1 << 0x00, + MDF_PLAYER_MODEL = 1 << 0x01, + MDF_SCID_0 = 1 << 0x02, + MDF_SCID_SPOOF = 1 << 0x03, + MDF_INVALID_OBJECT_CRASH = 1 << 0x04, + MDF_INVALID_PED_CRASH = 1 << 0x05, + MDF_CLONE_SPAWN = 1 << 0x06, + MDF_MODEL_CHANGE_CRASH = 1 << 0x07, + MDF_PLAYER_MODEL_CHANGE = 1 << 0x08, + MDF_RAC = 1 << 0x09, + MDF_MONEY_DROP = 1 << 0x0A, + MDF_SEP = 1 << 0x0B, + MDF_ATTACH_OBJECT = 1 << 0x0C, + MDF_ATTACH_PED = 1 << 0x0D, + + MDF_ENDS = 1 << 0x0E + } + + function get_player_ped(player: Player): Ped; + function player_id(): Player; + function set_player_model(hash: Hash): void; + function get_player_group(player: Player): Group; + function is_player_female(player: Player): boolean; + function is_player_friend(player: Player): boolean; + function is_player_playing(player: Player): boolean; + function is_player_free_aiming(player: Player): boolean; + function get_entity_player_is_aiming_at(player: Player): Entity; + function get_personal_vehicle(): Vehicle; + function set_player_visible_locally(player: Player, toggle: boolean): void; + function set_local_player_visible_locally(toggle: boolean): void; + function set_player_as_modder(player: Player, flags: int): void; + function get_player_name(player: Player): string; + function get_player_scid(player: Player): int; + function is_player_pressing_horn(player: Player): boolean; + function get_player_ip(player: Player): int; + function is_player_modder(player: Player, mask: int): boolean; + function is_player_god(player: Player): boolean; + function get_player_wanted_level(player: Player): int; + function player_count(): int; + function is_player_in_any_vehicle(player: Player): boolean; + function get_player_coords(player: Player): v3; + function get_player_heading(player: Player): float; + function get_player_health(player: Player): float; + function get_player_max_health(player: Player): float; + function get_player_armour(player: Player): float; + function get_player_from_ped(ped: Ped): int; + function get_player_team(player: Player): int; + function get_player_vehicle(player: Player): Vehicle; + function is_player_vehicle_god(player: Player): boolean; + function is_player_host(player: Player): boolean; + function get_host(): Player; + function is_player_spectating(player: Player): boolean; + function get_player_model(player: Player): Hash; + function send_player_sms(player: Player, msg: string): boolean; + function unset_player_as_modder(player: Player, flags: int): boolean; + function get_player_modder_flags(player: Player): int; + function get_modder_flag_text(flag: int): string; + function get_modder_flag_ends(): int; + function add_modder_flag(text: string): int; + function is_player_valid(player: Player): boolean; + function get_player_host_token(player: Player): int; + function get_player_host_priority(player: Player): int; + function set_player_targeting_mode(mode: int): void; + +} + diff --git a/RAGE/Script.d.ts b/RAGE/Script.d.ts new file mode 100644 index 0000000..ab66b9d --- /dev/null +++ b/RAGE/Script.d.ts @@ -0,0 +1,16 @@ +/** + * Script Functions + * @public + * @noSelf + */ +declare namespace script { + + function trigger_script_event(eventId: int, player: Player, params: vector): void; + function get_host_of_this_script(): Player; + function get_global_f(i: int): float; + function get_global_i(i: int): int; + function get_local_f(script: Hash, i: int): float; + function get_local_i(script: Hash, i: int): int; + +} + diff --git a/RAGE/ScriptDraw.d.ts b/RAGE/ScriptDraw.d.ts new file mode 100644 index 0000000..9511597 --- /dev/null +++ b/RAGE/ScriptDraw.d.ts @@ -0,0 +1,33 @@ +/** + * ScriptDraw Functions + * @public + * @noSelf + */ +declare namespace scriptdraw { + + enum eDrawTextFlags { + TEXTFLAG_NONE = 0, + TEXTFLAG_CENTER = 1 << 0, + TEXTFLAG_SHADOW = 1 << 1, + TEXTFLAG_VCENTER = 1 << 2, + TEXTFLAG_BOTTOM = 1 << 3, + TEXTFLAG_JUSTIFY_RIGHT = 1 << 4, + } + + function draw_text(text: string, pos: v2, size: v2, scale: float, color: uint32_t, flags: uint32_t): void; + //function wdraw_text(text: wstring, pos: v2, size: v2, scale: float, color: uint32_t, flags: uint32_t): void; + function register_sprite(path: string): uint32_t; + function draw_sprite(id: uint32_t, pos: v2, scale: float, rot: float, color: uint32_t): void; + function draw_line(start: v2, end: v2, size: uint32_t, color: uint32_t): void; + function draw_rect(pos: v2, size: v2, color: uint32_t): void; + function pos_pixel_to_rel_x(input: float): float; + function pos_pixel_to_rel_y(input: float): float; + function pos_rel_to_pixel_x(input: float): float; + function pos_rel_to_pixel_y(input: float): float; + function size_pixel_to_rel_x(input: float): float; + function size_pixel_to_rel_y(input: float): float; + function size_rel_to_pixel_x(input: float): float; + function size_rel_to_pixel_y(input: float): float; + +} + diff --git a/RAGE/Stats.d.ts b/RAGE/Stats.d.ts new file mode 100644 index 0000000..b593ca3 --- /dev/null +++ b/RAGE/Stats.d.ts @@ -0,0 +1,16 @@ +/** + * Stats Functions + * @public + * @noSelf + */ +declare namespace stats { + + function stat_get_int(hash: Hash, unk0: int): int32_t|null; + function stat_get_float(hash: Hash, unk0: int): float|null; + function stat_get_boolean(hash: Hash, unk0: int): boolean|null; + function stat_set_int(hash: Hash, value: int32_t, save: boolean): boolean; + function stat_set_float(hash: Hash, value: float, save: boolean): boolean; + function stat_set_boolean(hash: Hash, value: boolean, save: boolean): boolean; + +} + diff --git a/RAGE/Streaming.d.ts b/RAGE/Streaming.d.ts new file mode 100644 index 0000000..ed1142f --- /dev/null +++ b/RAGE/Streaming.d.ts @@ -0,0 +1,32 @@ +/** + * Streaming Functions + * @public + * @noSelf + */ +declare namespace streaming { + + function request_model(hash: Hash): boolean; + function has_model_loaded(hash: Hash): boolean; + function set_model_as_no_longer_needed(hash: Hash): boolean; + function is_model_in_cdimage(hash: Hash): boolean; + function is_model_valid(hash: Hash): boolean; + function is_model_a_plane(hash: Hash): boolean; + function is_model_a_vehicle(hash: Hash): boolean; + function is_model_a_heli(hash: Hash): boolean; + function request_ipl(szName: string): void; + function remove_ipl(szName: string): void; + function request_anim_set(szName: string): void; + function has_anim_set_loaded(szName: string): boolean; + function request_anim_dict(szName: string): void; + function has_anim_dict_loaded(szName: string): boolean; + function is_model_a_bike(ulHash: Hash): boolean; + function is_model_a_car(ulHash: Hash): boolean; + function is_model_a_bicycle(ulHash: Hash): boolean; + function is_model_a_quad(ulHash: Hash): boolean; + function is_model_a_boat(ulHash: Hash): boolean; + function is_model_a_train(ulHash: Hash): boolean; + function is_model_an_object(ulHash: Hash): boolean; + function is_model_a_ped(ulHash: Hash): boolean; + +} + diff --git a/RAGE/System.d.ts b/RAGE/System.d.ts new file mode 100644 index 0000000..de993f9 --- /dev/null +++ b/RAGE/System.d.ts @@ -0,0 +1,12 @@ +/** + * System Functions + * @public + * @noSelf + */ +declare namespace system { + + function wait(ms: int): void + function yield(ms: int): void + +} + diff --git a/RAGE/Time.d.ts b/RAGE/Time.d.ts new file mode 100644 index 0000000..4f23b37 --- /dev/null +++ b/RAGE/Time.d.ts @@ -0,0 +1,14 @@ +/** + * Time Functions + * @public + * @noSelf + */ +declare namespace time { + + function set_clock_time(hour: int, minute: int, second: int): void; + function get_clock_hours(): int; + function get_clock_minutes(): int; + function get_clock_seconds(): int; + +} + diff --git a/RAGE/UI.d.ts b/RAGE/UI.d.ts new file mode 100644 index 0000000..bf8a7d6 --- /dev/null +++ b/RAGE/UI.d.ts @@ -0,0 +1,49 @@ +/** + * UI Functions + * @public + * @noSelf + */ +declare namespace ui { + + type Blip = any; + type Pickup = any; + + /** + * @deprecated + */ + function notify_above_map(message: string, title: string, color: int): void + function get_entity_from_blip(blip: Blip): Entity + function get_blip_from_entity(entity: Entity): Blip + function add_blip_for_entity(entity: Entity): Blip + function set_blip_sprite(blip: Blip, spriteId: int): boolean + function set_blip_colour(blip: Blip, colour: int): boolean + function hide_hud_component_this_frame(componentId: int): void + function hide_hud_and_radar_this_frame(): void + function get_label_text(label: string): string + function draw_rect(x: float, y: float, width: float, height: float, r: int, g: int, b: int, a: int): void + function draw_line(pos1: v3, pos2: v3, r: int, g: int, b: int, a: int): void + function draw_text(pszText: string, pos: v2): void + function set_text_scale(scale: float): void + function set_text_color(r: int, g: int, b: int, a: int): void + function set_text_font(font: int): void + function set_text_wrap(start: float, end: float): void + function set_text_outline(b: boolean): void + function set_text_centre(b: boolean): void + function set_new_waypoint(coord: v2): void + function get_waypoint_coord(): v2 + function is_hud_component_active(componentId: int32_t): boolean + function show_hud_component_this_frame(componentId: int32_t): void + function set_waypoint_off(): void + function set_blip_as_mission_creator_blip(blip: Blip, toggle: boolean): boolean + function is_mission_creator_blip(blip: Blip): boolean + function add_blip_for_radius(pos: v3, radius: float): Blip + function add_blip_for_pickup(pickup: Pickup): Blip + function add_blip_for_coord(pos: v3): Blip + function set_blip_coord(blip: Blip, coord: v3): void + function get_blip_coord(blip: Blip): v3 + function remove_blip(blip: Blip): boolean + function set_blip_route(blip: Blip, toggle: boolean): void + function set_blip_route_color(blip: Blip, color: int32_t): void + +} + diff --git a/RAGE/Utils.d.ts b/RAGE/Utils.d.ts new file mode 100644 index 0000000..693a342 --- /dev/null +++ b/RAGE/Utils.d.ts @@ -0,0 +1,25 @@ +/** + * Utils Functions + * @public + * @noSelf + */ +declare namespace utils { + + function str_to_vk(keyName: string): int + //function string_to_wstring(str: string): wstring + //function wstring_to_string(str: wstring): string + function get_all_files_in_directory(path: string, extension: string): vector + function get_all_sub_directories_in_directory(path: string): vector + function file_exists(path: string): boolean + function dir_exists(path: string): boolean + function make_dir(path: string): boolean + function get_appdata_path(dir: string, file: string): string + function from_clipboard(): string + function to_clipboard(str: string): void + function time(): int + function time_ms(): int + function str_to_vecu64(str: string): vector + function vecu64_to_str(vec: vector): string + +} + diff --git a/RAGE/Vehicle.d.ts b/RAGE/Vehicle.d.ts new file mode 100644 index 0000000..90c5bc5 --- /dev/null +++ b/RAGE/Vehicle.d.ts @@ -0,0 +1,132 @@ +/** + * Vehicle Functions + * @public + * @noSelf + */ +declare namespace vehicle { + + function set_vehicle_tire_smoke_color(vehicle: Vehicle, r: int, g: int, b: int): void; + function get_ped_in_vehicle_seat(vehicle: Vehicle, seat: int): Ped; + function get_free_seat(vehicle: Vehicle): int; + function is_vehicle_full(vehicle: Vehicle): boolean; + function set_vehicle_stolen(vehicle: Vehicle, toggle: boolean): void; + function set_vehicle_color(v: Vehicle, p: BYTE, s: BYTE, pearl: BYTE, wheel: BYTE): boolean; + function get_mod_text_label(veh: Vehicle, modType: int, modValue: int): string; + function get_mod_slot_name(veh: Vehicle, modType: int): string; + function get_num_vehicle_mods(veh: Vehicle, modType: int): int; + function set_vehicle_mod(vehicle: Vehicle, modType: int, modIndex: int, customTires: boolean): boolean; + function get_vehicle_mod(vehicle: Vehicle, modType: int): int; + function set_vehicle_mod_kit_type(vehicle: Vehicle, type: int): boolean; + function set_vehicle_extra(veh: Vehicle, extra: int, toggle: boolean): void; + function does_extra_exist(veh: Vehicle, extra: int): boolean; + function is_vehicle_extra_turned_on(veh: Vehicle, extra: int): boolean; + function toggle_vehicle_mod(veh: Vehicle, mod: int, toggle: boolean): void; + function set_vehicle_bulletproof_tires(veh: Vehicle, toggle: boolean): void; + function is_vehicle_a_convertible(veh: Vehicle): boolean; + function get_convertible_roof_state(veh: Vehicle): boolean; + function set_convertible_roof(veh: Vehicle, toggle: boolean): void; + function set_vehicle_indicator_lights(veh: Vehicle, index: int, toggle: boolean): void; + function set_vehicle_brake_lights(veh: Vehicle, toggle: boolean): void; + function set_vehicle_can_be_visibly_damaged(veh: Vehicle, toggle: boolean): void; + function set_vehicle_engine_on(veh: Vehicle, toggle: boolean, instant: boolean, noAutoTurnOn: boolean): void; + function set_vehicle_fixed(veh: Vehicle): void; + function set_vehicle_deformation_fixed(veh: Vehicle): void; + function set_vehicle_undriveable(veh: Vehicle, toggle: boolean): void; + function set_vehicle_on_ground_properly(veh: Vehicle): boolean; + function set_vehicle_forward_speed(veh: Vehicle, speed: float): void; + function set_vehicle_number_plate_text(veh: Vehicle, text: string): void; + function set_vehicle_door_open(veh: Vehicle, doorIndex: int, loose: boolean, openInstantly: boolean): void; + function set_vehicle_doors_shut(veh: Vehicle, closeInstantly: boolean): void; + function is_toggle_mod_on(veh: Vehicle, index: int): boolean; + function set_vehicle_wheel_type(veh: Vehicle, type: int): void; + function set_vehicle_number_plate_index(veh: Vehicle, index: int): void; + function set_vehicle_tires_can_burst(veh: Vehicle, toggle: boolean): void; + function set_vehicle_tire_burst(veh: Vehicle, index: int, onRim: boolean, unk0: float): void; + function get_num_vehicle_mod(veh: Vehicle, modType: int): int; + function is_vehicle_engine_running(veh: Vehicle): boolean; + function set_vehicle_engine_health(veh: Vehicle, health: float): void; + function is_vehicle_damaged(veh: Vehicle): boolean; + function is_vehicle_on_all_wheels(veh: Vehicle): boolean; + function create_vehicle(model: Hash, pos: v3, heading: float, networked: boolean, unk2: boolean): Vehicle; + function set_vehicle_doors_locked(vehicle: Vehicle, lockStatus: int): boolean; + function set_vehicle_neon_lights_color(vehicle: Vehicle, color: int): boolean; + function get_vehicle_neon_lights_color(vehicle: Vehicle): int; + function set_vehicle_neon_light_enabled(vehicle: Vehicle, index: int, toggle: boolean): boolean; + function is_vehicle_neon_light_enabled(vehicle: Vehicle, index: int, toggle: boolean): boolean; + function set_vehicle_density_multipliers_this_frame(mult: float): void; + function set_random_vehicle_density_multiplier_this_frame(mult: float): void; + function set_parked_vehicle_density_multiplier_this_frame(mult: float): void; + function set_ambient_vehicle_range_multiplier_this_frame(mult: float): void; + function is_vehicle_rocket_boost_active(veh: Vehicle): boolean; + function set_vehicle_rocket_boost_active(veh: Vehicle, toggle: boolean): void; + function set_vehicle_rocket_boost_percentage(veh: Vehicle, percentage: float): void; + function set_vehicle_rocket_boost_refill_time(veh: Vehicle, refillTime: float): void; + function control_landing_gear(veh: Vehicle, state: int32_t): void; + function get_landing_gear_state(veh: Vehicle): int32_t; + function get_vehicle_livery(veh: Vehicle): int32_t; + function set_vehicle_livery(veh: Vehicle, index: int32_t): boolean; + function is_vehicle_stopped(veh: Vehicle): boolean; + function get_vehicle_number_of_passengers(veh: Vehicle): int32_t; + function get_vehicle_max_number_of_passengers(veh: Vehicle): int32_t; + function get_vehicle_model_number_of_seats(modelHash: Hash): int32_t; + function get_vehicle_livery_count(veh: Vehicle): int32_t; + function get_vehicle_roof_livery_count(veh: Vehicle): int32_t; + function is_vehicle_model(veh: Vehicle, model: Hash): boolean; + function is_vehicle_stuck_on_roof(veh: Vehicle): boolean; + function set_vehicle_doors_locked_for_player(veh: Vehicle, player: Player, toggle: boolean): void; + function get_vehicle_doors_locked_for_player(veh: Vehicle, player: Player): boolean; + function set_vehicle_doors_locked_for_all_players(veh: Vehicle, toggle: boolean): void; + function set_vehicle_doors_locked_for_non_script_players(veh: Vehicle, toggle: boolean): void; + function set_vehicle_doors_locked_for_team(veh: Vehicle, team: int32_t, toggle: boolean): void; + function explode_vehicle(veh: Vehicle, isAudible: boolean, isInvisible: boolean): void; + function set_vehicle_out_of_control(veh: Vehicle, killDriver: boolean, explodeOnImpact: boolean): void; + function set_vehicle_timed_explosion(veh: Vehicle, ped: Ped, toggle: boolean): void; + function add_vehicle_phone_explosive_device(veh: Vehicle): void; + function has_vehicle_phone_explosive_device(): boolean; + function detonate_vehicle_phone_explosive_device(): void; + function set_taxi_lights(veh: Vehicle, state: boolean): void; + function is_taxi_light_on(veh: Vehicle): boolean; + function set_vehicle_colors(veh: Vehicle, primary: int32_t, secondary: int32_t): boolean; + function set_vehicle_extra_colors(veh: Vehicle, pearl: int32_t, wheel: int32_t): boolean; + function get_vehicle_primary_color(veh: Vehicle): int32_t; + function get_vehicle_secondary_color(veh: Vehicle): int32_t; + function get_vehicle_pearlecent_color(veh: Vehicle): int32_t; + function get_vehicle_wheel_color(veh: Vehicle): int32_t; + function set_vehicle_fullbeam(veh: Vehicle, toggle: boolean): boolean; + function set_vehicle_custom_primary_colour(veh: Vehicle, color: uint32_t): void; + function get_vehicle_custom_primary_colour(veh: Vehicle): uint32_t; + function clear_vehicle_custom_primary_colour(veh: Vehicle): void; + function is_vehicle_primary_colour_custom(veh: Vehicle): boolean; + function set_vehicle_custom_secondary_colour(veh: Vehicle, color: uint32_t): void; + function get_vehicle_custom_secondary_colour(veh: Vehicle): uint32_t; + function clear_vehicle_custom_secondary_colour(veh: Vehicle): void; + function is_vehicle_secondary_colour_custom(veh: Vehicle): boolean; + function set_vehicle_custom_pearlescent_colour(veh: Vehicle, color: uint32_t): void; + function get_vehicle_custom_pearlescent_colour(veh: Vehicle): uint32_t; + function set_vehicle_custom_wheel_colour(veh: Vehicle, color: uint32_t): void; + function get_vehicle_custom_wheel_colour(veh: Vehicle): uint32_t; + function get_livery_name(veh: Vehicle, livery: int32_t): string; + function set_vehicle_window_tint(veh: Vehicle, t: int32_t): void; + function get_vehicle_window_tint(veh: Vehicle): int32_t; + /** + * gets the model hash of every vehicle type + */ + function get_all_vehicle_model_hashes(): vector; + /** + * gets all vehicle objects loaded, like traffic or personal vehicles + */ + function get_all_vehicles(): vector; + function modify_vehicle_top_speed(veh: Vehicle, f: float): void; + function set_vehicle_engine_torque_multiplier_this_frame(veh: Vehicle, f: float): void; + function get_vehicle_headlight_color(v: Vehicle): int32_t; + function set_vehicle_headlight_color(v: Vehicle, color: int32_t): boolean; + function set_heli_blades_full_speed(v: Vehicle): void; + function set_heli_blades_speed(v: Vehicle, speed: float): void; + function set_vehicle_parachute_active(v: Vehicle, toggle: boolean): void; + function does_vehicle_have_parachute(v: Vehicle): boolean; + function can_vehicle_parachute_be_activated(v: Vehicle): boolean; + function set_vehicle_can_be_locked_on(veh: Vehicle, toggle: boolean, skipSomeCheck: boolean): void; + + +} + diff --git a/RAGE/Water.d.ts b/RAGE/Water.d.ts new file mode 100644 index 0000000..3ed7a2d --- /dev/null +++ b/RAGE/Water.d.ts @@ -0,0 +1,13 @@ +/** + * Water Functions + * @public + * @noSelf + */ +declare namespace water { + + function get_waves_intensity(): float; + function set_waves_intensity(intensity: float): void; + function reset_waves_intensity(): void; + +} + diff --git a/RAGE/Weapon.d.ts b/RAGE/Weapon.d.ts new file mode 100644 index 0000000..dac439f --- /dev/null +++ b/RAGE/Weapon.d.ts @@ -0,0 +1,34 @@ +/** + * Weapon Functions + * @public + * @noSelf + */ +declare namespace weapon { + + function give_delayed_weapon_to_ped(ped: Ped, hash: Hash, time: int, equipNow: boolean): void; + function get_weapon_tint_count(weapon: Hash): int; + function get_ped_weapon_tint_index(ped: Ped, weapon: Hash): int; + function set_ped_weapon_tint_index(ped: Ped, weapon: Hash, index: int): void; + function give_weapon_component_to_ped(ped: Ped, weapon: Hash, component: Hash): void; + function remove_all_ped_weapons(ped: Ped): void; + function remove_weapon_from_ped(ped: Ped, weapon: Hash): void; + function get_max_ammo(ped: Ped, weapon: Hash): [boolean,int]; + function set_ped_ammo(ped: Ped, weapon: Hash, ammo: int): boolean; + function remove_weapon_component_from_ped(ped: Ped, weapon: Hash, component: Hash): void; + function has_ped_got_weapon_component(ped: Ped, weapon: Hash, component: Hash): boolean; + function get_ped_ammo_type_from_weapon(ped: Ped, weapon: Hash): Hash; + function set_ped_ammo_by_type(ped: Ped, type: Hash, amount: uint32_t): void; + function has_ped_got_weapon(ped: Ped, weapon: Hash): boolean; + function get_all_weapon_hashes(): vector; + function get_weapon_name(weapon: Hash): string; + function get_weapon_weapon_wheel_slot(weapon: Hash): int; + function get_weapon_model(weapon: Hash): Hash; + function get_weapon_audio_item(weapon: Hash): Hash; + function get_weapon_slot(weapon: Hash): Hash; + function get_weapon_ammo_type(weapon: Hash): int; + function get_weapon_weapon_group(weapon: Hash): Hash; + function get_weapon_weapon_type(weapon: Hash): Hash; + function get_weapon_pickup(weapon: Hash): Hash; + +} + diff --git a/RAGE/Worldprobe.d.ts b/RAGE/Worldprobe.d.ts new file mode 100644 index 0000000..e7d3ba0 --- /dev/null +++ b/RAGE/Worldprobe.d.ts @@ -0,0 +1,23 @@ +/** + * Worldprobe Functions + * @public + * @noSelf + */ +declare namespace worldprobe { + + enum eRayIntersect { + RAYINT_MAP = 1 << 0, + RAYINT_VEH = 1 << 1, + RAYINT_PED = 1 << 2, + RAYINT_PED2 = 1 << 3, + RAYINT_OBJECT = 1 << 4, + RAYINT_UNK0 = 1 << 5, + RAYINT_UNK1 = 1 << 6, + RAYINT_UNK2 = 1 << 7, + RAYINT_VEGETATION = 1 << 8, + } + + function raycast(start: v3, end: v3, intersect: int, ignore: Entity): [hit: boolean, hitPos: v3, hitSurf: v3, hitMat: Hash, hitEnt: Entity] + +} + diff --git a/package.json b/package.json new file mode 100644 index 0000000..5cc8700 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "types-ts-2take1", + "version": "1.0.0", + "description": "Typescript types for 2take1, used with https://typescripttolua.github.io", + "keywords": [ + "Typescript", + "2take1", + "lua" + ], + "author": "Zomo", + "license": "UNLICENSED" +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..1c76ada --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# types-ts-2take1 + +Typescript types for 2take1, used with [typescripttolua](https://typescripttolua.github.io) diff --git a/structs/Feat.d.ts b/structs/Feat.d.ts new file mode 100644 index 0000000..6bd6107 --- /dev/null +++ b/structs/Feat.d.ts @@ -0,0 +1,103 @@ +/** + * a feature from the menu + * @public + */ +declare class Feat { + + /** + * only for testing, + * + * @param type "debug" + * + * @example + * + * new Feat("debug") + * + */ + constructor(type: "debug"); + + /** + * feature on/off boolean + */ + public get on(): boolean; + public set on(on: boolean); + + readonly parent: Feat|null; + + /** + * Only for parents + */ + readonly children: Feat[]; + + /** + * Only for parents + */ + readonly child_count: number; + + readonly type: number; + + /** + * Ids will be recycled after the feature is deleted + */ + readonly id: number; + + /** + * value for integer features + */ + public get value_i(): integer; + public set value_i(value_i: integer); + + /** + * min value + */ + public get min_1(): integer; + public set min_1(min_1: integer); + + /** + * max value + */ + public get max_i(): integer; + public set max_i(max_i: integer); + + /** + * step size + */ + public get mod_i(): integer; + public set mod_i(mod_i: integer); + + /** + * deprecated + * + * @deprecated + */ + public get threaded(): boolean; + public set threaded(threaded: boolean); + + public get name(): string; + public set name(name: string); + + /** + * d3d handler + * + * @privateRemarks + * + * it's only defined as `any` because I don't understand the d3d handler function enough + */ + public get renderer(): any; + public set renderer(renderer: any); + + /** + * show/hide feature + */ + public get hidden(): boolean; + public set hidden(hidden: boolean); + + /** + * additional context passed to script handlers + */ + public get data(): any; + public set data(data: any); + + public toggle(): Feat; + +} diff --git a/structs/MenuKey.d.ts b/structs/MenuKey.d.ts new file mode 100644 index 0000000..6d32ae3 --- /dev/null +++ b/structs/MenuKey.d.ts @@ -0,0 +1,24 @@ +/** + * + * @public + */ +declare class MenuKey { + + /** + * vector of virtual keys + */ + readonly keys: table; + + public push_vk(virtualKeyCode: uint32_t): void; + + public push_str(key: string): boolean; + + public pop(): void; + + public clear(): void; + + public is_down(): boolean; + + public is_down_stepped(): boolean; + +} diff --git a/structs/PlayerFeat.d.ts b/structs/PlayerFeat.d.ts new file mode 100644 index 0000000..74a0db3 --- /dev/null +++ b/structs/PlayerFeat.d.ts @@ -0,0 +1,42 @@ +/** + * a player feature + * @public + */ +declare class PlayerFeat { + + /** + * only for testing, + * + * @param type "debug" + * + * @example + * + * new Feat("debug") + * + */ + constructor(type: "debug"); + + readonly feats: Feat[]; + + readonly id: number; + + readonly parent_id: number; + + /** + * deprecated + */ + public get threaded(): boolean; + public set threaded(threaded: boolean); + + /** + * Make sure you set the renderer with the PlayerFeat function, and not the Feat function. Otherwise the handler will not receive the player id in the second param. + * + * @privateRemarks + * + * it's only defined as `any` because I don't understand the d3d handler function enough + * + */ + public get renderer(): any; + public set renderer(renderer: any); + +} diff --git a/structs/Regex.d.ts b/structs/Regex.d.ts new file mode 100644 index 0000000..472b49a --- /dev/null +++ b/structs/Regex.d.ts @@ -0,0 +1,27 @@ +/** + * + * @public + */ +declare class Regex { + + /** + * only for testing, + * + * @param type "debug" + * + * @example + * + * new Feat("debug") + * + */ + constructor(type: "debug"); + + readonly pattern: string; + + constructor(pattern: string); + + public search(subject: string): RegexResult; + + public __tostring(): string; + +} diff --git a/structs/RegexResult.d.ts b/structs/RegexResult.d.ts new file mode 100644 index 0000000..fb57c64 --- /dev/null +++ b/structs/RegexResult.d.ts @@ -0,0 +1,39 @@ +/** + * + * @privateRemarks + * + * example directly translated from the api docs and is untested + * + * I also don't know if javascript's regex will work + * + * @example + * + * let r = new Regex("^(test123)"), + * s = "test123 abcd 345345", + * m = r.search(r, s) + * + * if (m.count > 0) + * ui.notify_above_map(m.matches[1], "Lua regex", 140) + * + * @public + */ +declare class RegexResult { + + /** + * only for testing, + * + * @param type "debug" + * + * @example + * + * new Feat("debug") + */ + constructor(type: "debug"); + + readonly count: integer; + + readonly matches: string[]; + + public __tostring(): string; + +} diff --git a/structs/v2.d.ts b/structs/v2.d.ts new file mode 100644 index 0000000..cde1fea --- /dev/null +++ b/structs/v2.d.ts @@ -0,0 +1,33 @@ +/** + * a 2x1 matrix + * @public + * @noSelf + */ +declare class v2 { + + readonly x: float; + readonly y: float; + + /** + * **instanciating this class with `new` will break the lua** + * @deprecated + */ + constructor(x: float, y: float); + + public __add(val: v2|v3|float): v2; + public __sub(val: v2|v3|float): v2; + public __mul(val: v2|v3|float): v2; + public __div(val: v2|v3|float): v2; + public __eq(val: v2): boolean; + public __lt(val: v2): boolean; + public __le(val: v2): boolean; + public __tostring(): string + + public magnitude(val: v2|null): float; + +} + +/** + * @noSelf + */ +declare function v2(x: float, y: float): v2 \ No newline at end of file diff --git a/structs/v3.d.ts b/structs/v3.d.ts new file mode 100644 index 0000000..c0b2425 --- /dev/null +++ b/structs/v3.d.ts @@ -0,0 +1,54 @@ +/** + * a 3x1 matrix + * + * @privateRemarks + * + * example directly translated from the api docs and is untested + * + * @example + * + * let player_id = player.player_id(), + * player_ped = player.get_player_ped(player_id), + * pos = player.get_player_coords(player_id), + * rot = entity.get_entity_rotation(player_ped), + * dir = rot + * + * dir.transformRotToDir() + * dir *= 4 + * pos += dir + * + * @public + * @noSelf + */ +declare class v3 { + + readonly x: float; + readonly y: float; + readonly z: float; + + /** + * **instanciating this class with `new` will break the lua** + * @deprecated + */ + constructor(x: float, y: float, z: float); + + public __add(val: v2|v3|float): v3; + public __sub(val: v2|v3|float): v3; + public __mul(val: v2|v3|float): v3; + public __div(val: v2|v3|float): v3; + public __eq(val: v2): boolean; + public __lt(val: v2): boolean; + public __le(val: v2): boolean; + public __tostring(): string + + public magnitude(val: v3|null): float; + public transformRotToDir(): void; + public radToDeg(): void; + public degToRad(): void; + +} + +/** + * @noSelf + */ +declare function v3(x: float, y: float, z: float): v3